${deliveryMode}

The current delivery mode V8.9 and later

The sendmail program can run in any of several modes, each of which determines its behavior. When sendmail first starts to run, it sets its mode based on the setting of its DeliveryMode option (DeliveryMode on page 1004) and places the character representing that mode into this ${deliveryMode} macro. If sendmail is run with the -odi command-line switch, for example, this ${deliveryMode} macro is given the value i. Once the sendmail program is running, its delivery mode can be changed for a variety of reasons. When it starts to process the queue, for example, the mode is changed to d (for deliver).

One use for the ${deliveryMode} macro can be seen in the standard configuration file:

SBasic_check_relay
# check for deferred delivery mode
R$*                     $: < $&{deliveryMode} > $1
R< d > $*               $@ deferred

Here, the Basic_check_relay rule set is called to determine whether mail from the connecting host should be accepted. Because the hostname of the connecting host is not looked up with DNS when in deferred mode, many necessary policy checks should not be performed (such as access database lookups) because the true hostname might not be known. These rules cause those checks to be skipped when in deferred mode. Later, when the message is processed from the queue, the hostname will be looked up with DNS.

Because it is unlikely that the sendmail daemon will be run with DeliveryMode=d set in the configuration file, there is no need to prefix ${deliveryMode} ...

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.