### Cai dat Postfix
1. # yum remove sendmail
2. #yum install postfix* squirrelmail* dovecot* -y
3. Cau hinh Postfix
myhostname = mail.vnlamp.local
mydomain = vnlamp.local
myorigin = $myhostname
inet_interfaces = all
mydestination = $myhostname, $mydomain, localhost.$mydomain
mynetworks_style = class
mynetworks_style = subnet
mynetworks_style = host
mynetworks = 192.168.2.0/24, 168.100.189.0/28, 127.0.0.0/8
4. Khoi dong cac dich vu
#/etc/init.d/postfix restart
#/etc/init.d/dovecot restart
#/etc/init.d/httpd restart
5. Tao 02 User va dat password
#useradd mail01
6. Kiem tra mail server
- Dung browser check webmail
http://192.168.2.x/webmail
### Cau hinh Header check
- header_checks = regexp:/etc/postfix/header_checks ==> remove #
- Tao file header_checks neu chua co
- Rule header check
+ /^Subject:. *spam/ REJECT
+ /^From:. "spammer/ REJECT
+ /^To: mail01@vnlamp.local/ REDIRECT mail02@vnlamp.local
+ /^From:. *\@.*\.cn/
+ /^Received:. *netline.com/ REJECT Blacklisted
- #postmap /etc/postfix/header_checks ==> chuyen tu file text thanh file db
### Cau hinh Body check
- body_checks = regexp:/etc/postfix/body_checks ==> remove #
- Tao file body_checks neu chua co
- tao rule tu dong:
+ wget -O - http://www.malware.com.br/cgi/submit?action=list_postfix > /etc/postfix/body_checks
- #postmap /etc/postfix/body_checks ==> chuyen tu file text thanh file db
Create File Update
# vi /etc/postfix/update.sh
#!/bin/bash
# Script to update malware urls
/usr/bin/wget -O - http://www.malware.com.br/cgi/submit?action=list_postfix > /etc/postfix/body_checks
/usr/sbin/postmap /etc/postfix/body_checks
/etc/init.d/postfix reload
Add Crontad
0 23 * * * /etc/postfix/update.sh >/dev/null 2>&1
### Chan file dinh kem
- mime_header_checks = regexp:/etc/postfix/mime_header_checks
- Tao file sender_access neu chua co
- Rule sender_access:
/name=[^>]*\.(doc|docx|txt|bat|com|exe|dll|vbs)/ REJECT
- #postmap /etc/postfix/mime_header_checks
### Chan nguoi gui
- smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access
- Tao file sender_access neu chua co
- Rule sender_access:
test01@abc.local REJECT
test02@abc.com OK
abc.com REJECT
- #postmap /etc/postfix/sender_access
Không có nhận xét nào:
Đăng nhận xét