sendmail ローカル配送

$ sendmail -bt
> $=w

> /quit

$=w is a class that contains all the names sendmail considers local. These include those listed in /etc/mail/local-host-names and those in /etc/hosts that sendmail considers local after examining the machine's network interfaces.

https://serverfault.com/questions/495600/why-sendmail-is-accepting-mails-for-hostname-not-present-in-local-host-names-fil

まずはstatic配送=mailertable
sendmailは配送先判定で真っ先にmailertableを見る
全丸投げstatic=LOCALRELAY
spool(localuser)がいない→LOCALRELAY
ドラえもんstatic=SMART_HOST
localとstaticで配送先がわからなかったら→SMART_HOST
SmartHost設定がない=MX配送

http://www.soi.wide.ad.jp/class/20040031/slides/03/42.html

9.2.1 Determine the Local Canonical Name

The local hostname is then given to the gethostbyname routine to obtain the canonical name for the local host. That same routine also returns any aliases (other names for the local host). Note that, if you defined NETINET6 (NET...) when compiling (for IPv6 support), you must use getipnodebyname(3) in place of gethostbyname(3).

The short (host) name found by gethostbyname(3) or getipnodebyname(3) is assigned as the value of the $w sendmail macro. The short name, the canonical name, and any aliases are added to the class $=w.

If the DontProbeInterfaces option (DontProbeInterfaces) is undefined, or set to false, the address and hostname associated with each interface are also added to the class $=w (see Section 9.2.2).

https://docstore.mik.ua/orelly/other/Sendmail_3rd/1565928393_sendmail3-chp-9-sect-2.html

https://serverfault.com/questions/65365/disable-local-delivery-in-sendmail

DontProbeInterfaces

https://serverfault.com/questions/536051/how-do-i-configure-sendmail-to-send-mail-via-mx-record-and-not-to-localhost

DontProbeInterfaces
m4 名: confDONT_PROBE_INTERFACES
引数: true または false。デフォルトは false。

このオプションを true に設定すると、sendmail は、すべてのローカルインタフェースの名前およびアドレスをクラス w ($=w) に挿入しません。したがって、これらのアドレスのサポートを同時に含める必要があります (たとえば、mailertable エントリに)。そうしないと、これらのインタフェースアドレスへのメールは構成エラーで戻されます。ただし、このオプションを設定すると、起動が速くなります。

https://docs.oracle.com/cd/E19455-01/816-0113/6m6kenfm7/index.html

define(`confDONT_PROBE_INTERFACES',true)dnl
 インターフェイスに付いているアドレスの逆引きをしないようにする
http://blog.livedoor.jp/nor_x/archives/22808506.html

mailertable

my.domain esmtp:host.my.domain

右半分は "mailer:host" のようにメイラ: 機械名の組にします。 ここで、 "mailer" の部分はメイラの 設定用シンボル名 (すなわち、sendmail.cf ファイルの {M} 行) です。 "host" 部分はメイラに渡されるホスト名となります。 ドメインベースの一致方法 (すなわち、ドットに続く一致方法) では、 ホスト名のワイルドカード部分を補完するために "%1" を使用します。 たとえば、最初に挙げた例の一番目の行は、 "anything.my.domain" 宛てのすべてのメールを同じホスト名に送信しますが、 その際には (おそらく実験的な) メイラ xnetを使用しています。

http://www.ki.nu/software/cf/mailertables.html

mailertable は smarthost より優先される。
smarthost設定がある場合に特定ドメインに対し smarthost を使用しない設定。

my.domain smtp:my.domain