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