CentOS 7.2 mail Server (Postfix) _linux

Source: Internet
Author: User
Tags auth imap dovecot

Introduction of Postfix

Postfix is an e-mail server that is served by the IBM Watson Research Center (T.J). Wietse Venema, a Dutch researcher at Watson Research Center, was created to improve the SendMail mail server. First appeared in the late 1990, is an open source software.
Postfix Official website: http://www.postfix.org/
Postfix Download Address: http://www.postfix.org/download.html

Second, postfix installation

Install Postfix to configure the SMTP server
[1] Even if the CentOS system is installed with a minimal installation, Postfix is installed, but if Postfix is not installed, install it first, as shown below.
[root@linuxprobe ~]# yum-y install Postfix

[2] This example displays the SASL function that configures Smtp-auth to use Dovecot.

[Root@linuxprobe ~]# vi/etc/postfix/main.cf # line 75:uncomment and specify hostname myhostname = Linuxprobe.srv.world  # line 83:uncomment and specify domain name mydomain = srv.world # line 99:uncomment myorigin = $mydomain # line 116: Change inet_interfaces = all # line 164:add mydestination = $myhostname, localhost. $mydomain, localhost, $mydomain # l INE 264:uncomment and specify your local network Mynetworks = 127.0.0.0/8, 10.0.0.0/24 # line 419:uncomment (use Mailbo Xdir) Home_mailbox = mailbox/# line 574:add smtpd_banner = $myhostname ESMTP # Add follows to the end # limit a emai

L size for 10M message_size_limit = 10485760 # limit a mailbox to 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 = Noano Nymous Smtpd_sasl_local_domain = $myhostname smtpd_recipient_restrictions = permit_mynetworks,permit_auth_ Destination,permit_sasl_authenticated,rejECT [root@linuxprobe ~]# systemctl restart postfix [root@linuxprobe ~]# systemctl enable Postfix

 

[3] If FIREWALLD is running, please allow SMTP service. SMTP uses 25/TCP.

[ROOT@DLP ~]# firewall-cmd--add-service=smtp--permanent
Success
[ROOT@DLP
~]# Firewall-cmd]--reload Success 

Third, Dovecot installation

Install Dovecot To configure the Pop/imap server
[1] Install Dovecot.
[root@linuxprobe ~]# yum-y Install Dovecot

[2] This example shows a configuration to provide SASL functionality to postfix.

 [root@linuxprobe ~]# vi/etc/dovecot/dovecot.conf # line 24:uncomment protocols = IMAP POP3 LMTP # line 30:uncomment and change (if not use IPv6) listen = * [Root@linuxprobe ~]# Vi/etc/dovecot/conf.d/10-au Th.conf # line 10:uncomment and change (allow plain text auth) Disable_plaintext_auth = no # line 100:add Auth_mechani SMS = Plain Login [root@linuxprobe ~]# vi/etc/dovecot/conf.d/10-mail.conf # line 30:uncomment and add mail_location = ma Ildir:~/maildir [Root@linuxprobe ~]# 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@li Nuxprobe ~]# vi/etc/dovecot/conf.d/10-ssl.conf # line 8:change (not require SSL) SSL = no [Root@linuxprobe ~]#, SYSTEMCT L Start Dovecot [root@linuxprobe ~]# systemctl enable Dovecot 

[3] If FIREWALLD is running, please allow POP/IMAP service. POPs use 110/tcp,imap to use 143/TCP.

[Root@vdevops ~]# firewall-cmd--add-port={110/tcp,143/tcp}--permanent
Success
[Root@vdevops ~]# Firewall-cmd--reload
Success 

Four, SSL settings

Configure SSL to encrypt connections
[1] First create certificate, Portal: http://www.jb51.net/article/97434.htm

[2] Configure postfix and dovecot for SSL.

# Add to the ' end
Smtpd_use_tls = yes
smtpd_tls_cert_file =/etc/pki/tls/certs/server.crt
smtpd_tls_key_ File =/etc/pki/tls/certs/server.key
smtpd_tls_session_cache_database = Btree:/etc/postfix/smtpd_scache
[ Root@linuxprobe ~]# vi/etc/postfix/master.cf
# line 26-28:uncomment
Smtps inet  n  -  n  -  -  smtpd-
 o Syslog_name=postfix/smtps-
 o smtpd_tls_wrappermode=yes
