centos7+postfix+devocot+cycus-sasl搭建邮箱服务器
2017-06-02 15:58
429 查看
一.域名配置
1.设置指定ip的A记录
假设已经有了ip为119.*.*.*(图中打马赛克的地方)服务器,首先在域名解析那配置一条A记录如下图所示2.配置二级域名的A记录
3.配置mx记录
使用自己的域名配置一个mx记录指向第二步配置的二级域名4.配置txt记录
记录值为 v=spf1 include:spf.mail.domain.com ~all,其中mail.domain.com为2里面配置的二级域名二.软件安装
如果系统自带sendmail软件,先停止运行,然后卸载rpm -qa|grep sendmail
查看是否安装了sendmail,如果安装,停止运行然后卸载
/etc/init.d/sendmail stop yum remove sendmail
1.安装postfix 和dovecot
yum -y install postfix dovecot
2.安装cyrus-sasl
yum -y install cyrus-sasl-*
三.配置软件
1.配置postfix
主要配置邮箱服务器的收件地址,发件地址,邮件存储的位置等等,postfix配置文件位于/etc/postfix/main.cfvim /etc/postfix/main.cf
修改一下几个地方:
myhostname=mail.yourdomain.com //这里要换成你自己的邮箱服务器 mydomain=yourdomain.com //这里换成你自己的主机服务器 myorigin = $mydomain inet_interfaces = all #可以接收所有域名的邮件 inet_protocols = ipv4 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,mail.$mydomain, www.$mydomain, ftp.$mydomain local_recipient_maps = mynetworks =0.0.0.0/0 #设置内网ip relay_domains = $mydestination home_mailbox = Maildir/ smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_sasl_authenticated,reject_unauth_destination,permit_mynetworks smtpd_client_restrictions = permit_sasl_authenticated
2.配置devocot
vim /etc/dovecot/dovecot.conf
protocols = imap pop3 lmtp listen = *
vim /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no auth_mechanisms = plain
vim /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir
vim /etc/dovecot/conf.d/10-ssl.conf
ssl = no //关闭ssl认证
3.配置cycus-sasl
vim /etc/sysconfig/saslauthd
MECH=shadow #指定以本地系统用户名认证
以下文件没有则新增
vim /usr/lib64/sas12/smtpd.conf //64位系统 vim /usr/lib/sas12/smtpd.conf //32位系统
pwcheck_method: saslauthd mech_list: PLAIN LOGIN log_level:3
4.启动服务
至此,基本的配置已经完成了,现在只需要启动postfix devocot cycus-sasl这三个服务即可。在centos7中,其中服务使用systemctl命令systemctl start dovecot systemctl start postfix systemctl start saslauthd
使用systemctl status postfix命令可以查看运行状态,如果是running,则表示成功运行,其他两个方法类似。
5.新增邮箱账号
由于配置使用了使用centos用户名作为账号,因此只需要添加用户名即为添加用户。例如添加user@yourdomain.com这个账户useradd user //添加user用户 passwd user //设置密码
6.配置客户端
我测试采用的微软的outlook2016测试的,其他客户端类似选择pop3账户
注意:由于使用的是收发邮件默认使用的是110端口和25端口,因此如果服务器打开了防火墙,需要开放这两个端口。
相关文章推荐
- 动态IP搭建属于自己的企业邮箱服务器
- Postfix + Openssl + Dovecot + Squirrelmail 搭建安全WEB邮箱服务器
- ECS服务器搭建Discuz 邮箱设置,报错处理
- Windows手动搭建邮箱服务器教程,操作简单易上手
- 搭建postfix邮箱服务器
- postfix courier-imap maildrop cyrus-sasl extman搭建mail服务器
- 开源邮箱服务器搭建[未成功]
- 局域网内容邮箱服务器搭建
- 教你自己搭建linux邮箱服务器
- 动态域名搭建exchang邮箱服务器
- CentOS邮箱服务器搭建系列——SMTP服务器的构建( Postfix )
- 邮件系统服务器搭建记录(四)(Postfix+Cyrus-sasl+Courier-authlib+Dovecot+ExtMail+MySQL)
- 邮件系统服务器搭建记录(三)(Postfix+Cyrus-sasl+Courier-authlib+Dovecot+ExtMail+MySQL)
- 使用James搭建一个自己的邮箱服务器
- 使用James搭建一个自己的邮箱服务器
- 公司网站,邮箱,文件服务器搭建实战
- 邮件系统服务器搭建记录(二)(Postfix+Cyrus-sasl+Courier-authlib+Dovecot+ExtMail+MySQL)
- 基于Zimbra搭建的邮箱服务器
- james邮箱服务器搭建
- linux开源邮箱服务器搭建