HP-UX Reference (11i v3 07/02) - 3 Library Functions N-Z (vol 7)

s
smfi_replacebody(3N) smfi_replacebody(3N)
NAME
smfi_replacebody() - replaces the data in the sendmail message body
SYNOPSIS
#include <libmilter/mfapi.h>
int smfi_replacebody(
SMFICTX *
ctx,
unsigned char *
bodyp,
int
bodylen
);
PARAMETERS
ctx Specifies the opaque context structure.
bodyp Specifies a pointer to the start of the new body data, which does not have to be null-terminated.
If bodyp is set to NULL, the length of the body is considered to be 0 (zero). The body data must
be in CR or LF form.
bodylen Specifies the number of data bytes pointed by bodyp.
DESCRIPTION
smfi_replacebody()
replaces the body of the current message. smfi_replacebody() can be
called only from the
xxfi_eom() routine and can be called more than once. When
smfi_replacebody()
is called more than once, the subsequent smfi_replacebody() calls
append data to the new body of the message.
Notes
As the message body may be very large, setting
SMFIF_CHGBODY
may significantly affect filter perfor-
mance.
If a filter sets
SMFIF_CHGBODY
but does not call smfi_replacebody(), the original body remains
unchanged.
The filter order is important for the
smfi_replacebody()
routine. Filters placed later in the
sequence will observe the changes
RETURN VALUE
smfi_replacebody fails and returns
MI_FAILURE due to the following reasons:
The value of bodyp is equal to NULL and the value of bodylen is greater than 0.
Changing the body in the current connection state is invalid.
Network error occurs.
The
SMFIF_CHGBODY is not set when the
smfi_register() function is called.
AUTHOR
smfi_replacebody()
was developed by the Sendmail Inc.
SEE ALSO
smfi_chgheader(3N), smfi_insheader(3N), smfi_addrcpt(3N), smfi_addheader(3N), smfi_delrcpt(3N).
Sendmail 8.13.3 Programmer’s Guide on
docs.hp.com .
HP-UX 11i Version 3: February 2007 1 Hewlett-Packard Company 447