Did anyone have any suggestions on this recipe? Putting VERBOSE=YES
into the recipe causes bounceback fail messages to the sender. I want
to try to get reporting back like I had before... Here is a sample:
procmail: Assigning "LOG=~
"
~
procmail: Assigning "GIFBOX=.spam/"
procmail: Assigning "THBILLS=.thbills/"
procmail: Assigning "BILLS=.bills/"
procmail: Assigning "BLACKLIST=.spam/"
procmail: Assigning "CTGUY=.ctguy/"
procmail: Assigning "HCDMCT=.hcdm-ct/"
procmail: Assigning "FLYERS=.flyers/"
procmail: Assigning "NEWSLETTERS=.news/"
procmail: Assigning "SCHOOL=.school/"
procmail: Assigning "SPAMASSASSIN=.spam/"
procmail: Assigning "SPAMASSASSINBAD=.spambad/"
procmail: Assigning "t= "
procmail: Assigning "b=[ ]"
procmail: Assigning "n=
"
procmail: Assigning "a=[0-9A-Za-z]"
procmail: Assigning "a2=[0-9A-Za-z][0-9A-Za-z]"
procmail: Assigning "a3=[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]"
procmail: Assigning "a4=[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]"
procmail: Assigning
"a6=[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]"
procmail: Assigning
"a8=[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]"
procmail: Assigning
"a12=[0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z][0-9A-Za-z]"
procmail: Assigning "x=[0-9A-Fa-f]"
procmail: Assigning "x2=[0-9A-Fa-f][0-9A-Fa-f]"
procmail: Assigning "x3=[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]"
procmail: Assigning "x4=[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]"
procmail: Assigning
"x6=[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]"
procmail: Assigning
"x8=[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]"
procmail: Assigning
"x12=[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]"
procmail: No match on "^Subject: .*SEXUALLY.*"
procmail: Assigning "LASTFOLDER=.raw/new/1279410041.3772_0.site5.com"
From jamie(_at_)(_dot_)net Sat Jul 17 18:40:41 2010
Folder: .raw/new/1279410041.3772_0.site5.com 1161
procmail: Executing
"[,-s,/home/teamhend/.procmailrecipes/siteadmin/siteadmin-blacklist.txt,]"
procmail: Match on "[ -s
/home/teamhend/.procmailrecipes/siteadmin/siteadmin-blacklist.txt ]"
procmail: Executing
"fgrep,-iqf,/home/teamhend/.procmailrecipes/siteadmin/siteadmin-blacklist.txt"
procmail: Non-zero exitcode (1) from "fgrep"
procmail: No match on "fgrep -iqf
/home/teamhend/.procmailrecipes/siteadmin/siteadmin-blacklist.txt"
procmail: Assigning "MATCH="
procmail: Matched ".net"
procmail: Match on "^^(From |Return-Path: <)[^ @]+(_at_)\/[^ >]+"
procmail: Assigning "ENV_DOMAIN=.net"
procmail: Score: 3 3 "^Received:"
procmail: Assigning "N_RCVD=3"
procmail: Assigning "MATCH="
procmail: Matched "smtprelay0018.hostedemail.com"
procmail: Match on "^Received: from \/[^ ]+"
procmail: Assigning "R1_HOST=smtprelay0018.hostedemail.com"
procmail: No match on "^Content-Type:
multipart/related;.*boundary=(\")?\/[^\"]+"
procmail: Assigning "MATCH="
procmail: Matched "4C423F74(_dot_)7030305(_at_)(_dot_)net"
procmail: Match on "^Message-ID:.*\/[^ <@]+(_at_)[^>]+"
procmail: Assigning "H_MID=4C423F74(_dot_)7030305(_at_)hendricks(_dot_)net"
procmail: Assigning "MATCH="
<SNIP>
I apologize for not placing the entire recipe. I was trying to be
succinct. I have placed it below. I have also placed "VERBOSE=YES"
in the recipe and it delivered the mail but kicked back an error
message. See below:
# $Id: .procmailrc.anti-gifspam 2006-Nov-18 15:11 $
SHELLMETAS # unset, for better error messages
SHELL = '/bin/sh'
VERBOSE=YES
LINEBUF = 4096
LOGABSTRACT = 'all'
MAILDIR = '/home/USER/mail/DOMAIN/siteadmin'
DEFAULT = 'new'
# disable next line to get procmail's logging on stderr
LOGFILE = "$_.log"
LOG = '~
'
GIFBOX = '.spam/' # IMAP-oriented, see delivery
THBILLS = '.thbills/'
BILLS = '.bills/'
BLACKLIST = '.spam/'
CTGUY = '.ctguy/'
HCDMCT = '.hcdm-ct/'
FLYERS = '.flyers/'
NEWSLETTERS = '.news/'
SCHOOL = '.school/'
SPAMASSASSIN = '.spam/'
SPAMASSASSINBAD = '.spambad/'
#------------------------------------------------------------
# set some globals
#------------------------------------------------------------
t = ' ' # only a TAB, like "\t"
b = "[ $t]" # [[:blank:]]
n = '
' # only an LF, like "\n"
a = '[0-9A-Za-z]' # [[:alnum:]]
a2 = "$a$a" a3 = "$a2$a"
a4 = "$a2$a2" a6 = "$a4$a2"
a8 = "$a4$a4" a12 = "$a8$a4"
x = '[0-9A-Fa-f]' # [[:xdigit:]]
x2 = "$x$x" x3 = "$x2$x"
x4 = "$x2$x2" x6 = "$x4$x2"
x8 = "$x4$x4" x12 = "$x8$x4"
#------------------------------------------------------------
# Dump Mail with Word Sexually
#------------------------------------------------------------
:0
* ^Subject: .*SEXUALLY.*
/dev/null
#------------------------------------------------------------
# Save All Raw Data to a Folder
#------------------------------------------------------------
:0c
.raw/
#------------------------------------------------------------
# dump all blacklisted to addresses
#------------------------------------------------------------
:0
* ? [ -s $HOME/.procmailrecipes/siteadmin/siteadmin-blacklist.txt ]
* ? fgrep -iqf $HOME/.procmailrecipes/siteadmin/siteadmin-blacklist.txt
/dev/null
#------------------------------------------------------------
# collect some message parameters
#------------------------------------------------------------
:0
* ^^(From |Return-Path: <)[^ @]+(_at_)\/[^ >]+
{ ENV_DOMAIN = $MATCH } # domain part of the Envelope-From
:0
* 1^1 ^Received:
{ } N_RCVD = $= # number of Received header fields
:0
* ^Received: from \/[^ ]+
{ R1_HOST = $MATCH }
:0
* ^Content-Type: multipart/related;.*\
boundary=(\")?\/[^\"]+
{ H_CTB = $MATCH } # primary MIME boundary
:0
* ^Message-ID:.*\/[^ <@]+(_at_)[^>]+
{ H_MID = $MATCH
:0
* H_MID ?? ^^\/[^(_at_)]+
{ MID1 = $MATCH } # volatile part of the Message-ID
:0
* H_MID ?? @\/.+
{ MID2 = $MATCH } # FQDN part of the Message-ID
}
LOG = "<${H_MID}> ${N_RCVD}$n"
#------------------------------------------------------------
# catch gifspam
#------------------------------------------------------------
:0
# if the number of Received header fields is 1 or 2
* N_RCVD ?? ^^(1|2)^^
# and it is a multipart message
* ^MIME-Version: 1\.0\
^Content-Type: multipart/
# and the MIME boundary matches some regex
*$ H_CTB ?? ^^----=_NextPart_000_${x4}_${x8}\.${a8}^^
{
:0
# if the FQDN part of the Message-ID does not contain a dot
# or ends in the domain part of the Envelope-From
*$ MID2 ?? (^^[^.]+|$\ENV_DOMAIN)^^
# and part of the message body matches some regex
*$ B ?? ^--$\H_CTB\
^Content-Type: image/(gif|jpe?g|png);\
^${b}+name=\"[^\"]+\.(gif|jpg|png)\"\
(^Content-Transfer-Encoding: base64)?\
(^Content-Description:.*)?\
^Content-ID: <\
(${a12}([$]|${a})${a8}([$]|${a})${a8}(_at_)$\MID2\
|${a12}[$]${a8}[$]${a}+(_at_)${a}+\
|[^ >(_dot_)(_at_)]+\(_dot_)(gif|jpg|png)@${x8}\.${a8}\
)>$
# then deliver
${GIFBOX}/
#----------------------------------------------------------
# Procmail stops at delivery, so only if the previous
# recipe did not deliver, then processing continues here.
#----------------------------------------------------------
:0
# if the FQDN part of the Message-ID is equal to the HELO
*$ MID2 ?? ^^$\R1_HOST^^
# and there are 10 (or more) gif-attachments
* -9^0
*$ 1^1 B ?? ^--$\H_CTB\
^Content-Type: image/(gif|jpe?g|png);\
^${b}+name=\"[0-9]+\.(gif|jpg|png)\"$
# then deliver
${GIFBOX}/
}
#------------------------------------------------------------
:0
# if the number of Received header fields is 2 or 3
* N_RCVD ?? ^^(2|3)^^
# and the MIME boundary matches /[[:xdigit:]]+/
*$ H_CTB ?? ^^${x}+^^
# and the FQDN part of the Message-ID ends in the domain part
# of the Envelope-From
*$ MID2 ?? ()$\ENV_DOMAIN^^
# and the From: header field has an unquoted name, followed
# by <user-part(_at_)domain-part-of-the-Envelope-From>
*$ ^From: [^\"<]+ <[^(_at_)]+@$\ENV_DOMAIN>$
# and part of the message body matches some regex
*$ B ?? ^--$\H_CTB\
^Content-Type: image/(gif|jpe?g|png);\
^${b}+name=\"[^\"]+\.(gif|jpg|png)\"\
(^Content-Transfer-Encoding: base64)?\
(^Content-Description:.*)?\
^Content-ID: <${x}+(_at_)$\ENV_DOMAIN>$
# then deliver
${GIFBOX}/
#------------------------------------------------------------
# Spam Assassin Review and Toss
#------------------------------------------------------------
:0 fw
* < 256000
| spamassassin
:0
* ^X-Spam-Level: \*\*\*\*\*
$SPAMASSASSINBAD
:0
* ^X-Spam-Level: \*\*
$SPAMASSASSIN
#------------------------------------------------------------
# Send Newsletters to SiteAdmin/News
#------------------------------------------------------------
:0
* ? [ -s $HOME/.procmailrecipes/siteadmin/siteadmin-newsletters.txt ]
* ? fgrep -iqf $HOME/.procmailrecipes/siteadmin/siteadmin-newsletters.txt
$NEWSLETTERS
#------------------------------------------------------------
# Send Flyers to SiteAdmin/Flyers
#------------------------------------------------------------
:0
* ? [ -s $HOME/.procmailrecipes/siteadmin/siteadmin-flyers.txt ]
* ? fgrep -iqf $HOME/.procmailrecipes/siteadmin/siteadmin-flyers.txt
$FLYERS
#------------------------------------------------------------
# Send School to SiteAdmin/School
#------------------------------------------------------------
:0
* ? [ -s $HOME/.procmailrecipes/siteadmin/siteadmin-school.txt ]
* ? fgrep -iqf $HOME/.procmailrecipes/siteadmin/siteadmin-school.txt
$SCHOOL
#------------------------------------------------------------
# Move websites.DOMAIN.com and ctguy--at--DOMAIN.com
#------------------------------------------------------------
MATCH # clear the var
:0 fw hi
* ^(Received|To):(_dot_)*(_at_)websites\(_dot_)DOMAIN\(_dot_)com
* ^Subject:\/.*
| formail -i "Subject: [CT]$MATCH"
:0 A
$CTGUY
MATCH # clear the var
:0 fw hi
* ^(Received|To):(_dot_)*ctguy(_at_)DOMAIN\(_dot_)com
* ^Subject:\/.*
| formail -i "Subject: [CT]$MATCH"
:0 A
$CTGUY
#------------------------------------------------------------
# Move sites.hcdm.us
#------------------------------------------------------------
MATCH # clear the var
:0 fw hi
* ^(Received|To):(_dot_)*(_at_)sites\(_dot_)DOMAIN3\(_dot_)us
* ^Subject:\/.*
| formail -i "Subject: [HCDM-CT]$MATCH"
:0 A
$HCDMCT
#------------------------------------------------------------
# Move DOMAIN2.us
#------------------------------------------------------------
MATCH # clear the var
:0 fw hi
* ^(Received|To):(_dot_)*(_at_)DOMAIN2\(_dot_)us
* ^Subject:\/.*
| formail -i "Subject: [JH.US]$MATCH"
:0 A
$CTGUY
#------------------------------------------------------------
# Move eos.com and eos.com
#------------------------------------------------------------
MATCH # clear the var
:0 fw hi
* ^To:(_dot_)*(_at_)DOMAIN4\(_dot_)com
* ^Subject:\/.*
| formail -i "Subject: [EOS]$MATCH"
:0 A
$CTGUY
MATCH # clear the var
:0 fw hi
* ^To:(_dot_)*(_at_)DOMAIN5\(_dot_)com
* ^Subject:\/.*
| formail -i "Subject: [EOS]$MATCH"
:0 A
$CTGUY
#------------------------------------------------------------
# Bills Move
#------------------------------------------------------------
MATCH # clear the var
:0 fw hi
* ^Received:(_dot_)*(_at_)bills\(_dot_)DOMAIN2\(_dot_)us
* ^Subject:\/.*
| formail -i "Subject: [BILLS]$MATCH"
:0 A
$BILLS
MATCH # clear the var
:0 fw hi
* ^Received:(_dot_)*(_at_)bills\(_dot_)DOMAIN\(_dot_)com
* ^Subject:\/.*
| formail -i "Subject: [THBILLS]$MATCH"
:0 A
$THBILLS
#------------------------------------------------------------
# SEWebManager
#------------------------------------------------------------
MATCH # clear the var
:0 fw hi
* ^Received:(_dot_)*sewebmanager(_at_)DOMAIN\(_dot_)com
* ^Subject:\/.*
| formail -i "Subject: [SEWeb]$MATCH"
:0 A
$CTGUY
I usually uncomment the SHELLMETAS line and I get a boatload of reporting
in my procmail.log.
SHELLMETAS has nothing to do with logging. It has to do with determining
what characters would necessitate launching a shell process to interpret the
command string to execute, rather than invoking the command directly - more
or less to differentiate between a simple command and something like a shell
pipeline.
SNIP
____________________________________________________________
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