# the goal of this was to simplify the python script by matching # variables in procmail and then passing them in to the python # script. note that procmail variables are available as environment # variables in subprocesses. i thought maybe procmail matching would be # faster or more accurate because 'it knows stuff', but maybe that's not # true. # ^FROM_MAILER # This should cover most messages from mailer programs (bounces etc.). # ^FROM_DAEMON # This is an expanded version of ^FROM_MAILER which covers a broader # range of machine-generated messages, notably including most mailing # lists and other (benign) bulk e-mail. :0 { :0 * ^Subject:[ ]*\/[^ ].* { SUBJECT=$MATCH } :0 * ^To:[ ]*\/[^ ].* { TO=$MATCH } :0 * ^From:[ ]*\/[^ ].* { FROM=$MATCH } # Call shell... -rt will parse return address # according to RFC rules. Note we only process HEADER :0 h SENDER=|formail -b -rtzxTo: # get the From: address as an address component ONLY (no comments) :0 h CLEANFROM=|formail -IReply-To: -rtzxTo: :0 # username portion :0 * CLEANFROM ?? ^\/[^@]+ { FROM_USER=$MATCH } #:0: #* !^FROM_DAEMON | ./request_handler.py SUBJECT SENDER }