Parse ndns from Tiscali

This commit is contained in:
Hocuri
2020-06-16 11:42:19 +02:00
committed by holger krekel
parent f4a1a526f5
commit 40c9c2752b
4 changed files with 108 additions and 5 deletions

View File

@@ -2334,6 +2334,18 @@ mod tests {
);
}
#[async_std::test]
async fn test_parse_ndn_tiscali() {
test_parse_ndn(
"alice@tiscali.it",
"shenauithz@testrun.org",
"Mr.un2NYERi1RM.lbQ5F9q-QyJ@tiscali.it",
include_bytes!("../test-data/message/tiscali_ndn.eml"),
"",
)
.await;
}
#[async_std::test]
async fn test_parse_ndn_testrun() {
test_parse_ndn(

View File

@@ -1458,7 +1458,8 @@ pub(crate) async fn prefetch_should_download(
let is_reply_to_chat_message = prefetch_is_reply_to_chat_message(context, &headers).await;
let maybe_ndn = if let Some(from) = headers.get_header_value(HeaderDef::From_) {
from.to_ascii_lowercase().contains("mailer-daemon")
let from = from.to_ascii_lowercase();
from.contains("mailer-daemon") || from.contains("mail-daemon")
} else {
false
};

View File

@@ -570,13 +570,13 @@ impl MimeMessage {
any_part_added = true;
}
Some("delivery-status") => {
// Some providers, e.g. Tiscali, forget to set the report-type. So, if it's None, assume that it might be delivery-status
Some("delivery-status") | None => {
if let Some(report) = self.process_delivery_status(context, mail)? {
self.failure_report = Some(report);
}
// Add all parts (in fact, AddSinglePartIfKnown() later check if
// the parts are really supported)
// Add all parts (we need another part, preferrably text/plain, to show as an error message)
for cur_data in mail.subparts.iter() {
if self.parse_mime_recursive(context, cur_data).await? {
any_part_added = true;
@@ -588,7 +588,6 @@ impl MimeMessage {
any_part_added = self.parse_mime_recursive(context, first).await?;
}
}
None => {}
}
}
}