mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
refactor: do not treat messages without headers as a special case
This commit is contained in:
@@ -776,10 +776,6 @@ impl MimeMessage {
|
|||||||
self.headers.contains_key("chat-version")
|
self.headers.contains_key("chat-version")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn has_headers(&self) -> bool {
|
|
||||||
!self.headers.is_empty()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn get_subject(&self) -> Option<String> {
|
pub(crate) fn get_subject(&self) -> Option<String> {
|
||||||
self.get_header(HeaderDef::Subject)
|
self.get_header(HeaderDef::Subject)
|
||||||
.filter(|s| !s.is_empty())
|
.filter(|s| !s.is_empty())
|
||||||
|
|||||||
@@ -138,12 +138,6 @@ pub(crate) async fn receive_imf_inner(
|
|||||||
Ok(mime_parser) => mime_parser,
|
Ok(mime_parser) => mime_parser,
|
||||||
};
|
};
|
||||||
|
|
||||||
// we can not add even an empty record if we have no info whatsoever
|
|
||||||
if !mime_parser.has_headers() {
|
|
||||||
warn!(context, "receive_imf: no headers found.");
|
|
||||||
return Ok(None);
|
|
||||||
}
|
|
||||||
|
|
||||||
info!(context, "Received message has Message-Id: {rfc724_mid}");
|
info!(context, "Received message has Message-Id: {rfc724_mid}");
|
||||||
|
|
||||||
// check, if the mail is already in our database.
|
// check, if the mail is already in our database.
|
||||||
|
|||||||
Reference in New Issue
Block a user