procmail tips and tricks
Amedee Van Gasse (ubuntu)
amedee-ubuntu at amedee.be
Sun May 10 23:10:36 UTC 2009
Hal Burgiss schreef:
> Any procmail users? Anyone want to share tips on how to take back
> control of your inbox from trolls, and other lesser lights?
>
> Below are some recipes I've accrued over time, but would love to add
> to it.
>
> I also have a mutt macro that dynamically creates a procmail recipe
> based on the subject of the email. Great for killing threads that
> won't die any other way.
>
> # Lists annoyances.
> :0
> * ^Sender: ubuntu-users-bounces at lists.ubuntu.com
> {
> LOG="ULIST: "
>
> # HTML enabled mail. Bad idea.
> :0 BH
> * ^Content-Type:.*(text/html|multipart/(alternative|mixed))
> { LOG="HTML: "
>
> :0
> /dev/null
> }
>
> # # check excessive line lengths and chronic non-trimmers
> # :0B
> # * ? /usr/local/bin/linelen.pl
> # { LOG="linelen.pl: "
> #
> # :0:
> # /tmp/testing.mail
> # }
>
> # Oh, PLEASE!!!!
> :0
> # * ^Subject: +(Re: )?unsub?scribe
> * ^Subject: +(Re: |Fwd?: |SV: |\* )*(please |how do I)?un-?(su)?b?scr?ibe
> /dev/null
>
> # Get rid of self proclaimed noobies.
> :0
> * ^Subject: +(Re: |Fwd?: |SV: )*n(ew|oo|00)b(ie|y|ee)?
> /dev/null
>
> # No subject, tough noogies!
> :0
> * ^Subject: +(Re: |Fwd?: |SV: )*(\(no subject\))? *$
> /dev/null
>
> # Bad subject, does not tell me a thing.
> # * ^Subject:.*list digest, Vol
> :0
> * ^Subject:.*list digest
> /dev/null
>
> :0
> * ^Subject: +(Re: |Fwd?: |SV: )*Invalid account
> /dev/null
>
> # Not descriptive enough :(
> :0
> * ^Subject: +(Re: |Fwd?: |SV: )*(please )?h ?e ?l ?p ?(please )?\!*$
> { LOG="helpme: "
>
> :0
> /dev/null
> }
>
> # upper case test
> :0D
> * ^Subject: +(Re: |RE: |Fwd?: |SV: )*.*HELP
> { LOG="helpme2: "
>
> :0
> /dev/null
> }
>
> :0
> * ^Subject: +(Re: |Fwd?: |SV: )*(easy |small |quick |some)*Questions?( again)?\.*$
> { LOG="Question: "
>
> :0
> /dev/null
> }
>
> :0
> * ^Subject: +(Re: |Fwd?: |SV: )*(small |weird |strange)*problems?(\.|!)*$
> { LOG="Problemo: "
>
> :0
> /dev/null
> }
>
> :0
> * ^Subject: .*(out of (the )?office|automated response)
> /dev/null
>
> :0
> * ^Subject: +(Re: |Fwd?: |SV: )*test( message| post(ing)?)?$
> /dev/null
>
> # Ed Wilts <ewilts at ewilts.org> single word subject.
> # Bag any one word subject lines. Can't be telling me enough.
> :0
> * ^Subject: (Re: |Fwd?: |SV: )*[A-Za-z0-9\,\._\-\!:;\"\'\?/]+$
> { LOG="one word: "
>
> :0
> /dev/null
> }
>
> # All CAPS, GMAFB ;-)
> :0D
> * ^Subject: (Re: |Fwd?: |RE: )*[A-Z0-9 \,\._\-\!:;\"\'\?/]+$
> { LOG="CAPS: "
>
> :0
> /dev/null
> }
>
> # cluelessness
> :0
> * ^From: root@
> { LOG="Rootdude: "
>
> :0
> /dev/null
> }
>
> # It can't be *that* damned important.
> :0
> * ^Subject:.*urgent
> /dev/null
> }
>
Interesting, and thank you for sharing.
But I wouldn't go so far as devnulling them. Your Mileage May Vary.
I think I will use your procmailrc as a base, but I think I'll use
formail to clean up the nonsense.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090511/1a117e11/attachment.sig>
More information about the ubuntu-users
mailing list