#!/bin/bash

#!/login
#!/register

Invalid Recipient Checker


This is a script that is intended for use with procmail.

Installation


Copy it to a directory in your home (for example: ~/bin) and make it executable: chmod +x ~/bin/checkaccs.sh.
Then add these procmail recipes to your ~/.procmailrc file:
 
:0fw 
| /bin/checkaccs.sh 

:0: 
^X-Suspicious: yes 
IN.suspicious 

The first recipe pipes the mail to checkaccs.sh which in case of invalidity adds the header line X-Suspicious: yes to the mail.
The second recipe then filters the mail by this header and saves it to the mailbox IN.suspicious for further consideration.
Needless to say, but this should only be done after all mailinglists have been filtered, since these usually do not have your mail in the To: or CC: header but the mailinglists address.

Configuration


The first few lines of checkaccs.sh contain configuration variables:
 
USER="blindcoder" 
HOST="scavenger.homeip.net" # hostname of your mail (the part after @) 
TMP="/tmp/checkacc.$$" # filename of tmp-file (use $$ in filename to 
# suppress race-conditions 
ALIASES="/etc/mail/aliases" # path to your aliases file 

ADD="" 

VERSION="0.1-release" 
DATE="Sun Apr 27 15:44:25 CEST 2003" 

The USER variable must contain the username you use to log in.
The HOST variable mest be set to the part after the @ in your mailaddress.
The TMP variable should point to a more or less random filename. Using $$ is acceptable, but some people prefer this line:
TMP="`mktemp`"
The ALIASES variable must point to the aliases file of your mailserver. This is used to determine your email aliases by which you can legally be reached.
The ADD variable contains a space separated list of other legal mailaddresses. Example:
ADD="postmaster@localhost webmaster@example.local god@other.local"

Edit | History | Subscribe