MailScanner With Postfix on Etch
Since a few weeks I have
spammed for dead almost and i’m trying to figure out whats the best
solution is. But since I have experience with MailScanner I will
install MailScanner. In order to get MailScanner working there are a
few thing you need to do. First off install MailScanner.
apt-get install MailScanner
While it’s installing MailScanner, apt creates all the needed configuration files.
Configuring MailScanner
- Next edit the MailScanner for use with Postfix, open up
/etc/MailScanner/MailScanner.conf with you favorite editor. You need
adjust these options
%org-name% = yoursite
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = postfix
- After you have done this you need to make sure Postfix can write to
/var/spool/MailScanner/incoming and /var/spool/MailScanner/quarantine.
In order to do this:
chown postfix:postfix /var/spool/MailScanner/
chown postfix:postfix /var/spool/MailScanner/incoming
chown postfix:postfix /var/spool/MailScanner/quarantine
chown postfix:postfix /var/lib/MailScanner/
chown postfix:postfix /var/run/MailScanner/
chown postfix:postfix /var/lock/subsys/MailScanner
- Final step make sure MailScanner can start, open /etc/default/mailscanner with your favorite editor and uncomment
run_mailscanner=1
- Now the base configuration of MailScanner is ready, next adjust Postfix.
Configuring Postfix
Note: Make sure you have a working version of Postfix
- Stop Postfix:
/etc/init.d/postfix stop
If Postfix is in a chrooted jail you need to adjust MailScanner accordingly. Chrooted jail is not supported here.
- Add this line to the Postfix main.cf configuration file
header_checks = regexp:/etc/postfix/header_checks
- Now put in the file /etc/postfix/header_checks
/^Received:/ HOLD
- After the configuration of Mailscanner and Postfix is complete you can move to the next part
Start MailScanner and Postfix
- Start Postfix
/etc/init.d/postfix start
- Start MailScanner
/etc/init.d/MailScanner start
- Check MailScanner
check_mailscanner
- If the output of check_mailscanner is the same as below here then you have a working version
dionysus:~# check_mailscanner
MailScanner running with pid 7589 7590
Links
MailScanner: http://www.mailscanner.info
MailScanner Wiki: http://wiki.mailscanner.info
Postfix: http://www.postfix.org
thanks a lot. it works fine.