1168515Sgshapiro<HTML>
2168515Sgshapiro<HEAD><TITLE>xxfi_connect</TITLE></HEAD>
3168515Sgshapiro<BODY>
4132943Sgshapiro<!--
5266692Sgshapiro$Id: xxfi_connect.html,v 1.20 2013-11-22 20:51:39 ca Exp $
6132943Sgshapiro-->
7168515Sgshapiro<H1>xxfi_connect</H1>
890792Sgshapiro
9168515Sgshapiro<TABLE border="0" cellspacing=4 cellpadding=4>
1090792Sgshapiro<!---------- Synopsis ----------->
11168515Sgshapiro<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD>
12168515Sgshapiro<PRE>
1390792Sgshapiro#include &lt;libmilter/mfapi.h&gt;
1490792Sgshapirosfsistat (*xxfi_connect)(
1590792Sgshapiro        SMFICTX    *ctx, 
1690792Sgshapiro        char       *hostname,
1790792Sgshapiro        _SOCK_ADDR *hostaddr);
18168515Sgshapiro</PRE>
19168515Sgshapiro</TD></TR>
2090792Sgshapiro<!----------- Description ---------->
21168515Sgshapiro<TR><TH valign="top" align=left>DESCRIPTION</TH><TD>
22168515Sgshapiro<TABLE border="1" cellspacing=1 cellpadding=4>
23168515Sgshapiro<TR>
24168515Sgshapiro<TH valign="top" align=left width=80>Called When</TH>
25168515Sgshapiro<TD>Once, at the start of each SMTP connection.</TD>
26168515Sgshapiro</TR>
27168515Sgshapiro<TR>
28168515Sgshapiro<TH valign="top" align=left width=80>Default Behavior</TH>
29168515Sgshapiro<TD>Do nothing; return SMFIS_CONTINUE.</TD>
30168515Sgshapiro</TR>
31168515Sgshapiro</TABLE>
3290792Sgshapiro<!--
3390792SgshapiroThis callback function is invoked on each connection to the mail 
34168515Sgshapirofilter program.
35168515SgshapiroThe callback is to be implemented by the Milter application developers.
36168515SgshapiroThe name of the callback can be any valid function name.
37168515SgshapiroThe function pointer is to be assigned to the
3890792SgshapirosmfiDesc.xxfi_connect and the pointer to the smfiDesc structure
3990792Sgshapirois passed to smfi_register().
40168515Sgshapiro</TD></TR>
4190792Sgshapiro-->
4290792Sgshapiro<!----------- Arguments ---------->
43168515Sgshapiro<TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
44168515Sgshapiro    <TABLE border="1" cellspacing=0>
45168515Sgshapiro    <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
46168515Sgshapiro    <TR><TD>ctx</TD>
47168515Sgshapiro	<TD>the opaque context structure.
48168515Sgshapiro	</TD></TR>
49168515Sgshapiro    <TR><TD>hostname</TD>
50168515Sgshapiro	<TD>the host name of the message sender, as determined by a
51168515Sgshapiro	reverse lookup on the host address.
52168515Sgshapiro	If the reverse lookup fails
53168515Sgshapiro	or if none of the IP addresses of the resolved host name
54168515Sgshapiro	matches the original IP address,
55168515Sgshapiro	hostname will contain the message sender's IP
56168515Sgshapiro	address enclosed in square brackets (e.g. `[a.b.c.d]').
57168515Sgshapiro	If the SMTP connection is made via stdin the value is
58168515Sgshapiro	<CODE>localhost</CODE>.
59168515Sgshapiro	</TD></TR>
60168515Sgshapiro    <TR><TD>hostaddr</TD>
61168515Sgshapiro	<TD>the host address,
62168515Sgshapiro	as determined by a <CODE>getpeername(2)</CODE> call on the SMTP socket.
63168515Sgshapiro	NULL if the type is not supported in the current version or if
6490792Sgshapiro	the SMTP connection is made via stdin.
65168515Sgshapiro	</TD></TR>
66168515Sgshapiro    </TABLE>
67168515Sgshapiro</TD></TR>
6890792Sgshapiro<!----------- Return values ---------->
6990792Sgshapiro<!--
70168515Sgshapiro<TR>
71168515Sgshapiro<TH valign="top" align=left>SPECIAL RETURN VALUES</TH>
72168515Sgshapiro<TD><TABLE border="1" cellspacing=0>
73168515Sgshapiro  <TR bgcolor="#dddddd"><TH>Return value</TH><TH>Description</TH></TR>
74168515Sgshapiro  <TR valign="top">
75168515Sgshapiro     <TD>SMFIS_ACCEPT</TD>
76168515Sgshapiro     <TD>Accept all commands and messages from this client without any
77168515Sgshapiro         further contact with the filter. </TD>
78168515Sgshapiro     </TD>
79168515Sgshapiro  </TR>
80168515Sgshapiro  <TR valign="top">
81168515Sgshapiro     <TD>SMFIS_CONTINUE</TD>
82168515Sgshapiro     <TD>Continue normal processing. </TD>
83168515Sgshapiro  </TR>
84168515Sgshapiro  <TR valign="top">
85168515Sgshapiro     <TD>SMFIS_DISCARD</TD>
86168515Sgshapiro     <TD>Undefined behaviour; do not use. </TD>
87168515Sgshapiro  </TR>
88168515Sgshapiro  <TR valign="top">
89168515Sgshapiro     <TD>SMFIS_TEMPFAIL</TD>
90168515Sgshapiro     <TD>Reject all commands and messages from this client with a
91168515Sgshapiro        temporary failure reply code.
92168515Sgshapiro	If also used in conjunction with <CODE>smfi_setreply()</CODE>
93168515Sgshapiro	to set a reply whose SMTP code is 421,
94168515Sgshapiro	the MTA will drop the connection immediately. </TD>
95168515Sgshapiro  </TR>
96168515Sgshapiro  <TR valign="top">
97168515Sgshapiro     <TD>SMFIS_REJECT</TD>
98168515Sgshapiro     <TD>Reject all commands and messages from this client with a
99168515Sgshapiro         permanent failure reply code. </TD>
100168515Sgshapiro  </TR>
101168515Sgshapiro</TABLE>
102168515Sgshapiro</TR>
10390792Sgshapiro-->
10490792Sgshapiro<!----------- Notes ---------->
105168515Sgshapiro<TR>
106168515Sgshapiro<TH valign="top" align=left>NOTES</TH> 
107168515Sgshapiro<TD>If an earlier filter rejects the connection in its xxfi_connect()
108168515Sgshapiroroutine, this filter's xxfi_connect() will not be called.</TD>
109168515Sgshapiro</TR>
110168515Sgshapiro</TABLE>
11190792Sgshapiro
112168515Sgshapiro<HR size="1">
113168515Sgshapiro<FONT size="-1">
114261363SgshapiroCopyright (c) 2000-2001, 2003, 2007 Proofpoint, Inc. and its suppliers.
11590792SgshapiroAll rights reserved.
116168515Sgshapiro<BR>
11790792SgshapiroBy using this file, you agree to the terms and conditions set
118112810Sgshapiroforth in the LICENSE.
119168515Sgshapiro</FONT>
120168515Sgshapiro</BODY>
121168515Sgshapiro</HTML>
122