mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
Sync heuristically_parse_ndn() and maybe_ndn in prefetch_should_download()
This commit is contained in:
@@ -903,16 +903,13 @@ impl MimeMessage {
|
|||||||
/// If you improve heuristics here you might also have to change prefetch_should_download() in imap/mod.rs.
|
/// If you improve heuristics here you might also have to change prefetch_should_download() in imap/mod.rs.
|
||||||
/// Also you should add a test in dc_receive_imf.rs (there already are lots of test_parse_ndn_* tests).
|
/// Also you should add a test in dc_receive_imf.rs (there already are lots of test_parse_ndn_* tests).
|
||||||
async fn heuristically_parse_ndn(&mut self, context: &Context) -> Option<()> {
|
async fn heuristically_parse_ndn(&mut self, context: &Context) -> Option<()> {
|
||||||
if self
|
let maybe_ndn = if let Some(from) = self.get(HeaderDef::From_) {
|
||||||
.get(HeaderDef::Subject)?
|
let from = from.to_ascii_lowercase();
|
||||||
.to_ascii_lowercase()
|
from.contains("mailer-daemon") || from.contains("mail-daemon")
|
||||||
.contains("fail")
|
} else {
|
||||||
&& self
|
false
|
||||||
.get(HeaderDef::From_)?
|
};
|
||||||
.to_ascii_lowercase()
|
if maybe_ndn && self.failure_report.is_none() {
|
||||||
.contains("mailer-daemon")
|
|
||||||
&& self.failure_report.is_none()
|
|
||||||
{
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref RE: regex::Regex = regex::Regex::new(r"Message-ID:(.*)").unwrap();
|
static ref RE: regex::Regex = regex::Regex::new(r"Message-ID:(.*)").unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user