User Tools

Site Tools


mail:spamassain_gateway

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
mail:spamassain_gateway [2013/03/18 14:27]
tschulz created
mail:spamassain_gateway [2013/03/22 06:08] (current)
tschulz [Spam Assassin Gateway (FreeBSD 9.1)]
Line 1: Line 1:
-====== ​Spam Assassin ​Gateway ======+====== ​SpamAssassin with MySQL Gateway ​(FreeBSD 9.1) ======
  
 +===== /​var/​db/​ports/​p5-Mail-SpamAssassin/​options =====
 +Copy the following to /​var/​db/​ports/​p5-Mail-SpamAssassin/​options
 +<file config options>
 +# This file is auto-generated by 'make config'​.
 +# Options for p5-Mail-SpamAssassin-3.3.2_6
 +_OPTIONS_READ=p5-Mail-SpamAssassin-3.3.2_6
 +_FILE_COMPLETE_OPTIONS_LIST= AS_ROOT SPAMC SACOMPILE DKIM SSL GNUPG MYSQL PGSQL RAZOR SPF_QUERY RELAY_COUNTRY DCC
 +OPTIONS_FILE_SET+=AS_ROOT
 +OPTIONS_FILE_SET+=SPAMC
 +OPTIONS_FILE_SET+=SACOMPILE
 +OPTIONS_FILE_SET+=DKIM
 +OPTIONS_FILE_SET+=SSL
 +OPTIONS_FILE_SET+=GNUPG
 +OPTIONS_FILE_SET+=MYSQL
 +OPTIONS_FILE_UNSET+=PGSQL
 +OPTIONS_FILE_SET+=RAZOR
 +OPTIONS_FILE_SET+=SPF_QUERY
 +OPTIONS_FILE_SET+=RELAY_COUNTRY
 +OPTIONS_FILE_SET+=DCC
 +</​file>​
 +
 +===== Install Ports =====
 +Run the following commands to install the required ports
 +<​file>​
 +cd /​usr/​ports/​mail/​p5-Mail-SpamAssassin
 +make install
 +cd /​usr/​ports/​mail/​spamass-rules/​
 +make install
 +cd /​usr/​ports/​mail/​spamass-milter/​
 +make install
 +cd /​usr/​ports/​databases/​mysql55-server/​
 +make install
 +</​file>​
 +===== /​etc/​rc.conf =====
 +Add the following to /​etc/​rc.conf
 +<file config rc.conf>
 +spamd_enable="​YES"​
 +spamd_flags="​--helper-home-dir --max-children 5 -Q --listen-ip= --allowed-ips=10
 +spamass_milter_enable="​YES"​
 +spamass_milter_socket="​inet:​9999@127.0.0.1"​
 +mysql_enable="​YES"​
 +...
 +</​file>​
 +
 +===== Setup Database =====
 +<​file>​
 +/​usr/​local/​etc/​rc.d/​mysql-server start
 +</​file>​
 +Run the following in a mysql prompt to create a database
 +<​file>​
 +create database SpamAssassin;​
 +quit
 +</​file>​
 +create the required tables
 +<​file>​
 +cd /​usr/​local/​share/​doc/​p5-Mail-SpamAssassin/​sql
 +mysql SpamAssassin < awl_mysql.sql
 +mysql SpamAssassin < userpref_mysql.sql
 +mysql SpamAssassin < bayes_mysql.sql
 +</​file>​
 +===== local.cf =====
 +  * default: /​usr/​local/​etc/​mail/​spamassassin/​local.cf
 +  * replace **USERNAME** and **PASSWORD** with the correct values
 +<file config local.cf>​
 +user_scores_dsn DBI:​mysql:​SpamAssassin:​localhost
 +user_scores_sql_username **USERNAME**
 +user_scores_sql_password **PASSWORD**
 +allow_user_rules 0
 +
 +user_awl_dsn DBI:​mysql:​SpamAssassin:​localhost
 +user_awl_sql_username **USERNAME**
 +user_awl_sql_password **PASSWORD**
 +user_awl_sql_table awl
 +auto_whitelist_factory Mail::​SpamAssassin::​SQLBasedAddrList
 +
 +bayes_store_module Mail::​SpamAssassin::​BayesStore::​SQL
 +bayes_sql_dsn DBI:​mysql:​SpamAssassin:​localhost
 +bayes_sql_username **USERNAME**
 +bayes_sql_password **PASSWORD**
 +</​file>​
 +
 +That's it restart and the milter will be listening of port 9999
mail/spamassain_gateway.1363634874.txt.gz · Last modified: 2013/03/18 14:27 by tschulz