邮件服务器postfix+cyrus
郵件服務器
Cyrus+postfix
?
| 1 2 | yum?install?postfix yum?install?cyrus |
?
postfix 不能和 sendmail? 同時使用
?
服務器版本CentOS 7----1611? 內核版本3.10.0-514.el7.x86_64
Centos7與之前的版本不一樣的命令systemctl和 防火墻firewall-cmd命令
firewalld與iptables-service無法共存
?
采用教程參考
http://www.cnblogs.com/apexchu/p/4271264.html
http://blog.csdn.net/clyao_123456/article/details/46693579
?
?
配置修改:
1、Postfix配置文件/etc/postfix/main.cf
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | [root@mailmonitor?postfix]#?vim?/etc/postfix/main.cf?? myhostname?=?localhost??//76行,后邊寫郵箱主機名即mail.****.***?? mydomain?=?51yip.com???//83行,設置域名?? myorigin?=?$mydomain???//99行,去掉注釋#?? inet_interfaces?=?all??//113行,把后面的localhost改成all?? mydestination?=?$myhostname,?localhost.$mydomain,?localhost,$mydomain?//164行,把前面的注釋拿掉,并加一下$mydomain?? mynetworks?=?192.168.0.0/16,?127.0.0.0/8??//264行,設置內網和本地IP?? local_recipient_maps?=??//210行,去掉注釋#?? smtpd_banner?=?$myhostname?ESMTP?unknow?//573行,去掉注釋#,然后把$mail_name?($mail_version)改成unknow?? ??? //在main.cf文件的底部加上以下內容?? smtpd_sasl_auth_enable?=?yes?????//使用SMTP認證?? broken_sasl_auth_clients?=?yes???//讓不支持RFC2554的smtpclient也可以跟postfix做交互。?? smtpd_sasl_local_domain?=?$myhostname??//?指定SMTP認證的本地域名?? smtpd_sasl_security_options?=?noanonymous?//取消匿名登陸方式?? smtpd_recipient_restrictions?=?permit_mynetworks,?permit_sasl_authenticated,?reject_unauth_destination?//設定郵件中有關收件人部分的限制?? smtpd_sasl_security_restrictions?=?permit_mynetworks,?permit_sasl_authenticated,?reject_unauth_destination?//設置允許范圍?未生效? message_size_limit?=?15728640?????//郵件大小?? mailbox_transport=lmtp:unix:/var/lib/imap/socket/lmtp???//設置連接cyrus-imapd的路徑 |
?
參考兩位的配置中有個參數在實際使用中無法生效 ?smtpd_sasl_security_restrictions ?加上該選項postfix無法正常使用,因此我給注釋掉了。
?
2、cyrus配置更改
???????? Cyrus-sasl配置
| 1 2 3 | [root@localhost?postfix]#?vim?/etc/sasl2/smtpd.conf??//在文件尾部加上以下內容?? log_level:?3?????//記錄log的模式?? saslauthd_path:/var/run/saslauthd/mux?????//設置一下smtp尋找cyrus-sasl的路徑 |
cyrus-imapd配置文件/etc/sysconfig/cyrus-imapd,/etc/cyrus.conf,/etc/imapd.conf。imapd.conf還包含非常多的參數,例如郵件存儲目錄、管理員賬號、連接認證方式等等。
?
?
啟動命令:
| 1 2 3 | systemctl?startpostfix systemctl?startsasl-authd systemctl?startcyrus-imapd |
?
?
防火墻需要添加的命令
| 1 | firewall-cmd?–zone=public??--add-port=25/tcp?–permanent?//永久添加25端口 |
or
| 1 | firewall-cmd??--addservice=smtp??–permanent?//直接添加服務 |
?
firewall-cmd –get-services? 可以得到所有存在的服務
firewall-cmd –list-all列出所有信息
防火墻動態更新命令 firewall-cmd–reload
?
查看端口監聽
| 1 | netstat?–tpnl?|grep??port |
?
測試郵件命令
| 1 | mail?-s?‘title’*****@**mail?<?/root/test(郵件內容) |
添加賬號
? ? ?本文轉自forsk 51CTO博客,原文鏈接:http://blog.51cto.com/forsk/1914448,如需轉載請自行聯系原作者
總結
以上是生活随笔為你收集整理的邮件服务器postfix+cyrus的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android笔记:Eclipse中SV
- 下一篇: linux mmap 详解【转】