1<html> 2<head><title>smfi_setconn</title></head> 3<body> 4<h1>smfi_setconn</h1> 5 6<table border="0" cellspacing=4 cellpadding=4> 7<!---------- Synopsis -----------> 8<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> 9<pre> 10#include <libmilter/mfapi.h> 11int smfi_setconn( 12 char *oconn; 13); 14</pre> 15Set the socket through which this filter should communicate with sendmail. 16</td></tr> 17 18<!----------- Description ----------> 19<tr><th valign="top" align=left>DESCRIPTION</th><td> 20<table border="1" cellspacing=1 cellpadding=4> 21<tr align="left" valign=top> 22<th width="80">Called When</th> 23<td>smfi_setconn must be called once before <a href="smfi_main.html">smfi_main</a>.</td> 24</tr> 25<tr align="left" valign=top> 26<th width="80">Effects</th> 27<td>Sets the socket through which the filter communicates with sendmail.</td> 28</tr> 29</table> 30 31<!----------- Arguments ----------> 32<tr><th valign="top" align=left>ARGUMENTS</th><td> 33 <table border="1" cellspacing=0> 34 <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> 35 <tr valign="top"><td>oconn</td> 36 <td>The address of the desired communication socket. 37 The address should be a NULL-terminated string in "proto:address" 38 format: 39 <ul> 40 <li><code>{unix|local}:/path/to/file</code> -- A named pipe. 41 <li><code>inet:port@{hostname|ip-address}</code> -- An IPV4 socket. 42 <li><code>inet6:port@{hostname|ip-address}</code> -- An IPV6 socket. 43 </ul> 44 </td></tr> 45 </table> 46</td></tr> 47 48<!----------- Return values ----------> 49<tr> 50<th valign="top" align=left>RETURN VALUES</th> 51 52<td>smfi_setconn will not fail on an invalid address. 53The failure will only be detected in <a href="smfi_main.html">smfi_main</a></td>. 54Nevertheless, smfi_setconn may fail for other reasons, e.g., 55due to a lack of memory. 56</tr> 57 58<tr> 59<th valign="top" align=left>NOTES</th> 60 61<td> 62<ul> 63 <li>If possible, filters should not run as root when communicating 64 over unix/local domain sockets. 65 <li>Unix/local sockets should have their permissions set to 66 0600 (read/write permission only for the socket's owner) or 67 0660 (read/write permission for the socket's owner and group) 68 which is useful if the sendmail RunAsUser option is used. 69 The permissions for a unix/local domain socket are determined as 70 usual by <code>umask</code>, which should be set to 007 or 077 71 before calling <code>smfi_setconn()</code>. 72</ul> 73</td> 74</tr> 75 76</table> 77 78<hr size="1"> 79<font size="-1"> 80Copyright (c) 2000, 2003 Sendmail, Inc. and its suppliers. 81All rights reserved. 82<br> 83By using this file, you agree to the terms and conditions set 84forth in the LICENSE. 85</font> 86</body> 87</html> 88