Re: Re: user_prefs in MailScanner
koos said:
I want to use de user_prefs (the file wich changed by DA) in MailScanner.conf
How do I this?
Originally posted by blacknight
Could you explain a bit more clearly what you are trying to do?
I think he is saying that he wants to configure MailScanner so that it takes into account the DA control panel end-user SpamAssassin Settings for
- whitelists
- blacklists
- subject rewrite
- score threshold
- and other settings
I am currently using SpamAssassin on my DA server and would also like to use MailScanner, but not if I have to take away the end-user control over their own whitelists/blacklists.
There is probably a way to integrate the DA control panel whitelists/blacklists with MailScanner but I'm not sure about the other settings.
The control panel saves the whitelist/blacklist data for the end-user in a text file
/home/username/.spamassassin/user_prefs
this text file has sections like this:
whitelist_from *@ecoms.com
whitelist_from *@maq.com
blacklist_from *@give-a-hint.com
However this format is not compatible with MailScanner.
I have MailScanner running on a different server (non-DA) and the whitelist for the server is in the file
etc/MailScanner/rules/spam.whitelist.rules
with lines like this
From: ecoms.com yes
From: maq.com yes
And it works similarly for blacklists
Looking in mailscanner.conf there are the following lines
# Spam Whitelist:
# Make this point to a ruleset, and anything in that ruleset whose value
# is "yes" will *never* be marked as spam.
# This can also be the filename of a ruleset.
#Is Definitely Not Spam = no
Is Definitely Not Spam = /etc/MailScanner/rules/spam.whitelist.rules
So in theory it should be possible to write some kind of shell script that looks for all the files
/home/[username]/.spamassassin/user_prefs
and grabs the data from the end of each line
whitelist_from *@ecoms.com
whitelist_from *@maq.com
and then adds the data to
/etc/MailScanner/rules/spam.whitelist.rules
in the format
From: ecoms.com yes
From: maq.com yes
I'm not sure how you would trigger this though... ideally when a user updates their SpamAssassin settings but I suppose you could just add the script to a cron job
There is also the issue that this would mean a single user's white/blacklist would apply to ALL the other user/domains on the server.
Or perhaps there is a way to configure MailScanner to allow individual user whitelists and blacklists.