邮件服务器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,如需转载请自行联系原作者





相关文章
|
网络协议 Linux 文件存储
Postfix 邮件服务器的配置
Postfix是一种功能强大且功能多样的邮件传输代理。在本文中,我们已经了解了如何使用postfix 和 dovecot为基于系统用户帐户的单个域实现基本电子邮件服务器。我们几乎没有涉及基于 postfix 的系统的真正功能,但希望能为新用户构建提供坚实的工作基础。
1682 0
|
存储 网络协议 Linux
Postfix + Extmail 企业邮件服务器搭建
ExtMail套件用于提供从浏览器中登录、使用邮件系统的Web操作界面,而Extman套件用于提供从浏览器中管理邮件系统的Web操作界面。它以GPL版权释出,设计初衷是希望设计一个适应当前高速发展的IT应用环境,满足用户多变的需求,能快速进行开发、改进和升级,适应能力强的webmail系统。
722 0
Postfix + Extmail 企业邮件服务器搭建
|
网络协议 Linux 网络安全
Linux服务器---邮件服务安装postfix
安装postfix      postfix是一个快速、易于管理、安全性高的邮件发送服务,可以配合dovecot实现一个完美的邮箱服务器。1、安装postfix       [root@localhost ~]# rpm -qa | grep postfix      [root@localhos...
2364 0
|
开发工具 网络安全 数据安全/隐私保护
Postfix 邮件服务器安装与配置
#!/bin/bash yum -y install postfix dovecot; #/etc/postfix/main.cf #postfix check  postfix start  postfix stop postfix flush  postfixreload #/etc/postfix/main.
1288 0
|
网络协议 测试技术 开发工具
|
网络协议 测试技术 数据安全/隐私保护
|
测试技术 开发工具 数据安全/隐私保护
|
网络协议 测试技术 开发工具