linux开源邮箱服务器搭建
来源:互联网 发布:新疆行知实验学校学费 编辑:程序博客网 时间:2024/05/22 08:14
1.安装Postfix
yum -y install postfix
安装完成还需要替换系统自带的sendmail:
rpm -e sendmail 或者 yum remove sendmail
修改MTA(默认邮件传输代理)
alternatives --config mta 然后直接回车即可。
2.安装Dovecot(邮局转发)
yum -y install dovecot
3.配置Postfix
vi /etc/postfix/main.cf
修改如下:
75行: 取消注释,设置hostname myhostname = mail.linkdood.cn # 83行: 取消注释,设置域名 mydomain = linkdood.cn # 99行: 取消注释 myorigin = $mydomain # 116行: 修改 inet_interfaces = all # 119行: 推荐ipv4,如果支持ipv6,则可以为all inet_protocols = ipv4 # 164行: 添加 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain # 264行: 取消注释,指定内网和本地的IP地址范围 #mynetworks = 127.0.0.0/8, 10.0.0.0/24 Mynetworks = 0.0.0.0/0 # 419行: 取消注释,邮件保存目录 home_mailbox = Maildir/ # 571行: 添加 smtpd_banner = $myhostname ESMTP # 添加到最后 # 规定邮件最大尺寸为10M (根据实际情况或者不添加使用默认值) message_size_limit = 10485760# 规定收件箱最大容量为1G mailbox_size_limit = 1073741824 # SMTP认证 smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous smtpd_sasl_local_domain = $myhostname smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
修改好了之后使用
/etc/init.d/postfix restart
开启postfix,自启
chkconfig postfix on
4.配置Dovecot
[root@mail ~]# vi /etc/dovecot/dovecot.conf # 26行: 如果不使用IPv6,请修改为* listen = * [root@mail ~]# vi /etc/dovecot/conf.d/10-auth.conf # 9行: 取消注释并修改 disable_plaintext_auth = no # 97行: 添加 auth_mechanisms = plain login [root@mail ~]# vi /etc/dovecot/conf.d/10-mail.conf # 30行: 取消注释并添加 mail_location = maildir:~/Maildir [root@mail ~]# vi /etc/dovecot/conf.d/10-master.conf # 88-90行: 取消注释并添加 # Postfix smtp验证 unix_listener /var/spool/postfix/private/auth { mode = 0666user = postfixgroup = postfix } [root@mail ~]# /etc/init.d/dovecot start Starting Dovecot Imap: [ OK ] [root@mail ~]# chkconfig dovecot on
到这里,我们的邮件服务器就已经搭建成功了。
5.域名解析
最后别忘了还需要进行域名解析工作。
添加一个子域名mail,A记录解析到服务器IP。
再添加一个MX记录,主机记录为空,记录值为上面解析的二级域名mail.linkdood.cn,优先级10。
注意:解析生效可能需要一段时间。
6.防火墙设置
/sbin/iptables -A INPUT -p tcp --dport 25 -j ACCEPT/sbin/iptables -A INPUT -p tcp --dport 110 -j ACCEPT/sbin/iptables -A INPUT -p tcp --dport 143 -j ACCEPT/sbin/iptables -t nat -A PREROUTING -p tcp -m tcp --dport 10025 -j REDIRECT --to-ports 25
7.邮箱使用
一切都弄好以后,就可以使用Foxmail等第三方软件来收发邮件了。在这里需要说一下,系统用户就是邮件的用户,例如root,就是一个邮箱用户,邮箱是root@domain.com,密码就是root的密码,所以需要创建用户,只要使用useradd创建用户,再使用passwd设置密码。
好了,假如创建一个admin的用户:
# 创建用户 useradd admin #设置密码,会要求输入两次密码 passwd admin
阅读全文
0 0
- linux开源邮箱服务器搭建
- Ubuntu搭建邮箱服务器
- 搭建postfix邮箱服务器
- 虚拟主机++iRedMail搭建邮箱服务器
- 局域网内容邮箱服务器搭建
- 基于Zimbra搭建的邮箱服务器
- Ubuntu搭建简易Postfix邮箱服务器
- PHP mail()本地邮箱服务器搭建全过程
- Postfix + Openssl + Dovecot + Squirrelmail 搭建安全WEB邮箱服务器
- CentOS 7使用Postfix、Dovecot及MariaDB搭建邮箱服务器
- 使用James搭建一个自己的邮箱服务器
- centos7+postfix+devocot+cycus-sasl搭建邮箱服务器
- Ubuntu 14.04搭建邮箱服务器(Postfix, Dovecot)
- Windows手动搭建邮箱服务器教程,操作简单易上手
- linux 服务器搭建vpn服务器
- 搭建linux服务器之Debian源相关
- linux服务器搭建本地yum源
- Linux搭建VPN服务器
- Redis 3.2.8 集群模式+Sentinel多Master部署
- php 使用 ffmpeg 转换视频,截图,并生成缩略图
- CyberLink PowerDirector Ultimate 16(威力导演视频处理工具)官方中文版V16.0.2406.0下载 | 威力导演16中文破解版
- Android 5.0 Headup形式的Notification消息通知
- JDBC规范——(4)概览
- linux开源邮箱服务器搭建
- 实时搜索引擎Elasticsearch(2)——Rest API的使用
- TCP协议中的三次握手和四次挥手(图解)
- 解决:target\surefire-reports for the individual test results
- Markdown编辑器代码示例
- 数据库测试用例要点
- 实时搜索引擎Elasticsearch(3)——查询API的使用
- 3D过渡动画
- lucene5.3.1的排序是怎么实现的?