Scanning for multiple organisations

Steve Freegard steve.freegard at fsl.com
Mon Dec 29 11:39:29 GMT 2008


Rob Sterenborg wrote:
> Hi all,
> 
> We're using PF with MS and SA to mark spam for multiple organisations.
> Different organisations tend to attract different kind of spam and a
> company for which we recently started to offer email services complained
> that at the moment they receive more spam than before.
> 
> I'd like to have a separate SA Bayes for each organisation we accept
> email for. However, AFAICT that would require running multiple MS/SA
> processes using different configs that would eat a lot of resources. Is
> there another, more intelligent, way of doing this?

Not without writing some code to achieve it.   Search the list archives 
for 'spamd support module' and you'll find some code I sent to the list 
that adds spamd support into MailScanner via the GenericSpamScanner 
interface.

You'd need to extend that a bit to change which $spamd_user is being 
sent to spamd depending on who the message is being sent to (remember 
that you will need to handle messages to multiple different domains in a 
single message) - then you can run spamd with '-c -x 
--virtual-config-dir=/var/spamd/prefs/%u' and it will automatically 
create user_prefs and the bayes databases in /var/spamd/prefs/<user> for 
you.  If you want to get fancy then you can use '-q' instead of 
'--virtual-config-dir' and that will allow all the preferences to be 
loaded from SQL instead (note that you can't mix both methods).

If you decide to go this route, then please make sure that you 
contribute your changes back so that others may benefit.

Kind regards,
Steve.


More information about the MailScanner mailing list