filter-mail
History
filter-mail is a small utility I originally wrote a few years ago to filter
incoming mail based on the sender address. Soon however, I discovered that more
than a simple filter was necessary; I was often checking the unfiltered box to
make sure that I had not ignored any important but unexpected messages. So, to
resolve this problem, I added an autoreply feature that would inform the sender
when their message had been blocked, and asked them to send mail to some other
email address that I presumably would check. This too proved insufficient, so I
made filter-mail capable of automatically updating my list of approved senders.
When someone sends a message that gets blocked, they get a special code in the
autoresponse that they can send back to filter-mail to get added to the list.
(This behavior has since been classified as a "challenge-response" mail system.)
In this way, I don't have to worry about missing some important messages. More
recently I made a few robustness changes to it, and now I believe that
filter-mail is a reliable enough email filtering system that I can release it
for others. (I have released it under the terms of the GNU GPL.)
I actually found out recently that there is now some company which has created a
product similar to my script, but they want to charge who knows how much for
what can be done with a fairly simple shell script.
Here's how it works:
1. Bob sends a message to Alice.
2. Bob is not on Alice's approved senders list, so Alice does not get his
message. Bob gets an automated reply from Alice informing him of this,
and containing a special code.
3. If Bob sends another message with the code as the subject line, he is
automatically added to the list of approved senders and a confirmation
message is sent to him.
A few notes:
- The original message is lost, but a copy is sent back to Bob in the
automatic response.
- If Bob does not reply within a week, his code expires.
- Before the code expires, any message from Bob that does not have the special
code as the subject line will be ignored entirely.
- After the code expires, if Bob sends another message, he will receive
another automated response with a new code.
- Bob must send the code as the only thing in the subject line. So, subject
lines like "Code: 04b9e86ef45efda5218114f0b9e6bc7d" won't work.
Instructions:
1. Download the filter-mail.tar.gz file below.
2. Extract it into your home directory on the machine where your mail
arrives.
3. Edit the file .filter-config and put in the values you like.
4. You're done!
Prerequisites:
- Some sort of UN*X system. I use Debian GNU/Linux. Other flavors ought to
work too.
- You must have an MTA (Mail Transport Agent) installed, like sendmail or
exim.
- Your mail must be delivered locally by procmail. This is most often the
default configuration, in my experience. Note that the 'fetchmail' utility
delivers mail to the local MTA, which then generally uses procmail.
- You must have bash installed as /bin/bash and many standard toolchain
programs must be in the path when procmail is run. (Needed: cat, cut, date,
echo, formail, grep, mail, rm, sort, tempfile, test, touch. I find that
tempfile is the rarest of these; most Red Hat systems don't seem to have it
installed for instance.)
Download:
filter-mail-0.9.4.tar.gz
filter-mail-0.9.3.tar.gz
filter-mail-0.9.2.tar.gz
Planned features:
At some point I plan to add these features. I may add them sooner if there is an
interest in them outside my own.
- Saving the original message in a time-sensitive quarantine of some sort, to
be released upon receipt of the code or user intervention.
- A web-based configuration management utility, mostly for managing the
above-mentioned quarantine.
Please send me any ideas,
improvements, comments, or problems you have using filter-mail. Thanks!