1<html> 2<head><title>smfi_replacebody</title></head> 3<body> 4<h1>smfi_replacebody</h1> 5 6<table border="0" cellspacing=4 cellpadding=4> 7<!---------- Synopsis -----------> 8<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> 9<pre> 10#include <libmilter/mfapi.h> 11int smfi_replacebody( 12 SMFICTX *ctx, 13 unsigned char *bodyp, 14 int bodylen 15); 16</pre> 17Replace message-body data. 18</td></tr> 19 20<!----------- Description ----------> 21<tr><th valign="top" align=left>DESCRIPTION</th><td> 22<table border="1" cellspacing=1 cellpadding=4> 23<tr align="left" valign=top> 24<th width="80">Called When</th> 25<td>Called only from <a href="xxfi_eom.html">xxfi_eom</a>. smfi_replacebody may be called more than once.</td> 26</tr> 27<tr align="left" valign=top> 28<th width="80">Effects</th> 29<td>smfi_replacebody replaces the body of the current message. If called 30more than once, subsequent calls result in data being appended to the new 31body. 32</td> 33</tr> 34</table> 35 36<!----------- Arguments ----------> 37<tr><th valign="top" align=left>ARGUMENTS</th><td> 38 <table border="1" cellspacing=0> 39 <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> 40 <tr valign="top"><td>ctx</td> 41 <td>Opaque context structure. 42 </td></tr> 43 <tr valign="top"><td>bodyp</td> 44 <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. 45 </td></tr> 46 <tr valign="top"><td>bodylen</td> 47 <td>The number of data bytes pointed to by bodyp. 48 </td></tr> 49 </table> 50</td></tr> 51 52<!----------- Return values ----------> 53<tr> 54<th valign="top" align=left>RETURN VALUES</th> 55 56<td>smfi_replacebody fails and returns MI_FAILURE if: 57<ul> 58 <li>bodyp == NULL and bodylen > 0. 59 <li>Changing the body in the current connection state is invalid. 60 <li>A network error occurs. 61 <li>SMFIF_CHGBODY was not set when <a href="smfi_register.html">smfi_register</a> was called. 62</ul> 63Otherwise, it will return MI_SUCCESS. 64</td> 65</tr> 66 67<!----------- Notes ----------> 68<tr align="left" valign=top> 69<th>NOTES</th> 70<td> 71<ul> 72 <li>Since the message body may be very large, setting SMFIF_CHGBODY may significantly affect filter performance. 73 <li>If a filter sets SMFIF_CHGBODY but does not call smfi_replacebody, the original body remains unchanged. 74 <li>For smfi_replacebody, filter order is important. <b>Later filters will see the new body contents created by earlier ones.</b> 75</ul> 76</td> 77</tr> 78 79</table> 80 81<hr size="1"> 82<font size="-1"> 83Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. 84All rights reserved. 85<br> 86By using this file, you agree to the terms and conditions set 87forth in the <a href="LICENSE.txt">LICENSE</a>. 88</font> 89</body> 90</html> 91