mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-11-09 21:31:12 +08:00
Remove technical subdomains from MTA-STS policies and TLS records (closes #429)
This commit is contained in:
parent
d52180dcf1
commit
f366dc3fd3
2 changed files with 12 additions and 6 deletions
|
|
@ -308,11 +308,13 @@ impl Policy {
|
||||||
|
|
||||||
impl Core {
|
impl Core {
|
||||||
pub fn build_mta_sts_policy(&self) -> Option<Policy> {
|
pub fn build_mta_sts_policy(&self) -> Option<Policy> {
|
||||||
self.smtp
|
self.smtp.session.mta_sts_policy.clone().and_then(|policy| {
|
||||||
.session
|
policy.try_build(self.tls.certificates.load().keys().filter(|key| {
|
||||||
.mta_sts_policy
|
!key.starts_with("mta-sts.")
|
||||||
.clone()
|
&& !key.starts_with("autoconfig.")
|
||||||
.and_then(|policy| policy.try_build(self.tls.certificates.load().keys()))
|
&& !key.starts_with("autodiscover.")
|
||||||
|
}))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,11 @@ impl JMAP {
|
||||||
|
|
||||||
// Add TLSA records
|
// Add TLSA records
|
||||||
for (name, key) in self.core.tls.certificates.load().iter() {
|
for (name, key) in self.core.tls.certificates.load().iter() {
|
||||||
if !name.ends_with(domain_name) {
|
if !name.ends_with(domain_name)
|
||||||
|
|| name.starts_with("mta-sts.")
|
||||||
|
|| name.starts_with("autoconfig.")
|
||||||
|
|| name.starts_with("autodiscover.")
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue