How to installing MailScanner on SUSE Enterprise Server
MailScanner เป็นโปรแกรมที่ได้รับความนิยมเป็นอย่างยิ่งบน Postfix หรือ Qmail สำหรับรักษาความปลอดภัยโดยทำหน้าที่สแกนเมล์ทั้งหมด
ตามที่เราคอนฟิก เพื่อป้องกันไวรัส และการป้องกันอีเมล์ขยะ ซึ่งการคอนฟิกจะต้องคอนฟิกร่วมกับโปรแกรมสแกนไวรัส เช่น ClamAV เป็นต้น.
[hana-code-insert name=’AdSense’ /]
1. Download source files
[sourcecode] wget //www.mailscanner.info/files/4/suse/MailScanner-4.78.17-1.suse.tar.gz
tar zxvf MailScanner-4.78.17-1.suse.tar.gz
cd MailScanner-4.78.17-1
[/sourcecode]
2. Build module & Installing
[sourcecode]
./install.sh
[/sourcecode]
3. Configuration MailScanner.conf
[sourcecode]
vi /etc/MailScanner/MailScanner.conf
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = postfix
%org-long-name% = Your Organisation Name Here
%web-site% = www.yoursite.com
[/sourcecode]
4. Change owner to postfix
[sourcecode]
chown postfix:postfix /var/spool/MailScanner/incoming
chown postfix:postfix /var/spool/MailScanner/quarantine
[/sourcecode]
5. Edit file MailScanner.conf
[sourcecode] vi /etc/MailScanner/MailScanner.conf
Virus Scanners = vscan
[/sourcecode]
6. Edit file virus.scanners.conf
[sourcecode]
vi /etc/MailScanner/virus.scanners.conf
clamav /usr/lib/MailScanner/clamav-wrapper /var/lib/clamav
[/sourcecode]
7. Edit file main.cf
[sourcecode]
vi /etc/postfix/main.cf
header_checks = regexp:/etc/postfix/header_checks
[/sourcecode]
8. Edit file header_checks
[sourcecode]
vi /etc/postfix/header_checks
Add line:
/^Received:/ HOLD
[/sourcecode]
9. Seting MailScanner & Clamd run on startup
[sourcecode]
chkconfig MailScanner on
chkconfig clamd on
[/sourcecode]
10. Start MailScanner
[sourcecode] /etc/init.d/postfix restart
/etc/init.d/clamd start
/etc/init.d/Mailscanner start
[/sourcecode]
หรือ
[sourcecode]
rcpostfix restart
rcclamd start
rcMailscanner start
[/sourcecode]
11. Edit file
[sourcecode] vi /usr/lib/MailScanner/clamav-wrapper
ClamUser="vscan"
ClamGroup="vscan"
[/sourcecode]
12. Using MailScanner
[sourcecode]
/usr/lib/MailScanner/clamav-wrapper /var/lib/clamav /tmp
[/sourcecode]
/tmp/mailstat.old: OK
/tmp/stats.db: OK
/tmp/5NQNUn4eKe: Empty file
———– SCAN SUMMARY ———–
Known viruses: 692220
Engine version: 0.95.3
Scanned directories: 1
Scanned files: 2
Infected files: 0
Data scanned: 0.01 MB
Data read: 0.01 MB (ratio 1.00:1)
Time: 2.235 sec (0 m 2 s)
Problems or Errors
Could not read directory /var/spool/incoming at /usr/lib/MailScanner/MailScanner/Config.pm line 2784
Error in configuration file line 171, directory /var/spool/incoming for outqueuedir does not exist (or is not readable) at /usr/lib/MailScanner/MailScanner/Config.pm line 3144
Solution:
[sourcecode]
mkdir /var/spool/incoming
mkdir /var/spool/quarantine
chown postfix.postfix /var/spool/incoming
chown postfix.postfix /var/spool/quarantine
[/sourcecode]
Reference – //www.mailscanner.info/postfix.html