1 北區機房 ip 維運處暨 idc 維運組 鄭任峰 郵件系統維運 課程 : sendmail 與...
TRANSCRIPT
![Page 1: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/1.jpg)
1
郵件系統維運課程 : Sendmail 與 postfix 的設定與比較
北區機房北區機房 IPIP 維運處暨維運處暨 IDCIDC 維運組 維運組 鄭任峰鄭任峰
![Page 2: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/2.jpg)
2
Contents Email relative RFC Postfix compare with Sendmail Mail deliverly process Mail relay process DNS MX Resource Record MX Backup Postfix definitive:
Postfix Major MDA purposePostfix Big picturePostfix Queue ManagerPostfix Content FilterPostfix Configuration
Sendmail definitive:Sendmail Major MDA purposeSendmail Big pictureSendmail Configuration
Different between Postfix & Sendmail Command Different between Postfix & Sendmail Configuration
![Page 3: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/3.jpg)
3
Email relative RFC RFC 2181 :
Clarifications to the DNS Specification
RFC 2821 :
communicate with SMTP protocol for exchange mails
RFC 1939 :
retrieve mails with POP3 protocol
RFC 2060 :
retrieve mails with IMAP protocol
![Page 4: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/4.jpg)
4
MUA/MTA/MDA MUA (Mail User Agent)
Outlook , Thunderbird , Eudora , pine …
MTA (Mail Transfer Agent)
Postfix , Qmail , Sendmail , MS Exchange …
MDA (Mail Delivery Agent)
local , smtp , sendmail , virtual , lmtp …
![Page 5: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/5.jpg)
5
Postfix compare with Sendmail Reliability: prevent resource exhaust Queue Management : flush/hold /re-queue Modules: dozen of MDAs Configuration Setting: separate parameter Concurrency Control: outgoing/incoming flow Transport: designate MDA Privilege: chroot Blocking: Client restriction/Syntex/
Content check/User defined
![Page 6: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/6.jpg)
6
Mail deliverly process
MUA
Sender
SMTP
SMTP
Mail Storage
POP3 / IMAP
MTA
MTA
MDA
POP/IMAP MUA
Mail System
Yellow MDAGreen MUARed Storagepink Server
DNS
Mail from: [email protected] Mail to: [email protected]
Domain : aptg.net
![Page 7: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/7.jpg)
7
Mail relay process
MUA
Sender
SMTP
MTA
MDA
MUA
Mail System
Yellow MDAGreen MUAPink Server
DNS
Mail from: [email protected] Mail to: [email protected]
Domain : aptg.net
MTA
![Page 8: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/8.jpg)
8
DNS MX Resource Record
From: [email protected] To: [email protected]
Step 1: MUA deliver mail(s) to aptg.net for relay
Step 2: aptg.net request ‘pchome.com.tw’ for DNS MX RR by Resolver
Step 3: PCHOME DNS server respond MX RR : mx.pchome.com.tw
Step 4: Resolver request for A RR of ‘MX RR’
Step 5: PCHOME DNS server respond A RR: 211.20.188.150
Step 6: Resolver provide pchome mail server IP to aptg.net
Step 7: aptg.net deliver mail(s) to 211.20.188.150 Port 25 with SMTP protocol
工作站
SMTP (step 7)
aptg.net mx.pchome.com.tw (211.20.188.150)
Client
Outlook
Resolver
SMTP (step 1,6)
DNS Query & Response
( Step 2,3,4,5)
pchome.com.tw MX preference=10 mail exchanger=mx.pchome.com.tw
mx.pchome.com.tw Address: 211.20.188.150
![Page 9: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/9.jpg)
9
MX Backup
SMTP
Mail2.a.b.c
Internet InternetMail1.a.b.c
Deliver process
Queue
SMTP
DNS Server
MX RR
SMTP
SMTP
Yellow MDAPink Server
mail.a.b.c MX preference = 10, mail exchanger = mail1.a.b.c
mail.a.b.c MX preference = 20, mail exchanger = mail2.a.b.c
![Page 10: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/10.jpg)
10
Postfix definitive Postfix Major MDA purpose Postfix Big picture Postfix Queue Manager Postfix Content Filter Postfix Configuration
![Page 11: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/11.jpg)
11
Postfix Major MDA purpose master: initiate/restart MDA , concurrency limitation qmgr: decide transport, move/flush/delete/hold queue cleanup: assign QueueID, push to qmgr (incoming) smtpd: listenning incoming request pickup: get queue from maildrop rewrite: rewrite header smtp: handle outgoing request local: put mail into disk (local user maildir/mailbox format) lmtp: put mail into disk (local/virtual user other format) virtual: put mail into disk (virtual user maildir/mailbox forma
t) pipe: pipe to program bounce: handle return mail
![Page 12: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/12.jpg)
12
Postfix Big Picture (1/7)
![Page 13: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/13.jpg)
13
Postfix Big Picture (2/7)From outside and relay to outside domain
smtpd cleanup
Trivial-rewrite
incoming
qmgr
Yellow MDABlue Queue PoolGray Queue ManagerPink Server
active smtp
DNS Server
SMTP Server / MUA send mail(s) to outside domain
![Page 14: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/14.jpg)
14
Postfix Big Picture (3/7)From outside and deliver to local domain
smtpd cleanup
Trivial-rewrite
incoming
qmgr
activelocal/lmtp/
virtual
[email protected]@[email protected]
Mail Storage
Yellow MDABlue Queue PoolGray Queue ManagerPink Storage
Aliases/forward table
SMTP Server / MUA deliver mail(s) to inside domain
![Page 15: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/15.jpg)
15
Postfix Big Picture (4/7)From local host and relay to outside domain
Pickup cleanup
Trivial-rewrite
incoming
qmgr
postdrop
From local host
maildrop active smtp
DNS Server
Yellow MDABlue Queue PoolGray Queue ManagerPink Server
![Page 16: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/16.jpg)
16
Postfix Big Picture (5/7)From local host and deliver to local domain
Pickup cleanup
Trivial-rewrite
incoming
qmgr
postdrop
From local host
maildrop activelocal/lmtp/
virtual
Yellow MDABlue Queue PoolGray Queue ManagerRed Storage
Mail Storage
[email protected]@[email protected]
Aliases/forward table
![Page 17: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/17.jpg)
17
Postfix Big Picture (6/7)MDA & qmgr
postdrop
smtpdincoming
qmgractive smtp
deferred
local
virtual
pipe
pickup cleanup
trivial-rewrite
maildrop
INPUT MDA OUTPUT MDA
Internal MDA
hold
Yellow MDABlue Queue PoolGray Queue Manager
lmtp
![Page 18: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/18.jpg)
18
Postfix Big Picture (7/7)Adding Content-Filter
smtpd
chkmsgsmtp
incoming
cleanup
deferred
qmgr
Yellow MDABlue Queue PoolGray Queue ManagerDeep Blue Amavis
activecleanup
Amavis
smtpd
Port:10024
Port:10025
Port:25
![Page 19: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/19.jpg)
19
Postfix ConfigurationMaster.cf
![Page 20: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/20.jpg)
20
Postfix Configuration - main.cf (1/3)
Filter
![Page 21: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/21.jpg)
21
Postfix Configuration - main.cf (2/3)
![Page 22: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/22.jpg)
22
Postfix Configuration - main.cf (3/3)
![Page 23: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/23.jpg)
23
Sendmail definitive Sendmail Major MDA purpose Sendmail Big picture Sendmail Configuration
![Page 24: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/24.jpg)
24
Sendmail Major MDA purpose smtp: handle outgoing request
local: put mail into disk (local user mailbox format)
pipe to program
uucp: unix to unix copy
X.400: other address format
![Page 25: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/25.jpg)
25
Sendmail Big Picture
![Page 26: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/26.jpg)
26
Sendmail Configuration – sendmail.cf (1/3)
![Page 27: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/27.jpg)
27
Sendmail Configuration – sendmail.cf (2/3)
![Page 28: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/28.jpg)
28
Sendmail Configuration – sendmail.cf (3/3)
![Page 29: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/29.jpg)
29
Different between Postfix & Sendmail Command
start/stop/reload Daemon postfix start/stop/reload sendmail –bd –q1h/killall –TERM sendmail/killall –HUP sendmail
flush/delete/requeue queue postfix flush/postsuper –d ALL/postsuper –r sendmail –q/ rm queue / none
major configuration file master.cf / main.cf sendmail.cf / sendmail.mc / local-host-names
Postfix
Sendmail
Postfix
Sendmail
Postfix
Sendmail
![Page 30: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/30.jpg)
30
Different betweenPostfix & Sendmail Configuration (1/3)
major configuration file
master.cf / main.cf
sendmail.cf / sendmail.mc / local-host-names
Local domain
mydestination = aptg.net (main.cf)
Cwaptg.net (sendmail.cf 或 local-host-names)
Relay domain
relay_host = apol.com.tw (main.cf)
apol.com.tw (relay-domains)
Postfix
Sendmail
Postfix
Sendmail
Postfix
Sendmail
![Page 31: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/31.jpg)
31
Different betweenPostfix & Sendmail Configuration (2/3)
Smart relay
transport_maps = hash:/etc/postfix/transport (main.cf)
apol.com.tw smtp:[mx.apol.com.tw]:25 (/etc/postfix/transport)
DSsmtp.aptg.net (sendmail.cf)
Queue Bounce
maximal_queue_lifetime = 1d (main.cf)
O Timeout.queuereturn=1d (sendmail.cf)
Queue retry
queue_run_delay = 4h (main.cf)
O Timeout.queuewarn=4h (sendmail.cf)
Postfix
Sendmail
Postfix
Sendmail
Postfix
Sendmail
![Page 32: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/32.jpg)
32
Different betweenPostfix & Sendmail Configuration (3/3)
Process Control (master.cf) service type private unpriv chroot wakeup maxproc command + args smtp inet n - n - 300 smtpd O MaxDaemonChildren=300 (sendmail.cf)
Max Message Size message_size_limit = 10240000 (main.cf) O MaxMessageSize= 10240000 (sendmail.cf)
Recipients limitation smtpd_recipient_limit = 100 (main.cf) O MaxRecipientsPerMessage=100 (sendmail.cf)
Postfix
Sendmail
Postfix
Sendmail
Postfix
Sendmail
![Page 33: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/33.jpg)
33
Reference Postfix Official site
http://www.postfix.org
Sendmail Official site
http://www.sendmail.org
V-Bird Postfix Building
http://linux.vbird.org/linux_server/0390postfix.php
V-Bird Sendmail Building
http://linux.vbird.org/linux_server/0380sendmail.php
Sendmail Instruction
http://fanqiang.chinaunix.net/a6/b3/index_b.html
Postfix Instruction
http://linux.tnc.edu.tw/techdoc/postfix-howto.htm
![Page 34: 1 北區機房 IP 維運處暨 IDC 維運組 鄭任峰 郵件系統維運 課程 : Sendmail 與 postfix 的設定與比較 北區機房 IP 維運處暨 IDC 維運組 鄭任峰](https://reader033.vdocuments.site/reader033/viewer/2022061411/56649e2a5503460f94b18cfd/html5/thumbnails/34.jpg)
34
Q & A