Back to index

php5  5.3.10
milter.php
Go to the documentation of this file.
00001 <?php
00025 function milter_log($msg)
00026 {
00027        $GLOBALS['log'] = fopen("/tmp/milter.log", "a");
00028        fwrite($GLOBALS['log'], date("[H:i:s d.m.Y]") . "\t{$msg}\n");
00029        fclose($GLOBALS['log']);
00030 }
00031 
00032 function milter_init() {
00033        milter_log("-- startup --");
00034        milter_log("milter_init()");
00035        smfi_setflags(SMFIF_ADDHDRS);
00036 }
00037 
00041 function milter_connect($connect)
00042 {
00043        milter_log("milter_connect('$connect')");
00044 }
00045 
00050 function milter_helo($helo)
00051 {
00052        milter_log("milter_helo('$helo')");
00053 }
00054 
00059 function milter_envfrom($args)
00060 {
00061        milter_log("milter_envfrom(args[])");
00062        foreach ($args as $ix => $arg) {
00063               milter_log("\targs[$ix] = $arg");
00064        }
00065 }
00066 
00071 function milter_envrcpt($args)
00072 {
00073        milter_log("milter_envrcpt(args[])");
00074        foreach ($args as $ix => $arg) {
00075               milter_log("\targs[$ix] = $arg");
00076        }
00077 }
00078 
00083 function milter_header($header, $value)
00084 {
00085        milter_log("milter_header('$header', '$value')");
00086 }
00087 
00091 function milter_eoh()
00092 {
00093        milter_log("milter_eoh()");
00094 }
00095 
00099 function milter_body($bodypart)
00100 {
00101        milter_log("milter_body('$bodypart')");
00102 }
00103 
00109 function milter_eom()
00110 {
00111        milter_log("milter_eom()");
00112   /* add PHP header to the message */
00113   smfi_addheader("X-PHP", phpversion());  
00114 }
00115 
00120 function milter_abort()
00121 {
00122        milter_log("milter_abort()");
00123 }
00124 
00128 function milter_close()
00129 {
00130        milter_log("milter_close()");
00131 }
00132 ?>