# smfi_setconn

SYNOPSIS |
    #include <libmilter/mfapi.h>
    int smfi_setconn(
    	char *oconn;
    );
Set the socket through which this filter should communicate with sendmail.
DESCRIPTION |
Called When | smfi_setconn must be called once before smfi_main.
Effects | Sets the socket through which the filter communicates with sendmail.
ARGUMENTS |
Argument | Description
--- | ---
oconn | The address of the desired communication socket. The address should be a NULL-terminated string in "proto:address" format: `{unix|local}:/path/to/file` -- A named pipe. `inet:port@{hostname|ip-address}` -- An IPV4 socket. `inet6:port@{hostname|ip-address}` -- An IPV6 socket.
RETURN VALUES | smfi_setconn will not fail on an invalid address. The failure will only be detected in smfi_main. Nevertheless, smfi_setconn may fail for other reasons, e.g., due to a lack of memory.
NOTES | If possible, filters should not run as root when communicating over unix/local domain sockets. Unix/local sockets should have their permissions set to 0600 (read/write permission only for the socket's owner) or 0660 (read/write permission for the socket's owner and group) which is useful if the sendmail RunAsUser option is used. The permissions for a unix/local domain socket are determined as usual by `umask`, which should be set to 007 or 077. Note some operating systems (e.g, Solaris) don't use the permissions of the socket. On those systems, place the socket in a protected directory.

Copyright (c) 2000, 2003 Sendmail, Inc. and its suppliers. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the LICENSE.