Milter smfi_register()
Declare xxfi_ functions to call and set flags All sendmail versions
The sendmail program calls your
Milter by passing information to your Milter’s
socket. The Milter library wraps your program, reads
from that socket, and passes that information into
xxfi_
functions that you write. But the Milter library
won’t call any of those functions unless you let it
know which ones to call. You do that by filling out
an smfiDesc
structure and passing that structure to the
smfi_register
() routine. The smfi_register
()
routine, which must be called before you call
smfi_main
()
(Milter smfi_main() on page 1193), is called like this:
ret
= smfi_register(descr);
The smfi_register
() routine takes a single
argument, descr
, which is
a copy of a structure (not a pointer) of the type
smfiDesc
. The
integer value MI_FAILURE is returned (to
ret
) if smfi_register
() cannot
allocate memory, or if the version is wrong or if
one of the flags is illegal (see Table 26-11). The smfiDesc
structure looks like this:
struct smfiDesc { char *name
; intversion
; unsigned longflags
; sfsistatfunct
; /* for xxfi_connect */ sfsistatfunct
; /* for xxfi_helo */ sfsistatfunct
; /* for xxfi_envfrom */ sfsistatfunct
; /* for xxfi_envrcpt */ sfsistatfunct
; /* for xxfi_header */ sfsistatfunct
; /* for xxfi_eoh */ sfsistatfunct
; /* for xxfi_body */ sfsistatfunct
; /* for xxfi_eom */ sfsistatfunct
; /* for xxfi_abort */ sfsistatfunct
; /* for xxfi_close */ sfsistatfunct
; /* for xxfi_unknown */ ← V8.14 and later ...
Get sendmail, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.