2 <head><title>smfi_register
</title></head>
5 $Id: smfi_register.html,v 1.11 2003/05/26 04:10:52 gshapiro Exp $
9 <table border=
"0" cellspacing=
4 cellpadding=
4>
10 <!---------- Synopsis ----------->
11 <tr><th valign=
"top" align=left width=
150>SYNOPSIS
</th><td>
13 #include
<libmilter/mfapi.h
>
18 Register a set of filter callbacks.
21 <!----------- Description ---------->
22 <tr><th valign=
"top" align=left
>DESCRIPTION
</th><td>
23 <table border=
"1" cellspacing=
1 cellpadding=
1>
24 <tr align=
"left" valign=top
>
25 <th width=
"80">Called When
</th>
26 <td>smfi_register must be called before smfi_main
</td>
28 <tr align=
"left" valign=top
>
29 <th width=
"80">Effects
</th>
30 <td>smfi_register creates a filter using the information given in the
31 smfiDesc argument. Multiple calls to smfi_register within a
32 single process are not allowed.
</td>
36 <!----------- Arguments ---------->
37 <tr><th valign=
"top" align=left
>ARGUMENTS
</th><td>
38 <table border=
"1" cellspacing=
0>
39 <tr bgcolor=
"#dddddd"><th>Argument
</th><th>Description
</th></tr>
40 <tr valign=
"top"><td>descr
</td>
42 A filter descriptor of type smfiDesc describing the filter's
43 functions. The structure has the following members:
47 char *xxfi_name; /* filter name */
48 int xxfi_version; /* version code -- do not change */
49 unsigned long xxfi_flags; /*
<a href=
"#flags">flags
</a> */
51 /* connection info filter */
52 sfsistat (*
<a href=
"xxfi_connect.html">xxfi_connect
</a>)(SMFICTX *, char *, _SOCK_ADDR *);
53 /* SMTP HELO command filter */
54 sfsistat (*
<a href=
"xxfi_helo.html">xxfi_helo
</a>)(SMFICTX *, char *);
55 /* envelope sender filter */
56 sfsistat (*
<a href=
"xxfi_envfrom.html">xxfi_envfrom
</a>)(SMFICTX *, char **);
57 /* envelope recipient filter */
58 sfsistat (*
<a href=
"xxfi_envrcpt.html">xxfi_envrcpt
</a>)(SMFICTX *, char **);
60 sfsistat (*
<a href=
"xxfi_header.html">xxfi_header
</a>)(SMFICTX *, char *, char *);
62 sfsistat (*
<a href=
"xxfi_eoh.html">xxfi_eoh
</a>)(SMFICTX *);
64 sfsistat (*
<a href=
"xxfi_body.html">xxfi_body
</a>)(SMFICTX *, unsigned char *, size_t);
66 sfsistat (*
<a href=
"xxfi_eom.html">xxfi_eom
</a>)(SMFICTX *);
68 sfsistat (*
<a href=
"xxfi_abort.html">xxfi_abort
</a>)(SMFICTX *);
69 /* connection cleanup */
70 sfsistat (*
<a href=
"xxfi_close.html">xxfi_close
</a>)(SMFICTX *);
74 A NULL value for any callback function indicates that the filter does
75 not wish to process the given type of information, simply returning
81 <!----------- Return values ---------->
83 <th valign=
"top" align=left
>RETURN VALUES
</th>
86 smfi_register may return MI_FAILURE for any of the following reasons:
88 <li>memory allocation failed.
89 <li>incompatible version or illegal flags value.
95 <!----------- Notes ---------->
96 <tr align=
"left" valign=top
>
101 The xxfi_flags field should contain the bitwise OR of zero or more of
102 the following values, describing the actions the filter may take:
103 <TABLE BORDER
CELLPADDING=
"1" cellspacing=
1>
104 <tr valign=
"top" bgcolor=
"#dddddd"><th align=
"left">Flag
</th><th align=
"center">Description
</th></tr>
105 <TR align=
"left" valign=top
>
110 This filter may add headers.
113 <TR align=
"left" valign=top
>
118 This filter may change and/or delete headers.
121 <TR align=
"left" valign=top
>
126 This filter may replace the body during filtering.
127 This may have significant performance impact
128 if other filters do body filtering after this filter.
136 This filter may add recipients to the message.
144 This filter may remove recipients from the message.
156 Copyright (c)
2000-
2001,
2003 Sendmail, Inc. and its suppliers.
159 By using this file, you agree to the terms and conditions set
160 forth in the LICENSE.