123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <?php
- function milter_log($msg)
- {
- $GLOBALS['log'] = fopen("/tmp/milter.log", "a");
- fwrite($GLOBALS['log'], date("[H:i:s d.m.Y]") . "\t{$msg}\n");
- fclose($GLOBALS['log']);
- }
- function milter_init() {
- milter_log("-- startup --");
- milter_log("milter_init()");
- smfi_setflags(SMFIF_ADDHDRS);
- }
- function milter_connect($connect)
- {
- milter_log("milter_connect('$connect')");
- }
- function milter_helo($helo)
- {
- milter_log("milter_helo('$helo')");
- }
- function milter_envfrom($args)
- {
- milter_log("milter_envfrom(args[])");
- foreach ($args as $ix => $arg) {
- milter_log("\targs[$ix] = $arg");
- }
- }
- function milter_envrcpt($args)
- {
- milter_log("milter_envrcpt(args[])");
- foreach ($args as $ix => $arg) {
- milter_log("\targs[$ix] = $arg");
- }
- }
- function milter_header($header, $value)
- {
- milter_log("milter_header('$header', '$value')");
- }
- function milter_eoh()
- {
- milter_log("milter_eoh()");
- }
- function milter_body($bodypart)
- {
- milter_log("milter_body('$bodypart')");
- }
- function milter_eom()
- {
- milter_log("milter_eom()");
-
- smfi_addheader("X-PHP", phpversion());
- }
- function milter_abort()
- {
- milter_log("milter_abort()");
- }
- function milter_close()
- {
- milter_log("milter_close()");
- }
- ?>
|