Create entries in msgs table for MDNs

At least one entry is required for DeleteMsgOnImap job. Additionally,
adding a hidden entry makes it possible to avoid redownloading the
message if it gets a new UID on the server.
This commit is contained in:
Alexander Krotov
2020-02-26 01:08:00 +03:00
parent f2aa17c9d0
commit 5b3bec1aac
2 changed files with 19 additions and 6 deletions

View File

@@ -624,10 +624,13 @@ fn add_parts(
let subject = mime_parser.get_subject().unwrap_or_default();
for part in mime_parser.parts.iter_mut() {
if mime_parser.location_kml.is_some()
let is_mdn = !mime_parser.reports.is_empty();
let is_location_kml = mime_parser.location_kml.is_some()
&& icnt == 1
&& (part.msg == "-location-" || part.msg.is_empty())
{
&& (part.msg == "-location-" || part.msg.is_empty());
if is_mdn || is_location_kml {
*hidden = true;
if state == MessageState::InFresh {
state = MessageState::InNoticed;