xref: /freebsd/contrib/sendmail/libmilter/docs/smfi_setconn.html (revision e2c0e292e8a7ca00ba99bcfccc9e637f45c3e8b1)
1d0cef73dSGregory Neil Shapiro<HTML>
2d0cef73dSGregory Neil Shapiro<HEAD><TITLE>smfi_setconn</TITLE></HEAD>
3d0cef73dSGregory Neil Shapiro<BODY>
4e92d3f3fSGregory Neil Shapiro<!--
54313cc83SGregory Neil Shapiro$Id: smfi_setconn.html,v 1.18 2013-11-22 20:51:39 ca Exp $
6e92d3f3fSGregory Neil Shapiro-->
7d0cef73dSGregory Neil Shapiro<H1>smfi_setconn</H1>
840266059SGregory Neil Shapiro
9d0cef73dSGregory Neil Shapiro<TABLE border="0" cellspacing=4 cellpadding=4>
1040266059SGregory Neil Shapiro<!---------- Synopsis ----------->
11d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD>
12d0cef73dSGregory 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);
17d0cef73dSGregory Neil Shapiro</PRE>
1840266059SGregory Neil ShapiroSet the socket through which this filter should communicate with sendmail.
19d0cef73dSGregory Neil Shapiro</TD></TR>
2040266059SGregory Neil Shapiro
2140266059SGregory Neil Shapiro<!----------- Description ---------->
22d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left>DESCRIPTION</TH><TD>
23d0cef73dSGregory Neil Shapiro<TABLE border="1" cellspacing=1 cellpadding=4>
24d0cef73dSGregory Neil Shapiro<TR align="left" valign=top>
25d0cef73dSGregory Neil Shapiro<TH width="80">Called When</TH>
26d0cef73dSGregory Neil Shapiro<TD>smfi_setconn must be called once before <A href="smfi_main.html">smfi_main</A>.</TD>
27d0cef73dSGregory Neil Shapiro</TR>
28d0cef73dSGregory Neil Shapiro<TR align="left" valign=top>
29d0cef73dSGregory Neil Shapiro<TH width="80">Effects</TH>
30d0cef73dSGregory Neil Shapiro<TD>Sets the socket through which the filter communicates with sendmail.</TD>
31d0cef73dSGregory Neil Shapiro</TR>
32d0cef73dSGregory Neil Shapiro</TABLE>
33*5b0945b5SGregory Neil Shapiro</TD></TR>
3440266059SGregory Neil Shapiro
3540266059SGregory Neil Shapiro<!----------- Arguments ---------->
36d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
37d0cef73dSGregory Neil Shapiro    <TABLE border="1" cellspacing=0>
38d0cef73dSGregory Neil Shapiro    <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
39d0cef73dSGregory Neil Shapiro    <TR valign="top"><TD>oconn</TD>
40d0cef73dSGregory Neil Shapiro	<TD>The address of the desired communication socket.
4140266059SGregory Neil Shapiro	The address should be a NULL-terminated string in "proto:address"
4240266059SGregory Neil Shapiro	format:
43d0cef73dSGregory Neil Shapiro	<UL>
44d0cef73dSGregory Neil Shapiro	<LI><CODE>{unix|local}:/path/to/file</CODE> -- A named pipe.
45d0cef73dSGregory Neil Shapiro	<LI><CODE>inet:port@{hostname|ip-address}</CODE> -- An IPV4 socket.
46d0cef73dSGregory Neil Shapiro	<LI><CODE>inet6:port@{hostname|ip-address}</CODE> -- An IPV6 socket.
47d0cef73dSGregory Neil Shapiro	</UL>
48d0cef73dSGregory Neil Shapiro	</TD></TR>
49d0cef73dSGregory Neil Shapiro    </TABLE>
50d0cef73dSGregory Neil Shapiro</TD></TR>
5140266059SGregory Neil Shapiro
5240266059SGregory Neil Shapiro<!----------- Return values ---------->
53d0cef73dSGregory Neil Shapiro<TR>
54d0cef73dSGregory Neil Shapiro<TH valign="top" align=left>RETURN VALUES</TH>
5540266059SGregory Neil Shapiro
56d0cef73dSGregory Neil Shapiro<TD>smfi_setconn will not fail on an invalid address.
57d0cef73dSGregory Neil ShapiroThe failure will only be detected in <A href="smfi_main.html">smfi_main</A>.
585ef517c0SGregory Neil ShapiroNevertheless, smfi_setconn may fail for other reasons, e.g.,
595ef517c0SGregory Neil Shapirodue to a lack of memory.
60d0cef73dSGregory Neil Shapiro</TD>
61d0cef73dSGregory Neil Shapiro</TR>
6240266059SGregory Neil Shapiro
63d0cef73dSGregory Neil Shapiro<TR>
64d0cef73dSGregory Neil Shapiro<TH valign="top" align=left>NOTES</TH>
6540266059SGregory Neil Shapiro
66d0cef73dSGregory Neil Shapiro<TD>
67d0cef73dSGregory Neil Shapiro<UL>
68d0cef73dSGregory Neil Shapiro  <LI>If possible, filters should not run as root when communicating
695ef517c0SGregory Neil Shapiro	over unix/local domain sockets.
70d0cef73dSGregory Neil Shapiro  <LI>Unix/local sockets should have their permissions set to
715ef517c0SGregory Neil Shapiro	0600 (read/write permission only for the socket's owner) or
725ef517c0SGregory Neil Shapiro	0660 (read/write permission for the socket's owner and group)
735ef517c0SGregory Neil Shapiro	which is useful if the sendmail RunAsUser option is used.
745ef517c0SGregory Neil Shapiro	The permissions for a unix/local domain socket are determined as
75d0cef73dSGregory Neil Shapiro	usual by <CODE>umask</CODE>, which should be set to 007 or 077.
76a7ec597cSGregory Neil Shapiro        Note some operating systems (e.g, Solaris) don't use the
77a7ec597cSGregory Neil Shapiro        permissions of the socket.  On those systems, place the socket in a
78a7ec597cSGregory Neil Shapiro        protected directory.
79d0cef73dSGregory Neil Shapiro</UL>
80d0cef73dSGregory Neil Shapiro</TD>
81d0cef73dSGregory Neil Shapiro</TR>
8240266059SGregory Neil Shapiro
83d0cef73dSGregory Neil Shapiro</TABLE>
8440266059SGregory Neil Shapiro
85d0cef73dSGregory Neil Shapiro<HR size="1">
86d0cef73dSGregory Neil Shapiro<FONT size="-1">
875dd76dd0SGregory Neil ShapiroCopyright (c) 2000, 2003 Proofpoint, Inc. and its suppliers.
8840266059SGregory Neil ShapiroAll rights reserved.
89d0cef73dSGregory Neil Shapiro<BR>
9040266059SGregory Neil ShapiroBy using this file, you agree to the terms and conditions set
915ef517c0SGregory Neil Shapiroforth in the LICENSE.
92d0cef73dSGregory Neil Shapiro</FONT>
93d0cef73dSGregory Neil Shapiro</BODY>
94d0cef73dSGregory Neil Shapiro</HTML>
95