邮件服务器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 (邮件内容)


添加账号

wKiom1jq--vRu_7fAAAmAY8Inyk056.png-wh_50





     本文转自forsk 51CTO博客,原文链接:http://blog.51cto.com/forsk/1914448,如需转载请自行联系原作者





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值