mail icon indicating copy to clipboard operation
mail copied to clipboard

Error saving draft: Message cannot be sent

Open handkerchief333 opened this issue 7 months ago β€’ 1 comments

Steps to reproduce

  1. Click on Forward when you receive an email with an attachment.
  2. Write a message and add recipient addresses.
  3. Change the sender address to a different email account.

Notes:

  • I don't know if it's necessary to have attachments, but it was in my case.
  • Steps 2 and 3 can also be reversed, with the same result.

Expected behavior

Forward emails with a different sender address that has also been set up as a mailbox.

Actual behavior

  • The message β€œError saving draft” (de: "Fehler beim Speichern des Entwurfs") appears at the bottom left.
  • The message can no longer be sent. Nothing happens when you click on the β€œSend” button.

Mail app version

5.3.1

Nextcloud version

31.0.5

Mailserver or service

No response

Operating system

No response

PHP engine version

PHP 8.3

Nextcloud memory caching

No response

Web server

Apache (supported)

Database

MariaDB

Additional info

  • No error messages or warnings appeared in the logs.

handkerchief333 avatar Jun 11 '25 11:06 handkerchief333

I've seen this JavaScript messages:

[ERROR] mail: Could not save draft 
Object { app: "mail", uid: "example", level: 2, error: {…} }
app: "mail"
error: Object { message: "Request failed with status code 404", name: "AxiosError", code: "ERR_BAD_REQUEST", … }
level: 2
uid: "example"
<prototype>: Object { … }
index.mjs:54:16
[ERROR] mail: could not send message 
Object { app: "mail", uid: "example", level: 2, error: {…} }
​
app: "mail"
error: Object { message: "Request failed with status code 404", name: "AxiosError", code: "ERR_BAD_REQUEST", … }
code: "ERR_BAD_REQUEST"
config: Object { timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", … }
message: "Request failed with status code 404"
name: "AxiosError"
request: XMLHttpRequest { readyState: 4, timeout: 0, withCredentials: false, … }
response: Object { data: {…}, status: 404, statusText: "", … }
​​
stack: "je@https://example.com/apps/mail/js/mail.js?v=d635cf65-137:2:1072151\nf@https://example.com/apps/mail/js/mail.js?v=d635cf65-137:2:1076435\n"
​​
status: 404
<prototype>: Object { constructor: J(e, t, n, a, r), toJSON: toJSON(), stack: "", … }
level: 2
uid: "example"
​
<prototype>: Object { … }
index.mjs:54:16
    log index.mjs:54
    error index.mjs:72
    default NewMessageModal.vue:476
    a match.js:15
    onSend NewMessageModal.vue:465
[WARN] mail: could not send message 
Object { app: "mail", uid: "example", level: 2, error: {…} }
​
app: "mail"
error: Object { message: "Request failed with status code 404", name: "AxiosError", code: "ERR_BAD_REQUEST", … }
level: 2
uid: "example"
​
<prototype>: Object { … }
index.mjs:51:16

handkerchief333 avatar Jun 11 '25 11:06 handkerchief333

Thanks for your bug report πŸ™

https://github.com/nextcloud/mail/blob/7114399e7d72c55c8e0fe927ac628e1d1c6ea4a8/lib/Service/Attachment/AttachmentService.php#L296-L300

The client object we are passing is for the sender account, because we want to store the draft there. If the source message is within another account, then we cannot use that client object to fetch the attachment.

kesselb avatar Oct 21 '25 18:10 kesselb