1<html>
2<head><title>smfi_setconn</title></head>
3<body>
4<!--
5$Id: smfi_setconn.html,v 1.14 2003/05/26 05:09:16 gshapiro 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=150>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
34<!----------- Arguments ---------->
35<tr><th valign="top" align=left>ARGUMENTS</th><td>
36    <table border="1" cellspacing=0>
37    <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr>
38    <tr valign="top"><td>oconn</td>
39	<td>The address of the desired communication socket.
40	The address should be a NULL-terminated string in "proto:address"
41	format:
42	<ul>
43	<li><code>{unix|local}:/path/to/file</code> -- A named pipe.
44	<li><code>inet:port@{hostname|ip-address}</code> -- An IPV4 socket.
45	<li><code>inet6:port@{hostname|ip-address}</code> -- An IPV6 socket.
46	</ul>
47	</td></tr>
48    </table>
49</td></tr>
50
51<!----------- Return values ---------->
52<tr>
53<th valign="top" align=left>RETURN VALUES</th>
54
55<td>smfi_setconn will not fail on an invalid address.
56The failure will only be detected in <a href="smfi_main.html">smfi_main</a></td>.
57Nevertheless, smfi_setconn may fail for other reasons, e.g.,
58due to a lack of memory.
59</tr>
60
61<tr>
62<th valign="top" align=left>NOTES</th>
63
64<td>
65<ul>
66  <li>If possible, filters should not run as root when communicating
67	over unix/local domain sockets.
68  <li>Unix/local sockets should have their permissions set to
69	0600 (read/write permission only for the socket's owner) or
70	0660 (read/write permission for the socket's owner and group)
71	which is useful if the sendmail RunAsUser option is used.
72	The permissions for a unix/local domain socket are determined as
73	usual by <code>umask</code>, which should be set to 007 or 077.
74        Note some operating systems (e.g, Solaris) don't use the
75        permissions of the socket.  On those systems, place the socket in a
76        protected directory.
77</ul>
78</td>
79</tr>
80
81</table>
82
83<hr size="1">
84<font size="-1">
85Copyright (c) 2000, 2003 Sendmail, Inc. and its suppliers.
86All rights reserved.
87<br>
88By using this file, you agree to the terms and conditions set
89forth in the LICENSE.
90</font>
91</body>
92</html>
93