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
39 <!----------- Arguments ---------->
40 <TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
41 <TABLE border="1" cellspacing=0>
42 <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
43 <TR valign="top"><TD>ctx</TD>
44 <TD>Opaque context structure.
46 <TR valign="top"><TD>bodyp</TD>
47 <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.
49 <TR valign="top"><TD>bodylen</TD>
50 <TD>The number of data bytes pointed to by bodyp.
55 <!----------- Return values ---------->
57 <TH valign="top" align=left>RETURN VALUES</TH>
59 <TD>smfi_replacebody fails and returns MI_FAILURE if:
61 <LI>bodyp == NULL and bodylen > 0.
62 <LI>Changing the body in the current connection state is invalid.
63 <LI>A network error occurs.
64 <LI>SMFIF_CHGBODY was not set when <A href="smfi_register.html">smfi_register</A> was called.
66 Otherwise, it will return MI_SUCCESS.
70 <!----------- Notes ---------->
71 <TR align="left" valign=top>
75 <LI>Since the message body may be very large, setting SMFIF_CHGBODY may significantly affect filter performance.
76 <LI>If a filter sets SMFIF_CHGBODY but does not call smfi_replacebody, the original body remains unchanged.
77 <LI>For smfi_replacebody, filter order is important. <B>Later filters will see the new body contents created by earlier ones.</B>
86 Copyright (c) 2000-2001, 2003 Proofpoint, Inc. and its suppliers.
89 By using this file, you agree to the terms and conditions set