xref: /freebsd/contrib/sendmail/libmilter/docs/smfi_replacebody.html (revision e92d3f3ffe83a6ed7eaafac70da9cf4fafe13243)
140266059SGregory Neil Shapiro<html>
240266059SGregory Neil Shapiro<head><title>smfi_replacebody</title></head>
340266059SGregory Neil Shapiro<body>
4e92d3f3fSGregory Neil Shapiro<!--
5e92d3f3fSGregory Neil Shapiro$Id: smfi_replacebody.html,v 1.13 2003/03/05 19:57:54 ca Exp $
6e92d3f3fSGregory Neil Shapiro-->
740266059SGregory Neil Shapiro<h1>smfi_replacebody</h1>
840266059SGregory Neil Shapiro
940266059SGregory Neil Shapiro<table border="0" cellspacing=4 cellpadding=4>
1040266059SGregory Neil Shapiro<!---------- Synopsis ----------->
1140266059SGregory Neil Shapiro<tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
1240266059SGregory Neil Shapiro<pre>
1340266059SGregory Neil Shapiro#include &lt;libmilter/mfapi.h&gt;
1440266059SGregory Neil Shapiroint smfi_replacebody(
1540266059SGregory Neil Shapiro	SMFICTX *ctx,
1640266059SGregory Neil Shapiro	unsigned char *bodyp,
1740266059SGregory Neil Shapiro	int bodylen
1840266059SGregory Neil Shapiro);
1940266059SGregory Neil Shapiro</pre>
2040266059SGregory Neil ShapiroReplace message-body data.
2140266059SGregory Neil Shapiro</td></tr>
2240266059SGregory Neil Shapiro
2340266059SGregory Neil Shapiro<!----------- Description ---------->
2440266059SGregory Neil Shapiro<tr><th valign="top" align=left>DESCRIPTION</th><td>
2540266059SGregory Neil Shapiro<table border="1" cellspacing=1 cellpadding=4>
2640266059SGregory Neil Shapiro<tr align="left" valign=top>
2740266059SGregory Neil Shapiro<th width="80">Called When</th>
2840266059SGregory Neil Shapiro<td>Called only from <a href="xxfi_eom.html">xxfi_eom</a>.  smfi_replacebody may be called more than once.</td>
2940266059SGregory Neil Shapiro</tr>
3040266059SGregory Neil Shapiro<tr align="left" valign=top>
3140266059SGregory Neil Shapiro<th width="80">Effects</th>
3240266059SGregory Neil Shapiro<td>smfi_replacebody replaces the body of the current message.  If called
3340266059SGregory Neil Shapiromore than once, subsequent calls result in data being appended to the new
3440266059SGregory Neil Shapirobody.
3540266059SGregory Neil Shapiro</td>
3640266059SGregory Neil Shapiro</tr>
3740266059SGregory Neil Shapiro</table>
3840266059SGregory Neil Shapiro
3940266059SGregory Neil Shapiro<!----------- Arguments ---------->
4040266059SGregory Neil Shapiro<tr><th valign="top" align=left>ARGUMENTS</th><td>
4140266059SGregory Neil Shapiro    <table border="1" cellspacing=0>
4240266059SGregory Neil Shapiro    <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr>
4340266059SGregory Neil Shapiro    <tr valign="top"><td>ctx</td>
4440266059SGregory Neil Shapiro	<td>Opaque context structure.
4540266059SGregory Neil Shapiro	</td></tr>
4640266059SGregory Neil Shapiro    <tr valign="top"><td>bodyp</td>
4740266059SGregory Neil Shapiro	<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.
4840266059SGregory Neil Shapiro	</td></tr>
4940266059SGregory Neil Shapiro    <tr valign="top"><td>bodylen</td>
5040266059SGregory Neil Shapiro	<td>The number of data bytes pointed to by bodyp.
5140266059SGregory Neil Shapiro	</td></tr>
5240266059SGregory Neil Shapiro    </table>
5340266059SGregory Neil Shapiro</td></tr>
5440266059SGregory Neil Shapiro
5540266059SGregory Neil Shapiro<!----------- Return values ---------->
5640266059SGregory Neil Shapiro<tr>
5740266059SGregory Neil Shapiro<th valign="top" align=left>RETURN VALUES</th>
5840266059SGregory Neil Shapiro
5940266059SGregory Neil Shapiro<td>smfi_replacebody fails and returns MI_FAILURE if:
6040266059SGregory Neil Shapiro<ul>
6140266059SGregory Neil Shapiro    <li>bodyp == NULL and bodylen &gt; 0.
6240266059SGregory Neil Shapiro    <li>Changing the body in the current connection state is invalid.
6340266059SGregory Neil Shapiro    <li>A network error occurs.
6440266059SGregory Neil Shapiro    <li>SMFIF_CHGBODY was not set when <a href="smfi_register.html">smfi_register</a> was called.
6540266059SGregory Neil Shapiro</ul>
6640266059SGregory Neil ShapiroOtherwise, it will return MI_SUCCESS.
6740266059SGregory Neil Shapiro</td>
6840266059SGregory Neil Shapiro</tr>
6940266059SGregory Neil Shapiro
7040266059SGregory Neil Shapiro<!----------- Notes ---------->
7140266059SGregory Neil Shapiro<tr align="left" valign=top>
7240266059SGregory Neil Shapiro<th>NOTES</th>
7340266059SGregory Neil Shapiro<td>
7440266059SGregory Neil Shapiro<ul>
7540266059SGregory Neil Shapiro    <li>Since the message body may be very large, setting SMFIF_CHGBODY may significantly affect filter performance.
7640266059SGregory Neil Shapiro    <li>If a filter sets SMFIF_CHGBODY but does not call smfi_replacebody, the original body remains unchanged.
7740266059SGregory Neil Shapiro    <li>For smfi_replacebody, filter order is important.  <b>Later filters will see the new body contents created by earlier ones.</b>
7840266059SGregory Neil Shapiro</ul>
7940266059SGregory Neil Shapiro</td>
8040266059SGregory Neil Shapiro</tr>
8140266059SGregory Neil Shapiro
8240266059SGregory Neil Shapiro</table>
8340266059SGregory Neil Shapiro
8440266059SGregory Neil Shapiro<hr size="1">
8540266059SGregory Neil Shapiro<font size="-1">
865ef517c0SGregory Neil ShapiroCopyright (c) 2000-2001, 2003 Sendmail, Inc. and its suppliers.
8740266059SGregory Neil ShapiroAll rights reserved.
8840266059SGregory Neil Shapiro<br>
8940266059SGregory Neil ShapiroBy using this file, you agree to the terms and conditions set
905ef517c0SGregory Neil Shapiroforth in the LICENSE.
9140266059SGregory Neil Shapiro</font>
9240266059SGregory Neil Shapiro</body>
9340266059SGregory Neil Shapiro</html>
94