码迷,mamicode.com
首页 > 系统相关 > 详细

Linux与云计算——第二阶段Linux服务器架设 第九章:Mail电子邮件服务器架设—postfix和Dovecot

时间:2016-08-10 14:29:25      阅读:308      评论:0      收藏:0      [点我收藏+]

标签:安装   postfix   dovecot   

Linux与云计算——第二阶段Linux服务器架设

第九章:Mail电子邮件服务器架设—postfix和Dovecot

安装Postfix

安装Postfix配置SMTP服务器. SMTP使用25/TCP.

[1] Postfix CentOS系统默认安装,哪怕你选择了最小安装,如果确认没有安装,请先安装.

[root@mail ~]# yum -y install postfix

[2] 使用Dovecot‘s SASL 配置SMTP认证

[root@mail ~]# vi /etc/postfix/main.cf

# line 75: 去掉注释修改主机名

myhostname = mail.example.com

# line 83: 去掉注释并且定义域名

mydomain = example.com

# line 99: 去掉注释

myorigin = $mydomain

# line 116: 修改

inet_interfaces = all

# line 164: 添加

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

# line 264: 去掉注释并且按照你本地局域网环境修改

mynetworks = 127.0.0.0/8, 192.168.96.0/24

# line 419: 去掉注释 (use Maildir)

home_mailbox = Maildir/

# line 574: 添加

smtpd_banner = $myhostname ESMTP

# 在最后面添加以下内容

# limit an email size for 10M

message_size_limit = 10485760

# limit a mailbox for 1G

mailbox_size_limit = 1073741824

# for SMTP-Auth

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

[root@mail ~]# systemctl restart postfix

[root@mail ~]# systemctl enable postfix

安装Dovecot

安装Dovecot配置POP/IMAP服务器。POP使用110/TCP, IMAP使用143/TCP.

[1] Install Dovecot.

[root@mail ~]# yum -y install dovecot

[2] provide SASL function to Postfix.

[root@mail ~]# vi /etc/dovecot/dovecot.conf

# line 24: 去掉注释

protocols = imap pop3 lmtp

# line 30: 去掉注释修改 ( 如果不使用IPv6 )

listen = *

[root@mail ~]# vi /etc/dovecot/conf.d/10-auth.conf

# line 10: 去掉注释并修改 ( 允许明文认证 )

disable_plaintext_auth = no

# line 100: 增加

auth_mechanisms = plain login

[root@mail ~]# vi /etc/dovecot/conf.d/10-mail.conf

# line 30: 去掉注释并添加

mail_location = maildir:~/Maildir

[root@mail ~]# vi /etc/dovecot/conf.d/10-master.conf

# line 96-98: uncomment and add like follows

# Postfix smtp-auth

unix_listener /var/spool/postfix/private/auth {

    mode = 0666

    user = postfix

    group = postfix

}

[root@mail ~]# vi /etc/dovecot/conf.d/10-ssl.conf

# line 8: 修改 (不使用SSL)

ssl = no

[root@mail ~]# systemctl start dovecot

[root@mail ~]# systemctl enable dovecot


本文出自 “11830455” 博客,请务必保留此出处http://11840455.blog.51cto.com/11830455/1836505

Linux与云计算——第二阶段Linux服务器架设 第九章:Mail电子邮件服务器架设—postfix和Dovecot

标签:安装   postfix   dovecot   

原文地址:http://11840455.blog.51cto.com/11830455/1836505

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!