freebsd-dev/contrib/sendmail/libmilter/docs/smfi_setreply.html

121 lines
3.7 KiB
HTML
Raw Normal View History

2002-02-17 21:56:45 +00:00
<html>
<head><title>smfi_setreply</title></head>
<body>
2004-08-01 01:04:57 +00:00
<!--
$Id: smfi_setreply.html,v 1.14 2003/11/16 05:04:01 ca Exp $
-->
2002-02-17 21:56:45 +00:00
<h1>smfi_setreply</h1>
<table border="0" cellspacing=4 cellpadding=4>
<!---------- Synopsis ----------->
<tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
<pre>
#include &lt;libmilter/mfapi.h&gt;
int smfi_setreply(
SMFICTX *ctx,
char *rcode,
char *xcode,
char *message
);
</pre>
2003-09-19 23:11:30 +00:00
Set the default SMTP error reply code. Only 4XX and 5XX replies are accepted.
2002-02-17 21:56:45 +00:00
</td></tr>
<!----------- Description ---------->
<tr><th valign="top" align=left>DESCRIPTION</th><td>
<table border="1" cellspacing=1 cellpadding=4>
<tr align="left" valign=top>
<th width="80">Called When</th>
2003-03-03 17:09:13 +00:00
<td>smfi_setreply may be called from any of the xxfi_ callbacks
other than xxfi_connect.</td>
2002-02-17 21:56:45 +00:00
</tr>
<tr align="left" valign=top>
<th width="80">Effects</th>
<td>Directly set the SMTP error reply code for this connection. This code
will be used on subsequent error replies resulting from actions taken by
this filter.</td>
</tr>
</table>
<!----------- Arguments ---------->
<tr><th valign="top" align=left>ARGUMENTS</th><td>
<table border="1" cellspacing=0>
<tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr>
<tr valign="top"><td>ctx</td>
<td>Opaque context structure.
</td></tr>
<tr valign="top"><td>rcode</td>
2003-09-19 23:11:30 +00:00
<td>The three-digit (RFC 821/2821) SMTP reply code, as a
null-terminated string. rcode cannot be NULL, and must be a valid
4XX or 5XX reply code.
</td></tr>
2002-02-17 21:56:45 +00:00
<tr valign="top"><td>xcode</td>
2003-09-19 23:11:30 +00:00
<td>The extended (RFC 1893/2034) reply code. If xcode is NULL, no
extended code is used. Otherwise, xcode must conform to RFC 1893/2034.
2002-02-17 21:56:45 +00:00
</td></tr>
<tr valign="top"><td>message</td>
<td>The text part of the SMTP reply. If message is NULL, an empty message is used.
</td></tr>
</table>
</td></tr>
<!----------- Return values ---------->
<tr>
<th valign="top" align=left>RETURN VALUES</th>
<td>smfi_setreply will fail and return MI_FAILURE if:
<ul>
<li>The rcode or xcode argument is invalid.
<li>A memory-allocation failure occurs.
</ul>
Otherwise, it return MI_SUCCESS.
</td>
</tr>
<!----------- Notes ---------->
<tr align="left" valign=top>
<th>NOTES</th>
<td>
<ul>
<li>Values passed to smfi_setreply are not checked for standards compliance.
2004-02-14 21:53:31 +00:00
<li>The message parameter should contain only printable characters,
other characters may lead to undefined behavior.
For example, CR or LF will cause the call to fail,
single '%' characters will cause the text to be ignored
(if there really should be a '%' in the string,
use '%%' just like for <tt>printf(3)</tt>).
2002-02-17 21:56:45 +00:00
<li>For details about reply codes and their meanings, please see RFC's
2003-09-19 23:11:30 +00:00
<a href="http://www.rfc-editor.org/rfc/rfc821.txt">821</a>/
<a href="http://www.rfc-editor.org/rfc/rfc2821.txt">2821</a>
and
<a href="http://www.rfc-editor.org/rfc/rfc1893.txt">1893</a>/
<a href="http://www.rfc-editor.org/rfc/rfc2034.txt">2034</a>.
2002-04-10 03:05:00 +00:00
<li>If the reply code (rcode) given is a '4XX' code but SMFI_REJECT is used
for the message, the custom reply is not used.
<li>Similarly, if the reply code (rcode) given is a '5XX' code but
SMFI_TEMPFAIL is used for the message, the custom reply is not used.
2004-08-01 01:04:57 +00:00
<BR>
Note: in neither of the last two cases an error is returned to the milter,
libmilter silently ignores the reply code.
<li>
If the milter returns SMFI_TEMPFAIL
and sets the reply code to '421',
then the SMTP server will terminate the SMTP session with a 421
error code.
2002-02-17 21:56:45 +00:00
</ul>
</td>
</tr>
</table>
<hr size="1">
<font size="-1">
2003-03-29 19:12:53 +00:00
Copyright (c) 2000, 2002-2003 Sendmail, Inc. and its suppliers.
2002-02-17 21:56:45 +00:00
All rights reserved.
<br>
By using this file, you agree to the terms and conditions set
2003-03-29 19:12:53 +00:00
forth in the LICENSE.
2002-02-17 21:56:45 +00:00
</font>
</body>
</html>