Sendmail 8.13.3 Programmer's Guide
Table Of Contents

Milter APIs
Library Control APIs
Chapter 2 11
Library Control APIs
This section describes the library control APIs that Sendmail 8.13.3
includes.
Filter applications use the library control APIs to provide the required
information to Sendmail. Each of the library control APIs returns either
MI_SUCCESS or MI_FAILURE to indicate the status of the operation. The
library control APIs do not directly communicate with Sendmail, but
they alter the state of the library.
Before handing control to libmilter (by calling smfi_main()), a filter
application can call the following library control APIs to set the
libmilter parameters:
• smfi_register()
• smfi_opensocket()
• smfi_setconn()
• settimeout()
• smfi_setbacklog()
• smfi_setdbg()
• smfi_stop()
• smfi_main()
The following sections discuss the library control APIs in detail.
The smfi_register() API
You can use the smfi_register() API to register a set of filter callbacks.
You must call smfi_register() before calling the smfi_main() API.
The smfi_register() API creates a filter using the information
supplied by the smfiDesc argument. Do not call smfi_register()
multiple times within a single process.
The declaration of smfi_register() is as follows:
#include <libmilter/mfapi.h>
int smfi_register(
smfiDesc descr
);