procmail
[Top] [All Lists]

Re: Recipe Correctness ?

2003-09-22 16:14:17
On Mon, 2003-09-22 at 10:40, Professional Software Engineering wrote:
At 08:47 2003-09-22 +1000, mpierce wrote:

Here are the two recipes which I include in the file, rc.other that
procmail uses. Both recipes have been modified to accept mail only from
either mpierce, mrpierce or marvinrpierce

FTR, "from" implies the sender, not the recipient.

A faux pas, meant TO


 @ optusnet.com.au,
teebookglobal.com or 303Sport.com.

.. and apparently yahoo.com.au as well.

If mail not addressed to those email addresses, then consider the mail
spam as my subscriptions are in another file, rc.subscriptions which
procmail processes before rc.other:

If a spammer addresses a message TO those addresses, then what?

Procmail will evaluate whether or not mail is spam before running the
rc.other script using spamassassin: 

#Spamassassin
#pipe the email through SpamAssassin
:0fw: spamassassin.lock
* < 256000                              #process email messages smaller
than 250 kB
| /usr/bin/spamassassin

# Mails with a score of 15 or higher are almost certainly spam (with
# 0.05% # false positives according to rules/STATISTICS.txt). Let's put
# them in a different mbox. (This one is optional.)
:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
#/dev/null                              # deactivated for spamassassin
sa_learn to read accumulated emails
$MAILDIR/spam/

# Evalute rule 1 and add spam status to email if spam
# All mail tagged as spam (eg. with a score higher than the set
threshold)
#
:0
* ^X-Spam-Status: Yes
$MAILDIR/spam/

# Work around procmail bug: any output on stderr will cause the "F" in 
#"From" to be dropped.  This will re-add it.
:0
* ^^rom[ ]
{
  LOG="*** Dropped F off From_ header! Fixing up. "

  :0 fhw
  | sed -e '1s/^/F/'
}

#Vipul's Razor
:0 Wc
| razor-check
:0 Wa
$MAILDIR/spam/

#INCLUDERC=$PMDIR/rc.spam
INCLUDERC=$PMDIR/rc.mailserver-check
INCLUDERC=$PMDIR/rc.subscriptions
INCLUDERC=$PMDIR/rc.other

*
!^TO_(mpierce|mrpierce|marvinrpierce)@(optusnet\.com\.au|teebookglobal\.com|303S
port.com|yahoo.com.au)

Note that this is a NOT condition, and since you deliver within this 
recipe, it makes me wonder why you have the very same inverted condition on 
the following recipe, which should NEVER encounter a message which this 
recipe has already disposed of, and therefore, the score will never be 
added below.

#Spam avoidance of certain routes and if not for me personally
:0:
* -1^0
*  1^0 ? formail -x"Received:" | egrep -is "dialsprint\.net"
*  1^0 ? formail -x"Received:" | egrep -is "sccmmhc02\.asp\.att\.net"
*  1^0 !
^TO_(mpierce|mrpierce|marvinrpierce)@(optusnet\.com\.au|teebookglobal\.com|303Sport.com|yahoo.com.au)
$MAILDIR/spam/

Additionally, those two received: lines seem overly complicated - you 
shouldn't need to invoke formail or egrep, just do:

* 1^0 ? Received:.*dialsprint\.net

Which will be a LOT faster.  Or, perhaps I'm missing something and you mean 
to be doing something different?

I took the original receipe from Timo procmail and modified what he had
written for my system. Have now made it simpler using your suggestion.



---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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