Mail lost when sending

Description

When sending, the undo counter (15s in this case) finishes, there is the usual UI indication of the sending in progress and then an error message is shown, with a text like “Failed to send e-mail”. This happened about three times over the course of a few weeks.

The original message is not sent (I’ve checked the GMail sent folder online) and it cannot be recovered - for instance from Drafts. There is a message in Drafts with the respective subject and a summary line that looks like the sent message however it cannot be opened correctly - an empty message editor is shown. The GMail Drafts folder does not contain the message at all.

As a warning sign, I noticed in two of the cases that the editor behaved strangely when writing the email. Some formatting was used in these cases (monspaced font in one and bullets in the other), and there were some editing glitches: for instance a word was deleted completely out of the blue, or a few items on the bullet list just vanished. Subsequently sending these e-mails failed as described.

Setup

  • OS and Version: Ubuntu 18.04
  • Mailspring Version: 1.4.2-f587b7b7

Additional Context

It just happened again, without any formatting problems. The exact error message is “Sorry, Mailspring was unable to deliver this message: undefined”

I’ve opened the developer tools and the log contains a bunch of SyncbackDraftTask objects followed by a SendDraftTask.

The SyncbackDraftTask objects contain the correct details of the message (except there’s no body field), but the SendDraftTask seems to be mixed up: it has a different account id, the sender is the default account (not the one I used in the draft), the subject is empty and the body is just <br>

In other messages that are sent correctly, SendDraftTask contains the correct information for the sent message.

Here is an error fragment from the log at the time of sending:

3198 [2018-10-18 15:44:26.866] [foreground] [info] [local-80dcf29b-ec5f] Running SendDraftTask performRemote:
3198 [2018-10-18 15:44:26.867] [foreground] [info] - Sending draft [1539866429.local-364f71d3-03f2-v1.4.2-f587b7b7@getmailspring.com](mailto:1539866429.local-364f71d3-03f2-v1.4.2-f587b7b7@getmailspring.com)
3198 [2018-10-18 15:44:26.868] [foreground] [info] -- Identified `sent` folder: [Gmail]/Sent Mail
3198 [2018-10-18 15:44:26.868] [foreground] [info] -- Sending a single message body to all recipients:
3198 [2018-10-18 15:44:26.869] [foreground] [info] -X An SMTP error occurred: ErrorNoRecipient LibEtPan code: 0
3198 [2018-10-18 15:44:26.914] [foreground] [error] [local-80dcf29b-ec5f] -- Failed ({"debuginfo":"ErrorNoRecipient","key":"send-failed","retryable":false,"what":"std::exception"}). Changing status to `complete`
3198 [2018-10-18 15:44:26.952] [foreground] [info] syncFolderChangesViaCondstore - [Gmail]/All Mail: modseq 46702 to 46702, uidnext 305 to 305

I can send all the logs if needed, not sure if it’s good to attach them here.


(Originally posted by radu-b on GitHub.)

I have the same issue.

What operating system are you using?
macOS High Sierra 10.13.6 (17G65)

What version of Mailspring are you using?
1.4.2-f587b7b7

Using Google Apps accounts, some emails go through, others don’t, I haven’t noticed a pattern. The undo send countdown goes all the way down then I get an alert with something along the lines of “Failed to send message: undefined”. If it happens again I’ll update with the full error message.

I haven’t noticed the message behaving strangely while writing the message but I’ll keep an eye out for it.

Like above, the unsent message will appear in drafts with the message preview, subject, recipients, etc. but once opened it’s a blank message, no recipients, message, subject, and also it will be set to the default account rather than the account the message was sent from.

Follow-Up

Happened yesterday and again today, the message in the error alert popup was “Sorry, Mailspring was unable to deliver the message: undefined.”

Here is a snippet from the logs:

59616 [2018-10-23 11:37:35.575] [main] [info] [local-62709687-1c09] Running SendDraftTask performLocal:
59616 [2018-10-23 11:37:35.576] [main] [info] [local-62709687-1c09] -- Succeeded. Changing status to `remote`
59616 [2018-10-23 11:37:35.946] [foreground] [info] Idle exited with code 0
59616 [2018-10-23 11:37:36.032] [foreground] [info] [local-62709687-1c09] Running SendDraftTask performRemote:
59616 [2018-10-23 11:37:36.034] [foreground] [info] - Sending draft 1540304986.local-887a7095-7585-v1.5.0-92ed66b8@getmailspring.com
59616 [2018-10-23 11:37:36.034] [foreground] [info] -- Identified `sent` folder: [Gmail]/Sent Mail
59616 [2018-10-23 11:37:36.042] [foreground] [info] -- Sending a single message body to all recipients:
59616 [2018-10-23 11:37:36.044] [foreground] [info] -X An SMTP error occurred: ErrorNoRecipient LibEtPan code: 0
59616 [2018-10-23 11:37:36.563] [foreground] [error] [local-62709687-1c09] -- Failed ({"debuginfo":"ErrorNoRecipient","key":"send-failed","retryable":false,"what":"std::exception"}). Changing status to `complete`
59616 [2018-10-23 11:37:36.631] [foreground] [info] syncFolderChangesViaCondstore - [Gmail]/All Mail: modseq 11340466 to 11340466, uidnext 129791 to 129791

(Originally posted by barbrick on GitHub.)

@barbrick Do you use the default undo timeout, or a larger one like me (15s)?


(Originally posted by radu-b on GitHub.)

@radu-b Good catch, I also use the 15 second timeout. I wonder if that’s related? I’ll set it back to 5s for the time being, unfortunately, the issue has been sporadic so it will be hard to tell if that makes a difference.


(Originally posted by barbrick on GitHub.)

I’d like to echo everything in this thread – I get the same type of logs, same error message, same deal with the timer expiring before getting the error, also with gmail, etc. I’d like to add that for whatever reason I don’t get this problem when replying to emails. It only happens when clicking the “compose” button and sending an email from the compose window. Maybe someone can confirm this?


(Originally posted by gitsper on GitHub.)

Hey folks—thanks for reporting this. I’m looking in to this and I’ll see if I can reproduce it reliably. When you’re composing emails and this happens, do you remember if you choose a “From:” address in the composer? It sounds like Mailspring might be waiting the 15 seconds, going to send the draft, and discovering that it’s sending through Account A with the “From” address of Account B.


(Originally posted by bengotow on GitHub.)

Hey folks—thanks for reporting this. I’m looking in to this and I’ll see if I can reproduce it reliably. When you’re composing emails and this happens, do you remember if you choose a “From:” address in the composer? It sounds like Mailspring might be waiting the 15 seconds, going to send the draft, and discovering that it’s sending through Account A with the “From” address of Account B.

Since reading this comment, I have been composing new mail by first selecting the inbox of the account I want to send from. Then when I click the send button, the “from” address in the composer window is populated with the address that I want. I have not had any errors sending mail in this way, so it seems your assessment is spot on!


(Originally posted by gitsper on GitHub.)

I’m sure it happens when changing the From address, I need to check if it happens without changing it.

Hey folks—thanks for reporting this. I’m looking in to this and I’ll see if I can reproduce it reliably. When you’re composing emails and this happens, do you remember if you choose a “From:” address in the composer? It sounds like Mailspring might be waiting the 15 seconds, going to send the draft, and discovering that it’s sending through Account A with the “From” address of Account B.

It happened to me without changing the from field but having set 15 secs to undo send in the timer settings option.


(Originally posted by rafacapa on GitHub.)

Duplicates:

I have been trying to reproduce the issue, but was unable to do so. I tried to change the sender in the composer window, selected a different account while the “undo send” modal was shown, … All my e-mails were sent correctly.

Is there anybody who can reliably reproduce the issue and provide some instructions for it?

