From f87816b8ec49d8a02e8bdd0caa88510fa66262b6 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 8 Jun 2022 16:08:52 +0000 Subject: [PATCH] [FIX] l10n_it_edi: imap seen/unseen flag more compatible In 7dd5437a65 the usage of imagelib was changed to match the one of general fetchmail so the flag sent to IMAP server was (\Seen) and not \Seen which is often accepted but not always. From recent reports, it seems that the method `uid` and `store` may have some difference (base on using message-id rather than UID) so this commit is reverting 7dd5437a65 and using the parenthesis around the flag explicitely. opw-2853609 closes odoo/odoo#93158 X-original-commit: 550f9e77625a7917bffd693f18aafe10a04276c9 Signed-off-by: Nicolas Lempereur (nle) --- addons/l10n_it_edi/models/ir_mail_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_it_edi/models/ir_mail_server.py b/addons/l10n_it_edi/models/ir_mail_server.py index 5e9e1fb1f10..4362a29e913 100644 --- a/addons/l10n_it_edi/models/ir_mail_server.py +++ b/addons/l10n_it_edi/models/ir_mail_server.py @@ -84,9 +84,9 @@ class FetchmailServer(models.Model): # To leave the mail in the state in which they were. if "Seen" not in data[1].decode("utf-8"): - imap_server.store(uid, '+FLAGS', '\\Seen') + imap_server.uid('STORE', uid, '+FLAGS', '(\\Seen)') else: - imap_server.store(uid, '-FLAGS', '\\Seen') + imap_server.uid('STORE', uid, '-FLAGS', '(\\Seen)') # See details in message_process() in mail_thread.py if isinstance(message, xmlrpclib.Binary):