After the connection is made, but before sendmail provides its
normal 220 greeting, this xxfi_connect() function, if used, is called.
The xxfi_connect() function is called like this:
sfsistat
xxfi_connect(SMFICTX *ctx, unsigned char *hostname, SOCK_ADDR *hostaddr)
Here, ctx is the context pointer passed to all xxfi_ functions to maintain state in a multithreaded
environment. The hostname is a pointer to a buffer that contains the hostname of
the connecting client. The hostname is derived by a reverse-look-up of the connecting
client??™s IP address. After finding the hostname, sendmail looks it up to find its IP address.
As a special case, if the found IP address does not match the original, the hostname will
contain the found IP address in square braces.
"foo.example.com" ?†? success
"[123.45.67.89]" ?†? failure
Note that a host can have multiple IP addresses and, if so, each is compared to the original
connecting IP address and at least one must match.
The hostname is guaranteed by the Milter library to never be NULL, but it can contain an
empty string. If the connection is over the standard input, the hostname will contain a copy
of the expression ???localhost??? as a string. The hostname may or may not be a canonical
hostname, depending on the connecting client??™s behavior.
The hostaddr is the result of a call to getpeername(2) for information about the connecting
client??™s socket.
Pages:
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178