Consolidate greylist exclusions into exclude()
This makes for an easily overridden method for excluding hosts from greylisting with custom rules
This commit is contained in:
parent
76c2e5b030
commit
179d6427fc
@ -285,9 +285,7 @@ sub greylist {
|
||||
map { $_ . '=' . $config->{$_} } sort keys %$config)
|
||||
);
|
||||
|
||||
return DECLINED if $self->is_immune();
|
||||
return DECLINED if !$self->p0f_match();
|
||||
return DECLINED if $self->geoip_match();
|
||||
return DECLINED if $self->exclude();
|
||||
|
||||
my $db = $self->get_db_location();
|
||||
my $lock = $self->get_db_lock($db) or return DECLINED;
|
||||
@ -507,6 +505,12 @@ sub prune_db {
|
||||
return $self->cleanup_and_return($tied, $lock, DECLINED);
|
||||
}
|
||||
|
||||
sub exclude {
|
||||
return 1 if $self->is_immune();
|
||||
return 1 if !$self->p0f_match();
|
||||
return 1 if $self->geoip_match();
|
||||
}
|
||||
|
||||
sub p0f_match {
|
||||
my $self = shift;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user