[GH-ISSUE #38] [Enhancement] Compose offline #34

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

Originally created by @Kabouik on GitHub (Mar 11, 2020).
Original GitHub issue: https://github.com/d99kris/nmail/issues/38

Originally assigned to: @d99kris on GitHub.

nmail throws a warning when trying to compose an email offline, saying this is not supported. It would be useful to be able to compose drafts offline and send them later.

Originally created by @Kabouik on GitHub (Mar 11, 2020). Original GitHub issue: https://github.com/d99kris/nmail/issues/38 Originally assigned to: @d99kris on GitHub. `nmail` throws a warning when trying to compose an email offline, saying this is not supported. It would be useful to be able to compose drafts offline and send them later.
kerem closed this issue 2026-03-03 01:19:15 +03:00
Author
Owner

@d99kris commented on GitHub (Mar 19, 2020):

Yeah, currently nmail is dependent on IMAP storage for drafts. But I agree offline draft compose is a pretty normal/basic feature for email clients, so I'll see what can be done.

<!-- gh-comment-id:601249917 --> @d99kris commented on GitHub (Mar 19, 2020): Yeah, currently nmail is dependent on IMAP storage for drafts. But I agree offline draft compose is a pretty normal/basic feature for email clients, so I'll see what can be done.
Author
Owner

@d99kris commented on GitHub (Jan 12, 2021):

I've been considering this feature for a while and I'm currently leaning towards leaving it out of scope.

It would make nmail a lot more complex (as it was designed with different assumptions), and the benefits do not outweigh the amount of work, from my perspective. The simple workaround is to open ones favourite text editor and type the email text there while offline, for later proper compose and sending using nmail (or other email client).

I will proceed to close this issue for now.

<!-- gh-comment-id:758621492 --> @d99kris commented on GitHub (Jan 12, 2021): I've been considering this feature for a while and I'm currently leaning towards leaving it out of scope. It would make nmail a lot more complex (as it was designed with different assumptions), and the benefits do not outweigh the amount of work, from my perspective. The simple workaround is to open ones favourite text editor and type the email text there while offline, for later proper compose and sending using nmail (or other email client). I will proceed to close this issue for now.
Author
Owner

@d99kris commented on GitHub (Feb 15, 2021):

I've been considering this some more and I've come to the conclusion that basic offline compose can be implemented without a major re-design.

I will reopen this issue and update here once I have implemented something.

<!-- gh-comment-id:779211094 --> @d99kris commented on GitHub (Feb 15, 2021): I've been considering this some more and I've come to the conclusion that basic offline compose can be implemented without a major re-design. I will reopen this issue and update here once I have implemented something.
Author
Owner

@d99kris commented on GitHub (Feb 19, 2021):

Brief description of the offline compose functionality implemented in nmail:

If postponing a composed message while offline, the message will be saved in an offline draft queue, and will be automatically uploaded to the configured draft folder once reconnected to the IMAP server.

If sending a composed message while offline, the message will be saved in an offline outbox queue, and will be automatically attempted to be resent once online again.

While composing a message a backup copy is now stored every 10 seconds. If the computer shuts down (or nmail crashes) there is a backup of the composed email. When nmail starts up next time, it will upload that composed message to the draft folder.

<!-- gh-comment-id:782035022 --> @d99kris commented on GitHub (Feb 19, 2021): Brief description of the offline compose functionality implemented in `nmail`: If postponing a composed message while offline, the message will be saved in an offline draft queue, and will be automatically uploaded to the configured `draft` folder once reconnected to the IMAP server. If sending a composed message while offline, the message will be saved in an offline outbox queue, and will be automatically attempted to be resent once online again. While composing a message a backup copy is now stored every 10 seconds. If the computer shuts down (or nmail crashes) there is a backup of the composed email. When nmail starts up next time, it will upload that composed message to the `draft` folder.
Author
Owner

@Kabouik commented on GitHub (Feb 19, 2021):

That looks beautiful, thanks for adding this!

On 2021-02-19 13:07 Kristofer Berggren notifications@github.com wrote:

Brief description of the offline compose functionality implemented in nmail:

If postponing a composed message while offline, the message will be saved in an offline draft queue, and
will be automatically uploaded to the configured draft folder once reconnected to the IMAP server.

If sending a composed message while offline, the message will be saved in an offline outbox queue, and
will be automatically attempted to be resent once online again.

While composing a message a backup copy is now stored every 10 seconds. If the computer shuts down (or
nmail crashes) there is a backup of the composed email. When nmail starts up next time, it will upload
that composed message to the draft folder.

--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
https://github.com/d99kris/nmail/issues/38#issuecomment-782035022

<!-- gh-comment-id:782154200 --> @Kabouik commented on GitHub (Feb 19, 2021): That looks beautiful, thanks for adding this! On 2021-02-19 13:07 Kristofer Berggren <notifications@github.com> wrote: > Brief description of the offline compose functionality implemented in `nmail`: > > If postponing a composed message while offline, the message will be saved in an offline draft queue, and > will be automatically uploaded to the configured `draft` folder once reconnected to the IMAP server. > > If sending a composed message while offline, the message will be saved in an offline outbox queue, and > will be automatically attempted to be resent once online again. > > While composing a message a backup copy is now stored every 10 seconds. If the computer shuts down (or > nmail crashes) there is a backup of the composed email. When nmail starts up next time, it will upload > that composed message to the `draft` folder. > > -- > You are receiving this because you authored the thread. > Reply to this email directly or view it on GitHub: > https://github.com/d99kris/nmail/issues/38#issuecomment-782035022
Author
Owner

@Kabouik commented on GitHub (May 31, 2023):

Have you had any negative feedback about the auto-save and auto-send-when-back-online feature? I just worked on an email and my WiFi connection had expired when I tried to send it, so nmail failed to send it and failed to upload it to the IMAP drafts. However, I did find a nmail-conf/cache/offlinequeue/outbox/0.eml file and I made a backup of it before going back online, but the file is unreadable (mu view and mu extact say the file seems invalid), and it has disappeared from the above folder after nmail was back online, but I have nothing new in my drafts or sent emails, or any other subfolder of offlinequeue/. This is not the first time this kind of issue happens to me, so I'm wondering if the feature is actually working as expected.

So two questions:

  • why does mu say the file seems invalid (my cache is not encrypted)?
  • why does nmail fail to upload it to sent or drafts while other emails usually go there correctly, and while the recipient apparently received the email correctly?

EDIT: Sorry, I said the recipient had not received the message and you may have seen that in your email notification for this Github comment, but they sent me another message saying they did receive it. It just doesn't appear on my end.. It's weird because my Drafts and Sent IMAP folders are correct, since all other emails usually show there correctly.

<!-- gh-comment-id:1570423758 --> @Kabouik commented on GitHub (May 31, 2023): Have you had any negative feedback about the auto-save and auto-send-when-back-online feature? I just worked on an email and my WiFi connection had expired when I tried to send it, so nmail failed to send it and failed to upload it to the IMAP drafts. However, I did find a `nmail-conf/cache/offlinequeue/outbox/0.eml` file and I made a backup of it before going back online, but the file is unreadable (`mu view` and `mu extact` say the file seems invalid), and it has disappeared from the above folder after nmail was back online, but I have nothing new in my drafts or sent emails, or any other subfolder of `offlinequeue/`. This is not the first time this kind of issue happens to me, so I'm wondering if the feature is actually working as expected. So two questions: - why does `mu` say the file seems invalid (my cache is not encrypted)? - why does nmail fail to upload it to sent or drafts while other emails usually go there correctly, and while the recipient apparently received the email correctly? EDIT: Sorry, I said the recipient had not received the message and you may have seen that in your email notification for this Github comment, but they sent me another message saying they did receive it. It just doesn't appear on my end.. It's weird because my Drafts and Sent IMAP folders are correct, since all other emails usually show there correctly.
Author
Owner

@d99kris commented on GitHub (Jun 3, 2023):

Hi @Kabouik - for the questions:

  1. The offlinequeue encryption is controlled by the queue_encrypt flag in main.conf (and is enabled by default I think). So it may be enabled for you even though general message cache (cache_encrypt) is disabled.
  2. Interesting, I tried this here now and I can also reproduce this problem - it's must be a bug. I'll look into it.
<!-- gh-comment-id:1574645069 --> @d99kris commented on GitHub (Jun 3, 2023): Hi @Kabouik - for the questions: 1. The offlinequeue encryption is controlled by the `queue_encrypt` flag in `main.conf` (and is enabled by default I think). So it may be enabled for you even though general message cache (`cache_encrypt`) is disabled. 2. Interesting, I tried this here now and I can also reproduce this problem - it's must be a bug. I'll look into it.
Author
Owner

@d99kris commented on GitHub (Jun 3, 2023):

I reported a separate bug for this (see #140) and fixed it as well. Please let me know in case you encounter more issues.

<!-- gh-comment-id:1574657598 --> @d99kris commented on GitHub (Jun 3, 2023): I reported a separate bug for this (see #140) and fixed it as well. Please let me know in case you encounter more issues.
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#34
No description provided.