2 <HEAD><TITLE>smfi_replacebody</TITLE></HEAD>
5 $Id: smfi_replacebody.html,v 1.16 2013-11-22 20:51:39 ca Exp $
7 <H1>smfi_replacebody</H1>
9 <TABLE border="0" cellspacing=4 cellpadding=4>
10 <!---------- Synopsis ----------->
11 <TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD>
13 #include <libmilter/mfapi.h>
20 Replace message-body data.
23 <!----------- Description ---------->
24 <TR><TH valign="top" align=left>DESCRIPTION</TH><TD>
25 <TABLE border="1" cellspacing=1 cellpadding=4>
26 <TR align="left" valign=top>
27 <TH width="80">Called When</TH>
28 <TD>Called only from <A href="xxfi_eom.html">xxfi_eom</A>. smfi_replacebody may be called more than once.</TD>
30 <TR align="left" valign=top>
31 <TH width="80">Effects</TH>
32 <TD>smfi_replacebody replaces the body of the current message. If called
33 more than once, subsequent calls result in data being appended to the new
40 <!----------- Arguments ---------->
41 <TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
42 <TABLE border="1" cellspacing=0>
43 <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
44 <TR valign="top"><TD>ctx</TD>
45 <TD>Opaque context structure.
47 <TR valign="top"><TD>bodyp</TD>
48 <TD>A pointer to the start of the new body data, which does not have to be null-terminated. If bodyp is NULL, it is treated as having length == 0. Body data should be in CR/LF form.
50 <TR valign="top"><TD>bodylen</TD>
51 <TD>The number of data bytes pointed to by bodyp.
56 <!----------- Return values ---------->
58 <TH valign="top" align=left>RETURN VALUES</TH>
60 <TD>smfi_replacebody fails and returns MI_FAILURE if:
62 <LI>bodyp == NULL and bodylen > 0.
63 <LI>Changing the body in the current connection state is invalid.
64 <LI>A network error occurs.
65 <LI><A HREF="smfi_register.html#SMFIF_CHGBODY">SMFIF_CHGBODY</A> is not set.
67 Otherwise, it will return MI_SUCCESS.
71 <!----------- Notes ---------->
72 <TR align="left" valign=top>
76 <LI>Since the message body may be very large, calling smfi_replacebody may significantly affect filter performance.
77 <LI>If a filter sets SMFIF_CHGBODY but does not call smfi_replacebody, the original body remains unchanged.
78 <LI>For smfi_replacebody, filter order is important. <B>Later filters will see the new body contents created by earlier ones.</B>
79 <LI>A filter which calls smfi_replacebody must have set the
80 <A HREF="smfi_register.html#SMFIF_CHGBODY">SMFIF_CHGBODY</A> flag.
89 Copyright (c) 2000-2001, 2003 Proofpoint, Inc. and its suppliers.
92 By using this file, you agree to the terms and conditions set