[Mimedefang] filter_recipient problem (bug?)
Egor Moskvichev
jugr at mail.ru
Wed Aug 11 05:07:39 EDT 2004
Hi, all!
The problem is...
Sometimes filter_recipient sub does not return recipient email address and
sender ip-address.
When i look through my mailstats i notice a few strings without $from_host
and $to_recipient values.
But messages itself are not empty and they look rather ordinarily.
Who can tell me whats going on?
Its very important for me, because i try to organize mail billing system.
You can see my mimedefang-filter below for details.
Thank you,
Egor Moskvichev
sub filter_recipient () {
my ($recipient, $sender, $ip, $hostname, $first, $helo, $rcpt_mailer,
$rcpt_host, $rcpt_addr) = @_;
$from_host = $ip;
$to_recipient = $recipient;
return ('CONTINUE', "ok");
};
sub filter_begin () {
$email_time = scalar(localtime);
$email_size = -s "./INPUTMSG";
open(LOG, ">> /var/log/mailstats");
printf LOG "%-25s %-15s %-50s %s\n", ($email_time, $from_host,
$to_recipient, $email_size);
close(LOG);
if ($from_host eq '') {
$filename = sprintf("%04d%02d%02d-%02d%02d", sub {($_[5]+1900,
$_[4]+1, $_[3], $_[2], $_[1])}->(localtime));
use File::Copy;
copy("./INPUTMSG", "/var/log/$filename");
};
};
1;
More information about the MIMEDefang
mailing list