### PMDIR: ProcMail DIRectory" ## Directory where procmail stores its log and rc files # 990409: PATH=$HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin PMDIR=$HOME/.LOG/ ## LOGFILE: procmail's log file. LOGFILE=$PMDIR/maillog.`/bin/date +%Y-%m` #LOG=`date +"%b %d %T %w"` #TRAP='formail -XMessage-Id:' MESSAGE_ID=`formail -xMessage-Id:` TRAP="echo 'END $MESSAGE_ID'" LOG="BEGIN $MESSAGE_ID " #LOGFILE=$PMDIR/maillog #LOGFILE=$PMDIR/Proclog_`/bin/date +%y_%m_%d` #Logs message disposition. FILEDIR=$HOME # "VERBOSE=on" is only used for debugging. # Benefits: The log file will tell you a lot about almost every decision that # Procmail does. And you get to see the line numbers to error messages, too. VERBOSE=on LOGABSTRACT=all ## MAILDIR: ## I suggest you create either $HOME/mail or $HOME/Mail ## and then you create a symbolic link to the other, eg ## $ mkdir $HOME/Mail ## $ ln -s $HOME/Mail $HOME/mail MAILDIR=$HOME/Mail SHELL=/bin/sh # If you need to set SHELL then *avoid* the "csh" and "tcsh"!!! #Set rules that are used to filter incoming mail #You can do this even with different files (ambiguous!) ################# We hate M$ W O R D ########################################################### INCLUDERC=$PMDIR/rc.msword ################# M A I L I N G L I S T S ######################################################### #Count message lines and add a lines header :0 fhw * ! ^Lines: * B ?? 1^1 ^.*$ * B ?? -1^0 ($)($)^^ | formail -f -A "Lines: $=" #First let me process mail from lists I am subscribed to lists="owner-freebsd-questions|owner-freebsd-isp|owner-freebsd-stable|techrepublic|openldap-software|\ hylafax-users|mml-general|win98-dialup|winnt-dialup|proftpd|tpc-rp|tpc-oper|mutt-users|mutt-users-owner|\ samba|netatalk-admins|procmail-admin|procmail-users|kde-nonlinux|openroot|exim-users|owner-newbie|\ owner-bind-users|comp-protocols-dns-bind|bind-users-bounce|hoods|theteam|imp|horde|6bone-owner|owner-freebsd-ia64" :0 #* $ ^Reply-To:.*\/($lists)@ * $ ^To:.*\/($lists)@ * $ ^From:.*\/($lists)@ * $ ^Return-Path:.*\/($lists)@ * MATCH ?? ^^\/[^(_at_)]+ IN.$MATCH ################################# M Y F R I E N D S ################################################ # Handling mail from known correspondents ###################################################################### # Here we search the list of people we always want to get mail from, # # and deliver the mail if it's from one of them, no matter what. # # The FRIENDS file is set and described above. # ###################################################################### #FRIENDS=$HOME/.LOG/green.lst #:0: #* ? (formail -x From: -x Sender: | fgrep -iqf $FRIENDS) #$DEFAULT # ## If the sender is in my greenlist then deliver it. - this works okay #:0: #* ? formail -xFrom: | fgrep -if $PMDIR/green.lst #$DEFAULT # ################################## S P A M M E R S S E C T I O N ################################## # Emails with more than seven recipients in the "To:" header field. Assume for simplicity that each address # will have exactly one "@" character in it. #:0 #* ^Subject:.*The information you requested #{ # :0 # { # WHOTO=`formail -z -xTo:` # COUNT=`echo ${WHOTO} | sed -e 's/[^(_at_)]//g' | wc -c` # COUNT1=`expr ${COUNT} - 1` # ISGT=`expr ${COUNT1} \> 7` # } # :0: # * ISGT ?? ^^1^^ # PROBABLE-Spam #} # Some known spam stuff