Commit b2790de1 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Added Greylisting defer_message and blacklist_message config options

- Updated TODO
- Updated config file with new options
parent e0e896d2
......@@ -20,8 +20,6 @@ Immediate requirements:
- option to not add timestamps to logs (we capture logs with daemontools which adds (numeric) timestamps) (2.1)
* log_timestamp=false in options
- make the responses ("Greylisting in effect") configurable (2.1)
- Email notification when hosts are added to whitelist/blacklist (2.1)
* Blacklist on excessive greylist retries, ie 50 in 1 minute ... etc. (2.1)
......@@ -36,7 +34,7 @@ Immediate requirements:
* BCC To in amavis plugin needs Merge option, don't overwrite fields offer merge option?
* Add "enable" box so new entries are not disabled automagically apon adding
- Quotas based on per-recipient and per-message sent, make this optional.
- Quotas based on per-recipient and per-message sent, make this optional. (2.1)
- Special treatment of user+something@domain and changing to user@domain, global config option (2.1)
......
......@@ -50,6 +50,8 @@ sub init {
# Defaults
$config{'enable'} = 0;
$config{'training_mode'} = 0;
$config{'defer_message'} = "Greylisting in effect, please come back later";
$config{'blacklist_message'} = "Greylisting in effect, sending server blacklisted";
my $moreInfo = "";
......@@ -340,7 +342,7 @@ sub check {
$sessionData->{'Sender'},
$sessionData->{'Recipient'});
return $server->protocol_response(PROTO_REJECT,"Greylisting in effect, sending server blacklisted");
return $server->protocol_response(PROTO_REJECT,$config{'blacklist_message'});
}
}
......@@ -473,7 +475,7 @@ sub check {
$sessionData->{'Sender'},
$sessionData->{'Recipient'});
return $server->protocol_response(PROTO_REJECT,"Greylisting in effect, sending server blacklisted");
return $server->protocol_response(PROTO_REJECT,$config{'blacklist_message'});
}
} # if ($totalCount > 0 && $totalCount >= $policy{'AutoBlacklistCount'})
} # if (defined($policy{'AutoBlacklistCount'}) && $policy{'AutoBlacklistCount'} > 0)
......@@ -507,7 +509,7 @@ sub check {
$sessionData->{'Recipient'});
# Skip to rejection, if we using greylisting 0 seconds is highly unlikely to be a greylisitng period
return $server->protocol_response(PROTO_DEFER,"451 4.7.1 Greylisting in effect, please come back later");
return $server->protocol_response(PROTO_DEFER,"451 4.7.1 ".$config{'defer_message'});
}
# And just a bit of debug
......@@ -579,7 +581,7 @@ sub check {
return $server->protocol_response(PROTO_DB_ERROR);
}
return $server->protocol_response(PROTO_DEFER,"451 4.7.1 Greylisting in effect, please come back later");
return $server->protocol_response(PROTO_DEFER,"451 4.7.1 ".$config{'defer_message'});
} else {
# Insert/update triplet in database
......
......@@ -154,6 +154,8 @@ enable=1
[Greylisting]
enable=1
#training_mode=1
#defer_message=Greylisting in effect, please come back later
#blacklist_message=Greylisting in effect, sending server blacklisted
# Quotas module
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment