Scalable Anti-Spam Using Spamassassin and MySQL: Difference between revisions

No edit summary
No edit summary
Line 1: Line 1:
{{ZC}}{{Article Infobox|{{admin}}|{{ZCS 7.0}}|||}}
{{ZC}}{{Article Infobox|{{admin}}|{{ZCS 7.0}}||}}
=Spamassassin Bayes Database Options=
=Spamassassin Bayes Database Options=
By default, SpamAssassin in Zimbra ZCS utilizes a Berkeley DB format database for it's Bayes filtering data.  The Berkeley DB format database implementation in SpamAssassin uses a sequential locking mechanism which can impede message processing for larger ZCS installations.  Thus the default for SpamAssassin to use the Berkeley DB format database may not be ideal.
By default, SpamAssassin in Zimbra ZCS utilizes a Berkeley DB format database for it's Bayes filtering data.  The Berkeley DB format database implementation in SpamAssassin uses a sequential locking mechanism which can impede message processing for larger ZCS installations.  Thus the default for SpamAssassin to use the Berkeley DB format database may not be ideal.
Line 6: Line 6:


Although there is some overhead in running and maintaining a MySQL database instance, the performance gains may warrant this extra overhead.
Although there is some overhead in running and maintaining a MySQL database instance, the performance gains may warrant this extra overhead.


=Enabling MySQL Database=
=Enabling MySQL Database=
Line 26: Line 25:
  zmlocalconfig -s antispam_mysql_user
  zmlocalconfig -s antispam_mysql_user
  zmlocalconfig -s antispam_mysql_password
  zmlocalconfig -s antispam_mysql_password


To enable the local MTA server to access the remote Spamassassin MySQL Database, as the zimbra user, run the following commands on the local server:
To enable the local MTA server to access the remote Spamassassin MySQL Database, as the zimbra user, run the following commands on the local server:

Revision as of 21:07, 6 May 2011

Admin Article

Article Information

This article applies to the following ZCS versions.

ZCS 7.0 Article ZCS 7.0


Spamassassin Bayes Database Options

By default, SpamAssassin in Zimbra ZCS utilizes a Berkeley DB format database for it's Bayes filtering data. The Berkeley DB format database implementation in SpamAssassin uses a sequential locking mechanism which can impede message processing for larger ZCS installations. Thus the default for SpamAssassin to use the Berkeley DB format database may not be ideal.

Alternatively, SpamAssassin can be configured to use a MySQL back-end database to store its Bayes filtering data. A MySQL database affords increased performance to SpamAssassin and message processing as it allows for concurrent access to the indexed database.

Although there is some overhead in running and maintaining a MySQL database instance, the performance gains may warrant this extra overhead.

Enabling MySQL Database

As the zimbra user, run the following commands:

zmlocalconfig -e antispam_mysql_enabled=TRUE
zmantispamctl restart

Reverting to (Default) Berkeley DB Format Database

As the zimbra user, run the following commands:

zmlocalconfig -e antispam_mysql_enabled=FALSE
zmantispamctl restart

Accessing a Remote Spamassassin MySQL Database

Optionally in a multi-node environment, if a Spamassassin MySQL Database server is already running on another MTA node, Spamassassin can be configured to utilize that remote Spamassassin MySQL Database (instead of running an additional MySQL database instance).

To configure Spamassassin to utilize a remote Spamassassin MySQL Database server, the user name and password of the remote Spamassassin MySQL Database is required. This can be obtained by running the following commands as the zimbra user:

On remote server

zmlocalconfig -s antispam_mysql_user
zmlocalconfig -s antispam_mysql_password

To enable the local MTA server to access the remote Spamassassin MySQL Database, as the zimbra user, run the following commands on the local server:

On local server

zmlocalconfig -e antispam_mysql_user=<username>
zmlocalconfig -e antispam_mysql_password=<password>
zmlocalconfig -e antispam_mysql_host=<remote_host>
zmlocalconfig -e antispam_mysql_enabled=TRUE
zmantispamctl restart

where <username> is the name of the MySQL user and <password> is the password for the MySQL user account on the remote server; and where <remote_host> is the FQDN of the remote host already running the Spamassassin MySQL Database engine.


Verified Against: ZCS 7.0 Date Created: 5/5/2011
Article ID: https://wiki.zimbra.com/index.php?title=Scalable_Anti-Spam_Using_Spamassassin_and_MySQL Date Modified: 2011-05-06



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search