Skip to content

Commit 66965e8

Browse files
committed
fix: Fix incorrect flag for MDN sent and hide junk flag used by Thunderbird
Signed-off-by: David Dreschner <[email protected]>
1 parent d1f55af commit 66965e8

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/Controller/MessagesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ public function mdn(int $id): JSONResponse {
472472

473473
try {
474474
$this->mailTransmission->sendMdn($account, $mailbox, $message);
475-
$this->mailManager->flagMessage($account, $mailbox->getName(), $message->getUid(), 'mdnsent', true);
475+
$this->mailManager->flagMessage($account, $mailbox->getName(), $message->getUid(), '$mdnsent', true);
476476
} catch (ServiceException $ex) {
477477
$this->logger->error('Sending mdn failed: ' . $ex->getMessage());
478478
throw $ex;

lib/Db/Message.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class Message extends Entity implements JsonSerializable {
8484
'forwarded',
8585
'$junk',
8686
'$notjunk',
87-
'mdnsent',
87+
'$mdnsent',
8888
Tag::LABEL_IMPORTANT,
8989
'$important' // @todo remove this when we have removed all references on IMAP to $important @link https://github.com/nextcloud/mail/issues/25
9090
];
@@ -338,7 +338,7 @@ public function jsonSerialize() {
338338
'important' => ($this->getFlagImportant() === true),
339339
'$junk' => ($this->getFlagJunk() === true),
340340
'$notjunk' => ($this->getFlagNotjunk() === true),
341-
'mdnsent' => ($this->getFlagMdnsent() === true),
341+
'$mdnsent' => ($this->getFlagMdnsent() === true),
342342
],
343343
'tags' => $indexed,
344344
'from' => $this->getFrom()->jsonSerialize(),

lib/Model/IMAPMessage.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ public function toDbMessage(int $mailboxId, MailAccount $account): Message {
535535
$msg->setFlagJunk(
536536
in_array(Horde_Imap_Client::FLAG_JUNK, $flags, true)
537537
|| in_array('junk', $flags, true)
538-
);
538+
); // While this is not a standard IMAP flag, Thunderbird uses it to mark "junk"
539539
$msg->setFlagNotjunk(in_array(Horde_Imap_Client::FLAG_NOTJUNK, $flags, true) || in_array('nonjunk', $flags, true));// While this is not a standard IMAP Flag, Thunderbird uses it to mark "not junk"
540540
// @todo remove this as soon as possible @link https://github.com/nextcloud/mail/issues/25
541541
$msg->setFlagImportant(in_array('$important', $flags, true) || in_array('$labelimportant', $flags, true) || in_array(Tag::LABEL_IMPORTANT, $flags, true));
@@ -552,6 +552,7 @@ public function toDbMessage(int $mailboxId, MailAccount $account): Message {
552552
Horde_Imap_Client::FLAG_DELETED,
553553
Horde_Imap_Client::FLAG_DRAFT,
554554
Horde_Imap_Client::FLAG_JUNK,
555+
'junk', // While this is not a standard IMAP flag, Thunderbird uses it to mark "junk"
555556
Horde_Imap_Client::FLAG_NOTJUNK,
556557
'nonjunk', // While this is not a standard IMAP Flag, Thunderbird uses it to mark "not junk"
557558
Horde_Imap_Client::FLAG_MDNSENT,

0 commit comments

Comments
 (0)