Sendmail 8.13.3 Programmer's Guide

Milter APIs
Library Control APIs
Chapter 2 17
By default, smfi_setdbg() returns MI_SUCCESS to the filter application.
The smfi_stop() API
You can use the smfi_stop() API to start an orderly shutdown of the
Milter program. You can call smfi_stop() from any of the callbacks or
any of the error-handling routines at any time. smfi_stop() causes each
thread to finish its current connection and then exit the connection.
When all the threads have exited, the call to the smfi_main() API
returns to the calling program, which may then exit or warm restart the
function (?). A filter application does not accept any new connection after
calling smfi_stop().
The declaration of smfi_stop() is as follows:
#include <libmilter/mfapi.h>
int smfi_stop(void);
Argument
You must call smfi_stop() with the argument void, which specifies that
smfi_stop() does not accept any argument.
Return Values
smfi_stop() always returns SMFI_CONTINUE to the Milter program.
Following are additional points regarding smfi_stop():
Another internal routine may have already requested the Milter
program to abort.
Another routine may already have requested the Milter program to
stop.
You cannot cancel the stop process when it has begun.