xxfi_ Routine Reference

A Milter is composed of two kinds of function calls. Those that you write are called the xxfi_ functions and are described here. Those that your written functions call in the Milter library are the smfi_ routines, described in the preceding section. The complete list of functions you write (the xxfi_ functions) is shown in Table 26-15 on page 1205, and that is followed by a reference section for each.

Note that these functions do not need to be prefixed with xxfi_ or given the names shown in the table or in the sections to follow. You may name these functions anything you want. Just to be sure to declare those names in the correct positions of the smfiDesc structure passed to the smfi_register() routine (Milter smfi_register() on page 1194):

struct smfiDesc MyFunctions  = {
    "MyMilter",                    /* Milter name    */
    SMFI_VERSION,                    /* Milter version */
    SMFIF_ADDHDRS,                    /* Milter flags     */
    xxfi_connect,                    /* Your connection handler      */
    myHeloFunction,                    /* Your HELO/EHLO handler */
... etc.

Here, for example, the xxfi_helo() function has been given the name myHeloFunction. We, however, will use the xxfi_ prefixed names used in the sendmail documentation for clarity.

Each function returns the type sfsistat and is passed as its first argument a context pointer called ctx:

sfsistat
xxfi_name(SMFICTX *ctx, args)

Your xxfi_ functions are called to handle each phase of an SMTP conversation. Some handle the connection setup and shutdown (are connection-oriented). Others handle the envelope startup ...

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.