opnsense-src/contrib/sendmail/libmilter/docs/smfi_setreply.html

118 lines
3.7 KiB
HTML
Raw Normal View History

2007-04-08 21:38:51 -04:00
<HTML>
<HEAD><TITLE>smfi_setreply</TITLE></HEAD>
<BODY>
2004-07-31 21:04:57 -04:00
<!--
2007-04-08 21:38:51 -04:00
$Id: smfi_setreply.html,v 1.17 2006/12/21 18:30:35 ca Exp $
2004-07-31 21:04:57 -04:00
-->
2007-04-08 21:38:51 -04:00
<H1>smfi_setreply</H1>
2002-02-17 16:56:45 -05:00
2007-04-08 21:38:51 -04:00
<TABLE border="0" cellspacing=4 cellpadding=4>
2002-02-17 16:56:45 -05:00
<!---------- Synopsis ----------->
2007-04-08 21:38:51 -04:00
<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD>
<PRE>
2002-02-17 16:56:45 -05:00
#include &lt;libmilter/mfapi.h&gt;
int smfi_setreply(
SMFICTX *ctx,
char *rcode,
char *xcode,
char *message
);
2007-04-08 21:38:51 -04:00
</PRE>
2003-09-19 19:11:30 -04:00
Set the default SMTP error reply code. Only 4XX and 5XX replies are accepted.
2007-04-08 21:38:51 -04:00
</TD></TR>
2002-02-17 16:56:45 -05:00
<!----------- Description ---------->
2007-04-08 21:38:51 -04:00
<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>
<TD>smfi_setreply may be called from any of the xxfi_ callbacks
other than xxfi_connect.</TD>
</TR>
<TR align="left" valign=top>
<TH width="80">Effects</TH>
<TD>Directly set the SMTP error reply code for this connection. This code
2002-02-17 16:56:45 -05:00
will be used on subsequent error replies resulting from actions taken by
2007-04-08 21:38:51 -04:00
this filter.</TD>
</TR>
</TABLE>
2002-02-17 16:56:45 -05:00
<!----------- Arguments ---------->
2007-04-08 21:38:51 -04:00
<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>
<TD>The three-digit (RFC 821/2821) SMTP reply code, as a
2003-09-19 19:11:30 -04:00
null-terminated string. rcode cannot be NULL, and must be a valid
4XX or 5XX reply code.
2007-04-08 21:38:51 -04:00
</TD></TR>
<TR valign="top"><TD>xcode</TD>
<TD>The extended (RFC 1893/2034) reply code. If xcode is NULL, no
2003-09-19 19:11:30 -04:00
extended code is used. Otherwise, xcode must conform to RFC 1893/2034.
2007-04-08 21:38:51 -04: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>
2002-02-17 16:56:45 -05:00
<!----------- Return values ---------->
2007-04-08 21:38:51 -04:00
<TR>
<TH valign="top" align=left>RETURN VALUES</TH>
2002-02-17 16:56:45 -05:00
2007-04-08 21:38:51 -04:00
<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>
2002-02-17 16:56:45 -05:00
Otherwise, it return MI_SUCCESS.
2007-04-08 21:38:51 -04:00
</TD>
</TR>
2002-02-17 16:56:45 -05:00
<!----------- Notes ---------->
2007-04-08 21:38:51 -04:00
<TR align="left" valign=top>
<TH>NOTES</TH>
<TD>
<UL>
<LI>Values passed to smfi_setreply are not checked for standards compliance.
<LI>The message parameter should contain only printable characters,
2004-02-14 16:53:31 -05:00
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,
2007-04-08 21:38:51 -04:00
use '%%' just like for <TT>printf(3)</TT>).
<LI>For details about reply codes and their meanings, please see RFC's
<A href="http://www.rfc-editor.org/rfc/rfc821.txt">821</A>/
<A href="http://www.rfc-editor.org/rfc/rfc2821.txt">2821</A>
2003-09-19 19:11:30 -04:00
and
2007-04-08 21:38:51 -04:00
<A href="http://www.rfc-editor.org/rfc/rfc1893.txt">1893</A>/
<A href="http://www.rfc-editor.org/rfc/rfc2034.txt">2034</A>.
<LI>If the reply code (rcode) given is a '4XX' code but SMFI_REJECT is used
2002-04-09 23:05:00 -04:00
for the message, the custom reply is not used.
2007-04-08 21:38:51 -04:00
<LI>Similarly, if the reply code (rcode) given is a '5XX' code but
2002-04-09 23:05:00 -04:00
SMFI_TEMPFAIL is used for the message, the custom reply is not used.
2004-07-31 21:04:57 -04:00
<BR>
Note: in neither of the last two cases an error is returned to the milter,
libmilter silently ignores the reply code.
2007-04-08 21:38:51 -04:00
<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.
</UL>
</TD>
</TR>
2002-02-17 16:56:45 -05:00
2007-04-08 21:38:51 -04:00
</TABLE>
2002-02-17 16:56:45 -05:00
2007-04-08 21:38:51 -04:00
<HR size="1">
<FONT size="-1">
2003-03-29 14:12:53 -05:00
Copyright (c) 2000, 2002-2003 Sendmail, Inc. and its suppliers.
2002-02-17 16:56:45 -05:00
All rights reserved.
2007-04-08 21:38:51 -04:00
<BR>
2002-02-17 16:56:45 -05:00
By using this file, you agree to the terms and conditions set
2003-03-29 14:12:53 -05:00
forth in the LICENSE.
2007-04-08 21:38:51 -04:00
</FONT>
</BODY>
</HTML>