1168515Sgshapiro<HTML>
2168515Sgshapiro<HEAD><TITLE>smfi_setconn</TITLE></HEAD>
3168515Sgshapiro<BODY>
4132943Sgshapiro<!--
5266692Sgshapiro$Id: smfi_setconn.html,v 1.18 2013-11-22 20:51:39 ca Exp $
6132943Sgshapiro-->
7168515Sgshapiro<H1>smfi_setconn</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;
1490792Sgshapiroint smfi_setconn(
1590792Sgshapiro	char *oconn;
1690792Sgshapiro);
17168515Sgshapiro</PRE>
1890792SgshapiroSet the socket through which this filter should communicate with sendmail.
19168515Sgshapiro</TD></TR>
2090792Sgshapiro
2190792Sgshapiro<!----------- Description ---------->
22168515Sgshapiro<TR><TH valign="top" align=left>DESCRIPTION</TH><TD>
23168515Sgshapiro<TABLE border="1" cellspacing=1 cellpadding=4>
24168515Sgshapiro<TR align="left" valign=top>
25168515Sgshapiro<TH width="80">Called When</TH>
26168515Sgshapiro<TD>smfi_setconn must be called once before <A href="smfi_main.html">smfi_main</A>.</TD>
27168515Sgshapiro</TR>
28168515Sgshapiro<TR align="left" valign=top>
29168515Sgshapiro<TH width="80">Effects</TH>
30168515Sgshapiro<TD>Sets the socket through which the filter communicates with sendmail.</TD>
31168515Sgshapiro</TR>
32168515Sgshapiro</TABLE>
3390792Sgshapiro
3490792Sgshapiro<!----------- Arguments ---------->
35168515Sgshapiro<TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
36168515Sgshapiro    <TABLE border="1" cellspacing=0>
37168515Sgshapiro    <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
38168515Sgshapiro    <TR valign="top"><TD>oconn</TD>
39168515Sgshapiro	<TD>The address of the desired communication socket.  
4090792Sgshapiro	The address should be a NULL-terminated string in "proto:address" 
4190792Sgshapiro	format:
42168515Sgshapiro	<UL>
43168515Sgshapiro	<LI><CODE>{unix|local}:/path/to/file</CODE> -- A named pipe.
44168515Sgshapiro	<LI><CODE>inet:port@{hostname|ip-address}</CODE> -- An IPV4 socket.
45168515Sgshapiro	<LI><CODE>inet6:port@{hostname|ip-address}</CODE> -- An IPV6 socket.
46168515Sgshapiro	</UL>
47168515Sgshapiro	</TD></TR>
48168515Sgshapiro    </TABLE>
49168515Sgshapiro</TD></TR>
5090792Sgshapiro
5190792Sgshapiro<!----------- Return values ---------->
52168515Sgshapiro<TR>
53168515Sgshapiro<TH valign="top" align=left>RETURN VALUES</TH> 
5490792Sgshapiro
55168515Sgshapiro<TD>smfi_setconn will not fail on an invalid address.
56168515SgshapiroThe failure will only be detected in <A href="smfi_main.html">smfi_main</A>.
57112810SgshapiroNevertheless, smfi_setconn may fail for other reasons, e.g.,
58112810Sgshapirodue to a lack of memory.
59168515Sgshapiro</TD>
60168515Sgshapiro</TR>
6190792Sgshapiro
62168515Sgshapiro<TR>
63168515Sgshapiro<TH valign="top" align=left>NOTES</TH> 
6490792Sgshapiro
65168515Sgshapiro<TD>
66168515Sgshapiro<UL>
67168515Sgshapiro  <LI>If possible, filters should not run as root when communicating
68112810Sgshapiro	over unix/local domain sockets.
69168515Sgshapiro  <LI>Unix/local sockets should have their permissions set to
70112810Sgshapiro	0600 (read/write permission only for the socket's owner) or
71112810Sgshapiro	0660 (read/write permission for the socket's owner and group)
72112810Sgshapiro	which is useful if the sendmail RunAsUser option is used.
73112810Sgshapiro	The permissions for a unix/local domain socket are determined as
74168515Sgshapiro	usual by <CODE>umask</CODE>, which should be set to 007 or 077.
75120256Sgshapiro        Note some operating systems (e.g, Solaris) don't use the
76120256Sgshapiro        permissions of the socket.  On those systems, place the socket in a
77120256Sgshapiro        protected directory.
78168515Sgshapiro</UL>
79168515Sgshapiro</TD>
80168515Sgshapiro</TR>
8190792Sgshapiro
82168515Sgshapiro</TABLE>
8390792Sgshapiro
84168515Sgshapiro<HR size="1">
85168515Sgshapiro<FONT size="-1">
86261363SgshapiroCopyright (c) 2000, 2003 Proofpoint, Inc. and its suppliers.
8790792SgshapiroAll rights reserved.
88168515Sgshapiro<BR>
8990792SgshapiroBy using this file, you agree to the terms and conditions set
90112810Sgshapiroforth in the LICENSE.
91168515Sgshapiro</FONT>
92168515Sgshapiro</BODY>
93168515Sgshapiro</HTML>
94