设为首页 收藏本站
查看: 1015|回复: 0

[经验分享] centos 安装postfix dovecot saslauth

[复制链接]

尚未签到

发表于 2015-11-24 08:44:53 | 显示全部楼层 |阅读模式
由于turbomail安装后,只能限制25个人员使用,并且每次发送时会在内容后加一段限制内容,并且占cpu率高了些。
针对以上问题,感觉还是在centos上安装postfix dovecot来构建企业免费邮箱。以下是安装操作笔记。

第一步卸载sandmail
yum remove sandmail
第二步安装postfix ,dovecot,cyrus-sasl,直接yum安装
yum -y install devecot
yum -y install postfix
yum -y install cyrus-sasl
三、修改postfix的配置文件
[iyunv@ser ~]# vim /etc/postfix/main.cf

myhostname = mail.smart-card.com
mydomain = smart-card.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks_style = subnet
mynetworks = 192.168.1.0/24, 127.0.0.0/8
relay_domains = $mydestination  //如果注释掉可以发送邮件到外部邮箱
mail_spool_directory = /var/spool/mail

#the mailsize limit 10Mmessage_size_limit = 10485760default_process_limit = 50default_destination_concurrency_limit = 20smtpd_sasl_auth_enable = yessmtpd_sasl_local_domain =  $myhostnamesmtpd_sasl_application_name = smtpdbroken_sasl_auth_clients = yessmtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,reject_unauth_destinationsmtpd_client_restrictions = permit_sasl_authenticatedsmtpd_sasl_security_options = noanonymous
重启 postfix 服务

[iyunv@ser ~]# service postfix restart
Shutting down postfix:                                     [  OK  ]
Starting postfix:                                          [  OK  ]
[iyunv@ser ~]# chkconfig  postfix on
[iyunv@ser ~]# chkconfig  dovecot on
修改dovecot的配置文件
vim /etc/dovecot.conf
protocols = imap imaps  pop3 pop3s(在后面启动dovecot时,说端口已经被使用,lsof -i tcp:端口,是pop3s占用了,如果出现这样的情况,把这里的pop3s去掉。)
listen = *
在iptables 里开放25,110,143端口


[iyunv@ser ~]# chkconfig  saslauthd on

修改 /etc/sysconfig/saslauthd
[iyunv@ser ~]# vim /etc/sysconfig/saslauthd


# Directory in which to place saslauthd's listening socket, pid file, and so
# on.  This directory must already exist.
SOCKETDIR=/var/run/saslauthd


# Mechanism to use when checking passwords.  Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled with the ablity to use.
MECH=shadow


# Additional flags to pass to saslauthd on the command line.  See saslauthd(8)
# for the list of accepted flags.
FLAGS=
修改 /usr/lib/sasl2/smtpd.conf
[iyunv@ser ~]# vim /usr/lib64/sasl2/smtpd.conf
pwcheck_method: saslauthd
测试 saslauthd
[iyunv@ser ~]# service saslauthd  restart

四.Dovecot 配置 Dovecot.conf
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u
service dovecot restart

然后在foxmail里就可以收发邮件了
添加邮件账号

useradd -g mail -s /sbin/nologin -d /home/MailUsers/redmine redmine
如果不建立用户目录则可以用以下命令
useradd -g mail -s /sbin/nologin -M redmine
passwd redmine

为了方便管理人员变更情况,所以在/home目录下建立了一个MailUsers目录了,以后如果要删除某账号
即可以用 userdel -r redmine,就可以删除该用户所有数据了

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-142853-1-1.html 上篇帖子: postfix smtpd_recipient_restrictions配置错误导致smtpd问题 下篇帖子: postfix + imap + pop3的配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表