My mail provider (Fastmail) puts the folders I define in the webinterface inside the INBOX. Thus when I sync them using mbsync I obtain the following:

 - .Drafts
 - .Foobar

But I would prefer having them one level above and parallel to the INBOX:


How can I achieve this? I've tried the Flatten option but then I still have a INBOX. prefixed to every folder and I loose the hierarchy for subfolders:


I could define a channel/renaming rule for every folder but there must be an easier way to do this.

3 Answers 3


I actually found it out by myself. The rule must be:

Channel movetoroot
  Master :remote:INBOX/
  Slave :local:
  Patterns * !INBOX

mbbb's answer lets you pull down a bunch of mailboxes and just strip the INBOX/ leader. This is nice, but something else you might want to do is download a single mailbox and totally rename it. This is how you can rename your sent mail to something more UNIX-friendly:

Channel          fmails
Master           :fmimap:INBOX/"Sent Items"
Slave            :fmmaildir:sent

Excerpt from my online notes (re: Fastmail):

Another subtlety, for some email clients, you may not like how the standard folders are nested under INBOX. Then, use port 992, rather than 993. This is briefly mentioned here, Server names and ports | FastMail, and more at length at Alternate namespace IMAP port (may help Outlook, OL Express, Apple Mail and BIS users) | FastMail Blog.

In other words, use port 992 instead of 993, so that folders come in flat. (Correspondingly, ports 142 instead of 143, if not using SSL.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .