smfi_setconn.html revision 261363
11590Srgrimes<HTML> 21590Srgrimes<HEAD><TITLE>smfi_setconn</TITLE></HEAD> 31590Srgrimes<BODY> 41590Srgrimes<!-- 51590Srgrimes$Id: smfi_setconn.html,v 1.18 2013/11/22 20:51:39 ca Exp $ 61590Srgrimes--> 71590Srgrimes<H1>smfi_setconn</H1> 81590Srgrimes 91590Srgrimes<TABLE border="0" cellspacing=4 cellpadding=4> 101590Srgrimes<!---------- Synopsis -----------> 111590Srgrimes<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD> 121590Srgrimes<PRE> 131590Srgrimes#include <libmilter/mfapi.h> 141590Srgrimesint smfi_setconn( 151590Srgrimes char *oconn; 161590Srgrimes); 171590Srgrimes</PRE> 181590SrgrimesSet the socket through which this filter should communicate with sendmail. 191590Srgrimes</TD></TR> 201590Srgrimes 211590Srgrimes<!----------- Description ----------> 221590Srgrimes<TR><TH valign="top" align=left>DESCRIPTION</TH><TD> 231590Srgrimes<TABLE border="1" cellspacing=1 cellpadding=4> 241590Srgrimes<TR align="left" valign=top> 251590Srgrimes<TH width="80">Called When</TH> 261590Srgrimes<TD>smfi_setconn must be called once before <A href="smfi_main.html">smfi_main</A>.</TD> 271590Srgrimes</TR> 281590Srgrimes<TR align="left" valign=top> 291590Srgrimes<TH width="80">Effects</TH> 301590Srgrimes<TD>Sets the socket through which the filter communicates with sendmail.</TD> 3174769Smikeh</TR> 321590Srgrimes</TABLE> 3374769Smikeh 341590Srgrimes<!----------- Arguments ----------> 3599112Sobrien<TR><TH valign="top" align=left>ARGUMENTS</TH><TD> 3699112Sobrien <TABLE border="1" cellspacing=0> 371590Srgrimes <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR> 381590Srgrimes <TR valign="top"><TD>oconn</TD> 391590Srgrimes <TD>The address of the desired communication socket. 401590Srgrimes The address should be a NULL-terminated string in "proto:address" 411590Srgrimes format: 421590Srgrimes <UL> 431590Srgrimes <LI><CODE>{unix|local}:/path/to/file</CODE> -- A named pipe. 441590Srgrimes <LI><CODE>inet:port@{hostname|ip-address}</CODE> -- An IPV4 socket. 451590Srgrimes <LI><CODE>inet6:port@{hostname|ip-address}</CODE> -- An IPV6 socket. 461590Srgrimes </UL> 471590Srgrimes </TD></TR> 481590Srgrimes </TABLE> 491590Srgrimes</TD></TR> 501590Srgrimes 511590Srgrimes<!----------- Return values ----------> 521590Srgrimes<TR> 531590Srgrimes<TH valign="top" align=left>RETURN VALUES</TH> 541590Srgrimes 55216564Scharnier<TD>smfi_setconn will not fail on an invalid address. 561590SrgrimesThe failure will only be detected in <A href="smfi_main.html">smfi_main</A>. 5777274SmikehNevertheless, smfi_setconn may fail for other reasons, e.g., 5818726Sjkhdue to a lack of memory. 5918726Sjkh</TD> 6074769Smikeh</TR> 6118726Sjkh 6274769Smikeh<TR> 631590Srgrimes<TH valign="top" align=left>NOTES</TH> 641590Srgrimes 651590Srgrimes<TD> 661590Srgrimes<UL> 671590Srgrimes <LI>If possible, filters should not run as root when communicating 681590Srgrimes over unix/local domain sockets. 69216564Scharnier <LI>Unix/local sockets should have their permissions set to 701590Srgrimes 0600 (read/write permission only for the socket's owner) or 71303303Spfg 0660 (read/write permission for the socket's owner and group) 721590Srgrimes which is useful if the sendmail RunAsUser option is used. 7377274Smikeh The permissions for a unix/local domain socket are determined as 74303303Spfg usual by <CODE>umask</CODE>, which should be set to 007 or 077. 75303303Spfg Note some operating systems (e.g, Solaris) don't use the 76303303Spfg permissions of the socket. On those systems, place the socket in a 771590Srgrimes protected directory. 781590Srgrimes</UL> 791590Srgrimes</TD> 801590Srgrimes</TR> 811590Srgrimes 821590Srgrimes</TABLE> 83216564Scharnier 841590Srgrimes<HR size="1"> 851590Srgrimes<FONT size="-1"> 8674769SmikehCopyright (c) 2000, 2003 Proofpoint, Inc. and its suppliers. 871590SrgrimesAll rights reserved. 8877274Smikeh<BR> 8977274SmikehBy using this file, you agree to the terms and conditions set 9077274Smikehforth in the LICENSE. 9177274Smikeh</FONT> 9277274Smikeh</BODY> 9377274Smikeh</HTML> 9474769Smikeh