Commit 16a55556 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Fixed bug where non-SASL authenticated email was being matched by the $* specification

parent 32e50c00
......@@ -487,12 +487,17 @@ sub saslUsernameMatches
# Decipher template
my ($template_user) = ($template =~ /^\$(\S+)$/);
# $- is a special case which allows matching against no SASL username
if ($template_user eq '-' && !$saslUsername) {
$match = 1;
# If there is no SASL username
if (!defined($saslUsername) || $saslUsername eq "") {
# $- is a special case which allows matching against no SASL username
if ($template_user eq '-') {
$match = 1;
}
# Else normal match
} elsif (lc($saslUsername) eq lc($template_user) || $template_user eq "*") {
$match = 1;
} else {
if (lc($saslUsername) eq lc($template_user) || $template_user eq "*") {
$match = 1;
}
}
return $match;
......
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