procmail
[Top] [All Lists]

Re: Help For Qmail Procmail Filter

2007-04-10 04:10:13
On Tue, Apr 10, 2007 at 12:41:46PM +0545, Rakesh Man Karmacharya wrote:
I am using qmail in freebsd as a pop server and all the mail come through
Antispam Gateway to pop server.Our Antispam Gateway tags  {Spam?} for spam
mails. Now i want to filter it through procmail .But procmail catches the
Spam tags Mail but one copy is deleivering to Mail Box also i want to stop
sending that spam  mail to mail box.

Your recipe only shows one message going through procmail and
being stopped.  Where is the second copy being generated?  It's
not coming from the procmail recipe you showed us.

////////.procmailrc//////
:0:
* ^Subject:.*Spam?
$HOME/Trash

The regex is flawed and doing more than you think.  It is
stuffing into Trash any mail with "spa" in the Subject.
E.g., "Subject: Spanish is my native language" would be
stopped.  The culprit: the question mark.  It means "one
or zore instances of the char that comes immediately before."

You want a real question mark, not a regex char.  You need
to quote the question mark to avoid false positives.

Also, even if you quote the question mark, the recipe is
not robust enough: People writing back about alleged spam that
was blocked will have *their* messages blocked.

I would suggest:

  SPACE = ' '
  TAB   = '     '
  WS    = "SPACE$TAB"

  TRASH = $HOME/Trash

   :0:
   * $ ^Subject:[$WS]*{Spam[?]}
   $TRASH

-- 
Dallman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>