diff options
Diffstat (limited to 'contrib/sendmail/libmilter/docs')
36 files changed, 3622 insertions, 0 deletions
diff --git a/contrib/sendmail/libmilter/docs/api.html b/contrib/sendmail/libmilter/docs/api.html new file mode 100644 index 0000000..af714ef --- /dev/null +++ b/contrib/sendmail/libmilter/docs/api.html @@ -0,0 +1,194 @@ +<html> +<head><title>Milter API</title></head> +<body> +<h1>Milter API</h1> + +<h2>Contents</h2> +<ul> + <li>Library Control Functions + <li>Data Access Functions + <li>Message Modification Functions + <li>Callbacks +</ul> + +<h2>Library Control Functions</h2> + +Before handing control to libmilter (by calling <a +href="smfi_main.html">smfi_main</a>), a filter may call the following +functions to set libmilter parameters. In particular, the filter must +call <a href="smfi_register.html">smfi_register</a> to register its +callbacks. Each function will return either MI_SUCCESS or MI_FAILURE to +indicate the status of the operation. +<p> +None of these functions communicate with the MTA. All alter the +library's state, some of which is communicated to the MTA inside <a +href="smfi_main.html">smfi_main</a>. +<p> +<table border="1" cellspacing=0 cellpadding=2><tr bgcolor="#dddddd"><th>Function</th><th>Description</th></tr> + +<tr><td><a href="smfi_register.html">smfi_register</a></td><td>Register a filter.</td></tr> + +<tr><td><a href="smfi_setconn.html">smfi_setconn</a></td><td>Specify socket to use.</td></tr> + +<tr><td><a href="smfi_settimeout.html">smfi_settimeout</a></td><td>Set timeout.</td></tr> + +<tr><td><a href="smfi_main.html">smfi_main</a></td><td>Hand control to libmilter.</td></tr> + +</table> + +<h2>Data Access Functions</h2> + +The following functions may be called from within the filter-defined callbacks +to access information about the current connection or message. +<p> +<table border="1" cellspacing=0 cellpadding=2><tr bgcolor="#dddddd"><th>Function</th><th>Description</th></tr> +<tr><td><a href="smfi_getsymval.html">smfi_getsymval</a></td><td>Return the value +of a symbol.</td></tr> + +<tr><td><a href="smfi_getpriv.html">smfi_getpriv</a></td><td>Get the private data +pointer.</td></tr> + +<tr><td><a href="smfi_setpriv.html">smfi_setpriv</a></td><td>Set the private data +pointer.</td></tr> + +<tr><td><a href="smfi_setreply.html">smfi_setreply</a></td><td>Set the specific +reply code to be used.</td></tr> + +</table> + +<h2>Message Modification Functions</h2> + +The following functions change a message's contents and attributes. +<b>They may only be called in <a href="xxfi_eom.html">xxfi_eom</a></b>. +All of these functions may invoke additional communication with the MTA. +They will return either MI_SUCCESS or MI_FAILURE to indicate the status of +the operation. + +<p> +A filter must have set the appropriate flag (listed below) in the +description passed to <a href="smfi_register.html">smfi_register</a> +to call any message modification function. Failure to do so will +cause the MTA to treat a call to the function as a failure of the +filter, terminating its connection. + +<p> +Note that the status returned indicates only whether or not the +filter's message was successfully sent to the MTA, not whether or not +the MTA performed the requested operation. For example, <a +href="smfi_addheader.html">smfi_addheader</a>, when called with an +illegal header name, will return MI_SUCCESS even though the MTA may +later refuse to add the illegal header. +<p> +<table border="1" cellspacing=0 cellpadding=2><tr bgcolor="#dddddd"><th>Function</th><th>Description</th><th>SMFIF_* flag</tr> +<tr><td><a href="smfi_addheader.html">smfi_addheader</a></td><td>Add a header to +the message.</td><td>SMFIF_ADDHDRS</td></tr> + +<tr><td><a href="smfi_chgheader.html">smfi_chgheader</a></td><td>Change or delete a header.</td><td>SMFIF_CHGHDRS</td></tr> + +<tr><td><a href="smfi_addrcpt.html">smfi_addrcpt</a></td><td>Add a recipient to +the envelope.</td><td>SMFIF_ADDRCPT</td></tr> + +<tr><td><a href="smfi_delrcpt.html">smfi_delrcpt</a></td><td>Delete a recipient +from the envelope.</td><td>SMFIF_DELRCPT</td></tr> + +<tr><td><a href="smfi_replacebody.html">smfi_replacebody</a></td><td>Replace the +body of the message.</td><td>SMFIF_CHGBODY</td></tr> + +</table> + +<h2>Callbacks</h2> + +The filter should implement one or more of the following callbacks, +which are registered via <a href="smfi_register.html">smfi_register</a>: +<p> +<table border="1" cellspacing=0 cellpadding=2><tr bgcolor="#dddddd"><th>Function</th><th>Description</th></tr> + +<tr><td><a href="xxfi_connect.html">xxfi_connect</a></td><td>connection info</td></tr> + +<tr><td><a href="xxfi_helo.html">xxfi_helo</a></td><td>SMTP HELO/EHLO command</td></tr> + +<tr><td><a href="xxfi_envfrom.html">xxfi_envfrom</a></td><td>envelope sender</td></tr> + +<tr><td><a href="xxfi_envrcpt.html">xxfi_envrcpt</a></td><td>envelope recipient</td></tr> + +<tr><td><a href="xxfi_header.html">xxfi_header</a></td><td>header</td></tr> + +<tr><td><a href="xxfi_eoh.html">xxfi_eoh</a></td><td>end of header</td></tr> + +<tr><td><a href="xxfi_body.html">xxfi_body</a></td><td>body block</td></tr> + +<tr><td><a href="xxfi_eom.html">xxfi_eom</a></td><td>end of message</td></tr> + +<tr><td><a href="xxfi_abort.html">xxfi_abort</a></td><td>message aborted</td></tr> + +<tr><td><a href="xxfi_close.html">xxfi_close</a></td><td>connection cleanup</td></tr> + +</table> + +<p> +The above callbacks should all return one of the following return values, +having the indicated meanings. Any return other than one of the below +values constitutes an error, and will cause sendmail to terminate its +connection to the offending filter. + +<p><a name="conn-spec"></a>Milter distinguishes between recipient-, +message-, and connection-oriented routines. Recipient-oriented +callbacks may affect the processing of a single message recipient; +message-oriented callbacks, a single message; connection-oriented +callbacks, an entire connection (during which multiple messages may be +delivered to multiple sets of recipients). +<a href="xxfi_envrcpt.html">xxfi_envrcpt</a> is recipient-oriented. +<a href="xxfi_connect.html">xxfi_connect</a>, +<a href="xxfi_helo.html">xxfi_helo</a> and +<a href="xxfi_close.html">xxfi_close</a> are connection-oriented. All +other callbacks are message-oriented. + +<p> +<table border="1" cellspacing=0 cellpadding=2> + <tr bgcolor="#dddddd"><th>Return value</th><th>Description</th></tr> + <tr valign="top"> + <td>SMFIS_CONTINUE</td> + <td>Continue processing the current connection, message, or recipient. + </td> + </tr> + <tr valign="top"> + <td>SMFIS_REJECT</td> + <td>For a connection-oriented routine, reject this connection; call <a href="xxfi_close.html">xxfi_close</a>.<br> + For a message-oriented routine (except + <a href="xxfi_eom.html">xxfi_eom</a> or + <a href="xxfi_abort.html">xxfi_abort</a>), reject this message.<br> + For a recipient-oriented routine, reject the current recipient (but continue processing the current message). + </td> + </tr> + <tr valign="top"> + <td>SMFIS_DISCARD</td> + <td>For a message- or recipient-oriented routine, accept this message, but silently discard it.<br> + SMFIS_DISCARD should not be returned by a connection-oriented routine. + </td> + </tr> + <tr valign="top"> + <td>SMFIS_ACCEPT</td> + <td>For a connection-oriented routine, accept this connection without further filter processing; call <a href="xxfi_close.html">xxfi_close</a>.<br> + For a message- or recipient-oriented routine, accept this message without further filtering.<br> + </td> + </tr> + <tr valign="top"> + <td>SMFIS_TEMPFAIL</td> + <td>Return a temporary failure, i.e., the corresponding SMTP command will return an appropriate 4xx status code. + For a message-oriented routine (except <a href="xxfi_envfrom.html">xxfi_envfrom</a>), fail for this message. <br> + For a connection-oriented routine, fail for this connection; call <a href="xxfi_close.html">xxfi_close</a>. <br> + For a recipient-oriented routine, only fail for the current recipient; continue message processing. + </td> + </tr> +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/design.html b/contrib/sendmail/libmilter/docs/design.html new file mode 100644 index 0000000..fbc74e6 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/design.html @@ -0,0 +1,144 @@ +<html> +<head> +<title>Architecture</title> +</head> +<body> + +<h1>Architecture</h1> + +<h2>Contents</h2> + +<ul> + <li>Design Goals + <li>Implementing Filtering Policies + <li>MTA - Filter Communication +</ul> + +<h2>Goals</h2> + +The Sendmail Content Management API (Milter) provides an interface for +third-party software to validate and modify messages as they pass +through the mail transport system. Filters can process messages' +connection (IP) information, envelope protocol elements, message +headers, and/or message body contents, and modify a message's +recipients, headers, and body. The MTA configuration file specifies +which filters are to be applied, and in what order, allowing an +administrator to combine multiple independently-developed filters. + +<p> +We expect to see both vendor-supplied, configurable mail filtering +applications and a multiplicity of script-like filters designed by and +for MTA administrators. A certain degree of coding sophistication and +domain knowledge on the part of the filter provider is assumed. This +allows filters to exercise fine-grained control at the SMTP level. +However, as will be seen in the example, many filtering applications +can be written with relatively little protocol knowledge. + +<p> +Given these expectations, the API is designed to achieve the following +goals: + +<OL> + <LI>Safety/security. + Filter processes should not need to run as root + (of course, they can if required, but that is a local issue); + this will simplify coding + and limit the impact of security flaws in the filter program. +<p> + <LI>Reliability. + Coding failures in a Milter process that cause that process + to hang or core-dump + should not stop mail delivery. + Faced with such a failure, + sendmail should use a default mechanism, + either behaving as if the filter were not present + or as if a required resource were unavailable. + The latter failure mode will generally have sendmail return + a 4xx SMTP code (although in later phases of the SMTP protocol + it may cause the mail to be queued for later processing). +<p> + <LI>Simplicity. + The API should make implementation of a new filter + no more difficult than absolutely necessary. + Subgoals include: + <UL> + <LI>Encourage good thread practice + by defining thread-clean interfaces including local data hooks. + <LI>Provide all interfaces required + while avoiding unnecessary pedanticism. + </UL> +<p> + <LI>Performance. + Simple filters should not seriously impact overall MTA performance. +</OL> + +<h2>Implementing Filtering Policies</h2> + +Milter is designed to allow a server administrator to combine +third-party filters to implement a desired mail filtering policy. For +example, if a site wished to scan incoming mail for viruses on several +platforms, eliminate unsolicited commercial email, and append a mandated +footer to selected incoming messages, the administrator could configure +the MTA to filter messages first through a server based anti-virus +engine, then via a large-scale spam-catching service, and finally +append the desired footer if the message still met requisite criteria. +Any of these filters could be added or changed independently. + +<p> +Thus the site administrator, not the filter writer, controls the +overall mail filtering environment. In particular, he/she must decide +which filters are run, in what order they are run, and how they +communicate with the MTA. These parameters, as well as the +actions to be taken if a filter becomes unavailable, are selectable +during MTA configuration. <a href="installation.html">Further +details</a> are available later in this document. + +<h2>MTA - Filter communication</h2> + +Filters run as separate processes, outside of the sendmail address +space. The benefits of this are threefold: + +<OL> + <LI>The filter need not run with "root" permissions, thereby + avoiding a large family of potential security problems.</LI> + + <LI>Failures in a particular filter will not affect the MTA or + other filters.</LI> + + <LI>The filter can potentially have higher performance because of + the parallelism inherent in multiple processes.</LI> +</OL> + +<p> +Each filter may communicate with multiple MTAs at the same time over +local or remote connections, using multiple threads of execution. <a +href="#figure-1">Figure 1</a> illustrates a possible network of +communication channels between a site's filters, its MTAs, and other +MTAs on the network: +</p> +<div align="center"> +<a name="figure-1"><img src="figure1.jpg" ALT=""></A><br> +<b>Figure 1: A set of MTA's interacting with a set of filters.</b> +</div> +<p> +The Milter library (libmilter) implements the communication protocol. +It accepts connections from various MTAs, passes the relevant data to +the filter through callbacks, then makes appropriate responses based +on return codes. A filter may also send data to the MTA as a result +of library calls. <a href="#figure-2">Figure 2</a> shows a single +filter process processing messages from two MTAs: +</p> +<div align="center"> +<img src="figure2.jpg" ALT=""><br> +<b>Figure 2: A filter handling simultaneous requests from two MTA's.</b> +</div> +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/figure1.fig b/contrib/sendmail/libmilter/docs/figure1.fig new file mode 100644 index 0000000..e0cbdc8 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/figure1.fig @@ -0,0 +1,56 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +6 975 225 5025 3375 +6 1500 1275 2700 2025 +2 2 0 2 1 7 50 0 -1 0.000 0 0 7 0 0 5 + 1650 1425 2550 1425 2550 1875 1650 1875 1650 1425 +4 0 1 50 0 0 20 0.0000 4 195 645 1800 1725 MTA\001 +-6 +6 1950 2625 3150 3375 +2 2 0 2 4 7 50 0 -1 0.000 0 0 7 0 0 5 + 2100 2775 3000 2775 3000 3225 2100 3225 2100 2775 +4 0 4 50 0 0 20 0.0000 4 195 645 2250 3075 MTA\001 +-6 +6 1050 225 2250 975 +2 2 0 2 14 7 50 0 -1 0.000 0 0 7 0 0 5 + 1200 375 2100 375 2100 825 1200 825 1200 375 +4 0 14 50 0 0 20 0.0000 4 195 645 1350 675 MTA\001 +-6 +2 1 0 2 1 7 50 0 -1 0.000 0 0 7 0 0 2 + 2550 1575 3750 2625 +2 1 0 2 1 7 50 0 -1 0.000 0 0 7 0 0 2 + 2550 1575 3750 1575 +2 1 0 2 1 7 50 0 -1 0.000 0 0 7 0 0 2 + 2550 1575 3750 825 +2 1 0 2 4 7 50 0 -1 0.000 0 0 7 0 0 2 + 3000 2925 3750 2625 +2 1 0 2 14 7 50 0 -1 0.000 0 0 7 0 0 2 + 2100 525 3750 825 +2 1 0 2 14 7 50 0 -1 0.000 0 0 7 0 0 2 + 2100 525 3750 2625 +2 1 0 4 0 7 50 0 -1 0.000 0 0 7 0 0 2 + 1050 3075 2100 3075 +2 1 0 4 0 7 50 0 -1 0.000 0 0 7 0 0 2 + 1050 1725 1650 1725 +2 1 0 4 0 7 50 0 -1 0.000 0 0 7 0 0 2 + 1050 675 1200 675 +2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 + 3750 2475 4950 2475 4950 2925 3750 2925 3750 2475 +2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 + 3750 1425 4950 1425 4950 1875 3750 1875 3750 1425 +2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 + 3750 525 4950 525 4950 975 3750 975 3750 525 +4 0 0 50 0 1 20 0.0000 4 210 795 3900 2775 Filter 3\001 +4 0 0 50 0 1 20 0.0000 4 210 795 3900 1725 Filter 2\001 +4 0 0 50 0 1 20 0.0000 4 210 795 3900 825 Filter 1\001 +-6 +2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 + 300 525 1050 525 1050 3225 300 3225 300 525 +4 0 0 50 0 2 24 1.5708 4 255 1950 825 2850 INTERNET\001 diff --git a/contrib/sendmail/libmilter/docs/figure1.jpg b/contrib/sendmail/libmilter/docs/figure1.jpg Binary files differnew file mode 100644 index 0000000..1a5f1de --- /dev/null +++ b/contrib/sendmail/libmilter/docs/figure1.jpg diff --git a/contrib/sendmail/libmilter/docs/figure1.ps b/contrib/sendmail/libmilter/docs/figure1.ps new file mode 100644 index 0000000..ae31760 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/figure1.ps @@ -0,0 +1,173 @@ +%!PS-Adobe-2.0 +%%Title: figure1.fig +%%Creator: fig2dev Version 3.2.3 Patchlevel +%%CreationDate: Tue Jun 6 14:00:04 2000 +%%For: sean@host232.Sendmail.COM (Sean O'rourke,5400) +%%Orientation: Landscape +%%Pages: 1 +%%BoundingBox: 0 0 612 792 +%%BeginSetup +%%IncludeFeature: *PageSize Letter +%%EndSetup +%%Magnification: 1.0000 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +newpath 0 792 moveto 0 0 lineto 612 0 lineto 612 792 lineto closepath clip newpath +198.0 238.0 translate + 90 rotate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +$F2psBegin +%%Page: 1 1 +10 setmiterlimit + 0.06000 0.06000 sc +%%Page: 1 1 +/Times-Bold ff 360.00 scf sf +825 2850 m +gs 1 -1 sc 90.0 rot (INTERNET) col0 sh gr +/Times-Roman ff 300.00 scf sf +1800 1725 m +gs 1 -1 sc (MTA) col1 sh gr +% Polyline +15.000 slw +n 2100 2775 m 3000 2775 l 3000 3225 l 2100 3225 l + cp gs col4 s gr +/Times-Roman ff 300.00 scf sf +2250 3075 m +gs 1 -1 sc (MTA) col4 sh gr +% Polyline +n 1200 375 m 2100 375 l 2100 825 l 1200 825 l + cp gs col14 s gr +/Times-Roman ff 300.00 scf sf +1350 675 m +gs 1 -1 sc (MTA) col14 sh gr +% Polyline +n 2550 1575 m + 3750 2625 l gs col1 s gr +% Polyline +n 2550 1575 m + 3750 1575 l gs col1 s gr +% Polyline +n 2550 1575 m + 3750 825 l gs col1 s gr +% Polyline +n 3000 2925 m + 3750 2625 l gs col4 s gr +% Polyline +n 2100 525 m + 3750 825 l gs col14 s gr +% Polyline +n 2100 525 m + 3750 2625 l gs col14 s gr +% Polyline +45.000 slw +n 1050 3075 m + 2100 3075 l gs col0 s gr +% Polyline +n 1050 1725 m + 1650 1725 l gs col0 s gr +% Polyline +n 1050 675 m + 1200 675 l gs col0 s gr +% Polyline +15.000 slw +n 3750 2475 m 4950 2475 l 4950 2925 l 3750 2925 l + cp gs col0 s gr +% Polyline +n 3750 1425 m 4950 1425 l 4950 1875 l 3750 1875 l + cp gs col0 s gr +% Polyline +n 3750 525 m 4950 525 l 4950 975 l 3750 975 l + cp gs col0 s gr +/Times-Italic ff 300.00 scf sf +3900 2775 m +gs 1 -1 sc (Filter 3) col0 sh gr +/Times-Italic ff 300.00 scf sf +3900 1725 m +gs 1 -1 sc (Filter 2) col0 sh gr +/Times-Italic ff 300.00 scf sf +3900 825 m +gs 1 -1 sc (Filter 1) col0 sh gr +% Polyline +7.500 slw +n 300 525 m 1050 525 l 1050 3225 l 300 3225 l + cp gs col0 s gr +% Polyline +15.000 slw +n 1650 1425 m 2550 1425 l 2550 1875 l 1650 1875 l + cp gs col1 s gr +$F2psEnd +rs +showpage diff --git a/contrib/sendmail/libmilter/docs/figure2.fig b/contrib/sendmail/libmilter/docs/figure2.fig new file mode 100644 index 0000000..c93bfe3 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/figure2.fig @@ -0,0 +1,67 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +5 1 0 1 0 7 50 0 -1 0.000 0 0 1 0 2981.250 1200.000 2700 1050 3300 1200 2700 1350 + 1 1 1.00 60.00 120.00 +6 4200 900 6450 1350 +2 2 0 1 1 7 50 0 -1 0.000 0 0 7 0 0 5 + 4200 900 6450 900 6450 1350 4200 1350 4200 900 +4 0 1 50 0 0 16 0.0000 4 195 2040 4350 1200 xxfi_header callback\001 +-6 +6 4200 2250 6450 2700 +2 2 0 1 4 7 50 0 -1 0.000 0 0 7 0 0 5 + 4200 2250 6450 2250 6450 2700 4200 2700 4200 2250 +4 0 4 50 0 0 16 0.0000 4 195 2040 4350 2550 xxfi_header callback\001 +-6 +6 600 2100 1800 2850 +2 2 0 2 4 7 50 0 -1 0.000 0 0 7 0 0 5 + 750 2250 1650 2250 1650 2700 750 2700 750 2250 +4 0 4 50 0 0 20 0.0000 4 195 645 900 2550 MTA\001 +-6 +6 600 750 1800 1500 +2 2 0 2 1 7 50 0 -1 0.000 0 0 7 0 0 5 + 750 900 1650 900 1650 1350 750 1350 750 900 +4 0 1 50 0 0 20 0.0000 4 195 645 900 1200 MTA\001 +-6 +2 1 0 2 1 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 4200 1200 3600 1200 +2 1 0 2 1 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 3450 900 4050 900 +2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 + 2400 300 6600 300 6600 3300 2400 3300 2400 300 +2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 + 2550 750 3450 750 3450 2700 2550 2700 2550 750 +2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 3450 2700 4050 2700 +2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 4200 2400 3600 2400 +2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 1650 2700 2250 2700 +2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 2400 2400 1800 2400 +2 1 0 2 1 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 1650 900 2250 900 +2 1 0 2 1 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 2.00 120.00 240.00 + 2400 1200 1800 1200 +4 0 0 50 0 0 20 0.0000 4 195 630 3900 600 Filter\001 +4 0 4 50 0 0 12 0.0000 4 180 1620 3450 3000 callback (arguments)\001 +4 0 4 50 0 0 12 0.0000 4 180 1575 3900 1950 optional library calls,\001 +4 0 4 50 0 0 12 0.0000 4 135 855 3900 2175 return code\001 +4 0 4 50 0 0 12 0.0000 4 135 780 1500 2100 responses\001 +4 0 0 50 0 0 16 0.0000 4 165 645 2700 2085 Milter\001 +4 0 0 50 0 0 16 0.0000 4 225 675 2700 2400 library\001 +4 0 4 50 0 0 12 0.0000 4 135 510 1500 3000 header\001 diff --git a/contrib/sendmail/libmilter/docs/figure2.jpg b/contrib/sendmail/libmilter/docs/figure2.jpg Binary files differnew file mode 100644 index 0000000..8b11485 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/figure2.jpg diff --git a/contrib/sendmail/libmilter/docs/figure2.ps b/contrib/sendmail/libmilter/docs/figure2.ps new file mode 100644 index 0000000..861a193 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/figure2.ps @@ -0,0 +1,242 @@ +%!PS-Adobe-2.0 +%%Title: figure2.fig +%%Creator: fig2dev Version 3.2.3 Patchlevel +%%CreationDate: Tue Jun 6 13:57:47 2000 +%%For: sean@host232.Sendmail.COM (Sean O'rourke,5400) +%%Orientation: Landscape +%%Pages: 1 +%%BoundingBox: 0 0 612 792 +%%BeginSetup +%%IncludeFeature: *PageSize Letter +%%EndSetup +%%Magnification: 1.5000 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +newpath 0 792 moveto 0 0 lineto 612 0 lineto 612 792 lineto closepath clip newpath +144.0 65.5 translate + 90 rotate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +$F2psBegin +%%Page: 1 1 +10 setmiterlimit + 0.09000 0.09000 sc +%%Page: 1 1 +/Times-Roman ff 180.00 scf sf +1500 3000 m +gs 1 -1 sc (header) col4 sh gr +/Times-Roman ff 240.00 scf sf +4350 1200 m +gs 1 -1 sc (xxfi_header callback) col1 sh gr +% Polyline +7.500 slw +n 4200 2250 m 6450 2250 l 6450 2700 l 4200 2700 l + cp gs col4 s gr +/Times-Roman ff 240.00 scf sf +4350 2550 m +gs 1 -1 sc (xxfi_header callback) col4 sh gr +% Polyline +15.000 slw +n 750 2250 m 1650 2250 l 1650 2700 l 750 2700 l + cp gs col4 s gr +/Times-Roman ff 300.00 scf sf +900 2550 m +gs 1 -1 sc (MTA) col4 sh gr +% Polyline +n 750 900 m 1650 900 l 1650 1350 l 750 1350 l + cp gs col1 s gr +/Times-Roman ff 300.00 scf sf +900 1200 m +gs 1 -1 sc (MTA) col1 sh gr +% Arc +7.500 slw +gs clippath +2713 1319 m 2667 1357 l 2761 1475 l 2710 1363 l 2808 1437 l cp +eoclip +n 2981.2 1200.0 318.8 -151.9 151.9 arc +gs col0 s gr + gr + +% arrowhead +n 2808 1437 m 2710 1363 l 2761 1475 l 2808 1437 l cp gs 0.00 setgray ef gr col0 s +% Polyline +15.000 slw +gs clippath +3585 1140 m 3585 1260 l 3872 1260 l 3632 1200 l 3872 1140 l cp +eoclip +n 4200 1200 m + 3600 1200 l gs col1 s gr gr + +% arrowhead +n 3872 1140 m 3632 1200 l 3872 1260 l 3872 1140 l cp gs col1 1.00 shd ef gr col1 s +% Polyline +gs clippath +4065 960 m 4065 840 l 3778 840 l 4018 900 l 3778 960 l cp +eoclip +n 3450 900 m + 4050 900 l gs col1 s gr gr + +% arrowhead +n 3778 960 m 4018 900 l 3778 840 l 3778 960 l cp gs col1 1.00 shd ef gr col1 s +% Polyline +n 2400 300 m 6600 300 l 6600 3300 l 2400 3300 l + cp gs col0 s gr +% Polyline +7.500 slw +n 2550 750 m 3450 750 l 3450 2700 l 2550 2700 l + cp gs col0 s gr +% Polyline +15.000 slw +gs clippath +4065 2760 m 4065 2640 l 3778 2640 l 4018 2700 l 3778 2760 l cp +eoclip +n 3450 2700 m + 4050 2700 l gs col4 s gr gr + +% arrowhead +n 3778 2760 m 4018 2700 l 3778 2640 l 3778 2760 l cp gs col4 1.00 shd ef gr col4 s +% Polyline +gs clippath +3585 2340 m 3585 2460 l 3872 2460 l 3632 2400 l 3872 2340 l cp +eoclip +n 4200 2400 m + 3600 2400 l gs col4 s gr gr + +% arrowhead +n 3872 2340 m 3632 2400 l 3872 2460 l 3872 2340 l cp gs col4 1.00 shd ef gr col4 s +% Polyline +gs clippath +2265 2760 m 2265 2640 l 1978 2640 l 2218 2700 l 1978 2760 l cp +eoclip +n 1650 2700 m + 2250 2700 l gs col4 s gr gr + +% arrowhead +n 1978 2760 m 2218 2700 l 1978 2640 l 1978 2760 l cp gs col4 1.00 shd ef gr col4 s +% Polyline +gs clippath +1785 2340 m 1785 2460 l 2072 2460 l 1832 2400 l 2072 2340 l cp +eoclip +n 2400 2400 m + 1800 2400 l gs col4 s gr gr + +% arrowhead +n 2072 2340 m 1832 2400 l 2072 2460 l 2072 2340 l cp gs col4 1.00 shd ef gr col4 s +% Polyline +gs clippath +2265 960 m 2265 840 l 1978 840 l 2218 900 l 1978 960 l cp +eoclip +n 1650 900 m + 2250 900 l gs col1 s gr gr + +% arrowhead +n 1978 960 m 2218 900 l 1978 840 l 1978 960 l cp gs col1 1.00 shd ef gr col1 s +% Polyline +gs clippath +1785 1140 m 1785 1260 l 2072 1260 l 1832 1200 l 2072 1140 l cp +eoclip +n 2400 1200 m + 1800 1200 l gs col1 s gr gr + +% arrowhead +n 2072 1140 m 1832 1200 l 2072 1260 l 2072 1140 l cp gs col1 1.00 shd ef gr col1 s +/Times-Roman ff 300.00 scf sf +3900 600 m +gs 1 -1 sc (Filter) col0 sh gr +/Times-Roman ff 180.00 scf sf +3450 3000 m +gs 1 -1 sc (callback \(arguments\)) col4 sh gr +/Times-Roman ff 180.00 scf sf +3900 1950 m +gs 1 -1 sc (optional library calls,) col4 sh gr +/Times-Roman ff 180.00 scf sf +3900 2175 m +gs 1 -1 sc (return code) col4 sh gr +/Times-Roman ff 180.00 scf sf +1500 2100 m +gs 1 -1 sc (responses) col4 sh gr +/Times-Roman ff 240.00 scf sf +2700 2085 m +gs 1 -1 sc (Milter) col0 sh gr +/Times-Roman ff 240.00 scf sf +2700 2400 m +gs 1 -1 sc (library) col0 sh gr +% Polyline +7.500 slw +n 4200 900 m 6450 900 l 6450 1350 l 4200 1350 l + cp gs col1 s gr +$F2psEnd +rs +showpage diff --git a/contrib/sendmail/libmilter/docs/index.html b/contrib/sendmail/libmilter/docs/index.html new file mode 100644 index 0000000..44c5f90 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/index.html @@ -0,0 +1,92 @@ +<html> +<head> +<title>Filtering Mail with Sendmail</title> +</head> +<body> +<!-- +$Id: index.html,v 1.10 2001/06/01 00:05:03 ca Exp $ +--> + +<h1>Filtering Mail with Sendmail</h1> + +<!-- +<P><b>Disclaimer</b>: +This preliminary API description is provided for review only. This +specification may change based on feedback from reviewers, and does +not bind Sendmail to offer this functionality in any release. +--> + +<h2>Introduction</h2> + +<P> +Sendmail's Content Management API (milter) provides third-party +programs to access mail messages as they are being processed by the +Mail Transfer Agent (MTA), allowing them to examine and modify message +content and meta-information. Filtering policies implemented by +Milter-conformant filters may then be centrally configured and +composed in an end-user's MTA configuration file. + +<p> +Possible uses for filters include spam rejection, virus +filtering, and content control. In general, Milter seeks to address +site-wide filtering concerns in a scalable way. Individual users' mail +filtering needs (e.g. sorting messages by subject) are left to +client-level programs such as <a href="http://www.procmail.org">Procmail</a>. + +<P> +This document is a technical introduction intended for those +interested in developing Milter filters. It includes: +<ul> +<li>A description of Milter's design goals. + +<li>An explanation of Milter application architecture, including +interactions between the support library and user code, and between +filters and the MTA. + +<li>A specification of the C application programming interface. +<li>An example of a simple Milter filter. +</ul> + +<h2>Contents</h2> + +<ul> +<li><a href="design.html">Architecture</a> +<ul> + <li>Design Goals + <li>Implementing Filtering Policies + <li>MTA - Filter communication +</ul> +<li><a href="overview.html">Technical Overview</a> +<ul> + <li>Initialization + <li>Control flow + <li>Multithreading + <li>Resource Management + <li>Signal Handling +</ul> +<li><a href="api.html">API Documentation</a> +<ul> + <li>Library Control Functions + <li>Data Access Functions + <li>Message Modification Functions + <li>Callbacks +</ul> +<li><a href="installation.html">Installation and Configuration</a> +<ul> + <li>Compiling and Installing Your Filter + <li>Configuring Sendmail +</ul> +<li><a href="sample.html">A Sample Filter</a> +<!-- <li><a href="other.html">Other Sources of Information</a> --> +</ul> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000, 2001 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/installation.html b/contrib/sendmail/libmilter/docs/installation.html new file mode 100644 index 0000000..8ebe4ee --- /dev/null +++ b/contrib/sendmail/libmilter/docs/installation.html @@ -0,0 +1,169 @@ +<html> +<head><title>Installation and Configuration</title> +</head> +<body> +<h1>Installation</h1> +<h2>Contents</h2> +<ul> + <li><a href="#compile">Compiling and Installing Your Filter</a> + <li><a href="#config">Configuring Sendmail</a> +</ul> + +<h2><a name="compile">Compiling and Installing Your Filter</A></h2> + +To compile a filter, modify the Makefile provided with the sample program, or: +<ul> + <li>Put the include and Sendmail directories in your include path + (e.g. -I/path/to/include -I/path/to/sendmail). + + <li>Make sure libmilter.so is in your library path, and link your + application with it (e.g. "-lmilter"). + + <li>Compile with pthreads, either by using -pthread for gcc, or + linking with a pthreads support library (-lpthread). +</ul> +Your compile command line will look like +<pre> +cc -I/path/to/include -I/path/to/sendmail -c myfile.c +</pre> +and your linking command line will look something like +<pre> +cc -o myfilter [object-files] -L[library-location] -lmilter -pthread +</pre> + +<p> +To run the filter, the Milter shared library must be available to the +run-time linker. + +<H2><a name="config">Configuring Sendmail</A></H2> + +First, you must compile sendmail versions before 8.12 with _FFR_MILTER +defined. To do this, add the following lines to your build +configuration file (devtools/Site/config.site.m4) +<pre> +APPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_MILTER=1') +APPENDDEF(`conf_libmilter_ENVDEF', `-D_FFR_MILTER=1') +</pre> + +then type <code>./Build -c</code> in your sendmail directory. + +<P> +Next, you must add the desired filters to your sendmail configuration +(.mc) file. With versions before 8.12, the file must then be +processed with _FFR_MILTER defined. Mail filters have three equates: +The required <code>S=</code> equate specifies the socket where +sendmail should look for the filter; The optional <code>F=</code> and +<code>T=</code> equates specify flags and timeouts, respectively. All +equates names, equate field names, and flag values are case sensitive. + +<P> +The current flags (<code>F=</code>) are: +<p> +<table cellspacing="1" cellpadding=4 border=1> +<tr bgcolor="#dddddd" align=left valign=top> +<th>Flag</TH> <th align="center">Meaning</TH> +</TR> +<tr align="left" valign=top> +<TD>R</TD> <TD>Reject connection if filter unavailable</TD> +</TR> +<tr align="left" valign=top> +<TD>T</TD> <TD>Temporary fail connection if filter unavailable</TD> +</TR> +</TABLE> + +If a filter is unavailable or unresponsive and no flags have been +specified, the MTA will continue normal handling of the current +connection. The MTA will try to contact the filter again on each new +connection. + +<P> +There are three fields inside of the <code>T=</code> equate: S, R, and +E. Note the separator between each is a ";" (semicolon), as "," +(comma) already separates equates. The value of each field is a +decimal number followed by a single letter designating the units ("s" +for seconds, "m" for minutes). The fields have the following +meanings: +<p> +<TABLE cellspacing="1" cellpadding=4 border=1> +<TR bgcolor="#dddddd" align=left valign=top> +<TH>Flag</TH> <TH align="center">Meaning</TH> +</TR> +<TR align="left" valign=top> +<TD>C</TD> <TD>Timeout for connecting to a filter. If set to 0, the + system's <CODE>connect()</CODE> timeout will be used. + Default: 5m</TD> +</TR> +<TR align="left" valign=top> +<TD>S</TD> <TD>Timeout for sending information from the MTA to a + filter. Default: 10s</TD> +</TR> +<TR align="left" valign=top> +<TD>R</TD> <TD>Timeout for reading reply from the filter. Default: 10s</TD> +</TR> +<TR align="left" valign=top> +<TD>E</TD> <TD>Overall timeout between sending end-of-message to + filter and waiting for the final acknowledgment. Default: 5m</TD> +</TR> +</TABLE> + +<p> +The following sendmail.mc example specifies three filters. The first +two rendezvous on Unix-domain sockets in the /var/run directory; the +third uses an IP socket on port 999. +<pre> + INPUT_MAIL_FILTER(`filter1', `S=unix:/var/run/f1.sock, F=R') + INPUT_MAIL_FILTER(`filter2', `S=unix:/var/run/f2.sock, F=T, T=S:1s;R:1s;E:5m') + INPUT_MAIL_FILTER(`filter3', `S=inet:999@localhost, T=C:2m') + + define(`confINPUT_MAIL_FILTERS', `filter2,filter1,filter3') +<hr width="30%"> + m4 <b>-D_FFR_MILTER</b> ../m4/cf.m4 myconfig.mc > myconfig.cf +</pre> +By default, the filters would be run in the order declared, +i.e. "filter1, filter2, filter3"; however, since +<code>confINPUT_MAIL_FILTERS</code> is defined, the filters will be +run "filter2, filter1, filter3". Also note that a filter can be +defined without adding it to the input filter list by using +MAIL_FILTER() instead of INPUT_MAIL_FILTER(). + +<p> +The above macros will result in the following lines being added to +your .cf file: +<PRE> + Xfilter1, S=unix:/var/run/f1.sock, F=R + Xfilter2, S=unix:/var/run/f2.sock, F=T, T=S:1s;R:1s;E:5m + Xfilter3, S=inet:999@localhost, T=C:2m + + O InputMailFilters=filter2,filter1,filter3 +</PRE> +<p> +Finally, the sendmail macros accessible via <a +href="smfi_getsymval.html">smfi_getsymval</a> can be configured by +defining the following m4 variables (or cf options): +<table cellspacing="1" cellpadding=4 border=1> +<tr bgcolor="#dddddd" align=left valign=top> +<th align="center">In .mc file</th> <th align="center">In .cf file</TH> +<th align="center">Default Value</th> +</tr> +<tr><td>confMILTER_MACROS_CONNECT</td><td>Milter.macros.connect</td> +<td><code>j, _, {daemon_name}, {if_name}, {if_addr}</code></td></tr> +<tr><td>confMILTER_MACROS_HELO</td><td>Milter.macros.helo</td> +<td><code>{tls_version}, {cipher}, {cipher_bits}, {cert_subject}, +{cert_issuer}</code></td></tr> +<tr><td>confMILTER_MACROS_ENVFROM</td><td>Milter.macros.envfrom</td> +<td><code>i, {auth_type}, {auth_authen}, {auth_ssf}, {auth_author}, +{mail_mailer}, {mail_host}, {mail_addr}</code></td></tr> +<tr><td>confMILTER_MACROS_ENVRCPT</td><td>Milter.macros.envrcpt</td> +<td><code>{rcpt_mailer}, {rcpt_host}, {rcpt_addr}</code></td></tr> +</table> +For information about available macros and their meanings, please +consult the sendmail documentation. +<hr size="1"> +<font size="-1"> +Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> </html> diff --git a/contrib/sendmail/libmilter/docs/other.html b/contrib/sendmail/libmilter/docs/other.html new file mode 100644 index 0000000..8ec9ffd --- /dev/null +++ b/contrib/sendmail/libmilter/docs/other.html @@ -0,0 +1,15 @@ +<html> +<head><title>Other Resources</title> +</head> +<body> +FAQ? Mailing list? More sample filters? +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/overview.html b/contrib/sendmail/libmilter/docs/overview.html new file mode 100644 index 0000000..7f1c036 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/overview.html @@ -0,0 +1,194 @@ +<html> +<head> +<title>Technical Overview</title> +</head> +<body> +<!-- +$Id: overview.html,v 1.12 2001/06/01 00:05:03 ca Exp $ +--> + +<h1>Technical Overview</h1> + +<h2>Contents</h2> + +<ul> + <li>Initialization + <li>Control flow + <li>Multithreading + <li>Resource Management + <li>Signal Handling +</ul> + +<h2>Initialization</h2> + +In addition to its own initialization, libmilter expects a filter to initialize several parameters before calling <a href="smfi_main.html">smfi_main</a>: +<ul> + <li>The callbacks the filter wishes to be called, and the types of + message modification it intends to perform (required, see <a + href="smfi_register.html">smfi_register</a>). + + <li>The socket address to be used when communicating with the MTA + (required, see <a href="smfi_setconn.html">smfi_setconn</a>). + + <li>The number of seconds to wait for MTA connections before + timing out (optional, see <a + href="smfi_settimeout.html">smfi_settimeout</a>). +</ul> +<p> +If the filter fails to initialize libmilter, or if one or more of the +parameters it has passed are invalid, a subsequent call to smfi_main +will fail. + +<h2>Control flow</h2> + +<p> +The following pseudocode describes the filtering process from the +perspective of a set of <code>N</code> MTA's, each corresponding to a +connection. Callbacks are shown beside the processing stages in which +they are invoked; if no callbacks are defined for a particular stage, +that stage may be bypassed. Though it is not shown, processing may be +aborted at any time during a message, in which case the <a +href="xxfi_abort.html">xxfi_abort</a> callback is invoked and control +returns to <code>MESSAGE</code>. +<p> +<pre> +For each of N connections +{ + For each filter + process connection/helo (<a href="xxfi_connect.html">xxfi_connect</a>, <a href="xxfi_helo.html">xxfi_helo</a>) +MESSAGE:For each message in this connection (sequentially) + { + For each filter + process sender (<a href="xxfi_envfrom.html">xxfi_envfrom</a>) + For each recipient + { + For each filter + process recipient (<a href="xxfi_envrcpt.html">xxfi_envrcpt</a>) + } + For each filter + { + For each header + process header (<a href="xxfi_header.html">xxfi_header</a>) + process end of headers (<a href="xxfi_eoh.html">xxfi_eoh</a>) + For each body block + process this body block (<a href="xxfi_body.html">xxfi_body</a>) + process end of message (<a href="xxfi_eom.html">xxfi_eom</a>) + } + } + For each filter + process end of connection (<a href="xxfi_close.html">xxfi_close</a>) +} +</pre> + +<P>Note: Filters are contacted in order defined in config file.</P> + +<P> +To write a filter, a vendor supplies callbacks to process relevant +parts of a message transaction. The library then controls all +sequencing, threading, and protocol exchange with the MTA. <a +href="#figure-3">Figure 3</a> outlines control flow for a filter +process, showing where different callbacks are invoked. +</p> +<div align="center"><a name="figure-3"></a> +<table border=1 cellspacing=0 cellpadding=2 width="70%"> +<tr bgcolor="#dddddd"><th>SMTP Commands</th><th>Milter Callbacks</th></tr> +<tr><td>(open SMTP connection)</td><td>xxfi_connect</td></tr> +<tr><td>HELO ...</td><td>xxfi_helo</td></tr> +<tr><td>MAIL From: ...</td><td>xxfi_envfrom</td></tr> +<tr><td>RCPT To: ...</td><td>xxfi_envrcpt</td></tr> +<tr><td>[more RCPTs]</td><td>[xxfi_envrcpt]</td></tr> +<tr><td>DATA</td><td> </td></tr> +<tr><td>Header: ...</td><td>xxfi_header</td></tr> +<tr><td>[more headers]</td><td>[xxfi_header]</td></tr> +<tr><td> </td><td>xxfi_eoh</td></tr> +<tr><td>body... </td><td>xxfi_body</td></tr> +<tr><td>[more body...]</td><td>[xxfi_body]</td></tr> +<tr><td>.</td><td>xxfi_eom</td></tr> +<tr><td>QUIT</td><td>xxfi_close</td></tr> +<tr><td>(close SMTP connection)</td><td> </td></tr> +</table> +<b>Figure 3: Milter callbacks related to an SMTP transaction.</b> +</div> +<p> +Note that although only a single message is shown above, multiple +messages may be sent in a single connection. Note also that a message +and/or connection may be aborted by either the remote host or the MTA +at any point during the SMTP transaction. If this occurs during a +message (between the MAIL command and the final "."), the filter's <a +href="xxfi_abort.html">xxfi_abort</a> routine will be called. <a +href="xxfi_close.html">xxfi_close</a> is called any time the +connection closes. + +<h2>Multithreading</h2> + +<p> +A single filter process may handle any number of connections +simultaneously. All filtering callbacks must therefore be reentrant, +and use some appropriate external synchronization methods to access +global data. Furthermore, since there is not a one-to-one +correspondence between threads and connections (N connections mapped +onto M threads, M <= N), connection-specific data must be accessed +through the handles provided by the Milter library. The programmer +cannot rely on library-supplied thread-specific data blocks +(e.g. pthread_getspecific()) to store connection-specific data. See +the API documentation for <a +href="smfi_setpriv.html">smfi_setpriv</a> and <a +href="smfi_getpriv.html">smfi_getpriv</a> for details. + +<h2>Resource management</h2> + +Since filters are likely to be long-lived, and to handle many +connections, proper deallocation of per-connection resources is +important. The lifetime of a connection is bracketed by calls to the +callbacks <a href="xxfi_connect.html">xxfi_connect</a> and <a +href="xxfi_close.html">xxfi_close</a>. Therefore connection-specific +resources (accessed via <a href="smfi_getpriv.html">smfi_getpriv</a> +and <a href="smfi_setpriv.html">smfi_setpriv</a>) may be allocated in +<a href="xxfi_connect.html">xxfi_connect</a>, and should be freed in +<a href="xxfi_close.html">xxfi_close</a>. For further information see +the <a href="api.html#conn-msg">discussion</a> of message- versus +connection-oriented routines. In particular, note that there is only +one connection-specific data pointer per connection. +<p> + +Each message is bracketed by calls to <a +href="xxfi_envfrom.html">xxfi_envfrom</a> and <a +href="xxfi_eom.html">xxfi_eom</a> (or <a +href="xxfi_abort.html">xxfi_abort</a>), implying that message-specific +resources can be allocated and reclaimed in these routines. Since the +messages in a connection are processed sequentially by each filter, +there will be only one active message associated with a given +connection and filter (and connection-private data block). These +resources must still be accessed through <a +href="smfi_getpriv.html">smfi_getpriv</a> and <a +href="smfi_setpriv.html">smfi_setpriv</a>, and must be reclaimed +in <a href="xxfi_abort.html">xxfi_abort</a>. + +<h2>Signal Handling</h2> + +libmilter takes care of signal handling, the filters are +not influenced directly by signals. +There are basically two types of signal handlers: + +<ol> +<li><TT>Stop</TT>: no new connections from the MTA will be accepted, +but existing connections are allowed to continue. +<li><TT>Abort</TT>: all filters will be stopped as soon as the next +communication with the MTA happens. +</ol> + +Filters are not terminated asynchronously (except by +signals that can't be caught). +In the case of <TT>Abort</TT> the +<a href="xxfi_abort.html">xxfi_abort</a> callback is invoked. + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000, 2001 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/sample.html b/contrib/sendmail/libmilter/docs/sample.html new file mode 100644 index 0000000..7e99704 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/sample.html @@ -0,0 +1,426 @@ +<html> +<head><title>A Sample Filter</title></head> +<body> +<h1>A Sample Filter</h1> + +The following sample logs each message to a separate temporary file, +adds a recipient given with the -a flag, and rejects a disallowed +recipient address given with the -r flag. It recognizes the following +options: +<p> +<center> +<table border="1" cellpadding=2 cellspacing=1> +<tr><td><code>-p port</code></td><td>The port through which the MTA will connect to the filter.</td></tr> +<tr><td><code>-t sec</code></td><td>The timeout value.</td></tr> +<tr><td><code>-r addr</code></td><td>A recipient to reject.</td></tr> +<tr><td><code>-a addr</code></td><td>A recipient to add.</td></tr> +</table> +</center> +<hr> +<pre> +#include "mfapi.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sysexits.h> +#include <unistd.h> +#ifndef bool +#define bool char +#define TRUE 1 +#define FALSE 0 +#endif + +extern int errno; + + +struct mlfiPriv +{ + char *mlfi_fname; + char *mlfi_connectfrom; + char *mlfi_helofrom; + FILE *mlfi_fp; +}; + +#define MLFIPRIV ((struct mlfiPriv *) <a href="smfi_getpriv.html">smfi_getpriv</a>(ctx)) + +extern sfsistat mlfi_cleanup(SMFICTX *, bool); +/* recipients to add and reject (set with -a and -r options) */ +char *add, *reject; + +sfsistat +<a href="xxfi_connect.html">mlfi_connect</a>(ctx, hostname, hostaddr) + SMFICTX *ctx; + char *hostname; + _SOCK_ADDR *hostaddr; +{ + struct mlfiPriv *priv; + char *ident; + + /* allocate some private memory */ + priv = malloc(sizeof *priv); + if (priv == NULL) + { + /* can't accept this message right now */ + return SMFIS_TEMPFAIL; + } + memset(priv, '\0', sizeof *priv); + + /* save the private data */ + <a href="smfi_setpriv.html">smfi_setpriv</a>(ctx, priv); + + ident = <a href="smfi_getsymval.html">smfi_getsymval</a>(ctx, "_"); + if(!ident) ident = "???"; + if(!(priv->mlfi_connectfrom = strdup(ident))) { + return SMFIS_TEMPFAIL; + } + /* Continue processing. */ + return SMFIS_CONTINUE; +} + +sfsistat +<a href="xxfi_helo.html">mlfi_helo</a>(ctx, helohost) + SMFICTX *ctx; + char *helohost; +{ + char *tls; + char *buf; + struct mlfiPriv *priv = MLFIPRIV; + tls = <a href="smfi_getsymval.html">smfi_getsymval</a>(ctx, "{tls_version}"); + if(!tls) tls = "No TLS"; + if(!helohost) helohost = "???"; + if(!(buf = (char*)malloc(strlen(tls) + strlen(helohost) + 3))) { + return SMFIS_TEMPFAIL; + } + sprintf(buf, "%s, %s", helohost, tls); + if(priv->mlfi_helofrom) + free(priv->mlfi_helofrom); + priv->mlfi_helofrom = buf; + /* Continue processing. */ + return SMFIS_CONTINUE; +} + +sfsistat +<a href="xxfi_envfrom.html">mlfi_envfrom</a>(ctx, argv) + SMFICTX *ctx; + char **argv; +{ + struct mlfiPriv *priv = MLFIPRIV; + char *mailaddr = <a href="smfi_getsymval.html">smfi_getsymval</a>(ctx, "{mail_addr}"); + int argc = 0; + + /* open a file to store this message */ + priv->mlfi_fname = strdup("/tmp/msg.XXXXXX"); + mkstemp(priv->mlfi_fname); + if (priv->mlfi_fname == NULL) + return SMFIS_TEMPFAIL; + if ((priv->mlfi_fp = fopen(priv->mlfi_fname, "w+")) == NULL) + { + free(priv->mlfi_fname); + return SMFIS_TEMPFAIL; + } + + /* count the arguments */ + while(*argv++) ++argc; + /* log the connection information we stored earlier: */ + if(fprintf(priv->mlfi_fp, "Connect from %s (%s)\n\n", + priv->mlfi_helofrom, priv->mlfi_connectfrom) == EOF) { + (void) mlfi_cleanup(ctx, FALSE); + return SMFIS_TEMPFAIL; + } + /* log the sender */ + if(fprintf(priv->mlfi_fp, "FROM %s (%d argument%s)\n", + mailaddr?mailaddr:"???", argc, + (argc == 1)?"":"s") + == EOF) { + (void) mlfi_cleanup(ctx, FALSE); + return SMFIS_TEMPFAIL; + } + /* continue processing */ + return SMFIS_CONTINUE; +} + +sfsistat +<a href="xxfi_envrcpt.html">mlfi_envrcpt</a>(ctx, argv) + SMFICTX *ctx; + char **argv; +{ + struct mlfiPriv *priv = MLFIPRIV; + char *rcptaddr = <a href="smfi_getsymval.html">smfi_getsymval</a>(ctx, "{rcpt_addr}"); + int argc = 0; + /* count the arguments */ + while(*argv++) ++argc; + /* log this recipient */ + if(reject && rcptaddr && (strcmp(rcptaddr, reject) == 0)) { + if(fprintf(priv->mlfi_fp, "RCPT %s -- REJECTED\n", rcptaddr) + == EOF) { + (void) mlfi_cleanup(ctx, FALSE); + return SMFIS_TEMPFAIL; + } + return SMFIS_REJECT; + } + if(fprintf(priv->mlfi_fp, "RCPT %s (%d argument%s)\n", + rcptaddr?rcptaddr:"???", argc, + (argc == 1)?"":"s") + == EOF) { + (void) mlfi_cleanup(ctx, FALSE); + return SMFIS_TEMPFAIL; + } + /* continue processing */ + return SMFIS_CONTINUE; +} + +sfsistat +<a href="xxfi_header.html">mlfi_header</a>(ctx, headerf, headerv) + SMFICTX *ctx; + char *headerf; + unsigned char *headerv; +{ + /* write the header to the log file */ + fprintf(MLFIPRIV->mlfi_fp, "%s: %s\n", headerf, headerv); + + /* continue processing */ + return SMFIS_CONTINUE; +} + +sfsistat +<a href="xxfi_eoh.html">mlfi_eoh</a>(ctx) + SMFICTX *ctx; +{ + /* output the blank line between the header and the body */ + fprintf(MLFIPRIV->mlfi_fp, "\n"); + + /* continue processing */ + return SMFIS_CONTINUE; +} + +sfsistat +<a href="xxfi_body.html">mlfi_body</a>(ctx, bodyp, bodylen) + SMFICTX *ctx; + unsigned char *bodyp; + size_t bodylen; +{ + /* output body block to log file */ + int nwritten; + if ((nwritten = fwrite(bodyp, bodylen, 1, MLFIPRIV->mlfi_fp)) != 1) + { + /* write failed */ + perror("error logging body"); + (void) mlfi_cleanup(ctx, FALSE); + return SMFIS_TEMPFAIL; + } + + /* continue processing */ + return SMFIS_CONTINUE; +} + +sfsistat +<a href="xxfi_eom.html">mlfi_eom</a>(ctx) + SMFICTX *ctx; +{ + bool ok = TRUE; + /* change recipients, if requested */ + if(add) + ok = ok && (<a href="smfi_addrcpt.html">smfi_addrcpt</a>(ctx, add) == MI_SUCCESS); + return mlfi_cleanup(ctx, ok); +} + +sfsistat +<a href="xxfi_abort.html">mlfi_abort</a>(ctx) + SMFICTX *ctx; +{ + return mlfi_cleanup(ctx, FALSE); +} + +sfsistat +mlfi_cleanup(ctx, ok) + SMFICTX *ctx; + bool ok; +{ + sfsistat rstat = SMFIS_CONTINUE; + struct mlfiPriv *priv = MLFIPRIV; + char *p; + char host[512]; + char hbuf[1024]; + + if (priv == NULL) + return rstat; + + /* close the archive file */ + if (priv->mlfi_fp != NULL && fclose(priv->mlfi_fp) == EOF) + { + /* failed; we have to wait until later */ + fprintf(stderr, "Couldn't close archive file %s: %s\n", + priv->mlfi_fname, strerror(errno)); + rstat = SMFIS_TEMPFAIL; + (void) unlink(priv->mlfi_fname); + } + else if (ok) + { + /* add a header to the message announcing our presence */ + if (gethostname(host, sizeof host) < 0) + strncpy(host, "localhost", sizeof host); + p = strrchr(priv->mlfi_fname, '/'); + if (p == NULL) + p = priv->mlfi_fname; + else + p++; + snprintf(hbuf, sizeof hbuf, "%s@%s", p, host); + <a href="smfi_addheader.html">smfi_addheader</a>(ctx, "X-Archived", hbuf); + } + else + { + /* message was aborted -- delete the archive file */ + fprintf(stderr, "Message aborted. Removing %s\n", + priv->mlfi_fname); + rstat = SMFIS_TEMPFAIL; + (void) unlink(priv->mlfi_fname); + } + + /* release private memory */ + free(priv->mlfi_fname); + + /* return status */ + return rstat; +} + +sfsistat +<a href="xxfi_close.html">mlfi_close</a>(ctx) + SMFICTX *ctx; +{ + struct mlfiPriv *priv = MLFIPRIV; + if(priv->mlfi_connectfrom) + free(priv->mlfi_connectfrom); + if(priv->mlfi_helofrom) + free(priv->mlfi_helofrom); + free(priv); + <a href="smfi_setpriv.html">smfi_setpriv</a>(ctx, NULL); + return SMFIS_CONTINUE; +} + +struct smfiDesc smfilter = +{ + "SampleFilter", /* filter name */ + SMFI_VERSION, /* version code -- do not change */ + SMFIF_ADDHDRS, /* flags */ + <a href="xxfi_connect.html">mlfi_connect</a>, /* connection info filter */ + <a href="xxfi_helo.html">mlfi_helo</a>, /* SMTP HELO command filter */ + <a href="xxfi_envfrom.html">mlfi_envfrom</a>, /* envelope sender filter */ + <a href="xxfi_envrcpt.html">mlfi_envrcpt</a>, /* envelope recipient filter */ + <a href="xxfi_header.html">mlfi_header</a>, /* header filter */ + <a href="xxfi_eoh.html">mlfi_eoh</a>, /* end of header */ + <a href="xxfi_body.html">mlfi_body</a>, /* body block filter */ + <a href="xxfi_eom.html">mlfi_eom</a>, /* end of message */ + <a href="xxfi_abort.html">mlfi_abort</a>, /* message aborted */ + <a href="xxfi_close.html">mlfi_close</a>, /* connection cleanup */ +}; + +static void +usage() +{ + fprintf(stderr, + "Usage: sample [-p socket-addr] [-t timeout] [-r reject-addr] \n\ +\t[-a accept-addr]\n"); +} + +int +main(argc, argv) + int argc; + char *argv[]; +{ + int retval; + char c; + const char *args = "p:t:r:a:h"; + extern char *optarg; + + /* Process command line options */ + while ((c = getopt(argc, argv, args)) != (char)EOF) + { + switch (c) + { + case 'p': + if (optarg == NULL || *optarg == '\0') + { + (void) fprintf(stderr, "Illegal conn: %s\n", + optarg); + exit(EX_USAGE); + } + if(<a href="smfi_setconn.html">smfi_setconn</a>(optarg) == MI_FAILURE) + { + (void) fputs("smfi_setconn failed", stderr); + exit(EX_SOFTWARE); + } + /* + ** If we're using a local socket, make sure it doesn't + ** already exist. + */ + if(strncmp(optarg, "unix:", 5) == 0) + unlink(optarg + 5); + else if(strncmp(optarg, "local:", 6) == 0) + unlink(optarg + 6); + break; + + case 't': + if (optarg == NULL || *optarg == '\0') + { + (void) fprintf(stderr, "Illegal timeout: %s\n", + optarg); + exit(EX_USAGE); + } + if(<a href="smfi_settimeout.html">smfi_settimeout</a>(atoi(optarg)) == MI_FAILURE) + { + (void) fputs("smfi_settimeout failed", stderr); + exit(EX_SOFTWARE); + } + break; + + case 'r': + if (optarg == NULL) + { + (void) fprintf(stderr, "Illegal reject rcpt: %s\n", + optarg); + exit(EX_USAGE); + } + reject = optarg; + break; + + case 'a': + if (optarg == NULL) + { + (void) fprintf(stderr, "Illegal add rcpt: %s\n", + optarg); + exit(EX_USAGE); + } + add = optarg; + smfilter.xxfi_flags |= SMFIF_ADDRCPT; + break; + case 'h': + default: + usage(); + exit(0); + } + } + if (<a href="smfi_register.html">smfi_register</a>(smfilter) == MI_FAILURE) + { + fprintf(stderr, "smfi_register failed\n"); + exit(EX_UNAVAILABLE); + } + retval = <a href="smfi_main.html">smfi_main</a>(); + return retval; +} + +/* eof */ + +</pre> +<hr size="1"> +<font size="-1"> +Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_addheader.html b/contrib/sendmail/libmilter/docs/smfi_addheader.html new file mode 100644 index 0000000..c6417e2 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_addheader.html @@ -0,0 +1,94 @@ +<html> +<head><title>smfi_addheader</title></head> +<body> +<h1>smfi_addheader</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_addheader( + SMFICTX *ctx, + char *headerf, + char *headerv +); +</pre> +Add a header to the current message. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>Called only from <a href="xxfi_eom.html">xxfi_eom</a>.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>Adds a header to the current message.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>headerf</td> + <td>The header name, a non-NULL, null-terminated string. + </td></tr> + <tr valign="top"><td>headerv</td> + <td>The header value to be added, a non-NULL, null-terminated string. This may be the empty string. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_addheader returns MI_FAILURE if: +<ul><li>headerf or headerv is NULL. + <li>Adding headers in the current connection state is invalid. + <li>Memory allocation fails. + <li>A network error occurs. + <li>SMFIF_ADDHDRS was not set when <a href="smfi_register.html">smfi_register</a> was called. +</ul> +Otherwise, it returns MI_SUCCESS. +</td> +</tr> + +<!----------- Notes ----------> +<tr align="left" valign=top> +<th>NOTES</th> +<td> +<ul><li>smfi_addheader does not change a message's existing headers. +To change a header's current value, use <a +href="smfi_chgheader.html">smfi_chgheader</a>. + <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>. + <li>For smfi_chgheader, filter order is important. <b>Later filters will see the header changes made by earlier ones.</b> + <li>Neither the name nor the value of the header is checked for + standards compliance. However, each line of the header must be under + 2048 characters and should be under 998 characters. If longer headers + are needed, make them multiline. + <b>It is the filter writer's responsibility to ensure that no standards + are violated.</b> +</ul> +</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_addrcpt.html b/contrib/sendmail/libmilter/docs/smfi_addrcpt.html new file mode 100644 index 0000000..d0a5963 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_addrcpt.html @@ -0,0 +1,80 @@ +<html> +<head><title>smfi_addrcpt</title></head> +<body> +<h1>smfi_addrcpt</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_addrcpt( + SMFICTX *ctx, + char *rcpt +); +</pre> +Add a recipient for the current message. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>Called only from <a href="xxfi_eom.html">xxfi_eom</a>.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>Add a recipient to the message envelope.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>rcpt</td> + <td>The new recipient's address. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_addrcpt will fail and return MI_FAILURE if: +<ul><li>rcpt is NULL. + <li>Adding headers in the current connection state is invalid. + <li>A network error occurs. + <li>SMFIF_ADDRCPT was not set when <a href="smfi_register.html">smfi_register</a> was called. +</ul> +Otherwise, it will return MI_SUCCESS. +</td> +</tr> + +<!----------- Notes ----------> +<tr align="left" valign=top> +<th>NOTES</th> +<td> +A filter which calls smfi_addrcpt must have set the SMFIF_ADDRCPT flag +in the smfiDesc_str passed to +<a href="smfi_register.html">smfi_register</a>. +</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_chgheader.html b/contrib/sendmail/libmilter/docs/smfi_chgheader.html new file mode 100644 index 0000000..4969674 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_chgheader.html @@ -0,0 +1,96 @@ +<html> +<head><title>smfi_chgheader</title></head> +<body> +<h1>smfi_chgheader</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_chgheader( + SMFICTX *ctx, + char *headerf, + mi_int32 hdridx, + char *headerv +); +</pre> +Change or delete a message header. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>Called only from <a href="xxfi_eom.html">xxfi_eom</a>.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>Changes a header's value for the current message.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>headerf</td> + <td>The header name, a non-NULL, null-terminated string. + </td></tr> + <tr valign="top"><td>hdridx</td> + <td>Header index value (1-based). A hdridx value of 1 will modify the first occurrence of a header named headerf. If hdridx is greater than the number of times headerf appears, a new copy of headerf will be added. + </td></tr> + <tr valign="top"><td>headerv</td> + <td>The new value of the given header. headerv == NULL implies that the header should be deleted. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td> +smfi_chgheader will return MI_FAILURE if +<ul><li>headerf is NULL + <li>Modifying headers in the current connection state is invalid. + <li>Memory allocation fails. + <li>A network error occurs. + <li>SMFIF_CHGHDRS was not set when <a href="smfi_register.html">smfi_register</a> was called. +</ul> +Otherwise, it returns MI_SUCCESS. +</tr> + +<!----------- Notes ----------> +<tr align="left" valign=top> +<th>NOTES</th> +<td> +<ul><li>While smfi_chgheader may be used to add new headers, it is more efficient and far safer to use <a href="smfi_addheader.html">smfi_addheader</a>. + <li>A filter which calls smfi_chgheader must have set the SMFIF_CHGHDRS flag in the smfiDesc_str passed to <a href="smfi_register.html">smfi_register</a>. + <li>For smfi_chgheader, filter order is important. <b>Later filters will see the header changes made by earlier ones.</b> + <li>Neither the name nor the value of the header is checked for + standards compliance. However, each line of the header must be under + 2048 characters and should be under 998 characters. If longer headers + are needed, make them multiline. + <b>It is the filter writer's responsibility to ensure that no standards + are violated.</b> +</ul> +</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_delrcpt.html b/contrib/sendmail/libmilter/docs/smfi_delrcpt.html new file mode 100644 index 0000000..f86fd2e --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_delrcpt.html @@ -0,0 +1,79 @@ +<html> +<head><title>smfi_delrcpt</title></head> +<body> +<h1>smfi_delrcpt</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_delrcpt( + SMFICTX *ctx; + char *rcpt; +); +</pre> +Remove a recipient from the current message's envelope. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>Called only from <a href="xxfi_eom.html">xxfi_eom</a>.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>smfi_delrcpt removes the named recipient from the current message's envelope.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>rcpt</td> + <td>The recipient address to be removed, a non-NULL, null-terminated string. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_delrcpt will fail and return MI_FAILURE if: +<ul> + <li>rcpt is NULL. + <li>Adding headers in the current connection state is invalid. + <li>A network error occurs. + <li>SMFIF_DELRCPT was not set when <a href="smfi_register.html">smfi_register</a> was called. +</ul> +Otherwise, it will return MI_SUCCESS +</td> +</tr> + +<!----------- Notes ----------> +<tr align="left" valign=top> +<th>NOTES</th> +<td> +The addresses to be removed must match exactly. For example, an address and its expanded form do not match. +</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_getpriv.html b/contrib/sendmail/libmilter/docs/smfi_getpriv.html new file mode 100644 index 0000000..8bb6efa --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_getpriv.html @@ -0,0 +1,59 @@ +<html> +<head><title>smfi_getpriv</title></head> +<body> +<h1>smfi_getpriv</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +void* smfi_getpriv( + SMFICTX *ctx +); +</pre> +Get the connection-specific data pointer for this connection. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>smfi_getpriv may be called in any of the xxfi_* callbacks.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>None.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_getpriv returns the private data pointer stored by a prior call to <a href="smfi_setpriv.html">smfi_setpriv</a>, or NULL if none has been set.</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_getsymval.html b/contrib/sendmail/libmilter/docs/smfi_getsymval.html new file mode 100644 index 0000000..d8a3304 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_getsymval.html @@ -0,0 +1,92 @@ +<html> +<head><title>smfi_getsymval</title></head> +<body> +<h1>smfi_getsymval</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +char* smfi_getsymval( + SMFICTX *ctx, + char *symname +); +</pre> +Get the value of a sendmail macro. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>smfi_getsymval may be called from within any of the xxfi_* callbacks. Which macros are defined will depend on when it is called.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>None.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>The opaque context structure. + </td></tr> + <tr valign="top"><td>symname</td> + <td>The name of a sendmail macro, optinally enclosed in braces ("{" and "}"). <a href="#notes">See below</a> for default macros. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_getsymval returns the value of the given macro as a null-terminated string, or NULL if the macro is not defined.</td> +</tr> + +<!----------- Notes ----------> +<tr align="left" valign=top> +<th><a name="notes">NOTES</A></th> +<td> +By default, the following macros are valid in the given contexts: + +<table border="1" cellspacing=0> +<tr bgcolor="#dddddd"><th>Sent With</th><th>Macros</th></tr> +<tr><td>xxfi_connect</td> <td>daemon_name, if_name, if_addr, j, _</td></tr> +<tr><td>xxfi_helo</td> <td>tls_version, cipher, cipher_bits, cert_subject, cert_issuer</td></tr> +<tr><td>xxfi_envfrom</td> <td>i, auth_type, auth_authen, auth_ssf, auth_author, + mail_mailer, mail_host, mail_addr</td></tr> +<tr><td>xxfi_envrcpt</td> <td>rcpt_mailer, rcpt_host, rcpt_addr</td></tr> +</table> +<p> +All macros stay in effect from the point they are received until the +end of the connection for the first two sets, the end of the message +for the third (xxfi_envfrom), and just for each recipient for the +final set (xxfi_envrcpt). +<p> +The macro list can be changed using the confMILTER_MACROS_* options in +sendmail.mc. The scopes of such macros will be determined by when +they are set by sendmail. For descriptions of macros' values, please +see the "Sendmail Installation and Operation Guide" provided with your +sendmail distribution. + +</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_main.html b/contrib/sendmail/libmilter/docs/smfi_main.html new file mode 100644 index 0000000..9652eaa --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_main.html @@ -0,0 +1,48 @@ +<html> +<head><title>smfi_main</title></head> +<body> +<h1>smfi_main</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_main( +); +</pre> +Hand control to libmilter event loop. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>smfi_main is called after a filter's initialization is complete.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>smfi_main hands control to the Milter event loop.</td> +</tr> +</table> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_main will return MI_FAILURE if it fails to establish a connection. This may occur for any of a variety of reasons (e.g. invalid address passed to <a href="smfi_setconn.html">smfi_setconn</a>). The reason for the failure will be logged. Otherwise, smfi_main will return MI_SUCCESS.</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_register.html b/contrib/sendmail/libmilter/docs/smfi_register.html new file mode 100644 index 0000000..705b3a4 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_register.html @@ -0,0 +1,160 @@ +<html> +<head><title>smfi_register</title></head> +<body> +<h1>smfi_register</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_register( + smfiDesc_str descr +); +</pre> +Register a set of filter callbacks. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=1> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>smfi_register must be called before smfi_main</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>smfi_register creates a filter using the information given in the +smfiDesc_str argument. Multiple calls to smfi_register within a +single process are not allowed.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>descr</td> + <td> +A filter descriptor of type smfiDesc_str describing the filter's +functions. The structure has the following members: +<pre> +struct smfiDesc +{ + char *xxfi_name; /* filter name */ + int xxfi_version; /* version code -- do not change */ + unsigned long xxfi_flags; /* <a href="#flags">flags</a> */ + + /* connection info filter */ + sfsistat (*<a href="xxfi_connect.html">xxfi_connect</a>)(SMFICTX *, char *, _SOCK_ADDR *); + /* SMTP HELO command filter */ + sfsistat (*<a href="xxfi_helo.html">xxfi_helo</a>)(SMFICTX *, char *); + /* envelope sender filter */ + sfsistat (*<a href="xxfi_envfrom.html">xxfi_envfrom</a>)(SMFICTX *, char **); + /* envelope recipient filter */ + sfsistat (*<a href="xxfi_envrcpt.html">xxfi_envrcpt</a>)(SMFICTX *, char **); + /* header filter */ + sfsistat (*<a href="xxfi_header.html">xxfi_header</a>)(SMFICTX *, char *, char *); + /* end of header */ + sfsistat (*<a href="xxfi_eoh.html">xxfi_eoh</a>)(SMFICTX *); + /* body block */ + sfsistat (*<a href="xxfi_body.html">xxfi_body</a>)(SMFICTX *, unsigned char *, size_t); + /* end of message */ + sfsistat (*<a href="xxfi_eom.html">xxfi_eom</a>)(SMFICTX *); + /* message aborted */ + sfsistat (*<a href="xxfi_abort.html">xxfi_abort</a>)(SMFICTX *); + /* connection cleanup */ + sfsistat (*<a href="xxfi_close.html">xxfi_close</a>)(SMFICTX *); +}; +</pre> + +A NULL value for any callback function indicates that the filter does +not wish to process the given type of information, simply returning +SMFIS_CONTINUE. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td> +smfi_register may return MI_FAILURE for any of the following reasons: +<ul> +<li>memory allocation failed. +<li>incompatible version or illegal flags value. +</ul> + +</td> +</tr> + +<!----------- Notes ----------> +<tr align="left" valign=top> +<th>NOTES</th> +<td> + +<a name="flags"></A> +The xxfi_flags field should contain the bitwise OR of zero or more of +the following values, describing the actions the filter may take: +<TABLE BORDER CELLPADDING="1" cellspacing=1> +<tr valign="top" bgcolor="#dddddd"><th align="left">Flag</th><th align="center">Description</th></tr> + <TR align="left" valign=top> + <TD> + SMFIF_ADDHDRS + </TD> + <TD> + This filter may add headers. + </TD> + </TR> + <TR align="left" valign=top> + <TD> + SMFIF_CHGHDRS + </TD> + <TD> + This filter may change and/or delete headers. + </TD> + </TR> + <TR align="left" valign=top> + <TD VALIGN="TOP"> + SMFIF_CHGBODY + </TD> + <TD> + This filter may replace the body during filtering. + This may have significant performance impact + if other filters do body filtering after this filter. + </TD> + </TR> + <TR> + <TD VALIGN="TOP"> + SMFIF_ADDRCPT + </TD> + <TD> + This filter may add recipients to the message. + </TD> + </TR> + <TR> + <TD VALIGN="TOP"> + SMFIF_DELRCPT + </TD> + <TD> + This filter may remove recipients from the message. + </TD> + </TR> +</TABLE> + +</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_replacebody.html b/contrib/sendmail/libmilter/docs/smfi_replacebody.html new file mode 100644 index 0000000..204c2dc --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_replacebody.html @@ -0,0 +1,90 @@ +<html> +<head><title>smfi_replacebody</title></head> +<body> +<h1>smfi_replacebody</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_replacebody( + SMFICTX *ctx, + unsigned char *bodyp, + int bodylen +); +</pre> +Replace message-body data. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>Called only from <a href="xxfi_eom.html">xxfi_eom</a>. smfi_replacebody may be called more than once.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>smfi_replacebody replaces the body of the current message. If called +more than once, subsequent calls result in data being appended to the new +body. +</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>bodyp</td> + <td>A pointer to the start of the new body data, which does not have to be null-terminated. If bodyp is NULL, it is treated as having length == 0. Body data should be in CR/LF form. + </td></tr> + <tr valign="top"><td>bodylen</td> + <td>The number of data bytes pointed to by bodyp. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_replacebody fails and returns MI_FAILURE if: +<ul> + <li>bodyp == NULL and bodylen > 0. + <li>Changing the body in the current connection state is invalid. + <li>A network error occurs. + <li>SMFIF_CHGBODY was not set when <a href="smfi_register.html">smfi_register</a> was called. +</ul> +Otherwise, it will return MI_SUCCESS. +</td> +</tr> + +<!----------- Notes ----------> +<tr align="left" valign=top> +<th>NOTES</th> +<td> +<ul> + <li>Since the message body may be very large, setting SMFIF_CHGBODY may significantly affect filter performance. + <li>If a filter sets SMFIF_CHGBODY but does not call smfi_replacebody, the original body remains unchanged. + <li>For smfi_replacebody, filter order is important. <b>Later filters will see the new body contents created by earlier ones.</b> +</ul> +</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_setconn.html b/contrib/sendmail/libmilter/docs/smfi_setconn.html new file mode 100644 index 0000000..0d46a5b --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_setconn.html @@ -0,0 +1,77 @@ +<html> +<head><title>smfi_setconn</title></head> +<body> +<h1>smfi_setconn</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_setconn( + char *oconn; +); +</pre> +Set the socket through which this filter should communicate with sendmail. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>smfi_setconn must be called once before <a href="smfi_main.html">smfi_main</a>.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>Sets the socket through which the filter communicates with sendmail.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>oconn</td> + <td>The address of the desired communication socket. + The address should be a NULL-terminated string in "proto:address" + format: + <ul> + <li><code>{unix|local}:/path/to/file</code> -- A named pipe. + <li><code>inet:port@{hostname|ip-address}</code> -- An IPV4 socket. + <li><code>inet6:port@{hostname|ip-address}</code> -- An IPV6 socket. + </ul> + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_setconn will not fail on an invalid address. The failure will +only be detected in <a href="smfi_main.html">smfi_main</a></td> +</tr> + +<tr> +<th valign="top" align=left>NOTES</th> + +<td> +<ul><li>If possible, filters should not run as root when communicating over unix/local domain sockets. + <li>Unix/local sockets should have their permissions set to 0600 (read/write permission only for the socket's owner). +</ul> +</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_setpriv.html b/contrib/sendmail/libmilter/docs/smfi_setpriv.html new file mode 100644 index 0000000..e800cc8 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_setpriv.html @@ -0,0 +1,77 @@ +<html> +<head><title>smfi_setpriv</title></head> +<body> +<h1>smfi_setpriv</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_setpriv( + SMFICTX *ctx, + void *privatedata +); +</pre> +Set the private data pointer for this connection. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>smfi_setpriv may be called in any of the xxfi_* callbacks.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>Sets the private data pointer for the context ctx.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>privatedata</td> + <td>Pointer to private data. This value will be returned by subsequent calls to <a href="smfi_getpriv.html">smfi_getpriv</a> using ctx. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_setpriv returns MI_FAILURE if ctx is an invalid context. +Otherwise, it returns MI_SUCCESS.</td> +</tr> + +<tr> +<th valign="top" align=left>NOTES</th> + +<td>There is only one private data pointer per connection; multiple +calls to smfi_setpriv with different values will cause previous values +to be lost. +<P> +Before a filter terminates it should release the private data +and set the pointer to NULL. +</td> + +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_setreply.html b/contrib/sendmail/libmilter/docs/smfi_setreply.html new file mode 100644 index 0000000..962f167 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_setreply.html @@ -0,0 +1,92 @@ +<html> +<head><title>smfi_setreply</title></head> +<body> +<h1>smfi_setreply</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_setreply( + SMFICTX *ctx, + char *rcode, + char *xcode, + char *message +); +</pre> +Set the default SMTP error reply code. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>smfi_setreply may be called from any of the xxfi_ callbacks.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>Directly set the SMTP error reply code for this connection. This code +will be used on subsequent error replies resulting from actions taken by +this filter.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>rcode</td> + <td>The three-digit (RFC 821) SMTP reply code, as a null-terminated string. rcode cannot be NULL, and must be a valid reply code. + </td></tr> + <tr valign="top"><td>xcode</td> + <td>The extended (RFC 2034) reply code. If xcode is NULL, no extended code is used. Otherwise, xcode must conform to RFC 2034. + </td></tr> + <tr valign="top"><td>message</td> + <td>The text part of the SMTP reply. If message is NULL, an empty message is used. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_setreply will fail and return MI_FAILURE if: +<ul> + <li>The rcode or xcode argument is invalid. + <li>A memory-allocation failure occurs. +</ul> +Otherwise, it return MI_SUCCESS. +</td> +</tr> + +<!----------- Notes ----------> +<tr align="left" valign=top> +<th>NOTES</th> +<td> +<ul> +<li>Values passed to smfi_setreply are not checked for standards compliance. +<li>For details about reply codes and their meanings, please see RFC's +<a href="http://www.cis.ohio-state.edu/htbin/rfc/rfc821.html">821</a> +and <a href="http://www.cis.ohio-state.edu/htbin/rfc/rfc2034.html">2034</a>. +</ul> +</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/smfi_settimeout.html b/contrib/sendmail/libmilter/docs/smfi_settimeout.html new file mode 100644 index 0000000..a9e870a --- /dev/null +++ b/contrib/sendmail/libmilter/docs/smfi_settimeout.html @@ -0,0 +1,60 @@ +<html> +<head><title>smfi_settimeout</title></head> +<body> +<h1>smfi_settimeout</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +int smfi_settimeout( + int otimeout +); +</pre> +Set the filter's connection timeout value. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>smfi_settimeout should only be called before <a href="smfi_main.html">smfi_main</a>.</td> +</tr> +<tr align="left" valign=top> +<th width="80">Effects</th> +<td>Sets the number of seconds libmilter will wait for an MTA connection before timing out a socket. If smfi_settimeout is not called, a default timeout of 1800 seconds is used.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>otimeout</td> + <td>The number of seconds to wait before timing out (> 0). Zero means +no wait, <b>not</b> "wait forever". + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>RETURN VALUES</th> + +<td>smfi_settimeout always returns MI_SUCCESS.</td> +</tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/xxfi_abort.html b/contrib/sendmail/libmilter/docs/xxfi_abort.html new file mode 100644 index 0000000..aeddf6f --- /dev/null +++ b/contrib/sendmail/libmilter/docs/xxfi_abort.html @@ -0,0 +1,80 @@ +<html> +<head><title>xxfi_abort</title></head> +<body> +<h1>xxfi_abort</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +sfsistat (*xxfi_abort)( + SMFICTX * ctx +); +</pre> +Handle the current message's being aborted. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>xxfi_abort may be called at any time during message processing (i.e. between some message-oriented routine and <a href="xxfi_eom.html">xxfi_eom</a>).</td> +</tr> +<tr align="left" valign=top> +<th>Default Behavior</th> +<td>Do nothing; return SMFIS_CONTINUE.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + </table> +</td></tr> + +<!----------- Notes ----------> +<tr> +<th valign="top" align=left>NOTES</th> +<td> +<ul> +<li>xxfi_abort must reclaim any resources allocated on a per-message +basis, and must be tolerant of being called between any two +message-oriented callbacks. + +<li>Calls to xxfi_abort and <a href="xxfi_eom.html">xxfi_eom</a> are +mutually exclusive. + +<li>xxfi_abort is not responsible for reclaiming connection-specific +data, since <a href="xxfi_close.html">xxfi_close</a> is always called +when a connection is closed. + +<li>Since the current message is already being aborted, the return +value is currently ignored. + +<li>xxfi_abort is only called if the message is aborted outside the +filter's control <b>and</b> the filter has not completed its +message-oriented processing. For example, if a filter has already +returned SMFIS_ACCEPT, SMFIS_REJECT, or SMFIS_DISCARD from a +message-oriented routine, xxfi_abort will not be called even if the +message is later aborted outside its control. +</ul> +</td> +</tr> +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/xxfi_body.html b/contrib/sendmail/libmilter/docs/xxfi_body.html new file mode 100644 index 0000000..b19e0d4 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/xxfi_body.html @@ -0,0 +1,80 @@ +<html> +<head><title>xxfi_body</title></head> +<body> +<h1>xxfi_body</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +sfsistat (*xxfi_body)( + SMFICTX * ctx, + unsigned char * bodyp, + size_t len +); +</pre> +Handle a piece of a message's body. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>xxfi_body is called zero or more times between xxfi_eoh and xxfi_eom.</td> +</tr> +<tr align="left" valign=top> +<th>Default Behavior</th> +<td>Do nothing; return SMFIS_CONTINUE.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>bodyp</td> + <td>Pointer to the start of this block of body data. bodyp is not valid outside this call to xxfi_body. + </td></tr> + <tr valign="top"><td>len</td> + <td>The amount of data pointed to by bodyp. + </td></tr> + </table> +</td></tr> + +<!----------- Notes ----------> +<tr> +<th valign="top" align=left>NOTES</th> +<td> +<ul> +<li>bodyp points to a sequence of bytes. +It is <em>not</em> a C string (a sequence of characters that is terminated by '\0'). +Therefore, do not use the usual C string functions like strlen() on this byte block. +Moreover, the byte sequence may contain '\0' characters inside the block. +Hence even if a trailing '\0' is added, C string functions may still fail +to work as expected. +<li>Since message bodies can be very large, defining xxfi_body can +significantly impact filter performance. +<li>End-of-lines are represented as received from SMTP (normally CR/LF). +<li>Later filters will see body changes made by earlier ones. +<li>Message bodies may be sent in multiple chunks, with one call to + xxfi_body per chunk. +</ul> +</td> +</tr> +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000-2002 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/xxfi_close.html b/contrib/sendmail/libmilter/docs/xxfi_close.html new file mode 100644 index 0000000..07742be --- /dev/null +++ b/contrib/sendmail/libmilter/docs/xxfi_close.html @@ -0,0 +1,66 @@ +<html> +<head><title>xxfi_close</title></head> +<body> +<h1>xxfi_close</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +sfsistat (*xxfi_close)( + SMFICTX * ctx +); +</pre> +The current connection is being closed. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>xxfi_close is always called once at the end of each connection.</td> +</tr> +<tr align="left" valign=top> +<th>Default Behavior</th> +<td>Do nothing; return SMFIS_CONTINUE.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + </table> +</td></tr> + +<!----------- Notes ----------> +<tr> +<th valign="top" align=left>NOTES</th> +<td> +<ul> +<li>xxfi_close is called on close even if the previous mail +transaction was aborted. +<li>xxfi_close is responsible for freeing any resources allocated on a +per-connection basis. +<li>Since the connection is already closing, the return value is +currently ignored. +</ul> +</td> +</tr> +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/xxfi_connect.html b/contrib/sendmail/libmilter/docs/xxfi_connect.html new file mode 100644 index 0000000..1710285 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/xxfi_connect.html @@ -0,0 +1,90 @@ +<html> +<head><title>xxfi_connect</title></head> +<body> +<h1>xxfi_connect</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +sfsistat (*xxfi_connect)( + SMFICTX *ctx, + char *hostname, + _SOCK_ADDR *hostaddr); +</pre> +</td></tr> +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr> +<th valign="top" align=left width=80>Called When</th> +<td>Once, at the start of each SMTP connection.</td> +</tr> +<tr> +<th valign="top" align=left width=80>Default Behavior</th> +<td>Do nothing; return SMFIS_CONTINUE.</td> +</tr> +</table> +<!-- +This callback function is invoked on each connection to the mail +filter program. The callback is to be implemented by the Milter +application developers. The name of the callback can be any valid +function name. The function pointer is to be assigned to the +smfiDesc.xxfi_connect and the pointer to the smfiDesc structure +is passed to smfi_register(). +</td></tr> +--> +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr><td>ctx</td> + <td>the opaque context structure. + </td></tr> + <tr><td>hostname</td> + <td>the host name of the message sender, as determined by a + reverse lookup on the host address. If the reverse lookup + fails, hostname will contain the message sender's IP + address enclosed in square brackets (e.g. `[a.b.c.d]'). + </td></tr> + <tr><td>hostaddr</td> + <td>the host address, as determined by a getpeername() call on the SMTP socket. + NULL if the type is not supported in the current version or if + the SMTP connection is made via stdin. + </td></tr> + </table> +</td></tr> +<!----------- Return values ----------> +<!-- +<tr> +<th valign="top" align=left>SPECIAL RETURN VALUES</th> +<td><table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Return value</th><th>Description</th></tr> + <tr valign="top"> + <td>SMFIS_DISCARD</td> + <td>Not meaningful, as + this is only meaningful from message-oriented routines. + </td> + </tr> +</table> +</tr> +--> +<!----------- Notes ----------> +<tr> +<th valign="top" align=left>NOTES</th> +<td>If an earlier filter rejects the connection in its xxfi_connect() +routine, this filter's xxfi_connect() will not be called.</td> +</tr> +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/xxfi_envfrom.html b/contrib/sendmail/libmilter/docs/xxfi_envfrom.html new file mode 100644 index 0000000..d023c40 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/xxfi_envfrom.html @@ -0,0 +1,92 @@ +<html> +<head><title>xxfi_envfrom</title></head> +<body> +<h1>xxfi_envfrom</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +sfsistat (*xxfi_envfrom)( + SMFICTX * ctx, + char ** argv +); +</pre> +Handle the envelope FROM command. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>xxfi_envfrom is called once at the beginning of each message, before xxfi_envrcpt.</td> +</tr> +<tr align="left" valign=top> +<th>Default Behavior</th> +<td>Do nothing; return SMFIS_CONTINUE.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>argv</td> + <td>Null-terminated SMTP command arguments; + argv[0] is guaranteed to be the sender address. + Later arguments are the ESMTP arguments. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>SPECIAL RETURN VALUES</th> +<td><table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Return value</th><th>Description</th></tr> + <tr valign="top"> + <td>SMFIS_TEMPFAIL</td> + <td>Reject this sender and message with a temporary error; a new sender (and hence a new message) may subsequently be specified. <a href="xxfi_abort.html">xxfi_abort</a> is not called. + </td> + </tr> + <tr valign="top"> + <td>SMFIS_REJECT</td> + <td>Reject this sender and message; a new sender/message may be specified. <a href="xxfi_abort.html">xxfi_abort</a> is not called. + </td> + </tr> + <tr valign="top"> + <td>SMFIS_DISCARD</td> + <td>Accept and silently discard this message. <a href="xxfi_abort.html">xxfi_abort</a> is not called. + </td> + </tr> + <tr valign="top"> + <td>SMFIS_ACCEPT</td> + <td>Accept this message. <a href="xxfi_abort.html">xxfi_abort</a> is not called. + </td> + </tr> +</table> +</tr> + +<!----------- Notes ----------> +<tr> +<th valign="top" align=left>NOTES</th> +<td>For more details on ESTMP responses, please see RFC +<a href="http://www.cis.ohio-state.edu/rfc/rfc1869.txt">1869</a>.</td> +</tr> +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html b/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html new file mode 100644 index 0000000..f13626a --- /dev/null +++ b/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html @@ -0,0 +1,94 @@ +<html> +<head><title>xxfi_envrcpt</title></head> +<body> +<h1>xxfi_envrcpt</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +sfsistat (*xxfi_envrcpt)( + SMFICTX * ctx, + char ** argv +); +</pre> +Handle the envelope RCPT command. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>xxfi_envrcpt is called once per recipient, hence one or more times per message, immediately after xxfi_envfrom.</td> +</tr> +<tr align="left" valign=top> +<th>Default Behavior</th> +<td>Do nothing; return SMFIS_CONTINUE.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>argv</td> + <td>Null-terminated SMTP command arguments; + argv[0] is guaranteed to be the recipient address. + Later arguments are the ESMTP arguments. + </td></tr> + </table> +</td></tr> + +<!----------- Return values ----------> +<tr> +<th valign="top" align=left>SPECIAL RETURN VALUES</th> +<td><table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Return value</th><th>Description</th></tr> + <tr valign="top"> + <td>SMFIS_TEMPFAIL</td> + <td>Temporarily fail for this particular recipient; further recipients + maystill be sent. <a href="xxfi_abort.html">xxfi_abort</a> is not called. + </td> + </tr> + <tr valign="top"> + <td>SMFIS_REJECT</td> + <td>Reject this particular recipient; further recipients maystill be sent. + <a href="xxfi_abort.html">xxfi_abort</a> is not called. + </td> + </tr> + <tr valign="top"> + <td>SMFIS_DISCARD</td> + <td>Accept and discard the message. <a href="xxfi_abort.html">xxfi_abort</a> will be called. + </td> + </tr> + <tr valign="top"> + <td>SMFIS_ACCEPT</td> + <td>Accept recipient. <a href="xxfi_abort.html">xxfi_abort</a> will not be called. + </td> + </tr> +</table> +</tr> + +<!----------- Notes ----------> +<tr> +<th valign="top" align=left>NOTES</th> +<td>For more details on ESTMP responses, please see RFC +<a href="http://www.cis.ohio-state.edu/rfc/rfc1869.txt">1869</a>.</td> +</tr> +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/xxfi_eoh.html b/contrib/sendmail/libmilter/docs/xxfi_eoh.html new file mode 100644 index 0000000..46c7925 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/xxfi_eoh.html @@ -0,0 +1,53 @@ +<html> +<head><title>xxfi_eoh</title></head> +<body> +<h1>xxfi_eoh</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +sfsistat (*xxfi_eoh)( + SMFICTX * ctx +); +</pre> +Handle the end of message headers. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>xxfi_eoh is called once after all headers have been sent and processed. +</td> +</tr> +<tr align="left" valign=top> +<th>Default Behavior</th> +<td>Do nothing; return SMFIS_CONTINUE.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + </table> +</td></tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/xxfi_eom.html b/contrib/sendmail/libmilter/docs/xxfi_eom.html new file mode 100644 index 0000000..40f6dee --- /dev/null +++ b/contrib/sendmail/libmilter/docs/xxfi_eom.html @@ -0,0 +1,58 @@ +<html> +<head><title>xxfi_eom</title></head> +<body> +<h1>xxfi_eom</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +sfsistat (*xxfi_eom)( + SMFICTX * ctx +); +</pre> +End of a message. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>xxfi_eom is called once after all calls to <a href="xxfi_body.html">xxfi_body</a> for a given message.</td> +</tr> +<tr align="left" valign=top> +<th>Default Behavior</th> +<td>Do nothing; return SMFIS_CONTINUE.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + </table> +</td></tr> + +<!----------- Notes ----------> +<tr> +<th valign="top" align=left>NOTES</th> +<td>A filter is required to make all its modifications to the message headers, body, and envelope in xxfi_eom. Modifications are made via the smfi_* routines. +</td> +</tr> +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/xxfi_header.html b/contrib/sendmail/libmilter/docs/xxfi_header.html new file mode 100644 index 0000000..a6c6322 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/xxfi_header.html @@ -0,0 +1,74 @@ +<html> +<head><title>xxfi_header</title></head> +<body> +<h1>xxfi_header</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +sfsistat (*xxfi_header)( + SMFICTX * ctx, + char * headerf, + char * headerv +); +</pre> +Handle a message header. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> +<td>xxfi_header is called zero or more times between xxfi_envrcpt and xxfi_eoh, once per message header.</td> +</tr> +<tr align="left" valign=top> +<th>Default Behavior</th> +<td>Do nothing; return SMFIS_CONTINUE.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>headerf</td> + <td> Header field name. + </td></tr> + <tr valign="top"><td>headerv</td> + <td>Header field value. The + content of the header may include folded white space (i.e. multiple + lines with following white space). The trailing line terminator (CR/LF) + is removed. + </td></tr> + </table> +</td></tr> + +<!----------- Notes ----------> +<tr> +<th valign="top" align=left>NOTES</th> +<td> +<ul> +<li>Later filters will see header changes/additions made by earlier ones. +<li>For much more detail about header format, please see +RFC <a href="http://www.cis.ohio-state.edu/htbin/rfc/rfc822.html">822</a> +</ul> +</td> +</tr> +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> diff --git a/contrib/sendmail/libmilter/docs/xxfi_helo.html b/contrib/sendmail/libmilter/docs/xxfi_helo.html new file mode 100644 index 0000000..b1aa9e9 --- /dev/null +++ b/contrib/sendmail/libmilter/docs/xxfi_helo.html @@ -0,0 +1,59 @@ +<html> +<head><title>xxfi_helo</title></head> +<body> +<h1>xxfi_helo</h1> + +<table border="0" cellspacing=4 cellpadding=4> +<!---------- Synopsis -----------> +<tr><th valign="top" align=left width=150>SYNOPSIS</th><td> +<pre> +#include <libmilter/mfapi.h> +sfsistat (*xxfi_helo)( + SMFICTX * ctx, + char * helohost +); +</pre> +Handle the HELO/EHLO command. +</td></tr> + +<!----------- Description ----------> +<tr><th valign="top" align=left>DESCRIPTION</th><td> +<table border="1" cellspacing=1 cellpadding=4> +<tr align="left" valign=top> +<th width="80">Called When</th> <td>xxfi_helo is called whenever the client +sends a HELO/EHLO command. It may therefore be called between zero and +three times</td> +</tr> +<tr align="left" valign=top> +<th>Default Behavior</th> +<td>Do nothing; return SMFIS_CONTINUE.</td> +</tr> +</table> + +<!----------- Arguments ----------> +<tr><th valign="top" align=left>ARGUMENTS</th><td> + <table border="1" cellspacing=0> + <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr> + <tr valign="top"><td>ctx</td> + <td>Opaque context structure. + </td></tr> + <tr valign="top"><td>helohost</td> + <td>Value passed to HELO/EHLO command, which should be + the domain name of the sending host (but is, in practice, + anything the sending host wants to send). + </td></tr> + </table> +</td></tr> + +</table> + +<hr size="1"> +<font size="-1"> +Copyright (c) 2000 Sendmail, Inc. and its suppliers. +All rights reserved. +<br> +By using this file, you agree to the terms and conditions set +forth in the <a href="LICENSE.txt">LICENSE</a>. +</font> +</body> +</html> |