mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-11-10 05:42:02 +08:00
Allow catch-all addresses when validating must match sender
This commit is contained in:
parent
20a74e787f
commit
a93c792a9a
1 changed files with 3 additions and 1 deletions
|
|
@ -109,7 +109,9 @@ impl<T: SessionStream> Session<T> {
|
||||||
if !self.data.authenticated_as.is_empty()
|
if !self.data.authenticated_as.is_empty()
|
||||||
&& self.params.auth_match_sender
|
&& self.params.auth_match_sender
|
||||||
&& (self.data.authenticated_as != address_lcase
|
&& (self.data.authenticated_as != address_lcase
|
||||||
&& !self.data.authenticated_emails.contains(&address_lcase))
|
&& !self.data.authenticated_emails.iter().any(|e| {
|
||||||
|
e == &address_lcase || (e.starts_with('@') && address_lcase.ends_with(e))
|
||||||
|
}))
|
||||||
{
|
{
|
||||||
return self
|
return self
|
||||||
.write(b"501 5.5.4 You are not allowed to send from this address.\r\n")
|
.write(b"501 5.5.4 You are not allowed to send from this address.\r\n")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue