personal rules

Ned Boddie nboddie at MY-NETWORK.COM
Mon Oct 20 16:10:01 IST 2003

Here's how I did it.

1. In MailScanner.conf set the following two variables as follows:

Is Definitely Not Spam = &ByDomainSpamWhitelist


Is Definitely Spam = &ByDomainSpamBlacklist

These two routines are in the

    /usr/lib/MailScanner/MailScanner/ file

on my system.  There's also just a tad of doc in there about doing this.

I use the default paths in the 'my $WhitelistDir & my &BlacklistDir'
variables in that module.  These directories will contain the by user
white and blacklist files,

2. Make the appropriate directories wherever you need.  I set the owner to
root and the group to apache on my system since I also have a php web page
for my users to manage their own white and black lists so I don't have to
mess with it :)

3. Along with the blacklist & whitelist directories I also made a 3rd
directory at the same level that I call 'prefs'.  This 3rd directory
contains both of the actual black * whitelist files by username, and then
I create symlink files from the actual lists into either the black or
whitelist subdirs as necessary.

Why do this indirection?

My users are actually emailable by a few different domains, i.e. x at
and x at, etc. along with some entries in the sendmail virtuser table
aliasing them to other names (married vs maiden names, etc.), so this way
I only have to have the user management web page maintain a single
black/white list combo that applies to ALL of their destination email

4. The filenames in the prefs subdir, by my convention, are <final
sendmail user resolution name>.<blacklist | whitelist>, and then the
symlinks into the white/blacklist creates a name <emailaddress>.<blacklist
| whitelist>


The files in the /etc/MailScanner/spam.bydomain/prefs are all owned by the
apache.apache user and group since they are all maintained by the web
page.  They are all chmodded to 0666.

/etc/MailScanner/spam.bydomain/prefs contains:


The symlinks in the black & whitelist directories are all owned by the
root.root since only MailScanner has to deal with them,  They
are all 777.

/etc/MailScanner/spam.bydomain/whitelist contains:

symlink from /etc/MailScanner/spam.bydomain/prefs/ned.whitelist -> ned at
symlink from /etc/MailScanner/spam.bydomain/prefs/ned.whitelist ->
neddy at (an allowed alias from the sendmail virtuser table)

symlink from /etc/MailScanner/spam.bydomain/prefs/bob.whitelist -> bob at

and /etc/MailScanner/spam.bydomain/blacklist contains:

symlink from /etc/MailScanner/spam.bydomain/prefs/ned.blacklist -> ned at
symlink from /etc/MailScanner/spam.bydomain/prefs/ned.blacklist ->
neddy at (an allowed alias from the sendmail virtuser table)

symlink from /etc/MailScanner/spam.bydomain/prefs/bob.blacklist -> bob at

If you care about the web page stuff I'll get around to packaging it up,
but at least from the MailScanner perpective you can do it this way.



> Hi,
>         Is it possible to personnalize blacklists or whitelists, like if
> user at doesn't want to receive e-mail from
> user at, but user2 at wants to receive mail from
> user at
> thanks,
> --------------
> Ugo Bellavance
> Camo-route Inc.
> ugob at

More information about the MailScanner mailing list