ทาง Linuxgray อนุญาติให้ copy บทความได้ แต่กรุณาอ้างอิง ชื่อผู้เขียน และทำ Link มาที่ http://www.linuxgray.com ขอบคุณครับ
โดย
มนตรี สีเทา ( RHCT , RHCE )
( Last update 22/02/2011 )
http://www.linuxgray.com
นี่เป็นบทความตัวอย่างการติดตั้ง Linux Mail Server เริ่มจากการติดตั้ง Package ก่อนครับ
[root@mail ~]# yum -y install postfix
[root@mail ~]# vi /etc/postfix/main.cf
# line 70
myhostname =
mail.linuxgray.com
# line 77
mydomain =
linuxgray.com
# line 93
myorigin = $mydomain
# line 110
inet_interfaces =
all
# line 155
mydestination = $myhostname, localhost.$mydomain, localhost
, $mydomain
# line 255
mynetworks = 127.0.0.0/8,
192.168.1.0/24
# line 410
home_mailbox = Maildir/
# line 536
#
line 537
header_checks = regexp:/etc/postfix/header_checks
body_checks = regexp:/etc/postfix/body_checks
# line 562
smtpd_banner = $myhostname ESMTP
message_size_limit = 5242880
mailbox_size_limit = 104857600
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth-client
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_client_restrictions = permit_mynetworks,reject_unknown_client,permit
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
[root@mail ~]# vi /etc/postfix/header_checks
/^From:.*<#.*@.*>/ REJECT
/^Return-Path:.*<#.*@.*>/ REJECT
# hide Received line
/^Received:/ IGNORE
[root@mail ~]# vi /etc/postfix/body_checks
/^(|[^>].*)example.com/ REJECT
[root@mail ~]#
/etc/rc.d/init.d/sendmail stop
Shutting down sm-client:
[ OK ]
Shutting down sendmail:
[ OK ]
[root@mail ~]# chkconfig sendmail off
[root@mail ~]#
alternatives --config mta
# change default MTA
There are 2 programs which provide 'mta'.
Selection Command
-----------------------------------------------
*+ 1
/usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix
Enter to keep the current selection[+], or type selection number:
2
# switch to postfix
[root@ftp ~]# /etc/rc.d/init.d/postfix start
[root@ftp ~]# chkconfig postfix on
|