smfi_setconn.html revision 120256
1181624Skmacy<html>
2181624Skmacy<head><title>smfi_setconn</title></head>
3181624Skmacy<body>
4181624Skmacy<h1>smfi_setconn</h1>
5181624Skmacy
6181624Skmacy<table border="0" cellspacing=4 cellpadding=4>
7181624Skmacy<!---------- Synopsis ----------->
8181624Skmacy<tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
9181624Skmacy<pre>
10181624Skmacy#include &lt;libmilter/mfapi.h&gt;
11181624Skmacyint smfi_setconn(
12181624Skmacy	char *oconn;
13181624Skmacy);
14181624Skmacy</pre>
15181624SkmacySet the socket through which this filter should communicate with sendmail.
16181624Skmacy</td></tr>
17181624Skmacy
18181624Skmacy<!----------- Description ---------->
19181624Skmacy<tr><th valign="top" align=left>DESCRIPTION</th><td>
20181624Skmacy<table border="1" cellspacing=1 cellpadding=4>
21181624Skmacy<tr align="left" valign=top>
22181624Skmacy<th width="80">Called When</th>
23181624Skmacy<td>smfi_setconn must be called once before <a href="smfi_main.html">smfi_main</a>.</td>
24181624Skmacy</tr>
25181624Skmacy<tr align="left" valign=top>
26181624Skmacy<th width="80">Effects</th>
27181624Skmacy<td>Sets the socket through which the filter communicates with sendmail.</td>
28181624Skmacy</tr>
29181624Skmacy</table>
30181624Skmacy
31181624Skmacy<!----------- Arguments ---------->
32181624Skmacy<tr><th valign="top" align=left>ARGUMENTS</th><td>
33181624Skmacy    <table border="1" cellspacing=0>
34181624Skmacy    <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr>
35181624Skmacy    <tr valign="top"><td>oconn</td>
36181624Skmacy	<td>The address of the desired communication socket.  
37181624Skmacy	The address should be a NULL-terminated string in "proto:address" 
38181624Skmacy	format:
39214077Sgibbs	<ul>
40214077Sgibbs	<li><code>{unix|local}:/path/to/file</code> -- A named pipe.
41214077Sgibbs	<li><code>inet:port@{hostname|ip-address}</code> -- An IPV4 socket.
42181624Skmacy	<li><code>inet6:port@{hostname|ip-address}</code> -- An IPV6 socket.
43181624Skmacy	</ul>
44181624Skmacy	</td></tr>
45181624Skmacy    </table>
46181624Skmacy</td></tr>
47181624Skmacy
48181624Skmacy<!----------- Return values ---------->
49181624Skmacy<tr>
50181624Skmacy<th valign="top" align=left>RETURN VALUES</th> 
51181624Skmacy
52181624Skmacy<td>smfi_setconn will not fail on an invalid address.
53181624SkmacyThe failure will only be detected in <a href="smfi_main.html">smfi_main</a></td>.
54181624SkmacyNevertheless, smfi_setconn may fail for other reasons, e.g.,
55214077Sgibbsdue to a lack of memory.
56214077Sgibbs</tr>
57214077Sgibbs
58181624Skmacy<tr>
59181624Skmacy<th valign="top" align=left>NOTES</th> 
60181624Skmacy
61181624Skmacy<td>
62181624Skmacy<ul>
63181624Skmacy  <li>If possible, filters should not run as root when communicating
64181624Skmacy	over unix/local domain sockets.
65214077Sgibbs  <li>Unix/local sockets should have their permissions set to
66214077Sgibbs	0600 (read/write permission only for the socket's owner) or
67222975Sgibbs	0660 (read/write permission for the socket's owner and group)
68222975Sgibbs	which is useful if the sendmail RunAsUser option is used.
69222975Sgibbs	The permissions for a unix/local domain socket are determined as
70222975Sgibbs	usual by <code>umask</code>, which should be set to 007 or 077.
71222975Sgibbs        Note some operating systems (e.g, Solaris) don't use the
72222975Sgibbs        permissions of the socket.  On those systems, place the socket in a
73222975Sgibbs        protected directory.
74222975Sgibbs</ul>
75222975Sgibbs</td>
76214077Sgibbs</tr>
77183375Skmacy
78183375Skmacy</table>
79183375Skmacy
80183375Skmacy<hr size="1">
81183375Skmacy<font size="-1">
82183375SkmacyCopyright (c) 2000, 2003 Sendmail, Inc. and its suppliers.
83183375SkmacyAll rights reserved.
84183375Skmacy<br>
85181624SkmacyBy using this file, you agree to the terms and conditions set
86181624Skmacyforth in the LICENSE.
87181624Skmacy</font>
88181624Skmacy</body>
89181624Skmacy</html>
90181624Skmacy