2 <head><title>smfi_addheader
</title></head>
4 <h1>smfi_addheader
</h1>
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
>
17 Add a header to the current message.
20 <!----------- Description ---------->
21 <tr><th valign=
"top" align=left
>DESCRIPTION
</th><td>
22 <table border=
"1" cellspacing=
1 cellpadding=
4>
23 <tr align=
"left" valign=top
>
24 <th width=
"80">Called When
</th>
25 <td>Called only from
<a href=
"xxfi_eom.html">xxfi_eom
</a>.
</td>
27 <tr align=
"left" valign=top
>
28 <th width=
"80">Effects
</th>
29 <td>Adds a header to the current message.
</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>ctx
</td>
38 <td>Opaque context structure.
40 <tr valign=
"top"><td>headerf
</td>
41 <td>The header name, a non-NULL, null-terminated string.
43 <tr valign=
"top"><td>headerv
</td>
44 <td>The header value to be added, a non-NULL, null-terminated string. This may be the empty string.
49 <!----------- Return values ---------->
51 <th valign=
"top" align=left
>RETURN VALUES
</th>
53 <td>smfi_addheader returns MI_FAILURE if:
54 <ul><li>headerf or headerv is NULL.
55 <li>Adding headers in the current connection state is invalid.
56 <li>Memory allocation fails.
57 <li>A network error occurs.
58 <li>SMFIF_ADDHDRS was not set when
<a href=
"smfi_register.html">smfi_register
</a> was called.
60 Otherwise, it returns MI_SUCCESS.
64 <!----------- Notes ---------->
65 <tr align=
"left" valign=top
>
68 <ul><li>smfi_addheader does not change a message's existing headers.
69 To change a header's current value, use
<a
70 href=
"smfi_chgheader.html">smfi_chgheader
</a>.
71 <li>A filter which calls smfi_addheader must have set the SMFIF_ADDHDRS flag in the smfiDesc_str passed to
<a href=
"smfi_register.html">smfi_register
</a>.
72 <li>For smfi_chgheader, filter order is important.
<b>Later filters will see the header changes made by earlier ones.
</b>
73 <li>Neither the name nor the value of the header is checked for
74 standards compliance. However, each line of the header must be under
75 2048 characters and should be under
998 characters. If longer headers
76 are needed, make them multi-line. To make a multi-line header, insert
77 a line feed (ASCII
0x0a, or
<tt>\n
</tt> in C) followed by at least
78 one whitespace character such as a space (ASCII
0x20) or tab (ASCII
0x09,
79 or
<tt>\t
</tt> in C). The line feed should NOT be preceded by a
80 carriage return (ASCII
0x0d); the MTA will add this automatically.
81 <b>It is the filter writer's responsibility to ensure that no standards
87 <!----------- Example code ---------->
89 <th valign=
"top" align=left
>EXAMPLE
</th>
98 ret = smfi_addheader(ctx,
"Content-Type",
99 "multipart/mixed;\n\tboundary=\"foobar\
"");
108 Copyright (c)
2000-
2003 Sendmail, Inc. and its suppliers.
111 By using this file, you agree to the terms and conditions set
112 forth in the LICENSE.