Unfortunately, I am not able to provide a set of steps, but just wanted to note that this is still an issue, and I’d say a very dangerous one :confused:

ok, it happened again for me, here is the log, hope I caught the right part. I have to note the “from” address was an alias.

8105 [2021-05-13 18:26:13.037] [metadataExpiration] [info] – Sending expiration event for Message BgKmt5isT9krquD44mZvNEogk1FkHALf5oyPe9vYB
8105 [2021-05-13 18:26:13.038] [metadataExpiration] [info] – Will wake for next expiration in 7200sec
8105 [2021-05-13 18:26:13.542] [main] [info] [local-96f72b04-554d] Running SyncbackDraftTask performLocal:
8105 [2021-05-13 18:26:13.547] [main] [info] [local-96f72b04-554d] – Succeeded. Changing status to remote
8105 [2021-05-13 18:26:13.612] [main] [info] [local-7691f80b-0af1] Running SendDraftTask performLocal:
8105 [2021-05-13 18:26:13.613] [main] [info] [local-7691f80b-0af1] – Succeeded. Changing status to remote
8105 [2021-05-13 18:26:14.150] [foreground] [info] Idle exited with code 0
8105 [2021-05-13 18:26:14.164] [foreground] [info] [local-96f72b04-554d] Running SyncbackDraftTask performRemote:
8105 [2021-05-13 18:26:14.164] [foreground] [info] [local-96f72b04-554d] – Succeeded. Changing status to complete
8105 [2021-05-13 18:26:14.166] [foreground] [info] [local-7691f80b-0af1] Running SendDraftTask performRemote:
8105 [2021-05-13 18:26:14.169] [foreground] [info] - Sending draft 07FC2209-7921-454A-AA2D-ACCDB16C8A50@getmailspring.com
8105 [2021-05-13 18:26:14.169] [foreground] [info] – Identified sent folder: [Gmail]/Wys&AUI-ane
8105 [2021-05-13 18:26:14.239] [foreground] [info] – Sending customized message bodies to each recipient:
8105 [2021-05-13 18:26:14.239] [foreground] [info] — Sending to info@xxxxxxxxxxxx
5688 [2021-05-13 18:26:16.476] [main] [info] Identity created at 1617554740 - using ID Schema 1
5688 [2021-05-13 18:26:16.477] [main] [info] ------------- Starting Sync (xxxxxxx@gmail.com) ---------------
5688 [2021-05-13 18:26:16.481] [metadata] [info] Metadata delta stream starting…
5688 [2021-05-13 18:26:20.480] [background] [info] Fetching XOAuth2 access token (gmail) for a4feb315
5688 [2021-05-13 18:26:20.782] [background] [info] Marking all folders as busy
5688 [2021-05-13 18:26:20.783] [background] [info] Syncing folder list…
5688 [2021-05-13 18:26:23.288] [background] [info] Syncing folder list…
5688 [2021-05-13 18:26:24.721] [background] [info] Sync loop deleting unlinked messages with phase 2.
5688 [2021-05-13 18:26:24.796] [background] [info] Sync loop complete.
5688 [2021-05-13 18:26:25.208] [foreground] [info] [local-7691f80b-0af1] Running SendDraftTask performRemote:
5688 [2021-05-13 18:26:25.208] [foreground] [info] [local-7691f80b-0af1] – Succeeded. Changing status to complete
5688 [2021-05-13 18:26:25.251] [main] [info] [local-a4471d98-0660] Running SendFeatureUsageEventTask performLocal:
5688 [2021-05-13 18:26:25.251] [main] [info] [local-a4471d98-0660] – Succeeded. Changing status to remote
5688 [2021-05-13 18:26:25.255] [main] [info] [local-08bc1ee3-8f5e] Running SendFeatureUsageEventTask performLocal:
5688 [2021-05-13 18:26:25.255] [main] [info] [local-08bc1ee3-8f5e] – Succeeded. Changing status to remote