[linux-elitists] pr(awk|oc)mail must die

Aaron Lehmann aaronl@vitelus.com
Mon Oct 9 00:24:02 PDT 2000

As I was bashing my head into the wall trying to deal with awk, some
kind soul pointed out MailDrop. apt-get it now. Imagine procmail with
perl-like syntax and a level of power in between procmail and perl.
For example, it actually has logical ors!! I ported my .procmailrc and
it ended up being about a third the length. The maildrop version is
below. In particular, contrast the simplicity of the mailing list
stuff with my procmail hack which involved scoring, shell pipes,
catch-all rules, shell expansion of regexps, and all sorts of other
gross stuff.



if (!/^Content-Type: (message\/|multipart\/|application\/pgp)/)
	if (/^-----BEGIN PGP MESSAGE-----/:bD \
	&&  /^-----END PGP MESSAGE-----/:bD)
		xfilter formail -i "Content-Type: application/pgp; format=text; x-action=encrypt"

	if (/^-----BEGIN PGP SIGNED MESSAGE-----/:bD \
	&&  /^-----BEGIN PGP SIGNATURE-----/:bD \
	&&  /^-----END PGP SIGNATURE-----/:bD)
		xfilter formail -i "Content-Type: application/pgp; format=text; x-action=sign"

# mailing list autosorter
if (/^(X-Mailing-[Ll]ist: <|X-BeenThere: |Delivered-To: mailing list |Sender: owner-)![^@>]+/:D \
||  /^(X-Loop: |Return-path: <owner-)![^@>]+/:D)
	if (!/^(B?cc|To|From): $EMAIL/ \
	&&   /In-Reply-To:.*$EMAIL/)

	to tolower(mail/$MATCH2)

# boring
if (/^Subject: .*404/:D)
	to mail/404

# bulk mailers are bad
if (/^X-Mailer: (Aureate Group Mail|MultiMailer)/:D \
||  /^From: owner@bugs.debian.org/)
	to mail/spam

# Losers running windows
if ((/^X-Mailer: .*(Eudora|Forte|Microsoft|Windows|Internet Mail Service)/ \
&& !/ender b/ \
&& !/adrian/) \
|| (/^From: .*@(yahoo|hotmail|aol|bigfoot|lycos|altavista|msn)\.com/ \
&& !/andrew zhang/ \
&& !/brian bis/))
	to mail/losers

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://allium.zgp.org/pipermail/linux-elitists/attachments/20001009/13efd434/attachment.pgp 

More information about the linux-elitists mailing list