2 <head><title>smfi_replacebody</title></head>
5 $Id: smfi_replacebody.html,v 1.13 2003/03/05 19:57:54 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=150>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 Sendmail, Inc. and its suppliers.
89 By using this file, you agree to the terms and conditions set