User Tools

Site Tools


start:howto:spamassassin-user-prefs-sql

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
start:howto:spamassassin-user-prefs-sql [2012/07/30 08:59]
BeNe
start:howto:spamassassin-user-prefs-sql [2015/01/19 23:40]
ninos removed
Line 1: Line 1:
 +**This HowTo is old. Please use following plugin!
 +http://​i-mscp.net/​filebase/​index.php/​File/​14-SpamAssassin/​**
 +
 ====== Info ====== ====== Info ======
  
-**This is more less a DRAFT (Version 0.2) and should not be use on a productive system! \\ +This HowTo is more or less ready for use. \\
-The HowTo is not ready but i will make it public so that other user can go on with it. I have not that time... \\+
 Feel free to change it ;-) Feel free to change it ;-)
  
-For any question use the Forum or PM me (BeNe)**+For any question use the Forum or PM me (BeNe)
  
 ====== Needed Packages ====== ====== Needed Packages ======
-aptitude install +<​code>​ 
-libaprutil1-dbd-mysql +aptitude update 
-razor +</​code>​ 
-libnet-dns-perl ​ +<​code>​ 
-libmailtools-perl ​ +aptitude install libaprutil1-dbd-mysql razor libnet-dns-perl libmailtools-perl spamc spamassassin libmail-dkim-perl dkim-filter clamsmtp libtie-cache-perl libdbd-mysql-perl pyzor 
-spamc +</​code>​
-spamassassin +
-libmail-dkim-perl +
-dkim-filter +
-clamsmtp +
-libtie-cache-perl ​ +
-libdbd-mysql-perl +
-pyzor+
  
 ====== Spamassassin ====== ====== Spamassassin ======
Line 29: Line 24:
 mkdir /​var/​lib/​spamassassin mkdir /​var/​lib/​spamassassin
 chown spamd:spamd /​var/​lib/​spamassassin chown spamd:spamd /​var/​lib/​spamassassin
-</​code>​ 
- 
-===== /​etc/​default/​spamassassin ===== 
-Change the file like this: 
-<​code>​ 
-ENABLED=1 
-SAHOME="/​var/​lib/​spamassassin/"​ 
-OPTIONS="​-d -q --create-prefs --max-children 5 --username spamd --helper-home-dir ${SAHOME} -s ${SAHOME}spamd.log"​ 
-PIDFILE="​${SAHOME}spamd.pid"​ 
 </​code>​ </​code>​
  
Line 44: Line 30:
 <​code>​ <​code>​
 rewrite_header Subject [***** SPAM _SCORE_ *****] rewrite_header Subject [***** SPAM _SCORE_ *****]
-required_score ​2.0+required_score ​5.0
 #to be able to use _SCORE_ we need report_safe set to 0 #to be able to use _SCORE_ we need report_safe set to 0
 #If this option is set to 0, incoming spam is only modified by adding some "​X-Spam-"​ headers and no changes will be made to the body. #If this option is set to 0, incoming spam is only modified by adding some "​X-Spam-"​ headers and no changes will be made to the body.
Line 58: Line 44:
 # Enable or disable network checks # Enable or disable network checks
 skip_rbl_checks 0 skip_rbl_checks 0
-use_razor2 ​0 +use_razor2 ​1 
-#use_dcc 0 +use_dcc 0 
-use_pyzor ​0+use_pyzor ​1
 </​code>​ </​code>​
  
Line 75: Line 61:
 smtp      inet  n       ​- ​      ​- ​      ​- ​      ​- ​      smtpd smtp      inet  n       ​- ​      ​- ​      ​- ​      ​- ​      smtpd
  -o content_filter=spamassassin  -o content_filter=spamassassin
- -o receive_override_options=no_address_mappings+ -o receive_override_options=no_address_mappings
 </​code>​ </​code>​
 +First option is to activate spamassassin.
 +Second option prevents that some forwarded mails are sent twice.
  
 Add on the end of the file: Add on the end of the file:
Line 93: Line 81:
  
 ===== Create MySQL User ===== ===== Create MySQL User =====
 +
 +ToDO: Need more priviliges to create, update...
 <​code>​ <​code>​
 mysql -h localhost -u root -p mysql -h localhost -u root -p
Line 105: Line 95:
 ===== Import SQL-Files ===== ===== Import SQL-Files =====
 <​code>​ <​code>​
