1d0cef73dSGregory Neil Shapiro<HTML> 2d0cef73dSGregory Neil Shapiro<HEAD><TITLE>xxfi_connect</TITLE></HEAD> 3d0cef73dSGregory Neil Shapiro<BODY> 4e92d3f3fSGregory Neil Shapiro<!-- 5d0cef73dSGregory Neil Shapiro$Id: xxfi_connect.html,v 1.19 2007/01/15 22:24:45 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 <libmilter/mfapi.h> 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> 3240266059SGregory Neil Shapiro<!-- 3340266059SGregory Neil ShapiroThis callback function is invoked on each connection to the mail 34d0cef73dSGregory Neil Shapirofilter program. 35d0cef73dSGregory Neil ShapiroThe callback is to be implemented by the Milter application developers. 36d0cef73dSGregory Neil ShapiroThe name of the callback can be any valid function name. 37d0cef73dSGregory Neil ShapiroThe function pointer is to be assigned to the 3840266059SGregory Neil ShapirosmfiDesc.xxfi_connect and the pointer to the smfiDesc structure 3940266059SGregory Neil Shapirois passed to smfi_register(). 40d0cef73dSGregory Neil Shapiro</TD></TR> 4140266059SGregory Neil Shapiro--> 4240266059SGregory Neil Shapiro<!----------- Arguments ----------> 43d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left>ARGUMENTS</TH><TD> 44d0cef73dSGregory Neil Shapiro <TABLE border="1" cellspacing=0> 45d0cef73dSGregory Neil Shapiro <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR> 46d0cef73dSGregory Neil Shapiro <TR><TD>ctx</TD> 47d0cef73dSGregory Neil Shapiro <TD>the opaque context structure. 48d0cef73dSGregory Neil Shapiro </TD></TR> 49d0cef73dSGregory Neil Shapiro <TR><TD>hostname</TD> 50d0cef73dSGregory Neil Shapiro <TD>the host name of the message sender, as determined by a 51d0cef73dSGregory Neil Shapiro reverse lookup on the host address. 52d0cef73dSGregory Neil Shapiro If the reverse lookup fails 53d0cef73dSGregory Neil Shapiro or if none of the IP addresses of the resolved host name 54d0cef73dSGregory Neil Shapiro matches the original IP address, 55d0cef73dSGregory Neil Shapiro hostname will contain the message sender's IP 5640266059SGregory Neil Shapiro address enclosed in square brackets (e.g. `[a.b.c.d]'). 57d0cef73dSGregory Neil Shapiro If the SMTP connection is made via stdin the value is 58d0cef73dSGregory Neil Shapiro <CODE>localhost</CODE>. 59d0cef73dSGregory Neil Shapiro </TD></TR> 60d0cef73dSGregory Neil Shapiro <TR><TD>hostaddr</TD> 61d0cef73dSGregory Neil Shapiro <TD>the host address, 62d0cef73dSGregory Neil Shapiro as determined by a <CODE>getpeername(2)</CODE> call on the SMTP socket. 6340266059SGregory Neil Shapiro NULL if the type is not supported in the current version or if 6440266059SGregory Neil Shapiro the SMTP connection is made via stdin. 65d0cef73dSGregory Neil Shapiro </TD></TR> 66d0cef73dSGregory Neil Shapiro </TABLE> 67d0cef73dSGregory Neil Shapiro</TD></TR> 6840266059SGregory Neil Shapiro<!----------- Return values ----------> 6940266059SGregory Neil Shapiro<!-- 70d0cef73dSGregory Neil Shapiro<TR> 71d0cef73dSGregory Neil Shapiro<TH valign="top" align=left>SPECIAL RETURN VALUES</TH> 72d0cef73dSGregory Neil Shapiro<TD><TABLE border="1" cellspacing=0> 73d0cef73dSGregory Neil Shapiro <TR bgcolor="#dddddd"><TH>Return value</TH><TH>Description</TH></TR> 74d0cef73dSGregory Neil Shapiro <TR valign="top"> 75d0cef73dSGregory Neil Shapiro <TD>SMFIS_ACCEPT</TD> 76d0cef73dSGregory Neil Shapiro <TD>Accept all commands and messages from this client without any 77d0cef73dSGregory Neil Shapiro further contact with the filter. </TD> 78d0cef73dSGregory Neil Shapiro </TD> 79d0cef73dSGregory Neil Shapiro </TR> 80d0cef73dSGregory Neil Shapiro <TR valign="top"> 81d0cef73dSGregory Neil Shapiro <TD>SMFIS_CONTINUE</TD> 82d0cef73dSGregory Neil Shapiro <TD>Continue normal processing. </TD> 83d0cef73dSGregory Neil Shapiro </TR> 84d0cef73dSGregory Neil Shapiro <TR valign="top"> 85d0cef73dSGregory Neil Shapiro <TD>SMFIS_DISCARD</TD> 86d0cef73dSGregory Neil Shapiro <TD>Undefined behaviour; do not use. </TD> 87d0cef73dSGregory Neil Shapiro </TR> 88d0cef73dSGregory Neil Shapiro <TR valign="top"> 89d0cef73dSGregory Neil Shapiro <TD>SMFIS_TEMPFAIL</TD> 90d0cef73dSGregory Neil Shapiro <TD>Reject all commands and messages from this client with a 91d0cef73dSGregory Neil Shapiro temporary failure reply code. 92d0cef73dSGregory Neil Shapiro If also used in conjunction with <CODE>smfi_setreply()</CODE> 93d0cef73dSGregory Neil Shapiro to set a reply whose SMTP code is 421, 94d0cef73dSGregory Neil Shapiro the MTA will drop the connection immediately. </TD> 95d0cef73dSGregory Neil Shapiro </TR> 96d0cef73dSGregory Neil Shapiro <TR valign="top"> 97d0cef73dSGregory Neil Shapiro <TD>SMFIS_REJECT</TD> 98d0cef73dSGregory Neil Shapiro <TD>Reject all commands and messages from this client with a 99d0cef73dSGregory Neil Shapiro permanent failure reply code. </TD> 100d0cef73dSGregory Neil Shapiro </TR> 101d0cef73dSGregory Neil Shapiro</TABLE> 102d0cef73dSGregory Neil Shapiro</TR> 10340266059SGregory Neil Shapiro--> 10440266059SGregory Neil Shapiro<!----------- Notes ----------> 105d0cef73dSGregory Neil Shapiro<TR> 106d0cef73dSGregory Neil Shapiro<TH valign="top" align=left>NOTES</TH> 107d0cef73dSGregory Neil Shapiro<TD>If an earlier filter rejects the connection in its xxfi_connect() 108d0cef73dSGregory Neil Shapiroroutine, this filter's xxfi_connect() will not be called.</TD> 109d0cef73dSGregory Neil Shapiro</TR> 110d0cef73dSGregory Neil Shapiro</TABLE> 11140266059SGregory Neil Shapiro 112d0cef73dSGregory Neil Shapiro<HR size="1"> 113d0cef73dSGregory Neil Shapiro<FONT size="-1"> 114d0cef73dSGregory Neil ShapiroCopyright (c) 2000-2001, 2003, 2007 Sendmail, Inc. and its suppliers. 11540266059SGregory Neil ShapiroAll rights reserved. 116d0cef73dSGregory Neil Shapiro<BR> 11740266059SGregory Neil ShapiroBy using this file, you agree to the terms and conditions set 1185ef517c0SGregory Neil Shapiroforth in the LICENSE. 119d0cef73dSGregory Neil Shapiro</FONT> 120d0cef73dSGregory Neil Shapiro</BODY> 121d0cef73dSGregory Neil Shapiro</HTML> 122