xref: /freebsd/contrib/sendmail/libmilter/docs/smfi_setconn.html (revision e17f5b1d307b7b8910d67883e57a9604305906d5)
1<HTML>
2<HEAD><TITLE>smfi_setconn</TITLE></HEAD>
3<BODY>
4<!--
5$Id: smfi_setconn.html,v 1.18 2013-11-22 20:51:39 ca Exp $
6-->
7<H1>smfi_setconn</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;
14int smfi_setconn(
15	char *oconn;
16);
17</PRE>
18Set the socket through which this filter should communicate with sendmail.
19</TD></TR>
20
21<!----------- Description ---------->
22<TR><TH valign="top" align=left>DESCRIPTION</TH><TD>
23<TABLE border="1" cellspacing=1 cellpadding=4>
24<TR align="left" valign=top>
25<TH width="80">Called When</TH>
26<TD>smfi_setconn must be called once before <A href="smfi_main.html">smfi_main</A>.</TD>
27</TR>
28<TR align="left" valign=top>
29<TH width="80">Effects</TH>
30<TD>Sets the socket through which the filter communicates with sendmail.</TD>
31</TR>
32</TABLE>
33</TD></TR>
34
35<!----------- Arguments ---------->
36<TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
37    <TABLE border="1" cellspacing=0>
38    <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
39    <TR valign="top"><TD>oconn</TD>
40	<TD>The address of the desired communication socket.
41	The address should be a NULL-terminated string in "proto:address"
42	format:
43	<UL>
44	<LI><CODE>{unix|local}:/path/to/file</CODE> -- A named pipe.
45	<LI><CODE>inet:port@{hostname|ip-address}</CODE> -- An IPV4 socket.
46	<LI><CODE>inet6:port@{hostname|ip-address}</CODE> -- An IPV6 socket.
47	</UL>
48	</TD></TR>
49    </TABLE>
50</TD></TR>
51
52<!----------- Return values ---------->
53<TR>
54<TH valign="top" align=left>RETURN VALUES</TH>
55
56<TD>smfi_setconn will not fail on an invalid address.
57The failure will only be detected in <A href="smfi_main.html">smfi_main</A>.
58Nevertheless, smfi_setconn may fail for other reasons, e.g.,
59due to a lack of memory.
60</TD>
61</TR>
62
63<TR>
64<TH valign="top" align=left>NOTES</TH>
65
66<TD>
67<UL>
68  <LI>If possible, filters should not run as root when communicating
69	over unix/local domain sockets.
70  <LI>Unix/local sockets should have their permissions set to
71	0600 (read/write permission only for the socket's owner) or
72	0660 (read/write permission for the socket's owner and group)
73	which is useful if the sendmail RunAsUser option is used.
74	The permissions for a unix/local domain socket are determined as
75	usual by <CODE>umask</CODE>, which should be set to 007 or 077.
76        Note some operating systems (e.g, Solaris) don't use the
77        permissions of the socket.  On those systems, place the socket in a
78        protected directory.
79</UL>
80</TD>
81</TR>
82
83</TABLE>
84
85<HR size="1">
86<FONT size="-1">
87Copyright (c) 2000, 2003 Proofpoint, Inc. and its suppliers.
88All rights reserved.
89<BR>
90By using this file, you agree to the terms and conditions set
91forth in the LICENSE.
92</FONT>
93</BODY>
94</HTML>
95