[GH-ISSUE #17] [Bug] Draft message discarded despite sending of message failed #18

Closed
opened 2026-03-03 01:19:02 +03:00 by kerem · 8 comments
Owner

Originally created by @Kabouik on GitHub (Jan 21, 2020).
Original GitHub issue: https://github.com/d99kris/nmail/issues/17

Originally assigned to: @d99kris on GitHub.

While trying to send you my log.txt regarding issue #13, it seems sending failed somehow, and the message (which was a draft I was editing) was removed from the draft. When sending fails, I would expect messages to be kept in drafts so that one does not have to compose from scratch again.

Of course, there is an underlying issue with the failure to send the message itself. I am using nmail on the computer (Solus distribution) and as I noticed before, sending does not work from it. I did not know this was reproducible until now. All messages I successfully sent using nmail so far were sent using Xubuntu chroot on my SailfishOS phone. libetpan and lipetpan-devel are installed. I will need to try sending a message with --verbose on.

Originally created by @Kabouik on GitHub (Jan 21, 2020). Original GitHub issue: https://github.com/d99kris/nmail/issues/17 Originally assigned to: @d99kris on GitHub. While trying to send you my `log.txt` regarding issue #13, it seems sending failed somehow, and the message (which was a draft I was editing) was removed from the draft. When sending fails, I would expect messages to be kept in drafts so that one does not have to compose from scratch again. Of course, there is an underlying issue with the failure to send the message itself. I am using nmail on the computer (Solus distribution) and as I noticed before, sending does not work from it. I did not know this was reproducible until now. All messages I successfully sent using nmail so far were sent using Xubuntu chroot on my SailfishOS phone. `libetpan` and `lipetpan-devel` are installed. I will need to try sending a message with `--verbose` on.
kerem closed this issue 2026-03-03 01:19:02 +03:00
Author
Owner

@Kabouik commented on GitHub (Jan 21, 2020):

If I check the draft folder from another client, the messages are there, so my above description is partly wrong. However, nmail won't display them even after fetching within the said folder using L.

Also, on my first attempt, I composed an email, send saved it to draft using Ctrl+O because I knew I had this issue a few days ago, and the message was correctly displayed in drafts within nmail. Only when trying to edit it and send it, it disappeared from nmail after the "Send message failed" message. Fetching in the draft folder does not show it, so I initially thought it was deleted, until I noticed other clients still see it.

<!-- gh-comment-id:576663370 --> @Kabouik commented on GitHub (Jan 21, 2020): If I check the draft folder from another client, the messages are there, so my above description is partly wrong. However, nmail won't display them even after fetching within the said folder using `L`. Also, on my first attempt, I composed an email, send saved it to draft using `Ctrl+O` because I knew I had this issue a few days ago, and the message was correctly displayed in drafts within nmail. Only when trying to edit it and send it, it disappeared from nmail after the "Send message failed" message. Fetching in the draft folder does not show it, so I initially thought it was deleted, until I noticed other clients still see it.
Author
Owner

@d99kris commented on GitHub (Jan 24, 2020):

This sounds like a bad bug. Let me try to (force) reproduce it and find a fix.

<!-- gh-comment-id:578043583 --> @d99kris commented on GitHub (Jan 24, 2020): This sounds like a bad bug. Let me try to (force) reproduce it and find a fix.
Author
Owner

@d99kris commented on GitHub (Jan 24, 2020):

I can see the issue too. In addition I guess it would be good for nmail to save the message that failed to send as a draft (for cases when user didn't actively save the draft).

<!-- gh-comment-id:578048829 --> @d99kris commented on GitHub (Jan 24, 2020): I can see the issue too. In addition I guess it would be good for `nmail` to save the message that failed to send as a draft (for cases when user didn't actively save the draft).
Author
Owner

@d99kris commented on GitHub (Jan 27, 2020):

I've implemented a fix for this now, where nmail will ask user whether to save a message as draft whenever a message send fails. Please re-open / comment if you face any issues.

<!-- gh-comment-id:578741092 --> @d99kris commented on GitHub (Jan 27, 2020): I've implemented a fix for this now, where `nmail` will ask user whether to save a message as draft whenever a message send fails. Please re-open / comment if you face any issues.
Author
Owner

@Kabouik commented on GitHub (Jan 27, 2020):

Thanks, I will try it.

<!-- gh-comment-id:578746951 --> @Kabouik commented on GitHub (Jan 27, 2020): Thanks, I will try it.
Author
Owner

@Kabouik commented on GitHub (Jan 29, 2020):

The new prompt to save to drafts after a failure to send a message is nice. However, I am not sure if these are fetching issues, but if I try to send a pre-existing draft, fail to send it and save it, apparently it will save a duplicate (but it might now show up before I quit nmail and come back, just fetching didn't show it). Not an big issue and some users may actually expect this behavior in case of slight changes in the message, but it would be better to make the prompt unambiguous (i.e., "Failed to send the message, would you like to save it as a new draft?") and if the new draft could show up in the list immediately (but again, maybe just Internet connection issues on my end reflecting on fetching). In most cases, it would likely be best to just overwrite the original draft when saving, instead of creating duplicates.

By contrast, if I choose not to save the message after the failure, I can see in the drafts that the original draft is deleted too, which I didn't expect. Declining to save should not be considered the same as approval to discard something that was saved before. Actually, drafts should probably never be deleted unless successfully sent or manually deleted from the list by pressing d. Here too, I think the message was actually still in the drafts after I quit nmail and launched it again, so somehow these changes I described here are not mirrored to the server, at least not immediately.

<!-- gh-comment-id:579532176 --> @Kabouik commented on GitHub (Jan 29, 2020): The new prompt to save to drafts after a failure to send a message is nice. However, I am not sure if these are fetching issues, but if I try to send a pre-existing draft, fail to send it and save it, apparently it will save a duplicate (but it might now show up before I quit nmail and come back, just fetching didn't show it). Not an big issue and some users may actually expect this behavior in case of slight changes in the message, but it would be better to make the prompt unambiguous (*i.e.*, "Failed to send the message, would you like to save it as a **new** draft?") and if the new draft could show up in the list immediately (but again, maybe just Internet connection issues on my end reflecting on fetching). In most cases, it would likely be best to just overwrite the original draft when saving, instead of creating duplicates. By contrast, if I choose not to save the message after the failure, I can see in the drafts that the original draft is deleted too, which I didn't expect. Declining to save should not be considered the same as approval to discard something that was saved before. Actually, drafts should probably never be deleted unless successfully sent or manually deleted from the list by pressing `d`. Here too, I think the message was actually still in the drafts after I quit nmail and launched it again, so somehow these changes I described here are not mirrored to the server, at least not immediately.
Author
Owner

@d99kris commented on GitHub (Jan 29, 2020):

Let me re-open this issue and look into this.

<!-- gh-comment-id:579701915 --> @d99kris commented on GitHub (Jan 29, 2020): Let me re-open this issue and look into this.
Author
Owner

@d99kris commented on GitHub (Jan 29, 2020):

Firstly, thanks for the feedback! Without feedback improvements to nmail would not be possible.

I've changed the behaviour now, so that when a user trying to send an old draft the prompt will be Send message failed. Overwrite draft (y/n)?. If the user selects no, the old draft will be kept in the draft folder. If the user selects yes - like before - nmail will delete the previous draft and store the new one. I've added some code though, which should force nmail to refresh the drafts folder to hopefully avoid duplicates being shown.

When failing to send a new freshly composed email, the prompt will be Send message failed. Save draft (y/n)?.

Hopefully this addresses the issues. If not, please let me know. Thanks!

<!-- gh-comment-id:579715781 --> @d99kris commented on GitHub (Jan 29, 2020): Firstly, thanks for the feedback! Without feedback improvements to `nmail` would not be possible. I've changed the behaviour now, so that when a user trying to send an old draft the prompt will be `Send message failed. Overwrite draft (y/n)?`. If the user selects no, the old draft will be kept in the draft folder. If the user selects yes - like before - `nmail` will delete the previous draft and store the new one. I've added some code though, which should force `nmail` to refresh the drafts folder to hopefully avoid duplicates being shown. When failing to send a new freshly composed email, the prompt will be `Send message failed. Save draft (y/n)?`. Hopefully this addresses the issues. If not, please let me know. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nmail#18
No description provided.