New convention for calling Qpsmtpd::Base stuff
I think
This commit is contained in:
parent
abcdd5442c
commit
cf09a662ad
@ -4,7 +4,6 @@ use Qpsmtpd;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Qpsmtpd::Base;
|
||||
use Qpsmtpd::Constants;
|
||||
|
||||
use IO::File qw(O_RDWR O_CREAT);
|
||||
|
@ -164,7 +164,7 @@ sub connect_handler {
|
||||
sub is_valid_localhost {
|
||||
my ($self) = @_;
|
||||
|
||||
if (Qpsmtpd::Base->is_localhost($self->qp->connection->remote_ip)) {
|
||||
if ($self->is_localhost($self->qp->connection->remote_ip)) {
|
||||
$self->adjust_karma(1);
|
||||
$self->log(LOGDEBUG, "pass, is localhost");
|
||||
return 1;
|
||||
|
@ -255,7 +255,7 @@ sub exclude_host {
|
||||
if ( $pattern =~ /^\/(.*)\/$/ ) {
|
||||
push @{ $self->{_exclude_re} }, qr/$1/;
|
||||
}
|
||||
elsif ( Qpsmtpd::Base->is_valid_ip($pattern) ) {
|
||||
elsif ( $self->is_valid_ip($pattern) ) {
|
||||
$self->{_exclude_ip}{$pattern} = 1;
|
||||
}
|
||||
else {
|
||||
|
@ -229,7 +229,6 @@ use warnings;
|
||||
|
||||
use Net::IP;
|
||||
|
||||
use Qpsmtpd::Base;
|
||||
use Qpsmtpd::Constants;
|
||||
|
||||
sub register {
|
||||
@ -342,7 +341,7 @@ sub is_regex_match {
|
||||
|
||||
sub invalid_localhost {
|
||||
my ($self, $host) = @_;
|
||||
if (Qpsmtpd::Base->is_localhost($self->qp->connection->remote_ip)) {
|
||||
if ($self->is_localhost($self->qp->connection->remote_ip)) {
|
||||
$self->log(LOGDEBUG, "pass, is localhost");
|
||||
return;
|
||||
}
|
||||
@ -357,7 +356,7 @@ sub invalid_localhost {
|
||||
|
||||
sub is_plain_ip {
|
||||
my ($self, $host) = @_;
|
||||
return if !Qpsmtpd::Base->is_valid_ip($host);
|
||||
return if ! $self->is_valid_ip($host);
|
||||
|
||||
$self->log(LOGDEBUG, "fail, plain IP");
|
||||
return "Plain IP is invalid HELO hostname (RFC 2821)", "plain IP";
|
||||
@ -369,7 +368,7 @@ sub is_address_literal {
|
||||
my ($ip) = $host =~ /^\[(.*)\]/; # strip off any brackets
|
||||
return if !$ip; # no brackets, not a literal
|
||||
|
||||
return if !Qpsmtpd::Base->is_valid_ip($ip);
|
||||
return if ! $self->is_valid_ip($ip);
|
||||
|
||||
$self->log(LOGDEBUG, "fail, bracketed IP");
|
||||
return "RFC 2821 allows an address literal, but we do not","bracketed IP";
|
||||
@ -377,7 +376,7 @@ sub is_address_literal {
|
||||
|
||||
sub is_forged_literal {
|
||||
my ($self, $host) = @_;
|
||||
return if !Qpsmtpd::Base->is_valid_ip($host);
|
||||
return if ! $self->is_valid_ip($host);
|
||||
|
||||
# should we add exceptions for reserved internal IP space? (192.168,10., etc)
|
||||
$host = substr $host, 1, -1;
|
||||
|
@ -404,7 +404,7 @@ sub set_asn {
|
||||
my ($self, $ip) = @_;
|
||||
$ip ||= $self->qp->connection->remote_ip;
|
||||
|
||||
if (Qpsmtpd::Base->is_ipv6($ip)) {
|
||||
if ($self->is_ipv6($ip)) {
|
||||
return $self->set_asn_ipv6($ip);
|
||||
}
|
||||
return if ! $self->{GeoIPASNum};
|
||||
|
Loading…
Reference in New Issue
Block a user