2016年3月30日 星期三

03/30/2016 pt3

在 CentOS7上安裝設定 E-mail Server

快速設定流程: 
安裝 Postfix 套件:
#yum -y install postfix dovecot

編修設定檔 /etc/postfix/main.cf:
#vim /etc/postfix/main.cf
myhostname = mail.example.com
mydomain = example.com
myorigin = $mydomain
mynetworks = 127.0.0.0/8, 192.168.100.0/24

inet_interfaces = all
mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost
mail_spool_directory = /var/mail

home_mailbox = Maildir/
mailbox_size_limit = 0
message_size_limit = 0

編修設定檔 /etc/dovecot/dovecot.conf:
#vim /etc/dovecot/dovecot.conf
protocols = imap

編修設定檔 /etc/dovecot/conf.d/10-mail.conf:
#vim /etc/dovecot/conf.d/10-mail.conf
mail_location = mbox:~/mail:INBOX=/var/mail/%u

設定防火牆,放行 smtp 與 imap 的服務:
#firewall-cmd --permanent --add-service=smtp
#firewall-cmd --permanent --add-service=imap
#firewall-cmd --reload

設定 SELinux :
#setsebool -P allow_postfix_local_write_mail_spool on

啟動 smtp 與 imap 的服務:
#systemctl enable postfix
#systemctl enable dovecot
#systemctl start postfix
#systemctl start dovecot

發送 mail ,檢測服務是否運作正常:
#mail student@mail.example.com
Subject: test
Hello World!
.

查看一下 /var/log/maillog 的記錄 :
#tail /var/log/maillog

沒有留言:

張貼留言