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