Milter smfi_addrcpt_par()

Add envelope recipient with ESMTP arguments V8.14 and later

The smfi_addrcpt_par() Milter library routine is used just like the smfi_addrcpt() routine earlier, with two differences. First, instead of specifying SMFIF_ADDRCPT, you specify the SMFIF_ADDRCPT_PAR flag in the flags portion of the smfiDesc structure:

struct smfiDesc smfilter =
{
    ...
    SMFIF_ADDRCPT_PAR,                 /* flags */
    ...

Failure to include this flag causes smfi_addrcpt_par() to return MI_FAILURE every time it is called.

Like smfi_addrcpt(), this smfi_addrcpt_par() routine may be called only from within an xxfi_eom() function you write (Milter xxfi_eom() on page 1215). It is called with an additional argument:

ret = smfi_addrcpt_par(ctx, addr, args);

Here, ctx is the common context pointer that was passed to your xxfi_eom() function. The addr is the email address of the recipient you wish to add. The additional args specifies any ESMTP envelope recipient arguments you wish to add. For example, the following (see ${dsn_notify} on page 821 for an explanation) specifies that the envelope recipient should not be notified of delivery failure or delivery delay:

"NOTIFY=NEVER"

No check is made by sendmail to ensure that the ESMTP extension you add is legal. Be aware that if you make a mistake, delivery may fail:

RCPT To:<user@example.com> NOTIFY=NONE
501 5.5.4 Bad argument "NONE"  to NOTIFY

The sendmail program checks only to be sure the argument is properly formed.

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.