Scalable Anti-Spam Using Spamassassin and MySQL: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{ | {{BC|Certified}} | ||
__FORCETOC__ | |||
<div class="col-md-12 ibox-content"> | |||
=Spamassassin Bayes Database Options= | =Spamassassin Bayes Database Options= | ||
{{KB|{{ZC}}|{{ZCS 7.0}}||}} | |||
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. | ||
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 | Alternatively, SpamAssassin can be configured to use a dedicated MySQL back-end | ||
database on an MTA node 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 an extra MySQL | |||
database instance, the performance gains may warrant this extra overhead. | |||
=Enabling MySQL Database= | =Enabling MySQL Database= | ||
Line 17: | Line 22: | ||
zmlocalconfig -e antispam_mysql_enabled=FALSE | zmlocalconfig -e antispam_mysql_enabled=FALSE | ||
zmantispamctl restart | zmantispamctl restart | ||
=Migrating to (Default) Berkeley DB Format Database= | |||
Migrating existing Bayes data (from Berkeley DB to MySQL DB) is currently not supported. | |||
=Accessing a Remote Spamassassin MySQL Database= | =Accessing a Remote Spamassassin MySQL Database= | ||
Line 26: | Line 34: | ||
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: | ||
Line 43: | Line 50: | ||
[[Category:ZCS 7.0]] | [[Category:ZCS 7.0]] | ||
[[Category:Anti-spam]] | |||
[[Category:MTA]] |
Latest revision as of 01:47, 11 July 2015
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 dedicated MySQL back-end database on an MTA node 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 an extra 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
Migrating to (Default) Berkeley DB Format Database
Migrating existing Bayes data (from Berkeley DB to MySQL DB) is currently not supported.
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.