Milter smfi_setconn()
Set up for the listening connection All sendmail versions
Milters are capable of communicating with
sendmail over a named pipe or
over a TCP network socket. You specify which of
these your Milter will use by calling smfi_setconn
() before
calling smfi_main
(). The smfi_setconn
() routine
is called like this:
ret
= smfi_setconn(how
);
Here, how
is a string of
the form prefix:socket
,
where prefix
is selected
from those shown in Table 26-12, and socket
is
appropriate to the
prefix
.
Table 26-12. Prefixes used in the smfi_setconn() string
Prefix |
Description |
---|---|
|
The socket will be a named pipe, the path to
which is specified, as for example, |
|
A synonym for |
|
The socket is for an IPv4 TCP/IP connection
which is specified as either a hostname or an IP
address, as, for example, |
|
The socket is for an IPv6 TCP/IP connection
which is specified as either a hostname or an IP
address, as, for example, |
Note that smfi_setconn
() does not actually set
up the socket. It only supplies your information to
the Milter library. To actually create the socket
you need to call either the smfi_main
() routine
(Milter smfi_main() on page 1193), which will create it automatically
as part of startup, or the smfi_opensocket
() routine (Milter smfi_opensocket() on page 1193), which will perform the actual
socket creation. The latter is preferred if you wish
to manage socket errors yourself.
For ...
Get sendmail, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.