xref: /freebsd/contrib/sendmail/libmilter/docs/xxfi_body.html (revision f7c32ed617858bcd22f8d1b03199099d50125721)
1<HTML>
2<HEAD><TITLE>xxfi_body</TITLE></HEAD>
3<BODY>
4<!--
5$Id: xxfi_body.html,v 1.18 2013-11-22 20:51:39 ca Exp $
6-->
7<H1>xxfi_body</H1>
8
9<TABLE border="0" cellspacing=4 cellpadding=4>
10<!---------- Synopsis ----------->
11<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD>
12<PRE>
13#include &lt;libmilter/mfapi.h&gt;
14sfsistat (*xxfi_body)(
15	SMFICTX *ctx,
16	unsigned char *bodyp,
17	size_t len
18);
19</PRE>
20Handle a piece of a message's body.
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>xxfi_body is called zero or more times between xxfi_eoh and xxfi_eom.</TD>
29</TR>
30<TR align="left" valign=top>
31<TH>Default Behavior</TH>
32<TD>Do nothing; return SMFIS_CONTINUE.</TD>
33</TR>
34</TABLE>
35</TD></TR>
36
37<!----------- Arguments ---------->
38<TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
39    <TABLE border="1" cellspacing=0>
40    <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
41    <TR valign="top"><TD>ctx</TD>
42	<TD>Opaque context structure.
43	</TD></TR>
44    <TR valign="top"><TD>bodyp</TD>
45	<TD>Pointer to the start of this block of body data.  bodyp is not valid outside this call to xxfi_body.
46	</TD></TR>
47    <TR valign="top"><TD>len</TD>
48	<TD>The amount of data pointed to by bodyp.
49	</TD></TR>
50    </TABLE>
51</TD></TR>
52
53<!----------- Notes ---------->
54<TR>
55<TH valign="top" align=left>NOTES</TH>
56<TD>
57<UL>
58<LI>bodyp points to a sequence of bytes.
59It is <EM>not</EM> a C string (a sequence of characters that is terminated by '\0').
60Therefore, do not use the usual C string functions like <CODE>strlen(3)</CODE>
61on this byte block.
62Moreover, the byte sequence may contain '\0' characters inside the block.
63Hence even if a trailing '\0' is added, C string functions may still fail
64to work as expected.
65<LI>Since message bodies can be very large, defining xxfi_body can
66significantly impact filter performance.
67<LI>End-of-lines are represented as received from SMTP (normally CR/LF).
68<LI>Later filters will see body changes made by earlier ones.
69<LI>Message bodies may be sent in multiple chunks, with one call to
70    xxfi_body per chunk.
71<LI>Return
72<A HREF="api.html#SMFIS_SKIP">SMFIS_SKIP</A>
73if a milter has received sufficiently many
74body chunks to make a decision,
75but still wants to invoke
76message modification functions that are only allowed to be called from
77<A HREF="xxfi_eom.html">xxfi_eom()</A>.
78Note: the milter <EM>must</EM>
79<A HREF="xxfi_negotiate.html">negotiate</A>
80this behavior with the MTA, i.e., it must check whether
81the protocol action
82<A HREF="xxfi_negotiate.html#SMFIP_SKIP"><CODE>SMFIP_SKIP</CODE></A>
83is available and if so, the milter must request it.
84</UL>
85</TD>
86</TR>
87</TABLE>
88
89<HR size="1">
90<FONT size="-1">
91Copyright (c) 2000-2003, 2007 Proofpoint, Inc. and its suppliers.
92All rights reserved.
93<BR>
94By using this file, you agree to the terms and conditions set
95forth in the LICENSE.
96</FONT>
97</BODY>
98</HTML>
99