Sendmail 8.13.3 Programmer's Guide
Table Of Contents

Milter APIs
Message Modification APIs
Chapter 2 31
...
ret = smfi_insheader(ctx, 0, "First", "See me?");
The smfi_addrcpt() API
You can use the smfi_addrcpt() API to add a recipient for the current
message. You can call smfi_addrcpt() only from the xxfi_eom()
callback.
The declaration for smfi_addrcpt() is as follows:
#include <libmilter/mfapi.h>
int smfi_addrcpt(
SMFICTX *ctx,
char *rcpt
);
A filter program that calls smfi_addrcpt() must set the SMFIF_ADDRCPT
flag in the smfiDesc_str structure passed to smfi_register().
Arguments
You must call smfi_addrcpt() with the following arguments:
ctx Specifies an opaque context structure.
rcpt Specifies the new address of the recipient.
Return Values
smfi_addrcpt() fails because of the following reasons and returns
MI_FAILURE:
• The rcpt value is NULL.
• Adding recipients in the current connection state is invalid.
• Network error occurs.
• The SMFIF_ADDRCPT flag is not set when the smfi_register()
routine is called.
The smfi_delrcpt() API
You can use the smfi_delrctp() API to delete a recipient from the
envelope of the current message. You can call smfi_delrcpt() only from
the xxfi_eom() callback.