5. sendmail.cf
Contents sendmail.cf NULL Client PPP Client Firewall
sendmail.cf sendmail ( ) ( ) SMTP UUCP
sendmail.cf OS sendmail sendmail.cf MX Lower MX MX RR
sendmail.cf V1: sendmail 5 ( V1) V2, V3: sendmail 6.x V4: sendmail 8.5 V5: sendmail 8.6.x V6: sendmail 8.7.x V7: sendmail 8.8.x mqueue sendmail qf sendmail
sendmail.cf cf? sendmail R8 SunOS ($%y ) Null address (<>,? ) @@host list:;? list:;@host %-hack?
sendmail.cf OS m4 cf sendmail mailconf JUNET CF sendmail R8
CF sendmail.cf make cleantools; make tools sed perl sendmail.def Standards/* make sendmail.cf sendmail.def sendmail.cf sendmail.cf
.def MX CF_TYPE=R8V7 sendmail.8.8 V7 OS_TYPE=bsdos3.0 OS mailer BITNET=mx user@node.bitnet
ACCEPT_ADDRS='x.co.jp' (!) FROM_ADDRESS='x.co.jp' root, daemon, postmaster,... ACCEPT_ADDRS='sub1.co.jp sub2.x.co.jp'
NULL Client CF_TYPE=R8V7-null SPOOL_HOST=mail.x.co.jp [] (lower MX A RR ) IP
PPP FROM_ADDRESS=po.provider.ne.jp DIRECT_DELIVER_DOMAINS=none DEFAULT_RELAY=mail.provider.ne.jp CON_EXP=True SMTP_MAILER_FLAG_ADD=e mqueue sendmail -q
PPP userdb, usertable check_compat O DialDelay=15s POP
Firewall (0/3) NS NS NS Wildcard MX * IN MX 10 ext-mail.x.co.jp. NS Wildcard MX
Firewall (1/3) 1 a. zone NS split-brain DNS b.
1 a b Internet Internet NS split-brain DNS ( zone) NS
Firewall (2/3) 2 DNS DNS a b
2 a NS NS Internet b Internet NS NS
DIRECT_DELIVER_DOMAINS=x.co.jp DEFAULT_RELAY=external.x.co.jp
STATIC_ROUTE_FILE=x.static x.static: GW [12.34.56.78] # (internal.x.co.jp) DOM x.co.jp
Firewall (3.1/3) 1 a. first MX inner-host IN MX 10 inner-host IN MX 20 gw 1st-MX b. A RR inner-host IN A 12.34.56.78 IN MX 10 gw
Firewall (3.2/3) c. inner.domain.jp inner.domain.jp.local sendmail.cf STATIC_ROUTE_FILE MAP (CF) d. 1 IP named named sendmail sendmail O DaemonPortOptions=Address=12.34.56.78
NS 1 (cont.) a, b bind8 allow-query a 1st MX 2nd MX
NS 1 (cont d) b A RR 1st-MX TRY_NULL_MX_LIST=True (CF) O TryNullMXList=True (sendmail.cf) local configuration error
GW DIRECT_DELIVER_DOMAINS=none DEFAULT_RELAY=internal.x.co.jp DIRECT_DELIVER_DOMAINS=x.co.jp DEFAULT_RELAY=internal.x.co.jp NULL Client
(cont.) 1st-MX 2nd-MX 2nd-MX aliases ACCEPT_ADDRS= SECONDARY_*= 1st-MX
(cont d) aliases NIS aliases aliases OA/etc/aliases, nis: mail.aliases ML
(cont.) 1 USERTABLE_MAPS='domain1=hash:/etc/map1 domain2=hash:/etc/map2' (1) 1 IP sendmail O DaemonPortOptions=Address=1.2.3.4 chroot
(cont d) (2) sendmail.cf local mailer /etc/passwd POP
sendmail.cf sendmail -bv sendmail -bt /etc/sendmail.cf
sendmail -bv mqueue (permission) % sendmail -C new.cf -oq/tmp -bv user@domain motonori@wide.ad.jp... deliverable: mailer smtp, host wide.ad.jp., user motonori@wide.ad.jp
3,0 /parse 5 smtp mailer 3,0 /parse local mailer ( ) /try ( )
( ) 0 5 (/parse) (mailer) (local ) 3 2 R= (/try) 4 1 S=
(1) sendmail -bt % sendmail -C new.cf -bt > 3,0 motonori@wide.ad.jp rewrite: ruleset 3 input: motonori @ wide. ad. Jp : rewrite: ruleset 0 returns: $# smtp $@ wide. ad. jp. $: motonori < @ wide. ad. jp > R5 sendmail 0 address R8 sendmail 3,0 address ( /parse)
(2) % sendmail -C new.cf -bt > 3,0 motonori@wide.ad.jp rewrite: ruleset 3 input: motonori @ wide. ad. Jp : rewrite: ruleset 0 returns: $# local $: motonori >
(3) 5 5 sendmail R8 3,0 local mailer aliases > 5 motonori rewrite: ruleset 5 input: motonori rewrite: ruleset 5 returns: $# smtp $@ spool $: motonori < @ spool >
(4) > /tryflags HS > /try smtp motonori Trying header sender address motonori for mailer smtp rewrite: ruleset 3 input: motonori : rewrite: ruleset 4 returns: motonori @ wide. ad. jp Rcode = 0, addr = motonori@wide.ad.jp
% sendmail -C new.cf -oq/tmp -v user@host From: user@host To: user@host This is a test. % -oq/tmp
SMTP # sendmail -C new.cf -bs 220 mail.wide.ad.jp ESMTP Sendmail 8.8.8 MAIL FROM:<motonori> 250 <motonori>... Sender ok RCPT TO:<motonori> 250 <motonori>... Recipient ok DATA 354 Enter mail, end with "." on a line by itself test. 250 TAA13313 Message accepted for delivery QUIT 221 mail.wide.ad.jp closing connection
sendmail.cf (cont.) /etc/sendmail.cf ( ) daemon sendmail # ps aux grep sendmail 72??... accepting connections on port 25 (sendmail) 195??... sendmail: OAA12345 mail.y.co.jp.: user open # kill -HUP 72 SIGHUP R8 sendmail R5 sendmail
sendmail.cf cf (cont d) # /usr/lib/sendmail -bd -q1h -bd ( ) -q1h (1 ) -q30m (30) mqueue # /usr/lib/sendmail -q1h
Sendmail.cf (MX)