2005-04-28 23:38:43 +02:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
use Qpsmtpd::Stats;
|
|
|
|
|
|
|
|
sub register {
|
|
|
|
my ($self) = @_;
|
|
|
|
|
|
|
|
$self->register_hook('deny', 'increment_deny');
|
|
|
|
$self->register_hook('queue', 'increment_mails');
|
|
|
|
}
|
|
|
|
|
|
|
|
sub increment_deny {
|
2005-05-09 15:41:10 +02:00
|
|
|
my ($self, $tran, $plugin, $level) = @_;
|
2005-04-28 23:38:43 +02:00
|
|
|
|
|
|
|
if ($level == DENY or $level == DENY_DISCONNECT) {
|
|
|
|
$Qpsmtpd::Stats::MAILS_REJECTED++;
|
|
|
|
}
|
|
|
|
elsif ($level == DENYSOFT or $level == DENYSOFT_DISCONNECT) {
|
|
|
|
$Qpsmtpd::Stats::MAILS_TEMPFAIL++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return DECLINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub increment_mails {
|
|
|
|
my $self = shift;
|
|
|
|
|
|
|
|
$Qpsmtpd::Stats::MAILS_RECEIVED++;
|
|
|
|
|
|
|
|
return DECLINED;
|
2005-05-09 15:41:10 +02:00
|
|
|
}
|