# (c) 1996-2005 Fred Morris, m3047@inwa.net. Licensed under the same terms # as perljacket.plx # Rewritten to utilize perljacket, Jan/2002 # Given that your e-mail address is youraccount@yourdomain: # 1. Substitute all instances of youraccount with your account name; and # 2. Substitute all instances of yourdomain with your domain name. #rev. 05-Jun-2005 # Set the shell to csh for superstitious reasons. SHELL=/bin/csh LOGFILE=procmail.log VERBOSE=yes # Pass everything through perljacket which is less than 3 megabytes in size. :0 H B h b f w * < 3000000 | ./perljacket.plx -t1000 # This recipe was dropping stuff on the floor, which wasn't the intended # behavior. This should cause it to pass the message through without # further processing, but adding the X-PerlJacket: Warning.. header. # If you don't like this behavior, change it. FWM, 05-Jun-2005 :0 E h b f w | formail -A"X-PerlJacket: Warning: oversized message or error!" # In addition to the X-PerlJacket header, my perljacket.filter defines # the following headers: # # X-Null Nuke em! # X-Bcc Stuff that was BCCed # X-Alias Stuff that was sent to an alias # X-Friend Friendlies # X-Mail-List Stuff from a recognized mailing list # X-Special Stuff that is special # X-Nozzle Stuff from misconfigured autoresponders # X-Banned Obnoxious domains # X-Banned-Pass Recognized subject line passwords for banned domains # X-Alias-Pass Recognized subject line passwords for aliased mail #/\/\/\/\/\/\/ PROCESSING \/\/\/\/\/\/\/\/\/\/\/\/\/\/ # Fry 'em crispy! :0 H * ^X-Null: /dev/null # Deal with stuff from banned domains, except when they're a # legitimate poster to a mailing list or a known friend. :0 H * ^X-Banned: * !^X-Friend: * !^X-Special: * !^X-Mail-List: * !^X-Banned-Pass: { # return a note to the sender that we're not accepting mail :0 H h c w * !^X-Nozzle: * !^FROM_DAEMON * !^X-Loop: youraccount@yourdomain | ( formail -r -A"X-Loop: youraccount@yourdomain" \ -I"From: youraccount@yourdomain" ;\ cat banned-note.txt ) | $SENDMAIL -oi -t # store it in the banned folder :0: ./mail/banned } # Catch all mail sent to aliases. :0 H * ^X-Alias: * !^X-Friend: * !^X-Special: * !^X-Mail-List: * !^X-Alias-Pass: { # Received for an alias but not addressed to me? Don't bother. : 0 H * !^To:.*youraccount /dev/null # Return a copy to the sender.. :0 H h c w * !^X-Nozzle: * !^FROM_DAEMON * !^X-Loop: youraccount@yourdomain | ( formail -r -A"X-Loop: youraccount@yourdomain" \ -I"From: youraccount@yourdomain" ;\ cat cookie-note.txt ) | $SENDMAIL -oi -t # Save it to the junk mail folder :0 c: ./mail/junk-mail # Strip it to just the headers and two lines of the body :0 f b w | head -n4 } # If something's not addressed to me and not a list, headers only, # save a copy on the server. :0 H * ^X-Bcc: * !^X-Friend: * !^X-Special: * !^X-Mail-List: * !^X-Alias-Pass: { # Send them a note that we need bona fides :0 H h c w * !^X-Nozzle: * !^FROM_DAEMON * !^X-Loop: youraccount@yourdomain | ( formail -r -A"X-Loop: youraccount@yourdomaint" \ -I"From: youraccount@yourdomain" ;\ cat junk-note.txt ) | $SENDMAIL -oi -t # If it's sent with Pegasus, don't even want to see it. :0 * ^X-Mailer:.*Pegasus /dev/null :0 c: ./mail/junk-mail :0 f b w | tail -n0 | echo "junk-mail" }