${if_family}

The network family of the receive interface V8.10 and later

When sendmail first starts up as a listening daemon, it binds to a port on all interfaces or on a particular interface (DaemonPortOptions=Addr= on page 994). 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 the ${if_addr} macro (as described earlier) and the family of that address in this ${if_family} macro. The family is a text representation of the integer value that represents the family, as defined in sys/socket.h. If the connection is from the local host, the ${if_family} macro is undefined. A value of 2, for example, could represent the AF_INET family.

${if_family} 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_family}, not ${if_family}).

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

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.