smfi_addheader.html revision 90792
1<html>
2<head><title>smfi_addheader</title></head>
3<body>
4<h1>smfi_addheader</h1>
5
6<table border="0" cellspacing=4 cellpadding=4>
7<!---------- Synopsis ----------->
8<tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
9<pre>
10#include &lt;libmilter/mfapi.h&gt;
11int smfi_addheader(
12	SMFICTX *ctx,
13	char *headerf,
14	char *headerv
15);
16</pre>
17Add a header to the current message.
18</td></tr>
19
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>
26</tr>
27<tr align="left" valign=top>
28<th width="80">Effects</th>
29<td>Adds a header to the current message.</td>
30</tr>
31</table>
32
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.
39	</td></tr>
40    <tr valign="top"><td>headerf</td>
41	<td>The header name, a non-NULL, null-terminated string.
42	</td></tr>
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.  
45	</td></tr>
46    </table>
47</td></tr>
48
49<!----------- Return values ---------->
50<tr>
51<th valign="top" align=left>RETURN VALUES</th> 
52
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.
59</ul>
60Otherwise, it returns MI_SUCCESS.
61</td>
62</tr>
63
64<!----------- Notes ---------->
65<tr align="left" valign=top>
66<th>NOTES</th> 
67<td>
68<ul><li>smfi_addheader does not change a message's existing headers.
69To change a header's current value, use <a
70href="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 multiline.
77    <b>It is the filter writer's responsibility to ensure that no standards
78    are violated.</b>
79</ul>
80</td>
81</tr>
82
83</table>
84
85<hr size="1">
86<font size="-1">
87Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
88All rights reserved.
89<br>
90By using this file, you agree to the terms and conditions set
91forth in the <a href="LICENSE.txt">LICENSE</a>.
92</font>
93</body>
94</html>
95