New email trigger not working

The new email trigger (new-email=exec ) doesn't execute commands. (:exec directly in aerc does work)

Edwin Vigneau
Assigned to
10 months ago
8 months ago
bug imap

~jeffas 10 months ago

What backend are you using by chance?

Edwin Vigneau 10 months ago

What do you mean by backend? I'm using arch linux and bash.

~sircmpwn 10 months ago

Mail backend. IMAP, notmuch, and maildir are your options.

Edwin Vigneau 10 months ago

IMAP (Gmail)

~sghctoma 8 months ago

I've also run into this problem, and did some digging. There are two conditions for executing the new mail trigger (lib/msgstore.go@193):

  • the \Seen flag must no be set
  • the \Recent flag must be set

From what I've seen, GMail does not set the \Recent flag on any messages. I've logged out of all my clients (so that they don't unset the flag), sent myself a mail, and sent SELECT commands via socat; the RECENT count was always zero. I don't know if this is a bug in Gmail, or their IMAP implementation still does not support the \Recent flag, but this explains the lack of trigger execution.

I also have a question regarding new mail triggers: Was that a design decision that new mail triggers are only executed on messages arriving to the currently selected folder, or does it work this way because of some technical difficulty, performance reasons, etc.? I think this might be confusing and can be perceived as "not working".

Register here or Log in to comment, or comment via email.