Ero sivun ”Spamassassin/en” versioiden välillä
(Ak: Uusi sivu: == Installation ==) |
(Ak: Uusi sivu: == Sources ==) |
||
(18 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 6: | Rivi 6: | ||
== Installation == | == Installation == | ||
− | + | Install Spamassassin with aptitude | |
aptitude install spamassassin | aptitude install spamassassin | ||
− | == | + | == Configuration == |
− | + | We create a user for the Spamassassin program. | |
adduser spamd --disabled-login | adduser spamd --disabled-login | ||
− | + | Open file: | |
/etc/default/spamassassin | /etc/default/spamassassin | ||
− | + | We enable Spamassassin by changing the ENABLED parameter from 0 to 1 | |
ENABLED=1 | ENABLED=1 | ||
− | + | We have to configure home- and settings parameters. | |
SPAMD_HOME="/home/spamd/" | SPAMD_HOME="/home/spamd/" | ||
OPTIONS="--create-prefs --max-children 5 --username spamd --helper-home-dir ${SPAMD_HOME} -s ${SPAMD_HOME}spamd.log" | OPTIONS="--create-prefs --max-children 5 --username spamd --helper-home-dir ${SPAMD_HOME} -s ${SPAMD_HOME}spamd.log" | ||
− | + | We must use a certain type of PID_FILE parameter: | |
PIDFILE="${SPAMD_HOME}spamd.pid" | PIDFILE="${SPAMD_HOME}spamd.pid" | ||
− | + | We want Spamassassin rules and settings to update automatically: | |
CRON=1 | CRON=1 | ||
− | + | The entire Spamassassin config file can be found here: https://www.dropbox.com/s/ndvpgc2jipdd4bk/etc.default.spamassassin.txt | |
− | + | Open the Postfix konfiguration file | |
nano /etc/postfix/master.conf | nano /etc/postfix/master.conf | ||
− | + | Find the line | |
smtp inet n - - - - smtpd | smtp inet n - - - - smtpd | ||
− | + | and below the line add: | |
-o content_filter=spamassassin | -o content_filter=spamassassin | ||
− | + | The end result: | |
smtp inet n - - - - smtpd | smtp inet n - - - - smtpd | ||
Rivi 57: | Rivi 57: | ||
− | + | Add this to the end of the file: | |
spamassassin unix - n n - - pipe | spamassassin unix - n n - - pipe | ||
Rivi 63: | Rivi 63: | ||
/usr/sbin/sendmail -oi -f ${sender} ${recipient} | /usr/sbin/sendmail -oi -f ${sender} ${recipient} | ||
− | + | And in the end restart the services so the changes will apply. | |
service postfix restart | service postfix restart | ||
Rivi 69: | Rivi 69: | ||
service spamassassin restart | service spamassassin restart | ||
− | == | + | == Testing == |
− | + | Send the text found below to your e-mail server | |
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X | XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X | ||
− | + | When it arrives it should have a *****SPAM***** in the topic line of the e-mail. | |
− | == | + | == Sources == |
https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin | https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin | ||
http://spamassassin.apache.org/gtube/ | http://spamassassin.apache.org/gtube/ |
Nykyinen versio 30. kesäkuuta 2015 kello 08.34
Spamassassin is an effective way to block junk mail in Postfix. Spamassassin requires Postfix to be installed before you can install Spamassassin.
Spamassassin marks junk mail with a "*****SPAM*****" notification in the e-mail topic line.
Sisällysluettelo
Installation
Install Spamassassin with aptitude
aptitude install spamassassin
Configuration
We create a user for the Spamassassin program.
adduser spamd --disabled-login
Open file:
/etc/default/spamassassin
We enable Spamassassin by changing the ENABLED parameter from 0 to 1
ENABLED=1
We have to configure home- and settings parameters.
SPAMD_HOME="/home/spamd/" OPTIONS="--create-prefs --max-children 5 --username spamd --helper-home-dir ${SPAMD_HOME} -s ${SPAMD_HOME}spamd.log"
We must use a certain type of PID_FILE parameter:
PIDFILE="${SPAMD_HOME}spamd.pid"
We want Spamassassin rules and settings to update automatically:
CRON=1
The entire Spamassassin config file can be found here: https://www.dropbox.com/s/ndvpgc2jipdd4bk/etc.default.spamassassin.txt
Open the Postfix konfiguration file
nano /etc/postfix/master.conf
Find the line
smtp inet n - - - - smtpd
and below the line add:
-o content_filter=spamassassin
The end result:
smtp inet n - - - - smtpd -o content_filter=spamassassin
Add this to the end of the file:
spamassassin unix - n n - - pipe user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
And in the end restart the services so the changes will apply.
service postfix restart
service spamassassin restart
Testing
Send the text found below to your e-mail server
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
When it arrives it should have a *****SPAM***** in the topic line of the e-mail.