[Wlug] Procmail Question

Theo Van Dinter felicity@kluge.net
Fri, 8 Nov 2002 10:07:37 -0500


--Sr1nOIr3CvdE5hEN
Content-Type: text/plain; charset=unknown-8bit
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 08, 2002 at 09:48:14AM -0500, Marc Hughes wrote:
> :0:
> * ^From.*jenny@axte84\.com
> * ^Subject.*MILLION OPT-IN EMAIL ADDRESSES
> Badspam
>=20
> This will do an AND between the two conditions ... Is there an easy way
> to OR between them? ... Or do I need to make a separate rule for each

There's a way, although it's really not straightforward...  One of my
old procmail-only anti-spam rules looked for 8-bit chars in the body:

:0BDfh
* -1^1 .
*  2^1 =3D[0-9A-F][0-9A-F]
* 20^1 [=A0=A1=A2=A3=A4=A5=A6=A7=A8=A9=AA=AB=AC=AD=AE=AF=B0=B1=B2=B3=B4=B5=
=B6=B7=B8=B9=BA=BB=BC=BD=BE=BF]
* 20^1 [=C0=C1=C2=C3=C4=C5=C6=C7=C8=C9=CA=CB=CC=CD=CE=CF=D0=D1=D2=D3=D4=D5=
=D6=D7=D8=D9=DA=DB=DC=DD=DE=DF]
* 20^1 [=E0=E1=E2=E3=E4=E5=E6=E7=E8=E9=EA=EB=EC=ED=EE=EF=F0=F1=F2=F3=F4=F5=
=F6=F7=F8=F9=FA=FB=FC=FD=FE=FF]
* 20^1 =3D[A-F][0-9A-F]
| formail -A "X-Reject: Too many foreign charcters."

(from http://www.vex.net/~wadialix/email/chinese/link.html)

Which basically says that for any 8 bit char, add 20 "points" to the rule.
If there's a quoted-printable char (=3DXX), add 2 points, and for anything
else add -1 points.

As long as the rule scores 1+ points (ie: it's positive), it matches.
So an or for you would be:

:0:
* 1^1 ^From.*jenny@axte84\.com
* 1^1 ^Subject.*MILLION OPT-IN EMAIL ADDRESSES
Badspam

I belive, haven't tested it.  :)   Look at the procmailsc man page for
more info.

> and every condition?  And an even further note... What are the thoughts
> on some of these anti-spam tools that work with procmail?  Any
> favorites?

SpamAssassin, hands down. :)  http://www.spamassassin.org/ Sucessfully
catches >98% of the spam I receive, currently at ~2100 a month (with
~5000 blocked at the SMTP level, grrr, stupid spammers!)  I used to do a
lot of procmail stuff, and now it's just SA.

(warning: I'm a SA developer, so I'm a little biased. ;))

--=20
Randomly Generated Tagline:
"It's always darkest before dawn. So if you're going to steal your
 neighbour's newspaper, that's the time to do it." - Zen Musings

--Sr1nOIr3CvdE5hEN
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9y9M5AuOQUeWAs2MRAknuAJ9gIHXVi3sfc4+rcxnDky12/wvjGgCePIEh
zhC4tfKmajkY5FVHIx8OeYE=
=N3G6
-----END PGP SIGNATURE-----

--Sr1nOIr3CvdE5hEN--