140266059SGregory Neil Shapiro<html> 240266059SGregory Neil Shapiro<head><title>smfi_register</title></head> 340266059SGregory Neil Shapiro<body> 440266059SGregory Neil Shapiro<h1>smfi_register</h1> 540266059SGregory Neil Shapiro 640266059SGregory Neil Shapiro<table border="0" cellspacing=4 cellpadding=4> 740266059SGregory Neil Shapiro<!---------- Synopsis -----------> 840266059SGregory Neil Shapiro<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> 940266059SGregory Neil Shapiro<pre> 1040266059SGregory Neil Shapiro#include <libmilter/mfapi.h> 1140266059SGregory Neil Shapiroint smfi_register( 12a7ec597cSGregory Neil Shapiro smfiDesc descr 1340266059SGregory Neil Shapiro); 1440266059SGregory Neil Shapiro</pre> 1540266059SGregory Neil ShapiroRegister a set of filter callbacks. 1640266059SGregory Neil Shapiro</td></tr> 1740266059SGregory Neil Shapiro 1840266059SGregory Neil Shapiro<!----------- Description ----------> 1940266059SGregory Neil Shapiro<tr><th valign="top" align=left>DESCRIPTION</th><td> 2040266059SGregory Neil Shapiro<table border="1" cellspacing=1 cellpadding=1> 2140266059SGregory Neil Shapiro<tr align="left" valign=top> 2240266059SGregory Neil Shapiro<th width="80">Called When</th> 2340266059SGregory Neil Shapiro<td>smfi_register must be called before smfi_main</td> 2440266059SGregory Neil Shapiro</tr> 2540266059SGregory Neil Shapiro<tr align="left" valign=top> 2640266059SGregory Neil Shapiro<th width="80">Effects</th> 2740266059SGregory Neil Shapiro<td>smfi_register creates a filter using the information given in the 28a7ec597cSGregory Neil ShapirosmfiDesc argument. Multiple calls to smfi_register within a 2940266059SGregory Neil Shapirosingle process are not allowed.</td> 3040266059SGregory Neil Shapiro</tr> 3140266059SGregory Neil Shapiro</table> 3240266059SGregory Neil Shapiro 3340266059SGregory Neil Shapiro<!----------- Arguments ----------> 3440266059SGregory Neil Shapiro<tr><th valign="top" align=left>ARGUMENTS</th><td> 3540266059SGregory Neil Shapiro <table border="1" cellspacing=0> 3640266059SGregory Neil Shapiro <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> 3740266059SGregory Neil Shapiro <tr valign="top"><td>descr</td> 3840266059SGregory Neil Shapiro <td> 39a7ec597cSGregory Neil ShapiroA filter descriptor of type smfiDesc describing the filter's 4040266059SGregory Neil Shapirofunctions. The structure has the following members: 4140266059SGregory Neil Shapiro<pre> 4240266059SGregory Neil Shapirostruct smfiDesc 4340266059SGregory Neil Shapiro{ 4440266059SGregory Neil Shapiro char *xxfi_name; /* filter name */ 4540266059SGregory Neil Shapiro int xxfi_version; /* version code -- do not change */ 4640266059SGregory Neil Shapiro unsigned long xxfi_flags; /* <a href="#flags">flags</a> */ 4740266059SGregory Neil Shapiro 4840266059SGregory Neil Shapiro /* connection info filter */ 4940266059SGregory Neil Shapiro sfsistat (*<a href="xxfi_connect.html">xxfi_connect</a>)(SMFICTX *, char *, _SOCK_ADDR *); 5040266059SGregory Neil Shapiro /* SMTP HELO command filter */ 5140266059SGregory Neil Shapiro sfsistat (*<a href="xxfi_helo.html">xxfi_helo</a>)(SMFICTX *, char *); 5240266059SGregory Neil Shapiro /* envelope sender filter */ 5340266059SGregory Neil Shapiro sfsistat (*<a href="xxfi_envfrom.html">xxfi_envfrom</a>)(SMFICTX *, char **); 5440266059SGregory Neil Shapiro /* envelope recipient filter */ 5540266059SGregory Neil Shapiro sfsistat (*<a href="xxfi_envrcpt.html">xxfi_envrcpt</a>)(SMFICTX *, char **); 5640266059SGregory Neil Shapiro /* header filter */ 5740266059SGregory Neil Shapiro sfsistat (*<a href="xxfi_header.html">xxfi_header</a>)(SMFICTX *, char *, char *); 5840266059SGregory Neil Shapiro /* end of header */ 5940266059SGregory Neil Shapiro sfsistat (*<a href="xxfi_eoh.html">xxfi_eoh</a>)(SMFICTX *); 6040266059SGregory Neil Shapiro /* body block */ 6140266059SGregory Neil Shapiro sfsistat (*<a href="xxfi_body.html">xxfi_body</a>)(SMFICTX *, unsigned char *, size_t); 6240266059SGregory Neil Shapiro /* end of message */ 6340266059SGregory Neil Shapiro sfsistat (*<a href="xxfi_eom.html">xxfi_eom</a>)(SMFICTX *); 6440266059SGregory Neil Shapiro /* message aborted */ 6540266059SGregory Neil Shapiro sfsistat (*<a href="xxfi_abort.html">xxfi_abort</a>)(SMFICTX *); 6640266059SGregory Neil Shapiro /* connection cleanup */ 6740266059SGregory Neil Shapiro sfsistat (*<a href="xxfi_close.html">xxfi_close</a>)(SMFICTX *); 6840266059SGregory Neil Shapiro}; 6940266059SGregory Neil Shapiro</pre> 7040266059SGregory Neil Shapiro 7140266059SGregory Neil ShapiroA NULL value for any callback function indicates that the filter does 7240266059SGregory Neil Shapironot wish to process the given type of information, simply returning 7340266059SGregory Neil ShapiroSMFIS_CONTINUE. 7440266059SGregory Neil Shapiro </td></tr> 7540266059SGregory Neil Shapiro </table> 7640266059SGregory Neil Shapiro</td></tr> 7740266059SGregory Neil Shapiro 7840266059SGregory Neil Shapiro<!----------- Return values ----------> 7940266059SGregory Neil Shapiro<tr> 8040266059SGregory Neil Shapiro<th valign="top" align=left>RETURN VALUES</th> 8140266059SGregory Neil Shapiro 8240266059SGregory Neil Shapiro<td> 8340266059SGregory Neil Shapirosmfi_register may return MI_FAILURE for any of the following reasons: 8440266059SGregory Neil Shapiro<ul> 8540266059SGregory Neil Shapiro<li>memory allocation failed. 8640266059SGregory Neil Shapiro<li>incompatible version or illegal flags value. 8740266059SGregory Neil Shapiro</ul> 8840266059SGregory Neil Shapiro 8940266059SGregory Neil Shapiro</td> 9040266059SGregory Neil Shapiro</tr> 9140266059SGregory Neil Shapiro 9240266059SGregory Neil Shapiro<!----------- Notes ----------> 9340266059SGregory Neil Shapiro<tr align="left" valign=top> 9440266059SGregory Neil Shapiro<th>NOTES</th> 9540266059SGregory Neil Shapiro<td> 9640266059SGregory Neil Shapiro 9740266059SGregory Neil Shapiro<a name="flags"></A> 9840266059SGregory Neil ShapiroThe xxfi_flags field should contain the bitwise OR of zero or more of 9940266059SGregory Neil Shapirothe following values, describing the actions the filter may take: 10040266059SGregory Neil Shapiro<TABLE BORDER CELLPADDING="1" cellspacing=1> 10140266059SGregory Neil Shapiro<tr valign="top" bgcolor="#dddddd"><th align="left">Flag</th><th align="center">Description</th></tr> 10240266059SGregory Neil Shapiro <TR align="left" valign=top> 10340266059SGregory Neil Shapiro <TD> 10440266059SGregory Neil Shapiro SMFIF_ADDHDRS 10540266059SGregory Neil Shapiro </TD> 10640266059SGregory Neil Shapiro <TD> 10740266059SGregory Neil Shapiro This filter may add headers. 10840266059SGregory Neil Shapiro </TD> 10940266059SGregory Neil Shapiro </TR> 11040266059SGregory Neil Shapiro <TR align="left" valign=top> 11140266059SGregory Neil Shapiro <TD> 11240266059SGregory Neil Shapiro SMFIF_CHGHDRS 11340266059SGregory Neil Shapiro </TD> 11440266059SGregory Neil Shapiro <TD> 11540266059SGregory Neil Shapiro This filter may change and/or delete headers. 11640266059SGregory Neil Shapiro </TD> 11740266059SGregory Neil Shapiro </TR> 11840266059SGregory Neil Shapiro <TR align="left" valign=top> 11940266059SGregory Neil Shapiro <TD VALIGN="TOP"> 12040266059SGregory Neil Shapiro SMFIF_CHGBODY 12140266059SGregory Neil Shapiro </TD> 12240266059SGregory Neil Shapiro <TD> 12340266059SGregory Neil Shapiro This filter may replace the body during filtering. 12440266059SGregory Neil Shapiro This may have significant performance impact 12540266059SGregory Neil Shapiro if other filters do body filtering after this filter. 12640266059SGregory Neil Shapiro </TD> 12740266059SGregory Neil Shapiro </TR> 12840266059SGregory Neil Shapiro <TR> 12940266059SGregory Neil Shapiro <TD VALIGN="TOP"> 13040266059SGregory Neil Shapiro SMFIF_ADDRCPT 13140266059SGregory Neil Shapiro </TD> 13240266059SGregory Neil Shapiro <TD> 13340266059SGregory Neil Shapiro This filter may add recipients to the message. 13440266059SGregory Neil Shapiro </TD> 13540266059SGregory Neil Shapiro </TR> 13640266059SGregory Neil Shapiro <TR> 13740266059SGregory Neil Shapiro <TD VALIGN="TOP"> 13840266059SGregory Neil Shapiro SMFIF_DELRCPT 13940266059SGregory Neil Shapiro </TD> 14040266059SGregory Neil Shapiro <TD> 14140266059SGregory Neil Shapiro This filter may remove recipients from the message. 14240266059SGregory Neil Shapiro </TD> 14340266059SGregory Neil Shapiro </TR> 14440266059SGregory Neil Shapiro</TABLE> 14540266059SGregory Neil Shapiro 14640266059SGregory Neil Shapiro</td> 14740266059SGregory Neil Shapiro</tr> 14840266059SGregory Neil Shapiro 14940266059SGregory Neil Shapiro</table> 15040266059SGregory Neil Shapiro 15140266059SGregory Neil Shapiro<hr size="1"> 15240266059SGregory Neil Shapiro<font size="-1"> 1535ef517c0SGregory Neil ShapiroCopyright (c) 2000-2001, 2003 Sendmail, Inc. and its suppliers. 15440266059SGregory Neil ShapiroAll rights reserved. 15540266059SGregory Neil Shapiro<br> 15640266059SGregory Neil ShapiroBy using this file, you agree to the terms and conditions set 1575ef517c0SGregory Neil Shapiroforth in the LICENSE. 15840266059SGregory Neil Shapiro</font> 15940266059SGregory Neil Shapiro</body> 16040266059SGregory Neil Shapiro</html> 161