Re: [SLUG] procmail question

From: Dylan William Hardison (dylanwh@tampabay.rr.com)
Date: Tue Jun 01 2004 - 12:30:43 EDT


Spake Patrick Grantham on Tuesday, June 01, 2004 at 10:25AM -0400:
> I the risk of offending someone: I keep getting spam offering "enhancment" a
> part of the male anatomy. I would greatly appreciate if someone were to
> post a procmail script to filter emails contain the name of the organ. The
> constraints are that the five letters of the organ are never adjacent to one
> another in the subject or body, but the letters occur in order between
> periods. The words "inch" and "size" are always present in the subject or
> body of the message. It also would be nice to reject the addresses and or
> domains in sendmail's /etc/mail/access file.
>
> Please. I offer to order you a pizza.

Okay, here's the spam assassin way, which is more flexible than just a
plain procmail regexp:

this goes in /etc/spamassassin/local.cf:
# begins
body ORGAN /p.{0,6}e.{0,6}n.{0,6}i.{0,6}s/
body ORGAN_SIZE /inch|size/
meta ENHANCEMENT_SPAM ORGAN && ORGAN_SIZE

score ORGAN 0.1
score ORGAN_SIZE 0.1
# Set to 5 to mark all mail with both "inch|size" and that organ
# to be marked as spam.
score ENHANCEMENT_SPAM 3
# EOF

Now, if your procmail isn't set up to use SA, you'll add this
procmail rule:

# procmail rule to filter through spamassassin.
:0 fw: spam.lock
| spamassassin
# end

Also, you'll probably want to move mail that is tagged as spam to some
other folder:

# begin procmail snippet
:0
* ^X-Spam-Flag:.*YES
replace this line with the proper folder thing>
# end

This should work, if you have spam assassin installed.
SA rocks, so you should. :)

-- 
Always do right.  This will gratify some people and astonish the rest.
              -- Mark Twain
-
GPG Fingerprint=D67D 2B75 53C6 9769 30E4  D390 239F C833 F32C F6F6
GPG KeyID=F32CF6F6
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:04:39 EDT