smfi_addheader.html revision 90792
190792Sgshapiro<html> 290792Sgshapiro<head><title>smfi_addheader</title></head> 390792Sgshapiro<body> 490792Sgshapiro<h1>smfi_addheader</h1> 590792Sgshapiro 690792Sgshapiro<table border="0" cellspacing=4 cellpadding=4> 790792Sgshapiro<!---------- Synopsis -----------> 890792Sgshapiro<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> 990792Sgshapiro<pre> 1090792Sgshapiro#include <libmilter/mfapi.h> 1190792Sgshapiroint smfi_addheader( 1290792Sgshapiro SMFICTX *ctx, 1390792Sgshapiro char *headerf, 1490792Sgshapiro char *headerv 1590792Sgshapiro); 1690792Sgshapiro</pre> 1790792SgshapiroAdd a header to the current message. 1890792Sgshapiro</td></tr> 1990792Sgshapiro 2090792Sgshapiro<!----------- Description ----------> 2190792Sgshapiro<tr><th valign="top" align=left>DESCRIPTION</th><td> 2290792Sgshapiro<table border="1" cellspacing=1 cellpadding=4> 2390792Sgshapiro<tr align="left" valign=top> 2490792Sgshapiro<th width="80">Called When</th> 2590792Sgshapiro<td>Called only from <a href="xxfi_eom.html">xxfi_eom</a>.</td> 2690792Sgshapiro</tr> 2790792Sgshapiro<tr align="left" valign=top> 2890792Sgshapiro<th width="80">Effects</th> 2990792Sgshapiro<td>Adds a header to the current message.</td> 3090792Sgshapiro</tr> 3190792Sgshapiro</table> 3290792Sgshapiro 3390792Sgshapiro<!----------- Arguments ----------> 3490792Sgshapiro<tr><th valign="top" align=left>ARGUMENTS</th><td> 3590792Sgshapiro <table border="1" cellspacing=0> 3690792Sgshapiro <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> 3790792Sgshapiro <tr valign="top"><td>ctx</td> 3890792Sgshapiro <td>Opaque context structure. 3990792Sgshapiro </td></tr> 4090792Sgshapiro <tr valign="top"><td>headerf</td> 4190792Sgshapiro <td>The header name, a non-NULL, null-terminated string. 4290792Sgshapiro </td></tr> 4390792Sgshapiro <tr valign="top"><td>headerv</td> 4490792Sgshapiro <td>The header value to be added, a non-NULL, null-terminated string. This may be the empty string. 4590792Sgshapiro </td></tr> 4690792Sgshapiro </table> 4790792Sgshapiro</td></tr> 4890792Sgshapiro 4990792Sgshapiro<!----------- Return values ----------> 5090792Sgshapiro<tr> 5190792Sgshapiro<th valign="top" align=left>RETURN VALUES</th> 5290792Sgshapiro 5390792Sgshapiro<td>smfi_addheader returns MI_FAILURE if: 5490792Sgshapiro<ul><li>headerf or headerv is NULL. 5590792Sgshapiro <li>Adding headers in the current connection state is invalid. 5690792Sgshapiro <li>Memory allocation fails. 5790792Sgshapiro <li>A network error occurs. 5890792Sgshapiro <li>SMFIF_ADDHDRS was not set when <a href="smfi_register.html">smfi_register</a> was called. 5990792Sgshapiro</ul> 6090792SgshapiroOtherwise, it returns MI_SUCCESS. 6190792Sgshapiro</td> 6290792Sgshapiro</tr> 6390792Sgshapiro 6490792Sgshapiro<!----------- Notes ----------> 6590792Sgshapiro<tr align="left" valign=top> 6690792Sgshapiro<th>NOTES</th> 6790792Sgshapiro<td> 6890792Sgshapiro<ul><li>smfi_addheader does not change a message's existing headers. 6990792SgshapiroTo change a header's current value, use <a 7090792Sgshapirohref="smfi_chgheader.html">smfi_chgheader</a>. 7190792Sgshapiro <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>. 7290792Sgshapiro <li>For smfi_chgheader, filter order is important. <b>Later filters will see the header changes made by earlier ones.</b> 7390792Sgshapiro <li>Neither the name nor the value of the header is checked for 7490792Sgshapiro standards compliance. However, each line of the header must be under 7590792Sgshapiro 2048 characters and should be under 998 characters. If longer headers 7690792Sgshapiro are needed, make them multiline. 7790792Sgshapiro <b>It is the filter writer's responsibility to ensure that no standards 7890792Sgshapiro are violated.</b> 7990792Sgshapiro</ul> 8090792Sgshapiro</td> 8190792Sgshapiro</tr> 8290792Sgshapiro 8390792Sgshapiro</table> 8490792Sgshapiro 8590792Sgshapiro<hr size="1"> 8690792Sgshapiro<font size="-1"> 8790792SgshapiroCopyright (c) 2000-2001 Sendmail, Inc. and its suppliers. 8890792SgshapiroAll rights reserved. 8990792Sgshapiro<br> 9090792SgshapiroBy using this file, you agree to the terms and conditions set 9190792Sgshapiroforth in the <a href="LICENSE.txt">LICENSE</a>. 9290792Sgshapiro</font> 9390792Sgshapiro</body> 9490792Sgshapiro</html> 95