2 <head><title>smfi_register</title></head>
6 <table border="0" cellspacing=4 cellpadding=4>
7 <!---------- Synopsis ----------->
8 <tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
10 #include <libmilter/mfapi.h>
15 Register a set of filter callbacks.
18 <!----------- Description ---------->
19 <tr><th valign="top" align=left>DESCRIPTION</th><td>
20 <table border="1" cellspacing=1 cellpadding=1>
21 <tr align="left" valign=top>
22 <th width="80">Called When</th>
23 <td>smfi_register must be called before smfi_main</td>
25 <tr align="left" valign=top>
26 <th width="80">Effects</th>
27 <td>smfi_register creates a filter using the information given in the
28 smfiDesc_str argument. Multiple calls to smfi_register within a
29 single process are not allowed.</td>
33 <!----------- Arguments ---------->
34 <tr><th valign="top" align=left>ARGUMENTS</th><td>
35 <table border="1" cellspacing=0>
36 <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr>
37 <tr valign="top"><td>descr</td>
39 A filter descriptor of type smfiDesc_str describing the filter's
40 functions. The structure has the following members:
44 char *xxfi_name; /* filter name */
45 int xxfi_version; /* version code -- do not change */
46 unsigned long xxfi_flags; /* <a href="#flags">flags</a> */
48 /* connection info filter */
49 sfsistat (*<a href="xxfi_connect.html">xxfi_connect</a>)(SMFICTX *, char *, _SOCK_ADDR *);
50 /* SMTP HELO command filter */
51 sfsistat (*<a href="xxfi_helo.html">xxfi_helo</a>)(SMFICTX *, char *);
52 /* envelope sender filter */
53 sfsistat (*<a href="xxfi_envfrom.html">xxfi_envfrom</a>)(SMFICTX *, char **);
54 /* envelope recipient filter */
55 sfsistat (*<a href="xxfi_envrcpt.html">xxfi_envrcpt</a>)(SMFICTX *, char **);
57 sfsistat (*<a href="xxfi_header.html">xxfi_header</a>)(SMFICTX *, char *, char *);
59 sfsistat (*<a href="xxfi_eoh.html">xxfi_eoh</a>)(SMFICTX *);
61 sfsistat (*<a href="xxfi_body.html">xxfi_body</a>)(SMFICTX *, unsigned char *, size_t);
63 sfsistat (*<a href="xxfi_eom.html">xxfi_eom</a>)(SMFICTX *);
65 sfsistat (*<a href="xxfi_abort.html">xxfi_abort</a>)(SMFICTX *);
66 /* connection cleanup */
67 sfsistat (*<a href="xxfi_close.html">xxfi_close</a>)(SMFICTX *);
71 A NULL value for any callback function indicates that the filter does
72 not wish to process the given type of information, simply returning
78 <!----------- Return values ---------->
80 <th valign="top" align=left>RETURN VALUES</th>
83 smfi_register may return MI_FAILURE for any of the following reasons:
85 <li>memory allocation failed.
86 <li>incompatible version or illegal flags value.
92 <!----------- Notes ---------->
93 <tr align="left" valign=top>
98 The xxfi_flags field should contain the bitwise OR of zero or more of
99 the following values, describing the actions the filter may take:
100 <TABLE BORDER CELLPADDING="1" cellspacing=1>
101 <tr valign="top" bgcolor="#dddddd"><th align="left">Flag</th><th align="center">Description</th></tr>
102 <TR align="left" valign=top>
107 This filter may add headers.
110 <TR align="left" valign=top>
115 This filter may change and/or delete headers.
118 <TR align="left" valign=top>
123 This filter may replace the body during filtering.
124 This may have significant performance impact
125 if other filters do body filtering after this filter.
133 This filter may add recipients to the message.
141 This filter may remove recipients from the message.
153 Copyright (c) 2000-2001, 2003 Sendmail, Inc. and its suppliers.
156 By using this file, you agree to the terms and conditions set
157 forth in the LICENSE.