35f45f208b
r588@jpeacock (orig r490): jpeacock | 2005-07-09 07:03:53 -0400 r547@jpeacock: jpeacock | 2005-07-02 07:20:17 -0400 Replace pithy comment with something more neutral. Thanks Gordon Rowell <gordonr@gormand.com.au> r548@jpeacock: jpeacock | 2005-07-02 07:24:21 -0400 Example patterns for badrcptto plugin - Gordon Rowell <gordonr@gormand.com.au> r586@jpeacock: jpeacock | 2005-07-09 06:54:47 -0400 Don't use varlog() directly unless you are passing all parameters. Don't try to log() anything during loading of logging plugins. r587@jpeacock: jpeacock | 2005-07-09 06:59:57 -0400 Cannot use new-style hooking with logging plugins (yet). r590@jpeacock (orig r491): jpeacock | 2005-07-10 06:56:55 -0400 r589@jpeacock: jpeacock | 2005-07-10 06:54:32 -0400 Track hooks as array and hash. Re-revert changes to logging plugins to use new-style hooking. logging/adaptive assumed that register() has been called before hook_logging. git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@503 958fd67b-6ff1-0310-b445-bb7760255be9
34 lines
826 B
Plaintext
34 lines
826 B
Plaintext
=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
|
|
|
|
sub hook_helo {
|
|
my ($self, $transaction, $host) = @_;
|
|
($host = lc $host) or return DECLINED;
|
|
|
|
for my $bad ($self->qp->config('badhelo')) {
|
|
if ($host eq lc $bad) {
|
|
$self->log(LOGDEBUG, "Denying HELO from host claiming to be $bad");
|
|
return (DENY, "Sorry, I don't believe that you are $host.");
|
|
}
|
|
}
|
|
return DECLINED;
|
|
}
|
|
|
|
# also support EHLO
|
|
*hook_ehlo = \&hook_helo;
|