首页 > 网站 > 建站经验 > 正文

CentOS 7.2部署邮件服务器(Postfix)

2019-11-02 16:30:51
字体:
来源:转载
供稿:网友

一、Postfix简介

Postfix 是一种电子邮件服务器,它是由任职于IBM华生研究中心(T.J. Watson Research Center)的荷兰籍研究员Wietse Venema为了改良sendmail邮件服务器而产生的。最早在1990年代晚期出现,是一个开放源代码的软件。

Postfix 官方网站:http://www.postfix.org/

Postfix 下载地址:http://www.postfix.org/download.html

二、Postfix安装

安装Postfix以配置SMTP服务器

[1] 即使CentOS系统安装了[最小安装],也会安装Postfix,但如果Postfix不安装,请先安装它,如下所示。

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

[2] 此示例显示配置SMTP-Auth以使用Dovecot的SASL函数。

[root@linuxprobe ~]# vi /etc/postfix/main.cf# line 75: uncomment and specify hostnamemyhostname = linuxprobe.srv.world# line 83: uncomment and specify domain namemydomain = srv.world# line 99: uncommentmyorigin = $mydomain# line 116: changeinet_interfaces = all# line 164: addmydestination = $myhostname, localhost.$mydomain, localhost, $mydomain# line 264: uncomment and specify your local networkmynetworks = 127.0.0.0/8, 10.0.0.0/24# line 419: uncomment (use mailboxdir)home_mailbox = mailbox/# line 574: addsmtpd_banner = $myhostname ESMTP# add follows to the end# limit an email size for 10Mmessage_size_limit = 10485760# limit a mailbox for 1Gmailbox_size_limit = 1073741824# for SMTP-Authsmtpd_sasl_type = dovecotsmtpd_sasl_path = private/authsmtpd_sasl_auth_enable = yessmtpd_sasl_security_options = noanonymoussmtpd_sasl_local_domain = $myhostnamesmtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject[root@linuxprobe ~]# systemctl restart postfix[root@linuxprobe ~]# systemctl enable postfix

[3]如果Firewalld正在运行,请允许SMTP服务。 SMTP使用25 / TCP。

[root@dlp ~]# firewall-cmd --add-service=smtp --permanentsuccess[root@dlp ~]# firewall-cmd --reloadsuccess 

三、Dovecot 安装

安装Dovecot以配置POP / IMAP服务器

[1] 安装Dovecot.

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

[2] 此示例显示配置为向Postfix提供SASL功能 .

[root@linuxprobe ~]# vi /etc/dovecot/dovecot.conf# line 24: uncommentprotocols = imap pop3 lmtp# line 30: uncomment and change ( if not use IPv6 )listen = *[root@linuxprobe ~]# vi /etc/dovecot/conf.d/10-auth.conf# line 10: uncomment and change ( allow plain text auth )disable_plaintext_auth = no# line 100: addauth_mechanisms = plain login[root@linuxprobe ~]# vi /etc/dovecot/conf.d/10-mail.conf# line 30: uncomment and addmail_location = maildir:~/Maildir[root@linuxprobe ~]# vi /etc/dovecot/conf.d/10-master.conf# line 96-98: uncomment and add like follows# Postfix smtp-authunix_listener /var/spool/postfix/private/auth { mode = 0666 user = postfix group = postfix}[root@linuxprobe ~]# vi /etc/dovecot/conf.d/10-ssl.conf# line 8: change (not require SSL)ssl = no[root@linuxprobe ~]# systemctl start dovecot[root@linuxprobe ~]# systemctl enable dovecot

[3] 如果Firewalld正在运行,请允许POP / IMAP服务。 POP使用110 / TCP,IMAP使用143 / TCP.

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表