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

Open first unread mailbox, otherwise any mailbox #4199

Open
dorsiflexion opened this issue Mar 18, 2024 · 1 comment
Open

Open first unread mailbox, otherwise any mailbox #4199

dorsiflexion opened this issue Mar 18, 2024 · 1 comment
Labels

Comments

@dorsiflexion
Copy link

How can one start neomutt in such a way, that it opens a mailbox with unread mail on start, and when there is no unread mail it opens any (or even better: a specified) mailbox?

I know of -Z that opens a mailbox with unread mail. But with this option, neomutt immediately exits when there is no new mail. -Zf "/some/mailbox" doesn't work either.

startup-hook 'exec next-unread-mailbox' doesn't work, probably because it's too early when this hook is executed.

A workaround is sh -c 'neomutt -Z || neomutt -f "/some/mailbox"'. But this calls neomutt twice, which will definitely and unnecessarily do some stuff twice, and it also forces one to start a shell, which is also unnecessary, making it pretty ugly.

@dorsiflexion dorsiflexion added the type:question Question label Mar 18, 2024
@roccoblues
Copy link
Member

Hi @dorsiflexion, that definitely sounds useful. I'm not aware of a way to do that in NeoMutt at the moment.

I see two ways to build this:

  1. Add a new CLI arg. Not sure if I like this. Adding CLI args for every new use-cases easily could lead to a mess. 😏
  2. Rethink our hooks. This is something @flatcap and me briefly discussed on IRC. We could add more hooks on clearly defined points (after initialize, after gui initialized, ...). This seems like a good use-case for it.

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

No branches or pull requests

2 participants