''${if_addr}'' '''


The IP address of the receive interface V8.10 and above

When sendmail first starts up as a listening daemon, it binds to a port on all interfaces or on a particular interface (See this section). It then waits to accept connections from hosts or programs that wish to route mail through it. Those hosts or programs are called "clients," and when they initiate a connection, it is called a client connection.

When a client connects to the local machine, sendmail records the local IP address of the connected-to interface in this ${if_addr} macro. If the address is an IPv4 address, the value stored is just the address:

But if the address is an IPv6 address, the address stored is prefixed with a literal IPv6:. For example:


If the connection was made on the loopback interface, the ${if_addr} macro is undefined.

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

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

    Part I: Build and Install
    Part II: Administration
    Part III: The Configuration File
    Chapter 21. The D (Define a Macro) Configuration Command
    Chapter 24. The O (Options) Configuration Command