I'm writing a script to send mails from a mailbox on a remote server and a script to check if the mails are received at another remote server. For this I have configured mutt.

What I now need is to list all mails from the mailbox with a specified subject from the command line. I couldn't find a command option to list mails from cli so I think I have to configure mutt to use Maildir and grep files but I'm not sure if that's the best way to achieve my goal.


This is perfect use for notmuch or even neomutt virtual-mailboxes

  1. install notmuch
  2. notmuch setup
  3. notmuch new #needed everytime you fetch emails - ideal to hook after mail sync
  4. You're done, you can search, count or whatever you want to.


$ notmuch search subject:"[neomutt/neomutt] NeoMutt core dumps on F28 beta (#1126)"
thread:00000000000009f4   2018-04-21 [11/11] Suvayu Ali, Pietro Cerutti, Richard Russon; [neomutt/neomutt] NeoMutt core dumps on F28 beta (#1126) (Maillists)

$ notmuch count subject:"[neomutt/neomutt] NeoMutt core dumps on F28 beta (#1126)"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.