Deleted Added
full compact
smfi_setmlreply.html (302408) smfi_setmlreply.html (132943)
1<HTML>
2<HEAD><TITLE>smfi_setmlreply</TITLE></HEAD>
3<BODY>
1<html>
2<head><title>smfi_setmlreply</title></head>
3<body>
4<!--
4<!--
5$Id: smfi_setmlreply.html,v 1.5 2013-11-22 20:51:39 ca Exp $
5$Id: smfi_setmlreply.html,v 1.1 2004/01/01 00:32:45 gshapiro Exp $
6-->
6-->
7<H1>smfi_setmlreply</H1>
7<h1>smfi_setmlreply</h1>
8
8
9<TABLE border="0" cellspacing=4 cellpadding=4>
9<table border="0" cellspacing=4 cellpadding=4>
10<!---------- Synopsis ----------->
10<!---------- Synopsis ----------->
11<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD>
12<PRE>
11<tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
12<pre>
13#include &lt;libmilter/mfapi.h&gt;
14int smfi_setmlreply(
15 SMFICTX *ctx,
16 char *rcode,
17 char *xcode,
18 ...
19);
13#include &lt;libmilter/mfapi.h&gt;
14int smfi_setmlreply(
15 SMFICTX *ctx,
16 char *rcode,
17 char *xcode,
18 ...
19);
20</PRE>
20</pre>
21Set the default SMTP error reply code to a multi-line response. Only 4XX
22and 5XX replies are accepted.
21Set the default SMTP error reply code to a multi-line response. Only 4XX
22and 5XX replies are accepted.
23</TD></TR>
23</td></tr>
24
25<!----------- Description ---------->
24
25<!----------- Description ---------->
26<TR><TH valign="top" align=left>DESCRIPTION</TH><TD>
27<TABLE border="1" cellspacing=1 cellpadding=4>
28<TR align="left" valign=top>
29<TH width="80">Called When</TH>
30<TD>smfi_setmlreply may be called from any of the xxfi_ callbacks
31other than xxfi_connect.</TD>
32</TR>
33<TR align="left" valign=top>
34<TH width="80">Effects</TH>
35<TD>Directly set the SMTP error reply code for this connection to the given
26<tr><th valign="top" align=left>DESCRIPTION</th><td>
27<table border="1" cellspacing=1 cellpadding=4>
28<tr align="left" valign=top>
29<th width="80">Called When</th>
30<td>smfi_setmlreply may be called from any of the xxfi_ callbacks
31other than xxfi_connect.</td>
32</tr>
33<tr align="left" valign=top>
34<th width="80">Effects</th>
35<td>Directly set the SMTP error reply code for this connection to the given
36lines after the xcode. The list of arguments must be NULL terminated.
37This code will be used on subsequent error replies resulting from actions
36lines after the xcode. The list of arguments must be NULL terminated.
37This code will be used on subsequent error replies resulting from actions
38taken by this filter.</TD>
39</TR>
40</TABLE>
38taken by this filter.</td>
39</tr>
40</table>
41
42<!----------- Arguments ---------->
41
42<!----------- Arguments ---------->
43<TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
44 <TABLE border="1" cellspacing=0>
45 <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
46 <TR valign="top"><TD>ctx</TD>
47 <TD>Opaque context structure.
48 </TD></TR>
49 <TR valign="top"><TD>rcode</TD>
50 <TD>The three-digit (RFC 821/2821) SMTP reply code, as a
43<tr><th valign="top" align=left>ARGUMENTS</th><td>
44 <table border="1" cellspacing=0>
45 <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr>
46 <tr valign="top"><td>ctx</td>
47 <td>Opaque context structure.
48 </td></tr>
49 <tr valign="top"><td>rcode</td>
50 <td>The three-digit (RFC 821/2821) SMTP reply code, as a
51 null-terminated string. rcode cannot be NULL, and must be a valid
52 4XX or 5XX reply code.
51 null-terminated string. rcode cannot be NULL, and must be a valid
52 4XX or 5XX reply code.
53 </TD></TR>
54 <TR valign="top"><TD>xcode</TD>
55 <TD>The extended (RFC 1893/2034) reply code. If xcode is NULL, no
53 </td></tr>
54 <tr valign="top"><td>xcode</td>
55 <td>The extended (RFC 1893/2034) reply code. If xcode is NULL, no
56 extended code is used. Otherwise, xcode must conform to RFC 1893/2034.
56 extended code is used. Otherwise, xcode must conform to RFC 1893/2034.
57 </TD></TR>
58 <TR valign="top"><TD>...</TD>
59 <TD>The remainder of the arguments are single lines of text, up to
57 </td></tr>
58 <tr valign="top"><td>...</td>
59 <td>The remainder of the arguments are single lines of text, up to
60 32 arguments, which will be used as the text part of the SMTP
61 reply. The list must be NULL terminated.
60 32 arguments, which will be used as the text part of the SMTP
61 reply. The list must be NULL terminated.
62 </TD></TR>
63 </TABLE>
64</TD></TR>
62 </td></tr>
63 </table>
64</td></tr>
65
66<!----------- Example ---------->
65
66<!----------- Example ---------->
67<TR>
68<TH valign="top" align=left>RETURN VALUES</TH>
69<TD>
67<tr>
68<th valign="top" align=left>RETURN VALUES</th>
69<td>
70For example, the code:<BR>
70For example, the code:<BR>
71<PRE>
71<pre>
72 ret = smfi_setmlreply(ctx, "550", "5.7.0",
73 "Spammer access rejected",
74 "Please see our policy at:",
75 "http://www.example.com/spampolicy.html",
76 NULL);
72 ret = smfi_setmlreply(ctx, "550", "5.7.0",
73 "Spammer access rejected",
74 "Please see our policy at:",
75 "http://www.example.com/spampolicy.html",
76 NULL);
77</PRE>
77</pre>
78<BR>would give the SMTP response:<BR>
78<BR>would give the SMTP response:<BR>
79<PRE>
79<pre>
80550-5.7.0 Spammer access rejected
81550-5.7.0 Please see our policy at:
82550 5.7.0 http://www.example.com/spampolicy.html
80550-5.7.0 Spammer access rejected
81550-5.7.0 Please see our policy at:
82550 5.7.0 http://www.example.com/spampolicy.html
83</PRE>
84</TD>
85</TR>
83</td>
84</tr>
86
87<!----------- Return values ---------->
85
86<!----------- Return values ---------->
88<TR>
89<TH valign="top" align=left>RETURN VALUES</TH>
87<tr>
88<th valign="top" align=left>RETURN VALUES</th>
90
89
91<TD>smfi_setmlreply will fail and return MI_FAILURE if:
92<UL>
93 <LI>The rcode or xcode argument is invalid.
94 <LI>A memory-allocation failure occurs.
95 <LI>If any text line contains a carraige return or line feed.
96 <LI>The length of any text line is more than MAXREPLYLEN (980).
97 <LI>More than 32 lines of text replies are given.
98</UL>
90<td>smfi_setmlreply will fail and return MI_FAILURE if:
91<ul>
92 <li>The rcode or xcode argument is invalid.
93 <li>A memory-allocation failure occurs.
94 <li>If any text line contains a carraige return or line feed.
95 <li>The length of any text line is more than MAXREPLYLEN (980).
96 <li>More than 32 lines of text replies are given.
97</ul>
99Otherwise, it return MI_SUCCESS.
98Otherwise, it return MI_SUCCESS.
100</TD>
101</TR>
99</td>
100</tr>
102
103<!----------- Notes ---------->
101
102<!----------- Notes ---------->
104<TR align="left" valign=top>
105<TH>NOTES</TH>
106<TD>
107<UL>
108<LI>Values passed to smfi_setmlreply are not checked for standards compliance.
109<LI>The message parameter should contain only printable characters,
103<tr align="left" valign=top>
104<th>NOTES</th>
105<td>
106<ul>
107<li>Values passed to smfi_setmlreply are not checked for standards compliance.
108<li>The message parameter should contain only printable characters,
110other characters may lead to undefined behavior.
111For example, CR or LF will cause the call to fail,
112single '%' characters will cause the text to be ignored
113(if there really should be a '%' in the string,
109other characters may lead to undefined behavior.
110For example, CR or LF will cause the call to fail,
111single '%' characters will cause the text to be ignored
112(if there really should be a '%' in the string,
114use '%%' just like for <TT>printf(3)</TT>).
115<LI>For details about reply codes and their meanings, please see RFC's
116<A href="http://www.rfc-editor.org/rfc/rfc821.txt">821</A>/
117<A href="http://www.rfc-editor.org/rfc/rfc2821.txt">2821</A>
113use '%%' just like for <tt>printf(3)</tt>).
114<li>For details about reply codes and their meanings, please see RFC's
115<a href="http://www.rfc-editor.org/rfc/rfc821.txt">821</a>/
116<a href="http://www.rfc-editor.org/rfc/rfc2821.txt">2821</a>
118and
117and
119<A href="http://www.rfc-editor.org/rfc/rfc1893.txt">1893</A>/
120<A href="http://www.rfc-editor.org/rfc/rfc2034.txt">2034</A>.
121<LI>If the reply code (rcode) given is a '4XX' code but SMFI_REJECT is used
118<a href="http://www.rfc-editor.org/rfc/rfc1893.txt">1893</a>/
119<a href="http://www.rfc-editor.org/rfc/rfc2034.txt">2034</a>.
120<li>If the reply code (rcode) given is a '4XX' code but SMFI_REJECT is used
122for the message, the custom reply is not used.
121for the message, the custom reply is not used.
123<LI>Similarly, if the reply code (rcode) given is a '5XX' code but
122<li>Similarly, if the reply code (rcode) given is a '5XX' code but
124SMFI_TEMPFAIL is used for the message, the custom reply is not used.
125<BR>
126Note: in neither of the last two cases an error is returned to the milter,
127libmilter silently ignores the reply code.
123SMFI_TEMPFAIL is used for the message, the custom reply is not used.
124<BR>
125Note: in neither of the last two cases an error is returned to the milter,
126libmilter silently ignores the reply code.
128<LI>If the milter returns SMFI_TEMPFAIL and sets the reply code to '421',
129then the SMTP server will terminate the SMTP session with a 421 error code.
130</UL>
131</TD>
132</TR>
127<li>
128If the milter returns SMFI_TEMPFAIL
129and sets the reply code to '421',
130then the SMTP server will terminate the SMTP session with a 421
131error code.
132</ul>
133</td>
134</tr>
133
135
134</TABLE>
136</table>
135
137
136<HR size="1">
137<FONT size="-1">
138Copyright (c) 2000, 2002-2003 Proofpoint, Inc. and its suppliers.
138<hr size="1">
139<font size="-1">
140Copyright (c) 2000, 2002-2003 Sendmail, Inc. and its suppliers.
139All rights reserved.
141All rights reserved.
140<BR>
142<br>
141By using this file, you agree to the terms and conditions set
142forth in the LICENSE.
143By using this file, you agree to the terms and conditions set
144forth in the LICENSE.
143</FONT>
144</BODY>
145</HTML>
145</font>
146</body>
147</html>