Sendmail 8.13.3 Programmer's Guide
Table Of Contents

Milter APIs
Message Modification APIs
Chapter 226
int smfi_addheader(
SMFICTX *ctx,
char *headerf,
char *headerv
);
Following are some points to consider regarding smfi_addheader():
• smfi_addheader() does not change existing headers of a message.
To change the current value of a header, use smfi_chgheader().
• A filter which calls smfi_addheader() must set the SMFIF_ADDHDRS
flag in the smfiDesc_str passed to the smfi_register() API.
•Forsmfi_addheader(), the order of the filter program is important.
Later filters will observe the header changes made by earlier filters.
• The filter program does not check the name and the value of the
header for standards compliance. However, each line of the header
must be less than 2048 characters. If you require longer headers, use
multiline headers. To make a multiline header, insert a LF (ASCII
0x0 character or \n in C language) followed by at least a white space
character, such as a space (ASCII 9x20) or a tab (ASCII 0x09 or \t in
C language) character.
You must not precede the LF with a CR (ASCII 0x0d character)
because the MTA adds the CR automatically. You must ensure that
you do not violate any standards.
Arguments
You must call smfi_addheader() with the following arguments:
ctx Specifies an opaque context structure.
headerf Specifies the header name, which is a non-NULL
string.
headerv Specifies the header value. headerv is a non-NULL,
null-terminated string. headerv can also be an empty
string.
Return Values
smfi_addheader() fails because of the following reasons and returns
MI_FAILURE: