1<html>
2<head><title>smfi_replacebody</title></head>
3<body>
4<!--
5$Id: smfi_replacebody.html,v 1.13 2003/03/05 19:57:54 ca Exp $
6-->
7<h1>smfi_replacebody</h1>
8
9<table border="0" cellspacing=4 cellpadding=4>
10<!---------- Synopsis ----------->
11<tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
12<pre>
13#include &lt;libmilter/mfapi.h&gt;
14int smfi_replacebody(
15	SMFICTX *ctx,
16	unsigned char *bodyp,
17	int bodylen
18);
19</pre>
20Replace message-body data.
21</td></tr>
22
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>
29</tr>
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
33more than once, subsequent calls result in data being appended to the new
34body.
35</td>
36</tr>
37</table>
38
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.
45	</td></tr>
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.
48	</td></tr>
49    <tr valign="top"><td>bodylen</td>
50	<td>The number of data bytes pointed to by bodyp.
51	</td></tr>
52    </table>
53</td></tr>
54
55<!----------- Return values ---------->
56<tr>
57<th valign="top" align=left>RETURN VALUES</th>
58
59<td>smfi_replacebody fails and returns MI_FAILURE if:
60<ul>
61    <li>bodyp == NULL and bodylen &gt; 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.
65</ul>
66Otherwise, it will return MI_SUCCESS.
67</td>
68</tr>
69
70<!----------- Notes ---------->
71<tr align="left" valign=top>
72<th>NOTES</th>
73<td>
74<ul>
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>
78</ul>
79</td>
80</tr>
81
82</table>
83
84<hr size="1">
85<font size="-1">
86Copyright (c) 2000-2001, 2003 Sendmail, Inc. and its suppliers.
87All rights reserved.
88<br>
89By using this file, you agree to the terms and conditions set
90forth in the LICENSE.
91</font>
92</body>
93</html>
94