xref: /freebsd/contrib/sendmail/libmilter/docs/smfi_replacebody.html (revision 5dd76dd0cc19450133aa379ce0ce4a68ae07fb39)
1d0cef73dSGregory Neil Shapiro<HTML>
2d0cef73dSGregory Neil Shapiro<HEAD><TITLE>smfi_replacebody</TITLE></HEAD>
3d0cef73dSGregory Neil Shapiro<BODY>
4e92d3f3fSGregory Neil Shapiro<!--
5*5dd76dd0SGregory Neil Shapiro$Id: smfi_replacebody.html,v 1.16 2013/11/22 20:51:39 ca Exp $
6e92d3f3fSGregory Neil Shapiro-->
7d0cef73dSGregory Neil Shapiro<H1>smfi_replacebody</H1>
840266059SGregory Neil Shapiro
9d0cef73dSGregory Neil Shapiro<TABLE border="0" cellspacing=4 cellpadding=4>
1040266059SGregory Neil Shapiro<!---------- Synopsis ----------->
11d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD>
12d0cef73dSGregory 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);
19d0cef73dSGregory Neil Shapiro</PRE>
2040266059SGregory Neil ShapiroReplace message-body data.
21d0cef73dSGregory Neil Shapiro</TD></TR>
2240266059SGregory Neil Shapiro
2340266059SGregory Neil Shapiro<!----------- Description ---------->
24d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left>DESCRIPTION</TH><TD>
25d0cef73dSGregory Neil Shapiro<TABLE border="1" cellspacing=1 cellpadding=4>
26d0cef73dSGregory Neil Shapiro<TR align="left" valign=top>
27d0cef73dSGregory Neil Shapiro<TH width="80">Called When</TH>
28d0cef73dSGregory Neil Shapiro<TD>Called only from <A href="xxfi_eom.html">xxfi_eom</A>.  smfi_replacebody may be called more than once.</TD>
29d0cef73dSGregory Neil Shapiro</TR>
30d0cef73dSGregory Neil Shapiro<TR align="left" valign=top>
31d0cef73dSGregory Neil Shapiro<TH width="80">Effects</TH>
32d0cef73dSGregory 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.
35d0cef73dSGregory Neil Shapiro</TD>
36d0cef73dSGregory Neil Shapiro</TR>
37d0cef73dSGregory Neil Shapiro</TABLE>
3840266059SGregory Neil Shapiro
3940266059SGregory Neil Shapiro<!----------- Arguments ---------->
40d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
41d0cef73dSGregory Neil Shapiro    <TABLE border="1" cellspacing=0>
42d0cef73dSGregory Neil Shapiro    <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
43d0cef73dSGregory Neil Shapiro    <TR valign="top"><TD>ctx</TD>
44d0cef73dSGregory Neil Shapiro	<TD>Opaque context structure.
45d0cef73dSGregory Neil Shapiro	</TD></TR>
46d0cef73dSGregory Neil Shapiro    <TR valign="top"><TD>bodyp</TD>
47d0cef73dSGregory 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.
48d0cef73dSGregory Neil Shapiro	</TD></TR>
49d0cef73dSGregory Neil Shapiro    <TR valign="top"><TD>bodylen</TD>
50d0cef73dSGregory Neil Shapiro	<TD>The number of data bytes pointed to by bodyp.
51d0cef73dSGregory Neil Shapiro	</TD></TR>
52d0cef73dSGregory Neil Shapiro    </TABLE>
53d0cef73dSGregory Neil Shapiro</TD></TR>
5440266059SGregory Neil Shapiro
5540266059SGregory Neil Shapiro<!----------- Return values ---------->
56d0cef73dSGregory Neil Shapiro<TR>
57d0cef73dSGregory Neil Shapiro<TH valign="top" align=left>RETURN VALUES</TH>
5840266059SGregory Neil Shapiro
59d0cef73dSGregory Neil Shapiro<TD>smfi_replacebody fails and returns MI_FAILURE if:
60d0cef73dSGregory Neil Shapiro<UL>
61d0cef73dSGregory Neil Shapiro    <LI>bodyp == NULL and bodylen &gt; 0.
62d0cef73dSGregory Neil Shapiro    <LI>Changing the body in the current connection state is invalid.
63d0cef73dSGregory Neil Shapiro    <LI>A network error occurs.
64d0cef73dSGregory Neil Shapiro    <LI>SMFIF_CHGBODY was not set when <A href="smfi_register.html">smfi_register</A> was called.
65d0cef73dSGregory Neil Shapiro</UL>
6640266059SGregory Neil ShapiroOtherwise, it will return MI_SUCCESS.
67d0cef73dSGregory Neil Shapiro</TD>
68d0cef73dSGregory Neil Shapiro</TR>
6940266059SGregory Neil Shapiro
7040266059SGregory Neil Shapiro<!----------- Notes ---------->
71d0cef73dSGregory Neil Shapiro<TR align="left" valign=top>
72d0cef73dSGregory Neil Shapiro<TH>NOTES</TH>
73d0cef73dSGregory Neil Shapiro<TD>
74d0cef73dSGregory Neil Shapiro<UL>
75d0cef73dSGregory Neil Shapiro    <LI>Since the message body may be very large, setting SMFIF_CHGBODY may significantly affect filter performance.
76d0cef73dSGregory Neil Shapiro    <LI>If a filter sets SMFIF_CHGBODY but does not call smfi_replacebody, the original body remains unchanged.
77d0cef73dSGregory Neil Shapiro    <LI>For smfi_replacebody, filter order is important.  <B>Later filters will see the new body contents created by earlier ones.</B>
78d0cef73dSGregory Neil Shapiro</UL>
79d0cef73dSGregory Neil Shapiro</TD>
80d0cef73dSGregory Neil Shapiro</TR>
8140266059SGregory Neil Shapiro
82d0cef73dSGregory Neil Shapiro</TABLE>
8340266059SGregory Neil Shapiro
84d0cef73dSGregory Neil Shapiro<HR size="1">
85d0cef73dSGregory Neil Shapiro<FONT size="-1">
86*5dd76dd0SGregory Neil ShapiroCopyright (c) 2000-2001, 2003 Proofpoint, Inc. and its suppliers.
8740266059SGregory Neil ShapiroAll rights reserved.
88d0cef73dSGregory Neil Shapiro<BR>
8940266059SGregory Neil ShapiroBy using this file, you agree to the terms and conditions set
905ef517c0SGregory Neil Shapiroforth in the LICENSE.
91d0cef73dSGregory Neil Shapiro</FONT>
92d0cef73dSGregory Neil Shapiro</BODY>
93d0cef73dSGregory Neil Shapiro</HTML>
94