${dsn_notify}

The DSN NOTIFY= value V8.10 and later

When sendmail receives a message via SMTP, it can also receive information about how it should handle a bounce. That information is included as part of an sender declaration:

RCPT To:<address> NOTIFY=how

Here, the SMTP RCPT To: command specifies an envelope recipient’s address. Following that address is the keyword NOTIFY=, followed by one or more of four possible keywords: success, failure, never, and delay (see -N on page 244 for a more complete description of NOTIFY= and its keywords).

The keywords specified are made the value of the ${dsn_notify} macro. If no NOTIFY= is specified, the ${dsn_notify} macro is undefined (NULL). If multiple RCPT To: commands are issued during a single SMTP session, each command will update the ${dsn_notify} macro in turn, overwriting the prior RCPT To: command’s value.

The ${dsn_notify} macro is also given a value if the -N command-line switch (-N on page 244) is used to set the NOTIFY= keyword during mail submission.

One use for this ${dsn_notify} macro might be to log every instance when notification of success is requested. One way to do this is with a syslog map in the check_compat rule set:

LOCAL_CONFIG
Klog syslog -D -LNOTICE

LOCAL_RULESETS
Scheck_compat
R$*                     $: $&{dsn_notify} $| $1
Rsuccess $| $* $| $*    $: $(log dsn=success, recipient=$2, sender=$1 $)

Here, we declare a syslog map (syslog on page 939) with the K configuration command (The K Configuration Command on page 882) in the LOCAL_CONFIG part ...

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.