You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Patrick Saweikis <ps...@techpro.com> on 2009/07/15 23:22:51 UTC

Spamassassin rules in a mysql database

Has anyone had any experience trying to make spamassassin use a mysql
database for it's ruleset instead of text files? We are planning on
making our anti-spam solution redundant, and it would be nice to have
this in a database instead of copying files around when we make changes.



Re: Spamassassin rules in a mysql database

Posted by mouss <mo...@ml.netoyen.net>.
Martin Gregorie a écrit :
>> put any custom rules in the database, and modify the spamd? start
>> scripts to write the custom rules to flat files.  modify your update
>> program to signal a spamd reload every time you modify the rules, or,
>> use unison.  we use unison (not for our VPS spam clusters) but for
>> syncing flat files used on our redundant web servers (any downloaded
>> pdf's can be up to 15 mins behind the 'master') which is why we don't
>> do that on our anti-spam clusters.
>>
> However you slice it, you'll need to introduce a cron job to pull down
> any SA configuration updates and restart spamd if any are found.
> Alternatively, you might want to modify the SA daemon start script to
> pull down updates to your configuration before starting spamd. 
> 
> Consequently this exercise boils down to finding the easiest way to
> graft update retrievals onto the cron job. I think there are a number of
> ways to do this that are simpler than using an SQL database. For
> starters, none of the following require text->SQL->text conversions. Try
> using one of these:
> 
> - CVS, or whatever version control system is favored at your site. 
>   CVS is simple to set up, works entirely with text files and can
>   sync multiple local copies to a central repository regardless of
>   where the copies are on the network. It only distributes changed
>   files and its trivial to discover if any changes were distributed.
> 
> - rsync can be used to distribute a flat file repository. Like CVS,
>   it will automatically distribute just the changed files, so its fast
>   and its fairly easy to find out if it pulled down any changes.
> 
> - wget can retrieve updates from a repository that's distributed by
>   an internal web server, Apache for instance.
> 

and as an extension (clarification?) of the latter:

- sa-update. "convert" your rules to a channel and use sa-update.


Re: Spamassassin rules in a mysql database

Posted by Martin Gregorie <ma...@gregorie.org>.
> put any custom rules in the database, and modify the spamd? start
> scripts to write the custom rules to flat files.  modify your update
> program to signal a spamd reload every time you modify the rules, or,
> use unison.  we use unison (not for our VPS spam clusters) but for
> syncing flat files used on our redundant web servers (any downloaded
> pdf's can be up to 15 mins behind the 'master') which is why we don't
> do that on our anti-spam clusters.
> 
However you slice it, you'll need to introduce a cron job to pull down
any SA configuration updates and restart spamd if any are found.
Alternatively, you might want to modify the SA daemon start script to
pull down updates to your configuration before starting spamd. 

Consequently this exercise boils down to finding the easiest way to
graft update retrievals onto the cron job. I think there are a number of
ways to do this that are simpler than using an SQL database. For
starters, none of the following require text->SQL->text conversions. Try
using one of these:

- CVS, or whatever version control system is favored at your site. 
  CVS is simple to set up, works entirely with text files and can
  sync multiple local copies to a central repository regardless of
  where the copies are on the network. It only distributes changed
  files and its trivial to discover if any changes were distributed.

- rsync can be used to distribute a flat file repository. Like CVS,
  it will automatically distribute just the changed files, so its fast
  and its fairly easy to find out if it pulled down any changes.

- wget can retrieve updates from a repository that's distributed by
  an internal web server, Apache for instance.

Martin



Re: Spamassassin rules in a mysql database

Posted by Michael Scheidell <sc...@secnap.net>.

Patrick Saweikis wrote:
>
> Has anyone had any experience trying to make spamassassin use a mysql 
> database for it's ruleset instead of text files? We are planning on 
> making our anti-spam solution redundant, and it would be nice to have 
> this in a database instead of copying files around when we make changes.  
>
we have multiple redundant cluster sets that need to do just that.  
custom rules, *.pre files, local.cf files, etc.

put any custom rules in the database, and modify the spamd? start 
scripts to write the custom rules to flat files.  modify your update 
program to signal a spamd reload every time you modify the rules, or, 
use unison.  we use unison (not for our VPS spam clusters) but for 
syncing flat files used on our redundant web servers (any downloaded 
pdf's can be up to 15 mins behind the 'master') which is why we don't do 
that on our anti-spam clusters.

other option is to use a unixsocket to simulate files.. spamd would 
never know the difference, but a failure on sql would hurt.

or, spamassassin is open source, go for it, but you would be reading 
(multiple dozens of files? ) each time a spamd instance started or 
reloaded or spawned.


-- 
Michael Scheidell, CTO
Phone: 561-999-5000, x 1259
 > *| *SECNAP Network Security Corporation

    * Certified SNORT Integrator
    * 2008-9 Hot Company Award Winner, World Executive Alliance
    * Five-Star Partner Program 2009, VARBusiness
    * Best Anti-Spam Product 2008, Network Products Guide
    * King of Spam Filters, SC Magazine 2008


_________________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.secnap.com/products/spammertrap/
_________________________________________________________________________
   

Re: Spamassassin rules in a mysql database

Posted by Bowie Bailey <Bo...@BUC.com>.
Patrick Saweikis wrote:
>
> Has anyone had any experience trying to make spamassassin use a mysql 
> database for it’s ruleset instead of text files? We are planning on 
> making our anti-spam solution redundant, and it would be nice to have 
> this in a database instead of copying files around when we make changes.
>

Why not use a shared directory? Since SA does not write to the rules 
directory, there would be no locking issues.

-- 
Bowie