<<< Date Index >>>     <<< Thread Index >>>

A simple whitelisting script



A very good way to create a whitelist is to
simply add all your addressEes there.  A quite
typical scenario with a spam (bogo)filter is that you
send e-mail to somebody, wait for reply, wait, still
don't see it, check spam folder, and there it is.
Whitelisting recipients will allow immediate
pass-through for their replies.  Instead of perl,
the script is in sh for light-weight.

Usage: in .muttrc, set sendmail=/path/to/this.script
In the script, use your actual sendmail.

TODO: 
-- Do we need locking for .whitelist?
-- Would be nice not to auto-whitelist ezmlm acks,
   may have an exclusion pattern.
-- Storing whitelist in access_db, or DCC-compatible?

Here it is, and also in attachment for easy save.

#!/bin/sh

whitelist=$HOME/.whitelist
allargs=$*
while test "z$1" != "z" -a "x$1" != "x--" 
do
  shift
done
test "z$1" != "z" && shift
for address in $*
do
  grep -is $address $whitelist > /dev/null || echo $address >> $whitelist
done
exec /usr/sbin/sendmail $allargs

-- 
Cheers,
Alexy Khrabrov :: www.setup.org :: Age Quod Agis

Attachment: whitelist.sendmail.sh
Description: Bourne shell script