Merge from vendor branch GCC:
[dragonfly.git] / contrib / sendmail-8.13.8 / libmilter / docs / smfi_addheader.html
1 <html>
2 <head><title>smfi_addheader</title></head>
3 <body>
4 <!--
5 $Id: smfi_addheader.html,v 1.15 2004/05/04 17:55:50 ca Exp $
6 -->
7 <h1>smfi_addheader</h1>
8
9 <table border="0" cellspacing=4 cellpadding=4>
10 <!---------- Synopsis ----------->
11 <tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
12 <pre>
13 #include &lt;libmilter/mfapi.h&gt;
14 int smfi_addheader(
15         SMFICTX *ctx,
16         char *headerf,
17         char *headerv
18 );
19 </pre>
20 Add a header to the current message.
21 </td></tr>
22
23 <!----------- Description ---------->
24 <tr><th valign="top" align=left>DESCRIPTION</th><td>
25 <table border="1" cellspacing=1 cellpadding=4>
26 <tr align="left" valign=top>
27 <th width="80">Called When</th>
28 <td>Called only from <a href="xxfi_eom.html">xxfi_eom</a>.</td>
29 </tr>
30 <tr align="left" valign=top>
31 <th width="80">Effects</th>
32 <td>Adds a header to the current message.</td>
33 </tr>
34 </table>
35
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>ctx</td>
41         <td>Opaque context structure.
42         </td></tr>
43     <tr valign="top"><td>headerf</td>
44         <td>The header name, a non-NULL, null-terminated string.
45         </td></tr>
46     <tr valign="top"><td>headerv</td>
47         <td>The header value to be added, a non-NULL, null-terminated string.  This may be the empty string.  
48         </td></tr>
49     </table>
50 </td></tr>
51
52 <!----------- Return values ---------->
53 <tr>
54 <th valign="top" align=left>RETURN VALUES</th> 
55
56 <td>smfi_addheader returns MI_FAILURE if:
57 <ul><li>headerf or headerv is NULL.
58     <li>Adding headers in the current connection state is invalid.
59     <li>Memory allocation fails.
60     <li>A network error occurs.
61     <li>SMFIF_ADDHDRS was not set when <a href="smfi_register.html">smfi_register</a> was called.
62 </ul>
63 Otherwise, it returns MI_SUCCESS.
64 </td>
65 </tr>
66
67 <!----------- Notes ---------->
68 <tr align="left" valign=top>
69 <th>NOTES</th> 
70 <td>
71 <ul><li>smfi_addheader does not change a message's existing headers.
72 To change a header's current value, use <a
73 href="smfi_chgheader.html">smfi_chgheader</a>.
74     <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>.
75     <li>For smfi_addheader, filter order is important.  <b>Later filters will see the header changes made by earlier ones.</b>
76     <li>Neither the name nor the value of the header is checked for
77     standards compliance.  However, each line of the header must be under
78     2048 characters and should be under 998 characters.  If longer headers
79     are needed, make them multi-line.  To make a multi-line header, insert
80     a line feed (ASCII 0x0a, or <tt>\n</tt> in C) followed by at least
81     one whitespace character such as a space (ASCII 0x20) or tab (ASCII 0x09,
82     or <tt>\t</tt> in C).  The line feed should NOT be preceded by a
83     carriage return (ASCII 0x0d); the MTA will add this automatically.
84     <b>It is the filter writer's responsibility to ensure that no standards
85     are violated.</b>
86 </ul>
87 </td>
88 </tr>
89
90 <!----------- Example code ---------->
91 <tr>
92 <th valign="top" align=left>EXAMPLE</th> 
93
94 <td>
95  <pre>
96   int ret;
97   SMFICTX *ctx;
98
99   ...
100
101   ret = smfi_addheader(ctx, "Content-Type",
102                        "multipart/mixed;\n\tboundary=\"foobar\"");
103  </pre>
104 </td>
105 </tr>
106
107 </table>
108
109 <hr size="1">
110 <font size="-1">
111 Copyright (c) 2000-2003 Sendmail, Inc. and its suppliers.
112 All rights reserved.
113 <br>
114 By using this file, you agree to the terms and conditions set
115 forth in the LICENSE.
116 </font>
117 </body>
118 </html>