一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術及軟件下載分享
分類導航

Linux|Centos|Ubuntu|系統進程|Fedora|注冊表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服務器之家 - 服務器系統 - Centos - CentOS 7.2部署郵件服務器(Postfix)

CentOS 7.2部署郵件服務器(Postfix)

2021-11-26 16:26shaonbean Centos

這篇文章主要為大家詳細介紹了CentOS 7.2如何部署郵件服務器Postfix,具有一定的參考價值,感興趣的小伙伴們可以參考一下

一、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函數。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[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
# line 264: uncomment and specify your local network
 
mynetworks = 127.0.0.0/8, 10.0.0.0/24
# line 419: uncomment (use mailboxdir)
 
home_mailbox = mailbox/
# line 574: add
 
smtpd_banner = $myhostname ESMTP
# add follows to the end
 
# 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@linuxprobe ~]# systemctl restart postfix
[root@linuxprobe ~]# systemctl enable postfix

[3]如果Firewalld正在運行,請允許SMTP服務。 SMTP使用25 / TCP。

?
1
2
3
4
[root@dlp ~]# firewall-cmd --add-service=smtp --permanent
success
[root@dlp ~]# firewall-cmd --reload
success

三、Dovecot 安裝

安裝Dovecot以配置POP / IMAP服務器
[1] 安裝Dovecot.
[root@linuxprobe ~]# yum -y install dovecot

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

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[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-auth.conf
# line 10: uncomment and change ( allow plain text auth )
disable_plaintext_auth = no
# line 100: add
auth_mechanisms = plain login
[root@linuxprobe ~]# vi /etc/dovecot/conf.d/10-mail.conf
# line 30: uncomment and add
mail_location = maildir:~/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@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.

?
1
2
3
4
[root@vdevops ~]# firewall-cmd --add-port={110/tcp,143/tcp} --permanent
success
[root@vdevops ~]# firewall-cmd --reload
success

四、SSL設置

配置SSL以加密連接
[1] 首先創建證書,傳送門:http://www.ythuaji.com.cn/article/97434.htm

[2] 為SSL配置Postfix和Dovecot。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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] 如果Firewalld正在運行,請允許SMTPS / POP3S / IMAPS服務。 SMTPS使用465 /
TCP,POP3S使用995 / TCP,IMAPS使用993 / TCP。

?
1
2
3
4
5
6
[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

郵件日志報告:pflogsumm

安裝pflogsumm這是Postfix日志報告工具
[1] 安裝postfix-perl-scripts包 .

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
[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 Jul 14
Grand Totals
------------
messages
  2 received
  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-0300   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
 1000-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 message count
------------------------
 
Recipients by message count
---------------------------
 
Senders by message size
-----------------------
 
Recipients by message size
--------------------------
 
message deferral detail: none
message bounce detail (by relay): none
message reject detail: none
message reject warning detail: none
message hold detail: none
message discard detail: none
smtp delivery failures: none
Warnings
--------
 tlsmgr (total: 6)
   3 redirecting the request to postfix-owned 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, configuration /etc/postfix
  3 terminating on signal 15
  1 reload -- version 2.10.1, configuration /etc/postfix
 
[root@linuxprobe ~]# crontab -e
# 發送郵件日志摘要在AM每天1:00到根
00 01 * * * perl /usr/sbin/pflogsumm -e -d yesterday /var/log/maillog | mail -s 'Logwatch for Postfix' root

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持服務器之家。

原文鏈接:http://blog.csdn.net/wh211212/article/details/53040620

延伸 · 閱讀

精彩推薦
  • CentosCentOS 6.6實現永久修改DNS地址的方法

    CentOS 6.6實現永久修改DNS地址的方法

    這篇文章主要介紹了CentOS 6.6實現永久修改DNS地址的方法,涉及針對CentOS配置文件的相關設置技巧,具有一定參考借鑒價值,需要的朋友可以參考下 ...

    Linux社區4472020-08-21
  • CentosCentOS下Uptime命令詳解

    CentOS下Uptime命令詳解

    在Linux下,我們可以使用uptime命令,而且此命令不必使用root權限。uptime命令在系統中已經默認安裝了。今天小編為大家帶來的是CentOS下Uptime命令詳解;希望...

    CentOS之家11482019-06-19
  • CentosCentOS6.5下Redis安裝與配置詳細步驟

    CentOS6.5下Redis安裝與配置詳細步驟

    本篇文章主要介紹了CentOS6.5下Redis安裝與配置詳細步驟,詳細介紹redis單機單實例安裝與配置,服務及開機自啟動。有興趣的可以了解一下。...

    飛流11452021-12-24
  • Centoscentos 安裝與操作方法

    centos 安裝與操作方法

    這篇文章主要介紹了centos 安裝與操作方法,需要的朋友可以參考下...

    centos之家5272019-07-11
  • Centoscentos不小心刪除/root目錄該如何解決?

    centos不小心刪除/root目錄該如何解決?

    一些朋友最近在問小編centos不小心刪除/root目錄該如何解決?今天小編就為大家分享centos不小心刪除/root目錄解決辦法;希望對大家會有幫助,有需要的朋友...

    腳本之家8022019-05-29
  • CentosCentos7運用/dev/shm進行網站優化

    Centos7運用/dev/shm進行網站優化

    這篇文章主要介紹了LINUX中Centos7運用/dev/shm進行網站優化相關知識點,對此有興趣的朋友參考學習下。...

    彬菌9912022-03-02
  • CentosCentOS7設置日期和時間方法以及基本概念介紹

    CentOS7設置日期和時間方法以及基本概念介紹

    這篇文章主要介紹了CentOS7設置日期和時間方法以及基本概念介紹,本文講解使用CentOS7中的新命令timedatectl設置日期時間方法,需要的朋友可以參考下 ...

    CentOS之家6522019-09-19
  • CentosCentos 7開啟網卡自動獲取IP的詳細方法

    Centos 7開啟網卡自動獲取IP的詳細方法

    本篇文章主要介紹了Centos 7開啟網卡自動獲取IP的詳細方法,小編覺得挺不錯的,現在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧...

    凌鋒8972021-12-29
主站蜘蛛池模板: 国产免费视| 95视频在线观看在线分类h片 | 门房秦大爷小说 | 亚洲 日韩 自拍 视频一区 | 美女任你摸 | 80日本xxxxxxxxx| 日本不卡一区二区三区在线观看 | 久久精品国产色蜜蜜麻豆国语版 | 国产一二在线观看视频网站 | 久久免费国产 | 91久久偷偷做嫩草影院电 | 亚洲图片 自拍偷拍 | 国内精品91最新在线观看 | 国产精品视频一区二区三区w | 揉搓喷水h | 国产第一综合另类色区奇米 | 国产亚洲人成网站在线观看不卡 | 东京干福利 | 憋尿调教绝望之岛 | 成年人在线免费看 | 亚洲国产99在线精品一区二区 | 舔穴吸奶 | 日本xnxnxnxnxn护士 | 娇小XXXXX第一次出血 | 成人高辣h视频一区二区在线观看 | 俺去俺来也www色官网免费的 | 91四虎国自产在线播放线 | 国产色资源 | 成人福利免费在线观看 | 午夜在线观看视频 | 91理论片午午伦夜理片久久 | 滑进了柔佳火热紧夹的 | 欧美一级级a在线观看 | 东京干福利 | 操熟美女又肥又嫩的骚屁股 | 色戒完整版2小时38分钟 | 成人福利免费在线观看 | 草莓在线 | 欧美聚众性派对hdsex | 国产视频一二三区 | 精品久久免费视频 |