1168515Sgshapiro<HTML> 2168515Sgshapiro<HEAD><TITLE>smfi_replacebody</TITLE></HEAD> 3168515Sgshapiro<BODY> 4132943Sgshapiro<!-- 5266692Sgshapiro$Id: smfi_replacebody.html,v 1.16 2013-11-22 20:51:39 ca Exp $ 6132943Sgshapiro--> 7168515Sgshapiro<H1>smfi_replacebody</H1> 890792Sgshapiro 9168515Sgshapiro<TABLE border="0" cellspacing=4 cellpadding=4> 1090792Sgshapiro<!---------- Synopsis -----------> 11168515Sgshapiro<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD> 12168515Sgshapiro<PRE> 1390792Sgshapiro#include <libmilter/mfapi.h> 1490792Sgshapiroint smfi_replacebody( 1590792Sgshapiro SMFICTX *ctx, 1690792Sgshapiro unsigned char *bodyp, 1790792Sgshapiro int bodylen 1890792Sgshapiro); 19168515Sgshapiro</PRE> 2090792SgshapiroReplace message-body data. 21168515Sgshapiro</TD></TR> 2290792Sgshapiro 2390792Sgshapiro<!----------- Description ----------> 24168515Sgshapiro<TR><TH valign="top" align=left>DESCRIPTION</TH><TD> 25168515Sgshapiro<TABLE border="1" cellspacing=1 cellpadding=4> 26168515Sgshapiro<TR align="left" valign=top> 27168515Sgshapiro<TH width="80">Called When</TH> 28168515Sgshapiro<TD>Called only from <A href="xxfi_eom.html">xxfi_eom</A>. smfi_replacebody may be called more than once.</TD> 29168515Sgshapiro</TR> 30168515Sgshapiro<TR align="left" valign=top> 31168515Sgshapiro<TH width="80">Effects</TH> 32168515Sgshapiro<TD>smfi_replacebody replaces the body of the current message. If called 3390792Sgshapiromore than once, subsequent calls result in data being appended to the new 3490792Sgshapirobody. 35168515Sgshapiro</TD> 36168515Sgshapiro</TR> 37168515Sgshapiro</TABLE> 3890792Sgshapiro 3990792Sgshapiro<!----------- Arguments ----------> 40168515Sgshapiro<TR><TH valign="top" align=left>ARGUMENTS</TH><TD> 41168515Sgshapiro <TABLE border="1" cellspacing=0> 42168515Sgshapiro <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR> 43168515Sgshapiro <TR valign="top"><TD>ctx</TD> 44168515Sgshapiro <TD>Opaque context structure. 45168515Sgshapiro </TD></TR> 46168515Sgshapiro <TR valign="top"><TD>bodyp</TD> 47168515Sgshapiro <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. 48168515Sgshapiro </TD></TR> 49168515Sgshapiro <TR valign="top"><TD>bodylen</TD> 50168515Sgshapiro <TD>The number of data bytes pointed to by bodyp. 51168515Sgshapiro </TD></TR> 52168515Sgshapiro </TABLE> 53168515Sgshapiro</TD></TR> 5490792Sgshapiro 5590792Sgshapiro<!----------- Return values ----------> 56168515Sgshapiro<TR> 57168515Sgshapiro<TH valign="top" align=left>RETURN VALUES</TH> 5890792Sgshapiro 59168515Sgshapiro<TD>smfi_replacebody fails and returns MI_FAILURE if: 60168515Sgshapiro<UL> 61168515Sgshapiro <LI>bodyp == NULL and bodylen > 0. 62168515Sgshapiro <LI>Changing the body in the current connection state is invalid. 63168515Sgshapiro <LI>A network error occurs. 64168515Sgshapiro <LI>SMFIF_CHGBODY was not set when <A href="smfi_register.html">smfi_register</A> was called. 65168515Sgshapiro</UL> 6690792SgshapiroOtherwise, it will return MI_SUCCESS. 67168515Sgshapiro</TD> 68168515Sgshapiro</TR> 6990792Sgshapiro 7090792Sgshapiro<!----------- Notes ----------> 71168515Sgshapiro<TR align="left" valign=top> 72168515Sgshapiro<TH>NOTES</TH> 73168515Sgshapiro<TD> 74168515Sgshapiro<UL> 75168515Sgshapiro <LI>Since the message body may be very large, setting SMFIF_CHGBODY may significantly affect filter performance. 76168515Sgshapiro <LI>If a filter sets SMFIF_CHGBODY but does not call smfi_replacebody, the original body remains unchanged. 77168515Sgshapiro <LI>For smfi_replacebody, filter order is important. <B>Later filters will see the new body contents created by earlier ones.</B> 78168515Sgshapiro</UL> 79168515Sgshapiro</TD> 80168515Sgshapiro</TR> 8190792Sgshapiro 82168515Sgshapiro</TABLE> 8390792Sgshapiro 84168515Sgshapiro<HR size="1"> 85168515Sgshapiro<FONT size="-1"> 86261363SgshapiroCopyright (c) 2000-2001, 2003 Proofpoint, Inc. and its suppliers. 8790792SgshapiroAll rights reserved. 88168515Sgshapiro<BR> 8990792SgshapiroBy using this file, you agree to the terms and conditions set 90112810Sgshapiroforth in the LICENSE. 91168515Sgshapiro</FONT> 92168515Sgshapiro</BODY> 93168515Sgshapiro</HTML> 94