${dsn_envid}

The DSN ENVID= value V8.10 and later

When sendmail receives a message via SMTP, it can also receive an envelope identifier as part of the envelope sender declaration:

MAIL From:<address> ENVID=envelopeID

Here, the MAIL From: command specifies the envelope sender’s address. Following that address is the keyword ENVID= followed by the envelope identifier. Whenever this identifier is presented and accepted, sendmail will place a copy of the identifier into this ${dsn_envid} macro.

A badly formed identifier (one that is not properly xtext-encoded, Macro Xtext Translations on page 795) will be rejected with:

501 5.5.4 Syntax error in ENVID parameter value

For a more complete explanation of the ENVID= keyword, see the ${envid} macro in ${envid} on page 823. Note that this ${dsn_envid} macro is set when mail is received via SMTP and when the -V command-line switch (-V on page 249) is used to set the envelope identifier. By contrast, the ${envid} macro is set only during delivery.

Note that the envelope ID described here is different from the message ID (as used with the Message-Id: header, Message-ID: on page 1159) and different from the queue ID (which identifies a queued file, The Queue Identifier on page 396).

One possible use for this ${dsn_envid} macro might be to syslog the envelope identifier. Another possible use might be to include a header showing the envelope identifier. Consider these mc configuration lines that do the latter:

LOCAL_CONFIG H?${dsn_envid}?X-DSN-ENVID: ${dsn_envid} ...

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.