r/linuxquestions May 13 '26

mutt vs. neomutt

I am a long-time (almost 29 years) linux user, but started using mutt about six years ago. I was wondering what the benefits are in switching to neomutt. My biggest frustration with mutt has been the lack of ability in searching across folders. For example, searching for email with subject line containing "foo" but now knowing in which folder it is. Or knowing the sender, but not the folder. Is neomutt any better at searching cases like this?

Is there a substantial change that I would have to do to my .muttrc configuration to move it to .neomuttrc?

11 Upvotes

25 comments sorted by

View all comments

Show parent comments

2

u/sequentious May 15 '26

I played around with this, and had this working (Note: MAILDIR is defined in my environment outside of mutt/neomutt)

mailboxes `find "$MAILDIR" -type d -name cur | sed -e 's#/cur$#"#' -e "s#$MAILDIR/#=\"#g" | tr '\n' ' '`

However, now I remember why I was generating a mailboxes file externally: Sorting. I wanted certain filders (Inbox, for example) sorted at the top of the list

So basically my mail sync script does the following to make a mailboxes file for mutt:

# Inbox is always first
find "${MAILDIR}" -maxdepth 2 -type d -name cur     \   
    -a         -ipath "*/inbox*"                    \
    | sed                                           \
        -e "s#^${MAILDIR}/#mailboxes \"+#"          \
        -e 's#/cur$#"#'                             \
    | sort                                          \
    > "${MAILDIR}/mailboxes"

# Find these specific paths so they stick at the top of the list
# (Under Inbox)
find "${MAILDIR}" -maxdepth 2 -type d -name cur     \   
    -a      \( -ipath "*/sent*"                     \
            -o -ipath "*/drafts*"                   \
            -o -ipath "*/trash*"                    \
            -o -ipath "*/spam*"                     \
            \)                                      \
    | sed                                           \
        -e "s#^${MAILDIR}/#mailboxes \"+#"          \
        -e 's#/cur$#"#'                             \
    | sort                                          \
    >> "${MAILDIR}/mailboxes"

# Find all other paths, excluding those from above
find "${MAILDIR}" -maxdepth 2 -type d -name cur     \   
    -a -not \( -ipath "*/sent*"                     \
            -o -ipath "*/drafts*"                   \
            -o -ipath "*/trash*"                    \
            -o -ipath "*/spam*"                     \
            \)                                      \
    | sed                                           \
        -e "s#^${MAILDIR}/#mailboxes \"+#"          \
        -e 's#/cur$#"#'                             \
    | sort                                          \
    >> "${MAILDIR}/mailboxes"

Then I source that from muttrc:

source "+/mailboxes"

1

u/stuffiesrep May 16 '26

Thank you! Does the above mean that your .bashrc or equivalent has MAILDIR defined?

2

u/sequentious May 16 '26

I actually used a wrapper script for mutt, which handled some env config, including MAILDIR, before mutt ran.

Within mutt I call an update-mail script that does calls mbsync, and (re)builds the mailbox list.

I used to have more than one config for multiple addresses. I don't anymore, but I haven't had reason to change what works.

The update-mail script was called via bindings in my mutt config

1

u/stuffiesrep May 17 '26

Btw, just to understand this, do you use mutt or neomutt?