Postfix + dovecot 搭建Mail服務器

             由於項目需要搭建一個收發Mail的服務器,就簡單搭建了一下;用postfix 實現SMTP服務,dovecot 實現POP服務;下面描述下搭建過程,以及中間出現問題的解決方法;
安裝PostFix 最基本的方法:1.安裝# yum install postfix;
2.修改配置文件:
#cd /etc/postfix/
# postconf -n > /etc/postfix/main2.cf
# mv /etc/postfix/main.cf /etc/postfix/main.cf.old
# mv /etc/postfix/main2.cf /etc/postfix/main.cf
 
main.fc增加如下:
# hostname
mynetworks = 127.0.0.1
myhostname = mail.xxx.com
mydestination = $mynetworks $myhostname
myorigin=xxx.com
mydestination=xxx.com
# banner
mail_name = Postfix - by extmail.org
smtpd_banner = $myhostname ESMTP $mail_name
# response immediately
smtpd_error_sleep_time = 0s
# Message and return code control
message_size_limit = 5242880
mailbox_size_limit = 5242880
show_user_unknown_table_name = no
# Queue lifetime control
bounce_queue_lifetime = 1d
maximal_queue_lifetime = 1d
 
重新啓動postfix服務即可; # service postfix restart
 
安裝dovecot 實現pop服務:
#yum instsll dovecot
修改配置文件: vi /etc/dovecot.conf
把#protocols = imap imaps pop3 pop3s前面的#去掉即可,
重啓 # service dovecot restart
 
至此;POP3服務和 SMTP服務已經可以使用了,不過需要增加用戶,還有幾個排錯的地方:
 
症狀:postfix配置好後,而telnet ip 25 不通;
解決方法:在/etc/postfix下找到main.cf,打開,找到inet_interfaces =
all,把前面的註釋去掉,默認是inet_interfaces = localhost,然後保
存,重啓postfix
 
症狀:無法增加用戶:
方法:vi  /etc/postfix/canonical
#postmap /etc/postfix/canonical
#service postfix restart
 
newuser 就是系統用戶,密碼用 passwd 修改即可。
 
 
 
 
 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章