xref: /freebsd/contrib/sendmail/libmilter/docs/xxfi_connect.html (revision e2c0e292e8a7ca00ba99bcfccc9e637f45c3e8b1)
1d0cef73dSGregory Neil Shapiro<HTML>
2d0cef73dSGregory Neil Shapiro<HEAD><TITLE>xxfi_connect</TITLE></HEAD>
3d0cef73dSGregory Neil Shapiro<BODY>
4e92d3f3fSGregory Neil Shapiro<!--
54313cc83SGregory Neil Shapiro$Id: xxfi_connect.html,v 1.20 2013-11-22 20:51:39 ca Exp $
6e92d3f3fSGregory Neil Shapiro-->
7d0cef73dSGregory Neil Shapiro<H1>xxfi_connect</H1>
840266059SGregory Neil Shapiro
9d0cef73dSGregory Neil Shapiro<TABLE border="0" cellspacing=4 cellpadding=4>
1040266059SGregory Neil Shapiro<!---------- Synopsis ----------->
11d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD>
12d0cef73dSGregory Neil Shapiro<PRE>
1340266059SGregory Neil Shapiro#include &lt;libmilter/mfapi.h&gt;
1440266059SGregory Neil Shapirosfsistat (*xxfi_connect)(
1540266059SGregory Neil Shapiro        SMFICTX    *ctx,
1640266059SGregory Neil Shapiro        char       *hostname,
1740266059SGregory Neil Shapiro        _SOCK_ADDR *hostaddr);
18d0cef73dSGregory Neil Shapiro</PRE>
19d0cef73dSGregory Neil Shapiro</TD></TR>
2040266059SGregory Neil Shapiro<!----------- Description ---------->
21d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left>DESCRIPTION</TH><TD>
22d0cef73dSGregory Neil Shapiro<TABLE border="1" cellspacing=1 cellpadding=4>
23d0cef73dSGregory Neil Shapiro<TR>
24d0cef73dSGregory Neil Shapiro<TH valign="top" align=left width=80>Called When</TH>
25d0cef73dSGregory Neil Shapiro<TD>Once, at the start of each SMTP connection.</TD>
26d0cef73dSGregory Neil Shapiro</TR>
27d0cef73dSGregory Neil Shapiro<TR>
28d0cef73dSGregory Neil Shapiro<TH valign="top" align=left width=80>Default Behavior</TH>
29d0cef73dSGregory Neil Shapiro<TD>Do nothing; return SMFIS_CONTINUE.</TD>
30d0cef73dSGregory Neil Shapiro</TR>
31d0cef73dSGregory Neil Shapiro</TABLE>
32*5b0945b5SGregory Neil Shapiro
3340266059SGregory Neil Shapiro<!--
3440266059SGregory Neil ShapiroThis callback function is invoked on each connection to the mail
35d0cef73dSGregory Neil Shapirofilter program.
36d0cef73dSGregory Neil ShapiroThe callback is to be implemented by the Milter application developers.
37d0cef73dSGregory Neil ShapiroThe name of the callback can be any valid function name.
38d0cef73dSGregory Neil ShapiroThe function pointer is to be assigned to the
3940266059SGregory Neil ShapirosmfiDesc.xxfi_connect and the pointer to the smfiDesc structure
4040266059SGregory Neil Shapirois passed to smfi_register().
4140266059SGregory Neil Shapiro-->
42*5b0945b5SGregory Neil Shapiro</TD></TR>
43*5b0945b5SGregory Neil Shapiro
4440266059SGregory Neil Shapiro<!----------- Arguments ---------->
45d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
46d0cef73dSGregory Neil Shapiro    <TABLE border="1" cellspacing=0>
47d0cef73dSGregory Neil Shapiro    <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
48d0cef73dSGregory Neil Shapiro    <TR><TD>ctx</TD>
49d0cef73dSGregory Neil Shapiro	<TD>the opaque context structure.
50d0cef73dSGregory Neil Shapiro	</TD></TR>
51d0cef73dSGregory Neil Shapiro    <TR><TD>hostname</TD>
52d0cef73dSGregory Neil Shapiro	<TD>the host name of the message sender, as determined by a
53d0cef73dSGregory Neil Shapiro	reverse lookup on the host address.
54d0cef73dSGregory Neil Shapiro	If the reverse lookup fails
55d0cef73dSGregory Neil Shapiro	or if none of the IP addresses of the resolved host name
56d0cef73dSGregory Neil Shapiro	matches the original IP address,
57d0cef73dSGregory Neil Shapiro	hostname will contain the message sender's IP
5840266059SGregory Neil Shapiro	address enclosed in square brackets (e.g. `[a.b.c.d]').
59d0cef73dSGregory Neil Shapiro	If the SMTP connection is made via stdin the value is
60d0cef73dSGregory Neil Shapiro	<CODE>localhost</CODE>.
61d0cef73dSGregory Neil Shapiro	</TD></TR>
62d0cef73dSGregory Neil Shapiro    <TR><TD>hostaddr</TD>
63d0cef73dSGregory Neil Shapiro	<TD>the host address,
64d0cef73dSGregory Neil Shapiro	as determined by a <CODE>getpeername(2)</CODE> call on the SMTP socket.
6540266059SGregory Neil Shapiro	NULL if the type is not supported in the current version or if
6640266059SGregory Neil Shapiro	the SMTP connection is made via stdin.
67d0cef73dSGregory Neil Shapiro	</TD></TR>
68d0cef73dSGregory Neil Shapiro    </TABLE>
69d0cef73dSGregory Neil Shapiro</TD></TR>
7040266059SGregory Neil Shapiro<!----------- Return values ---------->
7140266059SGregory Neil Shapiro<!--
72d0cef73dSGregory Neil Shapiro<TR>
73d0cef73dSGregory Neil Shapiro<TH valign="top" align=left>SPECIAL RETURN VALUES</TH>
74d0cef73dSGregory Neil Shapiro<TD><TABLE border="1" cellspacing=0>
75d0cef73dSGregory Neil Shapiro  <TR bgcolor="#dddddd"><TH>Return value</TH><TH>Description</TH></TR>
76d0cef73dSGregory Neil Shapiro  <TR valign="top">
77d0cef73dSGregory Neil Shapiro     <TD>SMFIS_ACCEPT</TD>
78d0cef73dSGregory Neil Shapiro     <TD>Accept all commands and messages from this client without any
79d0cef73dSGregory Neil Shapiro         further contact with the filter. </TD>
80d0cef73dSGregory Neil Shapiro     </TD>
81d0cef73dSGregory Neil Shapiro  </TR>
82d0cef73dSGregory Neil Shapiro  <TR valign="top">
83d0cef73dSGregory Neil Shapiro     <TD>SMFIS_CONTINUE</TD>
84d0cef73dSGregory Neil Shapiro     <TD>Continue normal processing. </TD>
85d0cef73dSGregory Neil Shapiro  </TR>
86d0cef73dSGregory Neil Shapiro  <TR valign="top">
87d0cef73dSGregory Neil Shapiro     <TD>SMFIS_DISCARD</TD>
88d0cef73dSGregory Neil Shapiro     <TD>Undefined behaviour; do not use. </TD>
89d0cef73dSGregory Neil Shapiro  </TR>
90d0cef73dSGregory Neil Shapiro  <TR valign="top">
91d0cef73dSGregory Neil Shapiro     <TD>SMFIS_TEMPFAIL</TD>
92d0cef73dSGregory Neil Shapiro     <TD>Reject all commands and messages from this client with a
93d0cef73dSGregory Neil Shapiro        temporary failure reply code.
94d0cef73dSGregory Neil Shapiro	If also used in conjunction with <CODE>smfi_setreply()</CODE>
95d0cef73dSGregory Neil Shapiro	to set a reply whose SMTP code is 421,
96d0cef73dSGregory Neil Shapiro	the MTA will drop the connection immediately. </TD>
97d0cef73dSGregory Neil Shapiro  </TR>
98d0cef73dSGregory Neil Shapiro  <TR valign="top">
99d0cef73dSGregory Neil Shapiro     <TD>SMFIS_REJECT</TD>
100d0cef73dSGregory Neil Shapiro     <TD>Reject all commands and messages from this client with a
101d0cef73dSGregory Neil Shapiro         permanent failure reply code. </TD>
102d0cef73dSGregory Neil Shapiro  </TR>
103d0cef73dSGregory Neil Shapiro</TABLE>
104d0cef73dSGregory Neil Shapiro</TR>
10540266059SGregory Neil Shapiro-->
10640266059SGregory Neil Shapiro<!----------- Notes ---------->
107d0cef73dSGregory Neil Shapiro<TR>
108d0cef73dSGregory Neil Shapiro<TH valign="top" align=left>NOTES</TH>
109d0cef73dSGregory Neil Shapiro<TD>If an earlier filter rejects the connection in its xxfi_connect()
110d0cef73dSGregory Neil Shapiroroutine, this filter's xxfi_connect() will not be called.</TD>
111d0cef73dSGregory Neil Shapiro</TR>
112d0cef73dSGregory Neil Shapiro</TABLE>
11340266059SGregory Neil Shapiro
114d0cef73dSGregory Neil Shapiro<HR size="1">
115d0cef73dSGregory Neil Shapiro<FONT size="-1">
1165dd76dd0SGregory Neil ShapiroCopyright (c) 2000-2001, 2003, 2007 Proofpoint, Inc. and its suppliers.
11740266059SGregory Neil ShapiroAll rights reserved.
118d0cef73dSGregory Neil Shapiro<BR>
11940266059SGregory Neil ShapiroBy using this file, you agree to the terms and conditions set
1205ef517c0SGregory Neil Shapiroforth in the LICENSE.
121d0cef73dSGregory Neil Shapiro</FONT>
122d0cef73dSGregory Neil Shapiro</BODY>
123d0cef73dSGregory Neil Shapiro</HTML>
124