Sendmail 8.13.3 Programmer's Guide

Milter APIs
Callbacks
Chapter 236
Callbacks
A filter application must implement one or more of the following
callbacks, which are registered through the smfi_register() API:
xxfi_connect()
xxfi_helo()
xxfi_envfrom()
xxfi_envrcpt()
xxfi_header()
xxfi_eoh()
xxfi_body()
xxfi_eom()
xxfi_abort()
xxfi_close()
NOTE You can replace the xx portion in the callback name with the name of
your Milter program.
The following sections discuss these callbacks in detail.
The xxfi_connect() Callback
The xxfi_connect() callback returns the SMFIS_CONTINUE value to the
calling filter application. xxfi_connect() is called once during the start
of each SMTP connection.
The declaration of xxfi_connect() is as follows:
#include <libmilter/mfapi.h>
sfsistat (*xxfi_connect)(
SMFICTX *ctx,
char *hostname,
_SOCK_ADDR *hostaddr);