# cd build_unix # ../dist/configure # make
smmsp -c 'Sendmail Submission User' -d /var/spool/clientmqueue -s /sbin/nologin
$ vi devtools/Site/site.config.m4
APPENDDEF(`confMAPDEF', `-DNEWDB') ←Berkeley DB をサポート
APPENDDEF(`confLIBS', `-L../../../db-2.7.7/build_unix -ldb')
APPENDDEF(`confINCDIRS', `-I/usr/local/include')
APPENDDEF(`confLIBDIRS', `-L/usr/local/lib')
$ ./Build -c # ./Build install
# cd cf/cf # cp generic-linux.mc sendmail.mc # vi sendmail.mc (編集する) # ./Build sendmail.cf sendmail.cfの作成 # ./Build install-cf sendmail.cfとsubmit.cfを/etc/mailにコピー
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn')dnl
O PrivacyOptions=authwarnings,novrfy,noexpn
define(`SMART_HOST', `point.plala.jp')dnl
DSmmr.point.plala.jp
FEATURE(`nullclient', `mmr.plala.or.jp')dnl
FEATURE(`access_db',`hash -o /etc/mail/access.db')dnl
C{Accept}OK RELAY Kaccess hash -T<TMPF> -o /etc/mail/access.db
FEATURE(`accept_unresolvable_domains')dnl
define(`confMAX_MESSAGE_SIZE',`10485760')dnl
O MaxMessageSize=10485760
define(`confMAX_HEADERS_LENGTH', `32768')dnl
O MaxHeadersLength=32768
define(`confTO_QUEUERETURN', `5d')dnl
O Timeout.queuereturn=5d
define(`confTO_QUEUEWARN', `4h')dnl
O Timeout.queuewarn=4h
コマンド | 意味 | 説明 |
V | version | sendmailのバージョン |
C | class | クラスマクロを定義 |
F | file | ファイルやパイプからのクラスマクロを定義 |
D | マクロを定義 | |
O | option | オプションを定義 |
K | ||
T | ||
H | ||
P |
# level 10 config file format V10/Berkeley バージョン # override file safeties - setting this option compromises system security, # addressing the actual file configuration problem is preferred # need to set this before any file actions are encountered in the cf file #O DontBlameSendmail=safe # default LDAP map specification # need to set this now before any LDAP maps are defined #O LDAPDefaultSpec=-h localhost ################## # local info # ################## # my LDAP cluster # need to set this before any LDAP lookups are done (including classes) #D{sendmailMTACluster}$m Cwlocalhost "w"クラスに"localhost"を入れる # file containing names of hosts for which we receive email Fw/etc/mail/local-host-names "w"クラスに"/etc/mail/local-host-names"の内容を入れる # my official domain name # ... define this only if sendmail cannot automatically determine your domain #Dj$w.Foo.COM # host/domain names ending with a token in class P are canonical CP. # "Smart" relay host (may be null) DS # operators that cannot be in local usernames (i.e., network indicators) CO @ % ! # a class with just dot (for identifying canonical names) C.. # a class with just a left bracket (for identifying domain literals) C[[ # Resolve map (to check if a host exists in check_mail) Kresolve host -a<OKR> -T<TEMP> C{ResOk}OKR "ResOk"クラスに"OKR"を入れる # Hosts for which relaying is permitted ($=R) FR-o /etc/mail/relay-domains "R"クラスに"/etc/mail/relay-domains"を入れる? # arithmetic map Karith arith # dequoting map Kdequote dequote # class E: names that should be exposed as from this host, even if we masquerade # class L: names that should be delivered locally, even if we have a relay # class M: domains that should be converted to $M # class N: domains that should not be converted to $M #CL root C{E}root "E"クラスに"root"を入れる # my name for error messages DnMAILER-DAEMON "n"マクロに"MAILER-DAEMON"を入れる CPREDIRECT "P"クラスに"REDIRECT"を入れる # Configuration version number DZ8.13.5 "Z"マクロに"8.13.5"を入れる ############### # Options # ############### # strip message body to 7 bits on input? O SevenBitInput=False "SevenBitInput"オプションに"False"を入れる # wait for alias file rebuild (default units: minutes) O AliasWait=10 # location of alias file O AliasFile=/etc/mail/aliases # minimum number of free blocks on filesystem O MinFreeBlocks=100 # substitution for space (blank) characters O BlankSub=. # avoid connecting to "expensive" mailers on initial submission? O HoldExpensive=False # default delivery mode O DeliveryMode=background # temporary file mode O TempFileMode=0600 # location of help file O HelpFile=/etc/mail/helpfile # deliver MIME-encapsulated error messages? O SendMimeErrors=True # Forward file search path O ForwardPath=$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward # open connection cache size O ConnectionCacheSize=2 # open connection cache timeout O ConnectionCacheTimeout=5m # use Errors-To: header? O UseErrorsTo=False # log level O LogLevel=9 # verify RHS in newaliases? O CheckAliases=False # default messages to old style headers if no special punctuation? O OldStyleHeaders=True # SMTP daemon options O DaemonPortOptions=Name=MTA O DaemonPortOptions=Port=587, Name=MSA, M=E # privacy flags O PrivacyOptions=authwarnings # queue directory O QueueDirectory=/var/spool/mqueue O Timeout.queuereturn=5d O Timeout.queuewarn=4h # queue up everything before forking? O SuperSafe=True # status file O StatusFile=/var/log/sendmail.st # SMTP initial login message (old $e macro) O SmtpGreetingMessage=$j Sendmail $v/$Z; $b # UNIX initial From header format (old $l macro) O UnixFromLine=From $g $d # delimiter (operator) characters (old $o macro) O OperatorChars=.:%@!^/[]+ ############################ # QUEUE GROUP DEFINITIONS # ############################ ########################### # Message precedences # ########################### Pfirst-class=0 Pspecial-delivery=100 Plist=-30 Pbulk=-60 Pjunk=-100 ##################### # Trusted users # ##################### # this is equivalent to setting class "t" #Ft/etc/mail/trusted-users Troot Tdaemon Tuucp ######################### # Format of headers # ######################### H?P?Return-Path: <$g> HReceived: $?sfrom $s $.$?_($?s$|from $.$_) $.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.) $.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version} (version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${ve rify})$.$?u for $u; $|; $.$b H?D?Resent-Date: $a H?D?Date: $a H?F?Resent-From: $?x$x <$g>$|$g$. H?F?From: $?x$x <$g>$|$g$. H?x?Full-Name: $x # HPosted-Date: $a # H?l?Received-Date: $b H?M?Resent-Message-Id: <$t.$i@$j> H?M?Message-Id: <$t.$i@$j>
# vi local-host-names point.plala.jp
# vi aliases # Basic system aliases -- these MUST be present. MAILER-DAEMON: postmaster postmaster: root # General redirections for pseudo accounts. bin: root daemon: root games: root ingres: root nobody: root system: root toor: root uucp: root # Well-known aliases. manager: root dumper: root operator: root # trap decode to catch security attacks decode: root # Person who should get root's mail root: ham # makemap hash aliases < aliases
# cd /etc/mail # vi access localhost.localdomain RELAY localhost RELAY 127.0.0.1 RELAY 192.168.0 RELAY # makemap hash access < access
Hosts for which relaying is permitted ($=R)
Domain table (adding domains)
Generics table (mapping outgoing addresses)
Mailer table (overriding domains)
Virtual user table (maps incoming users)
オプション | 意味 | 説明 |
-bm | background mail | メールを配送する、submit.cfを利用(デフォルト) |
-bd | background daemon | デーモンモードで起動し、25/tcpをListenする |
-bp | background queue | キューのリストを表示する(=mailq) |
-q[time] | queue | キューにあるメッセージを送信する timeを指定すると一定時間ごとに処理を繰り返す(単位にh,m,sを設定可能) |
V8 sendmailのバージョン T1143325192 キューが生成された時間 K1143451286 最後に処理された時間 N71 試行回数 P6336269 優先度 I116/131078/1486886 dfファイルのiノード MDeferred: Connection timed out with mail2.6996.jp キューに入った原因 Frs $_localhost $r $slocalhost ${daemon_flags} SMAILER-DAEMON MDeferred: Connection timed out with mail2.6996.jp rRFC822; root@ns.6996.jp RPF:<root@ns.6996.jp> H?P?Return-Path: <g> 以下ヘッダ情報 H??Received: from localhost (localhost) by ns.6996.jp (8.13.5/8.13.5) id k2PM8KM5053217; Sun, 26 Mar 2006 07:19:52 +0900 (JST) H?D?Date: Sun, 26 Mar 2006 07:19:52 +0900 (JST) H?F?From: foo@6996.jp H?M?Message-Id: <200603252219.k2PM8KM5053217@mail.6996.jp> H??To: <bar@6996.jp> H??MIME-Version: 1.0 H??Content-Type: text/plain; charset="ISO-2022-JP" H??Subject: mail subject . qfファイルのEOFマーク