Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Snoozing messages #225

Open
Fell opened this issue Oct 14, 2024 · 3 comments
Open

Feature request: Snoozing messages #225

Fell opened this issue Oct 14, 2024 · 3 comments

Comments

@Fell
Copy link

Fell commented Oct 14, 2024

Some mail providers allow you to "snooze" a message for a given time. The message will be removed from your Inbox, and re-appear as an unread message at the time you specified.

Before switching to Mox, I used a script similar to Dovecot Snooze for this purpose, which ran as a simple cronjob.

I think the implementation is simple, yet effective. A special Snooze folder is created, and with it a set of subfolders like Snooze.Until Friday 18:00. At the mentioned time, all messages within that folder will be moved to Inbox and marked as unread. Mail clients will generally trigger a new message notification when this happens.

Discussion questions:

  • Are other users interested in such a feature?
  • How could this be implemented in Mox?
    • Hidden implementation: The folders are created by the user and Mox does its best to parse the folder labels and tries to act accordingly.
    • Using Admin UI: Times can be configured in the Admin UI and folders are managed automatically.
    • Static implementation: The feature can only be enabled/disabled and only a hardcoded set of folders is exposed to the user.
  • Are there any existing standards or RFCs we could utilise here?

I consider this a low priority/nice to have feature, but I find it very useful and I wanted to mention it.

What do you think?

@mjl-
Copy link
Owner

mjl- commented Oct 18, 2024

Sounds reasonable, and indeed it is functionality provided by other mail clients/systems.

There is an expired internet-draft about a snooze extension to IMAP and JMAP. A quick skim makes me think the expected implementation is also to move a message to temporary snooze mailbox (or perhaps a hierarchy within a snooze mailbox), with the messages being moved back when the timer expires. The IMAP extension would make it possible to set desired end date/time. But clients won't support it. Your approach of moving a message to a mailbox with the name of a schedule seems like a good way to make it work with any existing client. The webmail client could get its own functionality.

I think the new implementation concept for mox would be the timer that activates at the end of the snooze time, to move the message back. It won't be too complicated to implement. But does mean mox should probably parse all account message index database files, and schedule a timer for the first message to expire, or keep info about the earliest snooze deadline for each account in a single database file it opens at startup (this latter option seems better).

It may also be possible to use labels/tags/flags to trigger snooze functionality: setting a flag like "snooze:2 days" on a message would add the flag, and also move the message to the snooze folder (and perhaps clear the snooze label immediately, or when it is moved out of the snooze folder). However, there will be clients (like Thunderbird) that don't use the IMAP flags/labels/tags directly, they create flags like "$label1" and only use the human-entered title within the mail client (so mox can't see and act on it).

I won't have time to work on this any time soon, but I can give pointers to anyone interested in implementing it.

@Fell
Copy link
Author

Fell commented Oct 18, 2024

Thank you for consideration. I fully understand there are probably more important things right now.

Thinking about it again: Mox already executes "special behavior" when messages are moved to the Junk folder, doesn't it? It shouldn't bee too hard to implement, then. I might have some more time early next year, so I may have a Go at it then.

@mjl-
Copy link
Owner

mjl- commented Oct 31, 2024

Thinking about it again: Mox already executes "special behavior" when messages are moved to the Junk folder, doesn't it?

Correct. And also for a few other mailboxes (configurable). See https://github.com/search?q=repo%3Amjl-%2Fmox%20JunkFlagsForMailbox&type=code. The difference is that the snooze functionality requires a timer, to make changes later on. The junk/notjunk flags action can be taken immediately. But indeed the snooze functionality may have to be triggered at the same kind of places (in the code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants