${dsn_ret}

The DSN RET= 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 envelope-sender declaration:

RCPT To:<address> NOTIFY=how

Here, the RCPT To: command specifies an envelope recipient’s address. Following that address is the keyword RET=, followed by one of two possible keywords: full or hdrs (see -R on page 247 for a more complete description of RET= and its keywords). The full says to return the entire message, header and body, if the message bounces. The hdrs says to return only the header if the message bounces.

When a RET= value is received as part of an SMTP transaction, sendmail saves a copy of the keywords specified in the ${dsn_ret} macro. If multiple RCPT To: commands are issued during a single SMTP session, and each command lists a RET= value, each command will update the ${dsn_ret} macro in turn, overwriting the prior RCPT To: command’s value.

The ${dsn_ret} macro is also given a value if the -R command-line switch (-R on page 247) is used to set the RET= value during mail submission.

For two examples of how this macro might be used in rule sets, see the ${dsn_notify} and ${dsn_envid} macros explained earlier.

${dsn_ret} is transient. If it is defined in the configuration file or in the command line, that definition can be ignored by sendmail. Note that a $& prefix is necessary when you reference this macro in rules (that is, use $&{dsn_ret} ...

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.