/*++ /* NAME /* milter_macros /* SUMMARY /* manipulate MILTER_MACROS structures /* SYNOPSIS /* #include <milter.h> /* /* MILTER_MACROS *milter_macros_create(conn_macros, helo_macros, /* mail_macros, rcpt_macros, /* data_macros, eoh_macros, /* eod_macros, unk_macros) /* const char *conn_macros; /* const char *helo_macros; /* const char *mail_macros; /* const char *rcpt_macrps; /* const char *data_macros; /* const char *eoh_macros; /* const char *eod_macros; /* const char *unk_macros; /* /* MILTER_MACROS *milter_macros_alloc(init_mode) /* int init_mode; /* /* void milter_macros_free(mp) /* MILTER_MACROS *mp; /* /* int milter_macros_print(print_fn, stream, flags, ptr) /* ATTR_PRINT_COMMON_FN print_fn; /* VSTREAM *stream; /* int flags; /* void *ptr; /* /* int milter_macros_scan(scan_fn, fp, flags, ptr) /* ATTR_SCAN_COMMON_FN scan_fn; /* VSTREAM *fp; /* int flags; /* void *ptr; /* DESCRIPTION /* Sendmail mail filter (Milter) applications receive sets of /* macro name=value pairs with each SMTP or content event. /* In Postfix, these macro names are stored in MILTER_MACROS /* structures, as one list for each event type. By default, /* the same structure is shared by all Milter applications; /* it is initialized with information from main.cf. With /* Sendmail 8.14 a Milter can override one or more lists of /* macro names. Postfix implements this by giving the Milter /* its own MILTER_MACROS structure and by storing the per-Milter /* information there. /* /* This module maintains per-event macro name lists as /* mystrdup()'ed values. The user is explicitly allowed to /* update these values directly, as long as the result is /* compatible with mystrdup(). /* /* milter_macros_create() creates a MILTER_MACROS structure /* and initializes it with copies of its string arguments. /* Null pointers are not valid as input. /* /* milter_macros_alloc() creates am empty MILTER_MACROS structure /* that is initialized according to its init_mode argument. /* .IP MILTER_MACROS_ALLOC_ZERO /* Initialize all structure members as null pointers. This /* mode must be used with milter_macros_scan(), because that /* function blindly overwrites all structure members. No other /* function except milter_macros_free() allows structure members /* with null pointer values. /* .IP MILTER_MACROS_ALLOC_EMPTY /* Initialize all structure members with mystrdup(""). This /* is not as expensive as it appears to be. /* .PP /* milter_macros_free() destroys a MILTER_MACROS structure and /* frees any strings referenced by it. /* /* milter_macros_print() writes the contents of a MILTER_MACROS /* structure to the named stream using the specified attribute /* print routine. milter_macros_print() is meant to be passed /* as a call-back to attr_print*(), thusly: /* /* SEND_ATTR_FUNC(milter_macros_print, (const void *) macros), /* /* milter_macros_scan() reads a MILTER_MACROS structure from /* the named stream using the specified attribute scan routine. /* No attempt is made to free the memory of existing structure /* members. milter_macros_scan() is meant to be passed as a /* call-back to attr_scan*(), thusly: /* /* RECV_ATTR_FUNC(milter_macros_scan, (void *) macros), /* DIAGNOSTICS /* Fatal: out of memory. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this /* software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /* /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA
/*--*/