From 87fd426244e3a779f2df7a7af277ed3f1494c6a8 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Tue, 24 Feb 2026 11:37:14 +0100 Subject: [PATCH] Better error message. --- frontend/src/components/webmail/ComposeEmailForm.vue | 1 - modoboa/webmail/lib/imaputils.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/webmail/ComposeEmailForm.vue b/frontend/src/components/webmail/ComposeEmailForm.vue index bc16e809a..606c91b66 100644 --- a/frontend/src/components/webmail/ComposeEmailForm.vue +++ b/frontend/src/components/webmail/ComposeEmailForm.vue @@ -436,7 +436,6 @@ watch( if (!route.query.uid) { const args = route.query.mailbox === constants.DRAFTS_FOLDER ? [route.query.mailid] : [] - console.log(args) api.createComposeSession(...args).then((resp) => { const query = { ...route.query, uid: resp.data.uid } attachmentCount.value = resp.data.attachments?.length || 0 diff --git a/modoboa/webmail/lib/imaputils.py b/modoboa/webmail/lib/imaputils.py index 1028471e4..d40356659 100644 --- a/modoboa/webmail/lib/imaputils.py +++ b/modoboa/webmail/lib/imaputils.py @@ -783,6 +783,8 @@ class IMAPconnector: bcmd = "BODY.PEEK" if readonly else "BODY" to_fetch = f"(BODYSTRUCTURE {bcmd}[HEADER.FIELDS ({what})])" data = self._cmd("FETCH", mailid, to_fetch) + if int(mailid) not in data: + raise ImapError(f"Message with UID {mailid} not found in {mbox} folder") return data[int(mailid)]