Sendmail 8.13.3 Programmer's Guide
Table Of Contents

Milter APIs
Message Modification APIs
Chapter 230
characters. If you need longer headers, use a multiline header. To
make a multiline header, insert a LF (an ASCII 0x0a character, or \n
in C) followed by at least one white space character, such as, a space
(an ASCII 0x20 character) or tab (an ASCII 0x09 character, or \n in
C).
You must precede the LF with a CR (an ASCII 0x0d character)
because the MTA adds this automatically. You must ensure that you
do not violate any standards.
Arguments
You must call smfi_insheader() with the following arguments:
ctx Specifies an opaque context structure.
hdridx Specifies the location in the internal header list where
you must insert this header. If the value is set to 0,
hdridx is the first header.
headerf Specifies the header name, which is a non-NULL,
null-terminated string.
headerv Specifies the header value, which is a non-NULL,
null-terminated string. You can set headerv to an
empty argument.
Return Values
smfi_insheader() fails because of the following reasons and returns
MI_FAILURE:
• The headerf value or headerv value is NULL.
• Adding headers in the current connection state is invalid.
• Memory allocation fails.
• Network error occurs.
• SMFIF_ADDHDRS is not set when the smfi_register() is called.
smfi_insheader() returns MI_SUCCESS on success.
Example
Following is an example of smfi_insheader():
int ret;
SMFICTX *ctx;