Commit 9b995797 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Add support for matching sender <> , use @ as a policy member

parent a52e4e20
......@@ -689,7 +689,13 @@ sub getTrackKey
# Check TrackSender
} elsif ($method eq "sender") {
my $key = getEmailKey($spec,$sessionData->{'Sender'});
# Check if the sender is blank (<>), it makes no sense at present to work out how its tracked, <> is <>
my $key;
if ($sessionData->{'Sender'} ne "") {
$key = getEmailKey($spec,$sessionData->{'Sender'});
} else {
$key = "<>";
}
# Check for no key
if (defined($key)) {
......
......@@ -638,8 +638,14 @@ sub getKey
# Check TrackSender
} elsif ($method eq "sender") {
my $key = getEmailKey($spec,$sessionData->{'Sender'});
# Check if the sender is blank (<>), it makes no sense at present to work out how its tracked, <> is <>
my $key;
if ($sessionData->{'Sender'} ne "") {
$key = getEmailKey($spec,$sessionData->{'Sender'});
} else {
$key = "<>";
}
# Check for no key
if (defined($key)) {
$res = "Sender:$key";
......
......@@ -321,6 +321,11 @@ sub policySourceItemMatches
$res = saslUsernameMatches($sessionData->{'SASLUsername'},$item);
$server->log(LOG_DEBUG,"[POLICIES] $debugTxt: - Resolved source '$item' to a SASL user specification, match = $res") if ($log);
# Match blank email addy
} elsif ($item eq "@") {
$res = 1 if ($sessionData->{'Sender'} eq "");
$server->log(LOG_DEBUG,"[POLICIES] $debugTxt: - Resolved source '$item' to a email blank address specification, match = $res") if ($log);
# Match email addy
} elsif ($item =~ /^\S*@\S+$/) {
$res = emailAddressMatches($sessionData->{'Sender'},$item);
......
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