1d0cef73dSGregory Neil Shapiro<HTML> 2d0cef73dSGregory Neil Shapiro<HEAD><TITLE>smfi_setconn</TITLE></HEAD> 3d0cef73dSGregory Neil Shapiro<BODY> 4e92d3f3fSGregory Neil Shapiro<!-- 5d0cef73dSGregory Neil Shapiro$Id: smfi_setconn.html,v 1.17 2006/12/21 18:30:35 ca Exp $ 6e92d3f3fSGregory Neil Shapiro--> 7d0cef73dSGregory Neil Shapiro<H1>smfi_setconn</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 Shapiroint smfi_setconn( 1540266059SGregory Neil Shapiro char *oconn; 1640266059SGregory Neil Shapiro); 17d0cef73dSGregory Neil Shapiro</PRE> 1840266059SGregory Neil ShapiroSet the socket through which this filter should communicate with sendmail. 19d0cef73dSGregory Neil Shapiro</TD></TR> 2040266059SGregory Neil Shapiro 2140266059SGregory Neil Shapiro<!----------- Description ----------> 22d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left>DESCRIPTION</TH><TD> 23d0cef73dSGregory Neil Shapiro<TABLE border="1" cellspacing=1 cellpadding=4> 24d0cef73dSGregory Neil Shapiro<TR align="left" valign=top> 25d0cef73dSGregory Neil Shapiro<TH width="80">Called When</TH> 26d0cef73dSGregory Neil Shapiro<TD>smfi_setconn must be called once before <A href="smfi_main.html">smfi_main</A>.</TD> 27d0cef73dSGregory Neil Shapiro</TR> 28d0cef73dSGregory Neil Shapiro<TR align="left" valign=top> 29d0cef73dSGregory Neil Shapiro<TH width="80">Effects</TH> 30d0cef73dSGregory Neil Shapiro<TD>Sets the socket through which the filter communicates with sendmail.</TD> 31d0cef73dSGregory Neil Shapiro</TR> 32d0cef73dSGregory Neil Shapiro</TABLE> 3340266059SGregory Neil Shapiro 3440266059SGregory Neil Shapiro<!----------- Arguments ----------> 35d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left>ARGUMENTS</TH><TD> 36d0cef73dSGregory Neil Shapiro <TABLE border="1" cellspacing=0> 37d0cef73dSGregory Neil Shapiro <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR> 38d0cef73dSGregory Neil Shapiro <TR valign="top"><TD>oconn</TD> 39d0cef73dSGregory Neil Shapiro <TD>The address of the desired communication socket. 4040266059SGregory Neil Shapiro The address should be a NULL-terminated string in "proto:address" 4140266059SGregory Neil Shapiro format: 42d0cef73dSGregory Neil Shapiro <UL> 43d0cef73dSGregory Neil Shapiro <LI><CODE>{unix|local}:/path/to/file</CODE> -- A named pipe. 44d0cef73dSGregory Neil Shapiro <LI><CODE>inet:port@{hostname|ip-address}</CODE> -- An IPV4 socket. 45d0cef73dSGregory Neil Shapiro <LI><CODE>inet6:port@{hostname|ip-address}</CODE> -- An IPV6 socket. 46d0cef73dSGregory Neil Shapiro </UL> 47d0cef73dSGregory Neil Shapiro </TD></TR> 48d0cef73dSGregory Neil Shapiro </TABLE> 49d0cef73dSGregory Neil Shapiro</TD></TR> 5040266059SGregory Neil Shapiro 5140266059SGregory Neil Shapiro<!----------- Return values ----------> 52d0cef73dSGregory Neil Shapiro<TR> 53d0cef73dSGregory Neil Shapiro<TH valign="top" align=left>RETURN VALUES</TH> 5440266059SGregory Neil Shapiro 55d0cef73dSGregory Neil Shapiro<TD>smfi_setconn will not fail on an invalid address. 56d0cef73dSGregory Neil ShapiroThe failure will only be detected in <A href="smfi_main.html">smfi_main</A>. 575ef517c0SGregory Neil ShapiroNevertheless, smfi_setconn may fail for other reasons, e.g., 585ef517c0SGregory Neil Shapirodue to a lack of memory. 59d0cef73dSGregory Neil Shapiro</TD> 60d0cef73dSGregory Neil Shapiro</TR> 6140266059SGregory Neil Shapiro 62d0cef73dSGregory Neil Shapiro<TR> 63d0cef73dSGregory Neil Shapiro<TH valign="top" align=left>NOTES</TH> 6440266059SGregory Neil Shapiro 65d0cef73dSGregory Neil Shapiro<TD> 66d0cef73dSGregory Neil Shapiro<UL> 67d0cef73dSGregory Neil Shapiro <LI>If possible, filters should not run as root when communicating 685ef517c0SGregory Neil Shapiro over unix/local domain sockets. 69d0cef73dSGregory Neil Shapiro <LI>Unix/local sockets should have their permissions set to 705ef517c0SGregory Neil Shapiro 0600 (read/write permission only for the socket's owner) or 715ef517c0SGregory Neil Shapiro 0660 (read/write permission for the socket's owner and group) 725ef517c0SGregory Neil Shapiro which is useful if the sendmail RunAsUser option is used. 735ef517c0SGregory Neil Shapiro The permissions for a unix/local domain socket are determined as 74d0cef73dSGregory Neil Shapiro usual by <CODE>umask</CODE>, which should be set to 007 or 077. 75a7ec597cSGregory Neil Shapiro Note some operating systems (e.g, Solaris) don't use the 76a7ec597cSGregory Neil Shapiro permissions of the socket. On those systems, place the socket in a 77a7ec597cSGregory Neil Shapiro protected directory. 78d0cef73dSGregory Neil Shapiro</UL> 79d0cef73dSGregory Neil Shapiro</TD> 80d0cef73dSGregory Neil Shapiro</TR> 8140266059SGregory Neil Shapiro 82d0cef73dSGregory Neil Shapiro</TABLE> 8340266059SGregory Neil Shapiro 84d0cef73dSGregory Neil Shapiro<HR size="1"> 85d0cef73dSGregory Neil Shapiro<FONT size="-1"> 865ef517c0SGregory Neil ShapiroCopyright (c) 2000, 2003 Sendmail, Inc. and its suppliers. 8740266059SGregory Neil ShapiroAll rights reserved. 88d0cef73dSGregory Neil Shapiro<BR> 8940266059SGregory Neil ShapiroBy using this file, you agree to the terms and conditions set 905ef517c0SGregory Neil Shapiroforth in the LICENSE. 91d0cef73dSGregory Neil Shapiro</FONT> 92d0cef73dSGregory Neil Shapiro</BODY> 93d0cef73dSGregory Neil Shapiro</HTML> 94