NOTES |
- xxfi_close may be called "out-of-order", i.e. before even the
xxfi_connect is called.
After a connection is established by the MTA to the filter,
if the MTA decides this connection's traffic will be discarded
(e.g. via an access_db result), no data will be passed to the
filter from the MTA until the client closes down.
At that time, xxfi_close is called.
It can therefore be the only callback ever used for a given connection,
and developers should anticipate this possibility when crafting their
xxfi_close code.
In particular, it is incorrect to assume the private context pointer
will be something other than NULL in this callback.
- xxfi_close is called on close even if the previous mail
transaction was aborted.
- xxfi_close is not necessary called after SIGHUP, SIGTERM or SIGINT are sent
to the signal handler thread established by smfi_main, before smfi_main returns. On some UNIX
the underlying poll/select calls exit when libmilter closes the connection
to the MTA, on Linux select/poll exit when the timeout set by smfi_settimeout expires.
- xxfi_close is responsible for freeing any resources allocated on a
per-connection basis.
- Since the connection is already closing, the return value is
currently ignored.
|