socket
Perform lookups over a socket V8.13 and later
Beginning with V8.13 sendmail, a
new database-map type called socket
is available for
your use.[352] You declare a socket
database-map type like
this:
Kname socket type:port@host
Here,
is
the identifier that you will later use in rule sets.
The name
is declared in the same fashion as a Milter is
declared using the X configuration command (The X Configuration Command on page
1173). For example:type:port@host
Ktrustedip socket inet:8020@db5.example.gov
Here, lookups can be made in rule sets using the
database map named trustedip
. The
sendmail program will make an
IPv4 connection (the inet
) to port 8020 on the host db5.example.gov
. Once
the connection has been made, lookups are performed
using a simple dialog that looks like this:
sendmail sends: database_map_name key sendmail receives: status datum
Note that neither the request sent nor the reply received may end in a carriage-return/linefeed pair, a carriage return, or a line feed. Also note that the two parts of each dialog are separated by a single space character.
Both the request and the reply begin and end with characters that denote their length and termination. The length is an ASCII representation of the number of characters sent or received, stated as a prefix and a colon. Both the request and the reply are terminated by a comma. But note that the length prefix must not include the comma in its length computation. For example:
sendmail sends: 17:trustedip 1.2.3.4, sendmail receives ...
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.