xref: /freebsd/contrib/sendmail/libmilter/docs/smfi_setreply.html (revision 5ef517c097100c80269c8a0e02678a89fde6b35e)
1<html>
2<head><title>smfi_setreply</title></head>
3<body>
4<h1>smfi_setreply</h1>
5
6<table border="0" cellspacing=4 cellpadding=4>
7<!---------- Synopsis ----------->
8<tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
9<pre>
10#include &lt;libmilter/mfapi.h&gt;
11int smfi_setreply(
12	SMFICTX *ctx,
13	char *rcode,
14	char *xcode,
15	char *message
16);
17</pre>
18Set the default SMTP error reply code.
19</td></tr>
20
21<!----------- Description ---------->
22<tr><th valign="top" align=left>DESCRIPTION</th><td>
23<table border="1" cellspacing=1 cellpadding=4>
24<tr align="left" valign=top>
25<th width="80">Called When</th>
26<td>smfi_setreply may be called from any of the xxfi_ callbacks
27other than xxfi_connect.</td>
28</tr>
29<tr align="left" valign=top>
30<th width="80">Effects</th>
31<td>Directly set the SMTP error reply code for this connection.  This code
32will be used on subsequent error replies resulting from actions taken by
33this filter.</td>
34</tr>
35</table>
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>rcode</td>
45	<td>The three-digit (RFC 821) SMTP reply code, as a null-terminated string.  rcode cannot be NULL, and must be a valid reply code.
46	</td></tr>
47    <tr valign="top"><td>xcode</td>
48	<td>The extended (RFC 2034) reply code.  If xcode is NULL, no extended code is used.  Otherwise, xcode must conform to RFC 2034.
49	</td></tr>
50    <tr valign="top"><td>message</td>
51	<td>The text part of the SMTP reply.  If message is NULL, an empty message is used.
52	</td></tr>
53    </table>
54</td></tr>
55
56<!----------- Return values ---------->
57<tr>
58<th valign="top" align=left>RETURN VALUES</th>
59
60<td>smfi_setreply will fail and return MI_FAILURE if:
61<ul>
62    <li>The rcode or xcode argument is invalid.
63    <li>A memory-allocation failure occurs.
64</ul>
65Otherwise, it return MI_SUCCESS.
66</td>
67</tr>
68
69<!----------- Notes ---------->
70<tr align="left" valign=top>
71<th>NOTES</th>
72<td>
73<ul>
74<li>Values passed to smfi_setreply are not checked for standards compliance.
75<li>For details about reply codes and their meanings, please see RFC's
76<a href="http://www.rfc-editor.org/rfc/rfc821.txt">821</a>
77and <a href="http://www.rfc-editor.org/rfc/rfc2034.txt">2034</a>.
78<li>If the reply code (rcode) given is a '4XX' code but SMFI_REJECT is used
79for the message, the custom reply is not used.
80<li>Similarly, if the reply code (rcode) given is a '5XX' code but
81SMFI_TEMPFAIL is used for the message, the custom reply is not used.
82</ul>
83</td>
84</tr>
85
86</table>
87
88<hr size="1">
89<font size="-1">
90Copyright (c) 2000, 2002-2003 Sendmail, Inc. and its suppliers.
91All rights reserved.
92<br>
93By using this file, you agree to the terms and conditions set
94forth in the LICENSE.
95</font>
96</body>
97</html>
98