[root@linuxprobe ~]# vi/etc/dovecot/conf.d/10-ssl.conf
# line 8:change
SSL = yes
# line 14,15:specify Certificates
SSL _cert = </etc/pki/tls/certs/server.crt
ssl_key = </etc/pki/tls/certs/server.key
[root@linuxprobe ~] # systemctl Restart Postfix dovecot

[3] If FIREWALLD is running, please allow smtps/pop3s/imaps service. Smtps Use 465/
Tcp,pop3s use 995/tcp,imaps to use 993/TCP.

[Root@vdevops ~]# firewall-cmd--add-service={pop3s,imaps}--permanent
Success
[Root@vdevops ~]# Firewall-cmd--add-port=465/tcp--permanent
Success
[Root@vdevops ~]# firewall-cmd--reload
Success 

Mail Log report:Pflogsumm

Install Pflogsumm This is the Postfix log reporting tool
[1] Install the postfix-perl-scripts package.

[Root@linuxprobe ~]# yum-y install postfix-perl-scripts # Generate log summary for yesterday [Root@linuxprobe ~]# Perl/ usr/sbin/pflogsumm-d yesterday/var/log/maillog Postfix Log summaries for June totals------------messages 2 R
  Eceived 5 delivered 0 forwarded 0 deferred 0 bounced 0 rejected (0%)

 0 Reject warnings 0 held 0 discarded (0%) 
2879 Bytes received 6572 bytes delivered 1 senders 1 sending hosts/domains 2 recipients 2 recipient Hosts/domains Per-hour Traffic Summary------------------------Time received delivered deferred bounced rejected---------------- ----------------------------------------------------0000-0100 0 0 0 0 0 0100-0200 0 0 0 0 0 0200-0 300 0 0 0 0 0 0300-0400 0 0 0 0 0 0400-0500 0 0 0 0 0 0500-0600 0 0 0 0 0-0600 -0700 0 0 0 0 0 0700-0800 0 0 0 0 0 0800-0900 0 0 0 0 0 0900-1000 0 0 0 0 0-10  00-1100 2 5 0 0 0 1100-1200 0 0 0 0 0 1200-1300 0 0 0 0 0 1300-1400 0 0 0 0 0 1400-1500 0-0   0 0 0 1500-1600 0 0 0 0 0 1600-1700 0 0 0 0 0 1700-1800 0 0 0 0 0 1800-1900-0    0 0 0 0 1900-2000 0 0 0 0 0 2000-2100 0 0 0 0 0 2100-2200 0 0 0 0 0 2200-2300-0 0 0 0 0 2300-2400 0 0 0 0 0 host/domain summary:message Delivery-----------------------------------  ---sent cnt bytes defers avg dly Max dly host/domain-----------------------------------------------3 4119 0 0.4 s 0.8 S Srv.world 2 2453 0 0.1 s 0.1 s Mail.srv.world host/domain summary:messages Received------------------ ---------------------msg cnt bytes host/domain--------------------------2 2879 mail.srv.world senders by Messag E Count------------------------2 cent@mail.srv.world Recipients by message Count---------------------------3 Redh At@srv.world 2 Cent@maIl.srv.world senders by message size-----------------------the 2879 cent@mail.srv.world Recipients by message size------  --------------------4119 redhat@srv.world 2453 cent@mail.srv.world message Deferral Detail:none message Bounce Detail (by relay): None-Reject Detail:none message reject warning Detail:none message hold Detail:none message Discar D detail:none SMTP delivery failures:none warnings--------tlsmgr (total:6) 3 redirecting the request to Postfix-o
   Wned data_directory/var/li ...

3 Request to Update table Btree:/etc/postfix/smtpd_scache in non-... Fatal errors:none panics:none Master daemon Messages----------------------4 daemon started--version 2.10.1, config Uration/etc/postfix 3 terminating on signal 1 reload-version 2.10.1, Configuration/etc/postfix [Root@linuxpro Be ~]# crontab-e # Send mail log summary 1:00 to Gen * * Perl/usr/sbin/pflogsumm-e-D Yesterday/var/log/maillog |

 Mail-s ' Logwatch for Postfix ' root

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.