邮件服务器postfix+cyrus
郵件服務(wù)器
Cyrus+postfix
?
| 1 2 | yum?install?postfix yum?install?cyrus |
?
postfix 不能和 sendmail? 同時(shí)使用
?
服務(wù)器版本CentOS 7----1611? 內(nèi)核版本3.10.0-514.el7.x86_64
Centos7與之前的版本不一樣的命令systemctl和 防火墻firewall-cmd命令
firewalld與iptables-service無(wú)法共存
?
采用教程參考
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行,后邊寫(xiě)郵箱主機(jī)名即mail.****.***?? mydomain?=?51yip.com???//83行,設(shè)置域名?? 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行,設(shè)置內(nèi)網(wǎng)和本地IP?? local_recipient_maps?=??//210行,去掉注釋#?? smtpd_banner?=?$myhostname?ESMTP?unknow?//573行,去掉注釋#,然后把$mail_name?($mail_version)改成unknow?? ??? //在main.cf文件的底部加上以下內(nèi)容?? smtpd_sasl_auth_enable?=?yes?????//使用SMTP認(rèn)證?? broken_sasl_auth_clients?=?yes???//讓不支持RFC2554的smtpclient也可以跟postfix做交互。?? smtpd_sasl_local_domain?=?$myhostname??//?指定SMTP認(rèn)證的本地域名?? smtpd_sasl_security_options?=?noanonymous?//取消匿名登陸方式?? smtpd_recipient_restrictions?=?permit_mynetworks,?permit_sasl_authenticated,?reject_unauth_destination?//設(shè)定郵件中有關(guān)收件人部分的限制?? smtpd_sasl_security_restrictions?=?permit_mynetworks,?permit_sasl_authenticated,?reject_unauth_destination?//設(shè)置允許范圍?未生效? message_size_limit?=?15728640?????//郵件大小?? mailbox_transport=lmtp:unix:/var/lib/imap/socket/lmtp???//設(shè)置連接cyrus-imapd的路徑 |
?
參考兩位的配置中有個(gè)參數(shù)在實(shí)際使用中無(wú)法生效 ?smtpd_sasl_security_restrictions ?加上該選項(xiàng)postfix無(wú)法正常使用,因此我給注釋掉了。
?
2、cyrus配置更改
???????? Cyrus-sasl配置
| 1 2 3 | [root@localhost?postfix]#?vim?/etc/sasl2/smtpd.conf??//在文件尾部加上以下內(nèi)容?? log_level:?3?????//記錄log的模式?? saslauthd_path:/var/run/saslauthd/mux?????//設(shè)置一下smtp尋找cyrus-sasl的路徑 |
cyrus-imapd配置文件/etc/sysconfig/cyrus-imapd,/etc/cyrus.conf,/etc/imapd.conf。imapd.conf還包含非常多的參數(shù),例如郵件存儲(chǔ)目錄、管理員賬號(hào)、連接認(rèn)證方式等等。
?
?
啟動(dòng)命令:
| 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?//直接添加服務(wù) |
?
firewall-cmd –get-services? 可以得到所有存在的服務(wù)
firewall-cmd –list-all列出所有信息
防火墻動(dòng)態(tài)更新命令 firewall-cmd–reload
?
查看端口監(jiān)聽(tīng)
| 1 | netstat?–tpnl?|grep??port |
?
測(cè)試郵件命令
| 1 | mail?-s?‘title’*****@**mail?<?/root/test(郵件內(nèi)容) |
添加賬號(hào)
? ? ?本文轉(zhuǎn)自forsk 51CTO博客,原文鏈接:http://blog.51cto.com/forsk/1914448,如需轉(zhuǎn)載請(qǐng)自行聯(lián)系原作者
總結(jié)
以上是生活随笔為你收集整理的邮件服务器postfix+cyrus的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Android笔记:Eclipse中SV
- 下一篇: linux mmap 详解【转】