How do I create a new folder in Mutt

c (change-folder), ? (list), Shift+C (create-mailbox).


This works with Gmail but only in the single directory view, and not in the "all folders" view.

Also, if you want a space in the directory name, you need to escape it via Ctrl+V, Space.


If Mutt cannot create maildirs directly, it is easy to do it yourself. A "Maildir" format mail directory has nothing special except for three subdirectories cur/, new/ and tmp/ inside.

Assuming that your mail is kept under ~/mail/, a folder named "Something" would be created like:

  • For the Maildir++ layout used by Courier and Dovecot:

    mkdir -p ~/mail/.Something/{cur,new,tmp}
    

    (Note the leading dot – yes, this basically means subfolders are stored as hidden directories...)

    Equivalent to:

    mkdir ~/mail                    (implied by `-p`)
    mkdir ~/mail/.Something         (implied by `-p`)
    mkdir ~/mail/.Something/cur     (from brace expansion)
    mkdir ~/mail/.Something/new     (from brace expansion)
    mkdir ~/mail/.Something/tmp     (from brace expansion)
    
  • For the "filesystem" layout used by some other IMAP daemons:

    mkdir -p ~/mail/Something/{cur,new,tmp}
    

If you want a folder hierarchy "Archive" / "2010" / "06":

  • In Courier's layout, the folder would be named Archive.2010.06:

    mkdir -p ~/mail/.Archive.2010.06/{cur,new,tmp}
    
  • In the "filesystem" layout, it would be Archive/2010/06:

    mkdir -p ~/mail/Archive/2010/06/{cur,new,tmp}
    

(Terminology: mail clients keep messages in 'folders', and the filesystem stores everything in 'directories'.)


I usually just save some email to new not-yet-existing folder, and mutt creates the folder for me.

For me it's pretty intuitive, as there is no point in having folder without mails in it, so I just create it by saving there first mails that should go there.

Tags:

Mutt

Courier