HP-UX Reference (11i v3 07/02) - 3 Library Functions N-Z (vol 7)

s
smfi_register(3N) smfi_register(3N)
NAME
smfi_register() - registers a set of filter callbacks for sendmail
SYNOPSIS
#include <libmilter/mfapi.h>
int smfi_register(
smfiDesc
descr
);
PAMAMETERS
descr Specifies a filter descriptor of type
smfiDesc describing the filters functions.
DESCRIPTION
The
smfi_register()
creates a filter using the information given in the smfiDesc argument.
smfi_register()
must be called before the smfi_main() routine. Multiple calls to the
smfi_register()
routine within a single process is not allowed.
The
smfiDesc structure has the following members:
struct smfiDesc
{
char *xxfi_name; /* filter name */
int xfi_version; /* version code -- do not change */
unsigned long xxfi_flags; /* flags */
/* connection info filter */
sfsistat (*xxfi_connect)(SMFICTX *, char *, SOCK_ADDR *);
/* SMTP HELO command filter */
sfsistat (*xxfi_helo)(SMFICTX *, char *);
/* envelope sender filter */
sfsistat (*xxfi_envfrom)(SMFICTX *, char **);
/* envelope recipient filter */
sfsistat (*xxfi_envrcpt)(SMFICTX *, char **);
/* header filter */
sfsistat (*xxfi_header)(SMFICTX *, char *, char *);
/* end of header */
sfsistat (*xxfi_eoh)(SMFICTX *);
/* body block */
sfsistat (*xxfi_body)(SMFICTX *, unsigned char *, size_t);
/* end of message */
sfsistat (*xxfi_eom)(SMFICTX *);
/* message aborted */
sfsistat (*xxfi_abort)(SMFICTX *);
/* connection cleanup */
sfsistat (*xxfi_close)(SMFICTX *);
};
A NULL value for any callback function indicates that the filter does not wish to process the given type of
information and the filter returns the SMFIS_CONTINUE value.
Notes
The xxfi flags field must contain the bitwise OR of 0 (zero) or more of the following values:
SMFIF_ADDHDRS This filter adds headers.
SMFIF_CHGHDRS This filter changes and deletes headers.
SMFIF_CHGBODY This filter replaces the body of the message during the filtering process.
SMFIF_CHGBODY may have significant performance impact if other filters do body
filtering after SMFIF_CHGBODY.
SMFIF_ADDRCPT This filter adds recipients to the message.
SMFIF_DELRCPT This filter removes recipients from the message.
HP-UX 11i Version 3: February 2007 1 Hewlett-Packard Company 445