Message modification functions

The message modification functions change the message content and attributes. The functions are called only in by the xxfi_eom function. Message modification functions can invoke additional communication with the mail transfer agent (MTA). These functions return either the MI_SUCCESS or MI_FAILURE value to indicate the status of the operation.

Note: Message data (senders, recipients, headers, and body chunks) that are passed to the message modification functions in the parameters is copied and do not need to be preserved (allocated memory can be freed).

To call a message modification function, the filter must set the appropriate flag in the description that is passed to the smfi_register function. If the flag is not set, MTA treats the call to the function as a failure of the filter, and terminates the connection.

Note: The status returned by the function indicates whether the message filter was successfully sent to the MTA. The status does not indicate whether the MTA performed the requested operation. For example, the smfi_header function, when called with an illegal header name, returns the MI_SUCCESS flag even though the MTA can later decline to add the illegal header.
Table 1. Mod functions
Item Description function
smfi_addheader The smfi_addheader function adds a header to the message. SMFIF_ADDHDRS
smfi_chgheader The smfi_chgheader function modifies or deletes a header. SMFIF_CHGHDRS
smfi_insheader The smfi_insheader function inserts a header into the message. SMFIF_ADDHDRS
smfi_chgfrom The smfi_chgfrom function modifies the envelope sender address. SMFIF_CHGFROM
smfi_addrcpt The smfi_addrcpt function adds a recipient to the envelope. SMFIF_ADDRCPT
smfi_addrcpt_par The smfi_addrcpt_par function adds a recipient including extended simple mail transfer protocol (ESMTP) parameter to the envelope. SMFIF_ADDRCPT_PAR
smfi_delrcpt The smfi_delrcpt function deletes a recipient from the envelope. SMFIF_DELRCPT
smfi_replacebody The smfi_replacebody function replaces the body of the message. SMFIF_CHGBODY