[GH-ISSUE #182] Add support for multiple instances #127

Closed
opened 2026-03-03 01:20:01 +03:00 by kerem · 2 comments
Owner

Originally created by @d99kris on GitHub (Oct 4, 2025).
Original GitHub issue: https://github.com/d99kris/nmail/issues/182

Originally assigned to: @d99kris on GitHub.

Discussed in https://github.com/d99kris/nmail/discussions/181

It is often desirable to be able to compose an email, and switching to viewing different emails for reference.

While it's possibly to use ctrl-o to postpone the current message, view other emails and then go to 'drafts' folder and use c to continue compose it, it involves many steps.

With this feature nmail will allow one main regular nmail instance (with read-write cache access) and any number of "shadow" instances (with read-only cache access).

Limitations:

  • Shadow instances with read-only cache access will not refresh OAuth2 tokens, thus one should avoid long-running shadow instances on OAuth2.
  • Only main instance will check nmail's "offline queue" (i.e. backup drafts on disk) during startup and upload to 'drafts' or send (if selected by user).
  • No filesystem locking protecting config file from being read by shadow instance (on startup) when main instance writes to it (on exit), if the shadow instance is started at the exact same time as main nmail exits. The probability of encountering this is very small, but to stay safe it's better to not exit and start nmail instances for the same profile/config dir at the exact same time.

Functionality:

  1. nmail shall accept a new command line argument -ro / --read-only to start a shadow instance with read-only cache access.
  2. User shall be able to create an empty file touch ~/.config/nmail/auto-ro.flag and if present, extra nmail instances shall automatically be started in shadow / read-only mode, when there is already a main instance running.

The "auto read-only" functionality should not be enabled by default, due to the current limitations listed above.

Originally created by @d99kris on GitHub (Oct 4, 2025). Original GitHub issue: https://github.com/d99kris/nmail/issues/182 Originally assigned to: @d99kris on GitHub. ### Discussed in https://github.com/d99kris/nmail/discussions/181 It is often desirable to be able to compose an email, and switching to viewing different emails for reference. While it's possibly to use `ctrl-o` to postpone the current message, view other emails and then go to 'drafts' folder and use `c` to continue compose it, it involves many steps. With this feature nmail will allow one main regular nmail instance (with read-write cache access) and any number of "shadow" instances (with read-only cache access). Limitations: - Shadow instances with read-only cache access will not refresh OAuth2 tokens, thus one should avoid long-running shadow instances on OAuth2. - Only main instance will check nmail's "offline queue" (i.e. backup drafts on disk) during startup and upload to 'drafts' or send (if selected by user). - No filesystem locking protecting config file from being read by shadow instance (on startup) when main instance writes to it (on exit), if the shadow instance is started at the exact same time as main nmail exits. The probability of encountering this is very small, but to stay safe it's better to not exit and start nmail instances for the same profile/config dir at the exact same time. Functionality: 1. `nmail` shall accept a new command line argument `-ro` / `--read-only` to start a shadow instance with read-only cache access. 2. User shall be able to create an empty file `touch ~/.config/nmail/auto-ro.flag` and if present, extra nmail instances shall automatically be started in shadow / read-only mode, when there is already a main instance running. The "auto read-only" functionality should not be enabled by default, due to the current limitations listed above.
kerem 2026-03-03 01:20:01 +03:00
Author
Owner

@d99kris commented on GitHub (Oct 4, 2025):

Support for multiple sessions has been added in above commit / v5.8.1. Shadow / read-only instances are indicated in the top-bar by a ~ to the right of the status. See attached screenshot for an example.
Image

<!-- gh-comment-id:3367912251 --> @d99kris commented on GitHub (Oct 4, 2025): Support for multiple sessions has been added in above commit / `v5.8.1`. Shadow / read-only instances are indicated in the top-bar by a `~` to the right of the status. See attached screenshot for an example. <img width="842" height="626" alt="Image" src="https://github.com/user-attachments/assets/cc3b16b1-d4ac-402b-b7bf-d8d15495bc18" />
Author
Owner

@Kabouik commented on GitHub (Oct 4, 2025):

Nice, thanks!

<!-- gh-comment-id:3368012936 --> @Kabouik commented on GitHub (Oct 4, 2025): Nice, 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#127
No description provided.