SpamAssassin in OS X 10.5 Server maintains a dynamic auto-whitelist (AWL) of email senders. The AWL modifies the calculated spam scores for incoming and outgoing email according to the previous history of emails from that sender.
Sometimes you may want to modify the AWL entry for a sender. For example, if a sender has been forwarding junk mail to the junkmail user (for spam training) rather than redirecting it then they will be flagged as the sender and not the real original sender. This will cause the local user's AWL score being moved up towards spam-sender territory and may even result in outgoing mail from that user being tagged as spam by their own email server. This would be evident by looking at the AWL score in a sent message header.
There are a couple of SpamAssassin commands for modifying AWL entries for the above scenario (but see The Modification Problem section before use)...
--remove-addr-from-whitelist=user@example.com This removes the address from the AWL completely - it starts off again from 0.
--add-addr-to-whitelist=user@example.com This modifies (or creates) an AWL score for the address = -100
There is another option, --add-addr-to-blacklist, which modifies (or creates) an AWL score for the address = 100, effectively rejecting as spam (depending on where your cutoff score is set). However, if you really want to blacklist a sender it would be better to add an entry to your local.cf file... blacklist_from name@example.com.
Note that these commands just create an initial AWL score. This would then be modified as normal by subsequent incoming messages. So if the user keeps forwarding rather than redirecting spam messages to the spam training address then they will soon move into spam-sender territory again.
You can read more about how the AWL works here...
http://wiki.apache.org/spamassassin/AutoWhitelist
A full list of other options can be found in the manual page for spamassassin-run...
Apple Man Page for spamassassin-run
...or "man spamassassin-run" in Terminal.
Viewing Your AWL Entries
You can view all AWL entries by installing the sa-awl tool (perl script), here...
http://spamassassin.apache.org/full/3.0.x/dist/tools/check_whitelist
If saved as /usr/sbin/sa-awl (with execution rights), then the AWL database can be viewed with...
sa-awl /private/var/amavis/.spamassassin/auto-whitelist
The Modification Problem
Since SpamAssassin is run by the _amavisd user, you would expect to be able to modify the AWL by running the SpamAssassin command under "sudo -H -u _amavisd"... wrong! The problem with this is that _amavisd's home in 10.5 server is set to /private/var/virusmails and not /private/var/amavisd as is required (and as was the case in 10.4). Running it under sudo results in the creation of a redundant auto-whitelist file in _amavisd's home folder in virusmails whereas the active AWL file is /private/var/amavisd/.spamassassin/auto-whitelist.
NB. All following terminal commands are run with current directory: /private/var so before running other commands...
cd /private/var
One option to work around the home problem (aside from changing _amavisd's home) would be to create a symbolic link from virusmails to the real file...
ln -s amavis/.spamassassin/auto-whitelist virusmails/.spamassassin/auto-whitelist
...however, for the few times that it may be necessary to modify the AWL, I tend to favour the following which does not interfere with any of the default installation paths...
Take a copy of the existing file and put into root's home (create root's .spamassassin directory beforehand if required)...
sudo cp amavis/.spamassassin/auto-whitelist root/.spamassassin/auto-whitelist
Run the spamassassin command as root (the following removes an existing email address entry)...
sudo spamassassin --remove-addr-from-whitelist=user@example.com
Check the resultant AWL entry (if sa-awl has been installed)...
sudo sa-awl root/.spamassassin/auto-whitelist | grep user@example.com
All OK, copy the file back to amavisd directory (stop mail services first if you want, just to be on safe side, as there is a small chance that it might be getting accessed just at the moment of copying)...
sudo cp root/.spamassassin/auto-whitelist amavis/.spamassassin/auto-whitelist
Permissions for the file should be OK after copying; owner/group: _amavisd, permissions: 600
If you did not install sa-awl, then just send a test message from the address and check the mail headers to see changes in the AWL score. If the sender's AWL entry was removed then it takes 3 or 4 messages for it's new score to appear on headers.



it's good to see this information in your post, i was looking the same but there was not any proper resource, thanx now i have the link which i was looking for my research.
Posted by: uk dissertation writing | 28 February 2010 at 07:06 PM