# smfi_addheader

SYNOPSIS |
    #include <libmilter/mfapi.h>
    int smfi_addheader(
    	SMFICTX *ctx,
    	char *headerf,
    	char *headerv
    );
Add a header to the current message.
DESCRIPTION |
Called When | Called only from xxfi_eom.
Effects | Adds a header to the current message.
ARGUMENTS |
Argument | Description
--- | ---
ctx | Opaque context structure.
headerf | The header name, a non-NULL, null-terminated string.
headerv | The header value to be added, a non-NULL, null-terminated string. This may be the empty string.
RETURN VALUES | smfi_addheader returns MI_FAILURE if: headerf or headerv is NULL. Adding headers in the current connection state is invalid. Memory allocation fails. A network error occurs. SMFIF_ADDHDRS was not set when smfi_register was called. Otherwise, it returns MI_SUCCESS.
NOTES | smfi_addheader does not change a message's existing headers. To change a header's current value, use smfi_chgheader. A filter which calls smfi_addheader must have set the SMFIF_ADDHDRS flag in the smfiDesc_str passed to smfi_register. For smfi_chgheader, filter order is important. Later filters will see the header changes made by earlier ones. Neither the name nor the value of the header is checked for standards compliance. However, each line of the header must be under 2048 characters and should be under 998 characters. If longer headers are needed, make them multiline. It is the filter writer's responsibility to ensure that no standards are violated.

Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the LICENSE.