2003-03-18 10:43:22 +01:00
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
check_spamhelo - Check a HELO message delivered from a connecting host.
|
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
|
|
|
Check a HELO message delivered from a connecting host. Reject any
|
|
|
|
that appear in the badhelo config -- e.g. yahoo.com and aol.com, which
|
|
|
|
neither the real Yahoo or the real AOL use, but which spammers use
|
|
|
|
rather a lot.
|
|
|
|
|
|
|
|
=head1 CONFIGURATION
|
|
|
|
|
|
|
|
Add domains or hostnames to the F<badhelo> configuration file; one
|
|
|
|
per line.
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
2005-07-07 06:17:39 +02:00
|
|
|
sub hook_helo {
|
2003-03-18 10:43:22 +01:00
|
|
|
my ($self, $transaction, $host) = @_;
|
|
|
|
($host = lc $host) or return DECLINED;
|
|
|
|
|
|
|
|
for my $bad ($self->qp->config('badhelo')) {
|
|
|
|
if ($host eq lc $bad) {
|
2004-03-05 13:46:24 +01:00
|
|
|
$self->log(LOGDEBUG, "Denying HELO from host claiming to be $bad");
|
2005-07-14 04:31:01 +02:00
|
|
|
return (DENY, "Sorry, I don't believe that you are $host.");
|
2003-03-18 10:43:22 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return DECLINED;
|
|
|
|
}
|
|
|
|
|
2005-07-07 06:17:39 +02:00
|
|
|
# also support EHLO
|
|
|
|
*hook_ehlo = \&hook_helo;
|