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)]