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