Previous Section Next Section

${if_addr_out}

The IP address of the send interface V8.12 and above

The sendmail program can send SMTP email over one or more network interfaces, where each interface can have one or more addresses associated with it. When sendmail sends a network email message, it begins by connecting to a host on the network. Once that connection has been made (once the other site accepts the connection), sendmail records the address associated with the interface over which it made that outbound connection in the ${if_addr_out} macro.

If the connection uses an interface with an IPv4 address, that IP number is stored as, for example:

123.45.67.8

If the connection uses an interface with an IPv6 address, the address stored is prefixed with a literal IPv6:. For example:

IPv6:3ffe:8050:201:1860:42::1

If the connection uses the loopback interface, the value stored in ${if_addr_out} is 127.0.0.1 for IPv4, and IPv6:::1 for IPv6.

${if_addr_out} is available for use in rule sets, and can be useful for rejecting spam or restricting connections to particular addresses. Note that a $& prefix is necessary when you reference this macro in rules (that is, use $&{if_addr_out}, not ${if_addr_out}).

${if_addr_out} is transient. If it is defined in the configuration file or in the command line, that definition can be ignored by sendmail.

    Previous Section Next Section