Currently method #1 works but spamwords are sometimes found within a BASE64
encoded message. For example, an encoded PDF file could have a spamword in it
by chance because of the nature of the base64 algorithm. So I want to use
mimepart's BODY_PART variable to test for the plain/text part only - if it was
successfully set. I need to still resort to method #1 if for some reason that
BODY_PART was not set or is empty because the include file may have bombed out.
So I need a little help tweaking this:
Thank you!!
-eric
:0
* ^Subject:[ ]*\/[^ ].*
{
SUBJECT=$MATCH
}
# http://www.well.com/user/barts/email/mimepart.txt
INCLUDERC=mimepart.txt
:0 HB
# Don't get in a loop
* !^From:(_dot_)*spamaccount(_at_)mydomain(_dot_)com
* !^X-Loop:.*trap
* !^TOspamaccount(_at_)mydomain(_dot_)com
* < 1000000
# Method 1 - Test entire email for a spamword. Get exit code.
* ? grep -i -f /etc/vmail/spam_words
# Method 2 - Test for a spamword within the BODY_PART variable, needs to be
above method #1.
# * BODY_PART ?? grep -i -f /etc/vmail/spam_words
{
:0 HB
*
{
# Method 1
SPAM_WORD=`grep -i -f /etc/vmail/spam_words | tr "[:upper:]" "[:lower:]" |
grep -o -f /etc/vmail/spam_words | head -1`
# Method 2
# SPAM_WORD = $MATCH
}
:0 fwh
| formail -I"X-Loop: trap spamword" -I "Subject: [SPAMWORD $SPAM_WORD]
$SUBJECT"
:0
! spamaccount(_at_)mydomain(_dot_)com
}
____________________________________________________________
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