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 performance.
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.
The
SMFIF_CHGBODY
is not set when the
smfi_register()
function is called.
AUTHOR
smfi_replacebody()
was developed by the Sendmail Inc.