-/​usr/​share/​doc/​spamassassin/​sqlmysql -u spamassassin -p YoUrPaSSworD ​awl_mysql.sql +mysql -u spamassassin -p spamassassin < /​usr/​share/​doc/​spamassassin/​sql/​awl_mysql.sql 
-/​usr/​share/​doc/​spamassassin/​sqlmysql -u spamassassin -p YoUrPaSSworD ​userpref_mysql.sql +mysql -u spamassassin -p spamassassin ​< /​usr/​share/​doc/​spamassassin/​sql/​userpref_mysql.sql 
-/​usr/​share/​doc/​spamassassin/​sql# mysql -u spamassassin -p YoUrPaSSworD < bayes_mysql.sql+mysql -u spamassassin -p spamassassin ​< /​usr/​share/​doc/​spamassassin/​sql/bayes_mysql.sql
 </​code>​ </​code>​
  
Line 113: Line 103:
 <​code>​ <​code>​
 # mysql -u spamassassin -p # mysql -u spamassassin -p
 +use spamassassin;​
 INSERT INTO userpref (username,​preference,​value) VALUES ('​$GLOBAL','​required_hits','​5.0'​);​ INSERT INTO userpref (username,​preference,​value) VALUES ('​$GLOBAL','​required_hits','​5.0'​);​
 INSERT INTO userpref (username,​preference,​value) VALUES ('​$GLOBAL','​report_safe','​1'​);​ INSERT INTO userpref (username,​preference,​value) VALUES ('​$GLOBAL','​report_safe','​1'​);​
Line 154: Line 145:
  
 # Change to one to enable spamd # Change to one to enable spamd
-##ENABLED=0+ENABLED=
 + 
 +# Set new created SAHOME 
 +SAHOME="/​var/​lib/​spamassassin/"​
  
 # Options # Options
Line 164: Line 158:
  
 ##​OPTIONS="​--create-prefs --max-children 5 --helper-home-dir"​ ##​OPTIONS="​--create-prefs --max-children 5 --helper-home-dir"​
 +OPTIONS="​-d -q -x --create-prefs --max-children 5 --username spamd --helper-home-dir ${SAHOME} -s ${SAHOME}spamd.log"​
  
 # Pid file # Pid file
Line 170: Line 165:
 # Otherwise, the init script will not be able to shut spamd down. # Otherwise, the init script will not be able to shut spamd down.
 ##​PIDFILE="/​var/​run/​spamd.pid"​ ##​PIDFILE="/​var/​run/​spamd.pid"​
 +PIDFILE="​${SAHOME}spamd.pid"​
  
 # Set nice level of spamd # Set nice level of spamd
Line 178: Line 174:
 # spamassassin'​s rules on a nightly basis # spamassassin'​s rules on a nightly basis
 CRON=0 CRON=0
- 
-ENABLED=1 
-SAHOME="/​var/​lib/​spamassassin/"​ 
-OPTIONS="​-d -q --create-prefs --max-children 5 --username spamd --helper-home-dir ${SAHOME} -s ${SAHOME}spamd.log"​ 
-PIDFILE="​${SAHOME}spamd.pid"​ 
-</​code>​ 
- 
-===== Cron ===== 
-<​code>​ 
-13 */2 * * * /​usr/​local/​bin/​sa-update && /​etc/​init.d/​spamassassin restart 
 </​code>​ </​code>​
  
 ===== FOR DEBUG ===== ===== FOR DEBUG =====
 +Please use this just for debug (no daemonize)
 <​code>​ <​code>​
 spamd -D -q -x --create-prefs --max-children 5 --username spamd --helper-home-dir /​var/​lib/​spamassassin/​ -s /​var/​lib/​spamassassin/​spamd.log --pidfile=/​var/​lib/​spamassassin/​spamd.pid spamd -D -q -x --create-prefs --max-children 5 --username spamd --helper-home-dir /​var/​lib/​spamassassin/​ -s /​var/​lib/​spamassassin/​spamd.log --pidfile=/​var/​lib/​spamassassin/​spamd.pid
Line 198: Line 184:
 ====== ClamSMTP ====== ====== ClamSMTP ======
 We use ClamSMTP for AntiVirus We use ClamSMTP for AntiVirus
-===== /​etc/​clamsmtp =====+===== /​etc/​clamsmtp.conf =====
  
 <​code>​ <​code>​
Line 419: Line 405:
  
 ====== ToDo ====== ====== ToDo ======
-Mark as Junk2 Plugin for RC\\ +Mark as Junk2 Plugin for RC 0.8.x\\
-sa-learn works ? \\ +
-This and that \\+