xref: /freebsd/contrib/sendmail/libmilter/docs/smfi_setconn.html (revision e92d3f3ffe83a6ed7eaafac70da9cf4fafe13243)
140266059SGregory Neil Shapiro<html>
240266059SGregory Neil Shapiro<head><title>smfi_setconn</title></head>
340266059SGregory Neil Shapiro<body>
4e92d3f3fSGregory Neil Shapiro<!--
5e92d3f3fSGregory Neil Shapiro$Id: smfi_setconn.html,v 1.14 2003/05/26 05:09:16 gshapiro Exp $
6e92d3f3fSGregory Neil Shapiro-->
740266059SGregory Neil Shapiro<h1>smfi_setconn</h1>
840266059SGregory Neil Shapiro
940266059SGregory Neil Shapiro<table border="0" cellspacing=4 cellpadding=4>
1040266059SGregory Neil Shapiro<!---------- Synopsis ----------->
1140266059SGregory Neil Shapiro<tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
1240266059SGregory Neil Shapiro<pre>
1340266059SGregory Neil Shapiro#include &lt;libmilter/mfapi.h&gt;
1440266059SGregory Neil Shapiroint smfi_setconn(
1540266059SGregory Neil Shapiro	char *oconn;
1640266059SGregory Neil Shapiro);
1740266059SGregory Neil Shapiro</pre>
1840266059SGregory Neil ShapiroSet the socket through which this filter should communicate with sendmail.
1940266059SGregory Neil Shapiro</td></tr>
2040266059SGregory Neil Shapiro
2140266059SGregory Neil Shapiro<!----------- Description ---------->
2240266059SGregory Neil Shapiro<tr><th valign="top" align=left>DESCRIPTION</th><td>
2340266059SGregory Neil Shapiro<table border="1" cellspacing=1 cellpadding=4>
2440266059SGregory Neil Shapiro<tr align="left" valign=top>
2540266059SGregory Neil Shapiro<th width="80">Called When</th>
2640266059SGregory Neil Shapiro<td>smfi_setconn must be called once before <a href="smfi_main.html">smfi_main</a>.</td>
2740266059SGregory Neil Shapiro</tr>
2840266059SGregory Neil Shapiro<tr align="left" valign=top>
2940266059SGregory Neil Shapiro<th width="80">Effects</th>
3040266059SGregory Neil Shapiro<td>Sets the socket through which the filter communicates with sendmail.</td>
3140266059SGregory Neil Shapiro</tr>
3240266059SGregory Neil Shapiro</table>
3340266059SGregory Neil Shapiro
3440266059SGregory Neil Shapiro<!----------- Arguments ---------->
3540266059SGregory Neil Shapiro<tr><th valign="top" align=left>ARGUMENTS</th><td>
3640266059SGregory Neil Shapiro    <table border="1" cellspacing=0>
3740266059SGregory Neil Shapiro    <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr>
3840266059SGregory Neil Shapiro    <tr valign="top"><td>oconn</td>
3940266059SGregory Neil Shapiro	<td>The address of the desired communication socket.
4040266059SGregory Neil Shapiro	The address should be a NULL-terminated string in "proto:address"
4140266059SGregory Neil Shapiro	format:
4240266059SGregory Neil Shapiro	<ul>
4340266059SGregory Neil Shapiro	<li><code>{unix|local}:/path/to/file</code> -- A named pipe.
4440266059SGregory Neil Shapiro	<li><code>inet:port@{hostname|ip-address}</code> -- An IPV4 socket.
4540266059SGregory Neil Shapiro	<li><code>inet6:port@{hostname|ip-address}</code> -- An IPV6 socket.
4640266059SGregory Neil Shapiro	</ul>
4740266059SGregory Neil Shapiro	</td></tr>
4840266059SGregory Neil Shapiro    </table>
4940266059SGregory Neil Shapiro</td></tr>
5040266059SGregory Neil Shapiro
5140266059SGregory Neil Shapiro<!----------- Return values ---------->
5240266059SGregory Neil Shapiro<tr>
5340266059SGregory Neil Shapiro<th valign="top" align=left>RETURN VALUES</th>
5440266059SGregory Neil Shapiro
555ef517c0SGregory Neil Shapiro<td>smfi_setconn will not fail on an invalid address.
565ef517c0SGregory Neil ShapiroThe failure will only be detected in <a href="smfi_main.html">smfi_main</a></td>.
575ef517c0SGregory Neil ShapiroNevertheless, smfi_setconn may fail for other reasons, e.g.,
585ef517c0SGregory Neil Shapirodue to a lack of memory.
5940266059SGregory Neil Shapiro</tr>
6040266059SGregory Neil Shapiro
6140266059SGregory Neil Shapiro<tr>
6240266059SGregory Neil Shapiro<th valign="top" align=left>NOTES</th>
6340266059SGregory Neil Shapiro
6440266059SGregory Neil Shapiro<td>
655ef517c0SGregory Neil Shapiro<ul>
665ef517c0SGregory Neil Shapiro  <li>If possible, filters should not run as root when communicating
675ef517c0SGregory Neil Shapiro	over unix/local domain sockets.
685ef517c0SGregory Neil Shapiro  <li>Unix/local sockets should have their permissions set to
695ef517c0SGregory Neil Shapiro	0600 (read/write permission only for the socket's owner) or
705ef517c0SGregory Neil Shapiro	0660 (read/write permission for the socket's owner and group)
715ef517c0SGregory Neil Shapiro	which is useful if the sendmail RunAsUser option is used.
725ef517c0SGregory Neil Shapiro	The permissions for a unix/local domain socket are determined as
73a7ec597cSGregory Neil Shapiro	usual by <code>umask</code>, which should be set to 007 or 077.
74a7ec597cSGregory Neil Shapiro        Note some operating systems (e.g, Solaris) don't use the
75a7ec597cSGregory Neil Shapiro        permissions of the socket.  On those systems, place the socket in a
76a7ec597cSGregory Neil Shapiro        protected directory.
7740266059SGregory Neil Shapiro</ul>
7840266059SGregory Neil Shapiro</td>
7940266059SGregory Neil Shapiro</tr>
8040266059SGregory Neil Shapiro
8140266059SGregory Neil Shapiro</table>
8240266059SGregory Neil Shapiro
8340266059SGregory Neil Shapiro<hr size="1">
8440266059SGregory Neil Shapiro<font size="-1">
855ef517c0SGregory Neil ShapiroCopyright (c) 2000, 2003 Sendmail, Inc. and its suppliers.
8640266059SGregory Neil ShapiroAll rights reserved.
8740266059SGregory Neil Shapiro<br>
8840266059SGregory Neil ShapiroBy using this file, you agree to the terms and conditions set
895ef517c0SGregory Neil Shapiroforth in the LICENSE.
9040266059SGregory Neil Shapiro</font>
9140266059SGregory Neil Shapiro</body>
9240266059SGregory Neil Shapiro</html>
93