I'm using a bunch of mailboxes in mutt which are populated by imapfilter. To avoid manual reconfiguration (by going to the folder list and pressing s at every new entry), I'd like to configure mutt to simply subscribe to all IMAP folders except sent, trash and postponed on startup. Is this possible without having to generate the configuration file?


The imap_list_subscribed option may give you what you want, albeit in a roundabout way. From the documentation:

This variable configures whether IMAP folder browsing will look for only subscribed folders or all folders. This can be toggled in the IMAP browser with the function.

If set to no (the default), it will not check subscription status and will instead display all folders on the server (all of those returned by a LIST command).

If you're not happy with that and want the folders to be subscribed to as well, a better approach may be to script a CLI tool (much like you use imapfilter). The easiest may be curl, which supports raw IMAP commands. Simply fetch a list of folders (using LIST) and then subscribe to them (SUBSCRIBE).

| improve this answer | |

There is an option called imap_check_subscribed which you can set in your .muttrc. If this option is set, mutt will fetch set of subscribed folders from the IMAP server on connection.

| improve this answer | |
  • 1
    -1 That is not a solution to the given problem. I am already using this option. – l0b0 Aug 31 '11 at 9:18
  • 1
    Then I'm afraid I misunderstood your question, sorry. – Petr Uzel Aug 31 '11 at 9:25

So if I understand you correctly, you don't want to have to edit the config but apply configuration changes that normally would be in the config right?

Have you tried running the configure script with the --enable-imap flag?

If Mutt is compiled with IMAP support (by running the configure script with the --enable-imap flag), it has the ability to work with folders located on a remote IMAP server.

You can access the remote inbox by selecting the folder {imapserver}inbox, where imapserver is the name of the IMAP server and inbox is the special name for your spool mailbox on the IMAP server. If you want to access another mail folder at the IMAP server, you should use regular expressions in combination with the {imapserver}path/to/folder where path/to/folder is the path of the folder you want to access relative to your home directory.

Also, fetchmail is a more stable way to access your IMAP folders.

| improve this answer | |
  • Which configure script do you mean? – l0b0 Feb 15 '19 at 19:35
  • Good Question. What I am referring to is Installing Mutt manually and precompiled with the --enable-imap flag. Something like... 1. Find and download the source. 2. After downloading the source code and compiling or the pre-compiled package, extract it into a working directory using the tar command: tar -zxvf mutt-x.x.x.tar.gz 3. Change to the newly created directory: cd mutt- 26 4. Run the configure script to build the necessary files for compiling Mutt on your system: ./configure make install – Jesus Muhammad Christ Feb 15 '19 at 19:45
  • Mutt is compiled by default with IMAP support. I'm asking about something several levels removed: how to subscribe to IMAP folders on startup. – l0b0 Feb 15 '19 at 19:55
  • True, but the features I think you wanted are only available when you compile it yourself. Sorry, if it's not very helpful though. I am sure you are frustrated with it. I am not a big fan of MUTT. :-) – Jesus Muhammad Christ Feb 15 '19 at 19:58
  • Mutt had IMAP enabled by default back in 2002 when I first used it; I really cannot believe that it doesn't have IMAP by default in 2019. Do you have a reference for that? – l0b0 Feb 15 '19 at 21:41

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.