Fix MTA: DMARC is skipped when MAIL FROM SPF is unavailable
This commit is contained in:
@@ -17,6 +17,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If
|
|||||||
- Web Push payloads with `Content-Encoding: aes128gcm` should not be base64-encoded but sent as raw bytes.
|
- Web Push payloads with `Content-Encoding: aes128gcm` should not be base64-encoded but sent as raw bytes.
|
||||||
- `Email/import` does not send push notifications for imported messages.
|
- `Email/import` does not send push notifications for imported messages.
|
||||||
- `CalendarEvent/set` silently ignores `ifInState`.
|
- `CalendarEvent/set` silently ignores `ifInState`.
|
||||||
|
- MTA: DMARC is skipped when MAIL FROM SPF is unavailable.
|
||||||
- Calendar:
|
- Calendar:
|
||||||
- Uppercase `MAILTO` calendar addresses become invalid SMTP recipients.
|
- Uppercase `MAILTO` calendar addresses become invalid SMTP recipients.
|
||||||
- Scheduling invitations on a shared, non-owned calendar fail with `MAIL FROM unauthorized`.
|
- Scheduling invitations on a shared, non-owned calendar fail with `MAIL FROM unauthorized`.
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ use common::{
|
|||||||
};
|
};
|
||||||
use mail_auth::{
|
use mail_auth::{
|
||||||
AuthenticatedMessage, AuthenticationResults, Dkim2Result, DkimResult, DmarcResult, ReceivedSpf,
|
AuthenticatedMessage, AuthenticationResults, Dkim2Result, DkimResult, DmarcResult, ReceivedSpf,
|
||||||
|
SpfOutput, SpfResult,
|
||||||
common::{
|
common::{
|
||||||
crypto::Algorithm,
|
crypto::Algorithm,
|
||||||
headers::{Header, HeaderWriter},
|
headers::{Header, HeaderWriter},
|
||||||
@@ -349,8 +350,16 @@ impl<T: SessionStream> Session<T> {
|
|||||||
|
|
||||||
// Verify DMARC
|
// Verify DMARC
|
||||||
let is_report = !self.is_authenticated() && self.is_report();
|
let is_report = !self.is_authenticated() && self.is_report();
|
||||||
let (dmarc_result, dmarc_policy) = match &self.data.spf_mail_from {
|
let (dmarc_result, dmarc_policy) = if dmarc.verify() {
|
||||||
Some(spf_output) if dmarc.verify() => {
|
{
|
||||||
|
let synthetic_spf;
|
||||||
|
let spf_output = match &self.data.spf_mail_from {
|
||||||
|
Some(spf_output) => spf_output,
|
||||||
|
None => {
|
||||||
|
synthetic_spf = SpfOutput::new(String::new()).with_result(SpfResult::None);
|
||||||
|
&synthetic_spf
|
||||||
|
}
|
||||||
|
};
|
||||||
let time = Instant::now();
|
let time = Instant::now();
|
||||||
let dmarc_output =
|
let dmarc_output =
|
||||||
self.server
|
self.server
|
||||||
@@ -432,7 +441,8 @@ impl<T: SessionStream> Session<T> {
|
|||||||
|
|
||||||
(dmarc_result.into(), dmarc_policy.into())
|
(dmarc_result.into(), dmarc_policy.into())
|
||||||
}
|
}
|
||||||
_ => (None, None),
|
} else {
|
||||||
|
(None, None)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Analyze reports
|
// Analyze reports
|
||||||
|
|||||||
Reference in New Issue
Block a user