centos7.6 deployment Postfix + Dovecot mail system

Copyright: Jiang Productions, All Rights Reserved. Https://blog.csdn.net/weixin_44953658/article/details/90751839

First, the theoretical part

E-mail system based on e-mail messages to complete the transfer protocol
commonly used protocols are:
   Simple Mail Transfer Protocol (SMTP): e-mail for sending and transit issued occupancy server TCP / 25 port
   Post Office Protocol version 3 (POP3): the email storage to the local host, occupied for a TCP server / port 110
   internet message access protocol version 4 (IMAP4): TCP messages for local host access, the server occupied / 143 terminal
   ports

In the e-mail system
  to send and receive mail server user called mail user agent (MUA) -> Client program
  to save the user's mailbox the mail server (MDA) -> Save Mail
  forwarding messages between different e-mail service provider, the MUA messages from the MTA to the appropriate forwarding service
  device (MTA) -> client service procedures

When you deploy enterprise-class e-mail system, there are four considerations Please note
  add anti-spam and anti-virus module: it can effectively prevent spam or virus messages interference with business mail
  mail encryption: message contents can not be effectively protected hackers steal and tampering 
  add mail monitoring audit module: can effectively monitor whether there is a sensitive word to all employees of companies in the mail, if there is to disclose corporate
  irregularities such as data
  protection stability: stability is critical email systems, operation and maintenance should be done to ensure the stable operation of the e-mail system,
  and to be ready in time to prevent distributed denial of service attack

postfix master configuration file located /etc/postfix/main.cf
important parameters

parameter effect
myhostname Host name of the post office system
mydomain Domain name system of the post office
myorigin Mail sent from the local domain name system
inet_interfaces Listening network interface
mydestination Host or domain name can receive mail
mynetworks Set which hosts can be forwarded messages
relay_domains Set which messages can be forwarded domain

Second, the deployment process

operating system ip address service name
centos7_1 192.168.81.210 postfix+bind
centos7_2 192.168.81.220 dovecot
win7_1 192.168.81.134 outlook

DNS service configuration (Once configured to write on each server dns address)

1. Configure the server host name, host name of the server you need to ensure consistency with the transmission domain

[root@mail ~]# vim /etc/hostname
	mail.longzi.com
[root@mail ~]# hostnamectl set-hostname mail.longzi.com

2. Install the bind service (DNS)

[root@mail ~]#yum -y install bind bind-chroot

3. Configure the bind service

[root@mail ~]#vim /etc/named.conf
修改
	listen-on port 53  { any; };
	allow-query { any; };					

Here Insert Picture Description
4. Analytical configures the forward region

[root@mail ~]#vim /etc/named.rfc1912.zones

Here Insert Picture Description
The configuration data file area

[root@mail ~]# vim /var/named/longzi.com.zone

Here Insert Picture Description
6. Restart the service can bind

Postfix server configuration

1. Install postfix

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

2. modify the configuration file

[root@mail ~]# vim /etc/postfix/main.cf
	修改76:myhostname=mail.longzi.com			//定义主机名
	修改83:mydomain = longzi.com			//定义域名
	修改99:myorigin = $mydomain			//从本机发出邮件的域名名称
	修改116:inet_interfaces = all			//监听的网卡接口
	修改164:mydestination = $myhostname , $mydomain		//设置可转发哪		些主机的邮件

3. Restart services to

4. Create a mailbox user, useradd passwd

Dovecot server configuration

1. Setup

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

2. Modify the main configuration file

[root@localhost ~]# vim /etc/dovecor/dovecot.conf
	修改24:protocols = imap pop3 imtp		//支持的电子邮件协议
	修改25:disable_plaintext_auth = no			//是否允许明文验证
	修改48:login_trusted_networks = 192.168.81.0/24		//哪些人可以使		用

3. Configure the message format and storage path

[root@localhost ~]#vim /etc/dovecot/conf.d/10-mail.conf
	修改24:mail_location = mbox:~/mail:INBOX=/var/mail/%u

4. Restart the service to

verification

win7 use outlook mail
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/weixin_44953658/article/details/90751839