# Define the password PASSWD_=alimeti SUBJECT=`formail -xSubject: \ | sed -e 's/[;\`\\]/ /g' \ | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'` FROM=`formail -rt -xTo: \ | sed -e 's/[;\`\\]/ /g' \ | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'` :0 # Check for (the lack of) the password * $ ! ^Subject:.*${PASSWD_} ## Avoid e-mail loops and accept mail from lists I am subscribed to. #* ! ^To:.*iconnect\.co\.ke #* ! ^To:.*wash@([-a-z0-9_]+\.)*wananchi\.com * ! ^From:.*iconnect\.co\.ke * ! ^From:.*wananchi\.com * ! ^To:(_dot_)*cs(_at_)wananchi\(_dot_)com * ! ^To:.*idt\.Unitymail\.Net * ! ^From:.*opensrs\.org * ! ^From:.*techrepublic\.com * ! ^From:.*brainbench\.com * ! ^FROM_DAEMON * ! ^FROM_MAILER * ! ^List- * ! ^(Mailing-List|Approved-By|BestServHost|Resent-(Message-ID|Sender)): * ! ^Sender: (.*-errors@|owner-) * ! ^Sender: .*bind-users * ! ^X-[^:]*-List: * ! ^X-(Authentication-Warning|Loop|Sent-To|(Listprocessor|Mailman|Listar)-Version): * ! ^Precedence: (junk|bulk|list) * ! ^X-Loop: *wash(_at_)wananchi\(_dot_)com { :0 h c # Prepare and send notification # Be sure to customize for your sendmail path | (formail -r -I "Subject: Refused e-mail: Password or privileges required" \ -A "Precedence: Junk" \ -I "From: JUNK-FILTER (W a s h i n g t o n)" \ -I "Reply-To: null(_at_)wananchi(_dot_)com (Odhiambo Washington /dev/null)" \ -I "Sender: JUNK-FILTER(_at_)wananchi(_dot_)com" ; \ echo "************************************************" ; \ echo "* This response message is computer-generated.*" ; \ echo "************************************************" ; \ echo "" ; \ echo "Dear ${FROM}," ; \ echo "" ; \ echo "Your mail regarding <<"${SUBJECT}">> is being temporarily returned because your" ; \ echo "address has not been listed in my privileges database." ; \ echo "This is my simple step to counter Unsolicited Commercial Emails (aka spam)." ; \ echo "Please include the magic word (${PASSWD_}) anywhere on the _original_ subject line" ; \ echo "then kindly resend your e-mail to wash(_at_)wananchi(_dot_)com(_dot_)" ; \ echo "" ; \ echo "Thank you.") \ | $SENDMAIL -t :0 c | /usr/local/bin/formail -rtzxTo: >> /home/wash/.LOG/black.lst :0: RETURNED } #EOF