diff --git a/dev/Stores/User/Folder.js b/dev/Stores/User/Folder.js index 35a665c67..874b54572 100644 --- a/dev/Stores/User/Folder.js +++ b/dev/Stores/User/Folder.js @@ -24,23 +24,22 @@ ignoredKeywords = [ // Mailo 'sent', // KMail - '$attachment', '$encrypted', '$error', '$ignored', '$invitation', '$queued', - '$replied', '$sent', '$signed', '$todo', '$watched', // GMail - '$replied', - '$attachment', '$notphishing', 'junk', 'nonjunk', + // KMail & GMail + '$attachment', + '$replied', // Others '$readreceipt' ], diff --git a/dev/View/User/MailBox/MessageView.js b/dev/View/User/MailBox/MessageView.js index b17b0b98f..6454758b4 100644 --- a/dev/View/User/MailBox/MessageView.js +++ b/dev/View/User/MailBox/MessageView.js @@ -36,7 +36,7 @@ import { MessageFlagsCache } from 'Common/Cache'; import { AppUserStore } from 'Stores/User/App'; import { SettingsUserStore } from 'Stores/User/Settings'; import { AccountUserStore } from 'Stores/User/Account'; -import { FolderUserStore } from 'Stores/User/Folder'; +import { FolderUserStore, isAllowedKeyword } from 'Stores/User/Folder'; import { MessageUserStore } from 'Stores/User/Message'; import { MessagelistUserStore } from 'Stores/User/Messagelist'; import { ThemeStore } from 'Stores/Theme'; @@ -529,8 +529,8 @@ export class MailMessageView extends AbstractViewRight { newTag() { let message = currentMessage(); if (message) { - let keyword = prompt(i18n('MESSAGE/NEW_TAG'), '')?.replace(/\s+/g, ''); - if (keyword.length) { + let keyword = prompt(i18n('MESSAGE/NEW_TAG'), '')?.replace(/[\s\\]+/g, ''); + if (keyword.length && isAllowedKeyword(keyword)) { message.toggleTag(keyword); FolderUserStore.currentFolder().permanentFlags.push(keyword); } diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php index e7c9f83b3..183d90d3e 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php @@ -647,6 +647,15 @@ class Message implements \JsonSerializable $this->aFlagsLowerCase ), true); */ + // https://datatracker.ietf.org/doc/html/rfc5788#section-3.4.1 + // Thunderbird $label1 is same as $Important? + // Thunderbird $label4 is same as $todo? + $aFlags = \array_unique(\str_replace( + ['$readreceipt', '$replied', /* 'junk', 'nonjunk', '$queued', '$sent', 'sent'*/], + ['$mdnsent', '\\answered',/* '$junk', '$notjunk', '$submitpending', '$submitted', '$submitted'*/], + $this->aFlagsLowerCase + )); + return array( '@Object' => 'Object/Message', 'Folder' => $this->sFolder, @@ -676,7 +685,7 @@ class Message implements \JsonSerializable 'Attachments' => $this->oAttachments ? $this->oAttachments->SpecData() : null, - 'Flags' => $this->aFlagsLowerCase, + 'Flags' => $aFlags, // https://datatracker.ietf.org/doc/html/rfc8621#section-4.1.1 'id' => $this->sEmailId, diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php index 9900f7dab..e2aa0e3ba 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php @@ -194,19 +194,6 @@ trait Response 'FileName' => (\strlen($sSubject) ? \MailSo\Base\Utils::ClearXss($sSubject) : 'message-'.$mResult['Uid']) . '.eml' )); - // https://datatracker.ietf.org/doc/html/rfc5788#section-3.4.1 - $key = \array_search('$readreceipt', $mResult['Flags']); - if (false !== $key) { - $mResult['Flags'][$key] = '$mdnsent'; - } - // KMail - $key = \array_search('$replied', $mResult['Flags']); - if (false !== $key) { - $mResult['Flags'][$key] = '\\answered'; - } - - $mResult['Flags'] = \array_unique($mResult['Flags']); - if ('Message' === $sParent) { $mResult['DraftInfo'] = $mResponse->DraftInfo();