How to set up Gmail Mutt and OfflineIMAP with multiple accounts part 1

This shall be an in depth look at how to set gmail with mutt and offlineimap using multiple gmail accounts.

This first part is a statement of the problem and how to set up gmail.

Part 1: Gmail
Part 2: offlineIMAP
Part 3: mutt

The Scenario

I have three gmail accounts I want to work with. First is my school account. My school recently set up gmail for all the students which is where the official college correspondence goes. I also have an email account with my academic department. I am forwarding this email to my schools gmail account. They use an alias rather than the typical it looks like; so let’s refer to this account as

At the moment, POP and IMAP do not work with this account and I want to use mutt to work with my email so I forward everything to another gmail account where I also receive personal email. Let’s call this account

Lastly, I have a third account which I use for internet things. As in, I use this account when I sign up for a forum or use online stores or sign up for wordpress :) and that sort of thing. Let’s call this account

Setting up GMail

Since I’m going to be receiving my school email at my personal account, I will prepare my personal account to receive this email cleanly. Logging in to my account I’ll go to settings then labels and make a new label called school. I want everything going to my school account to have this label. In mutt, these labels will show up as independant folders or mailboxes. So with my school label created, in settings I now select filters and make a new filter. I want anything going to to go to my school label so I type in that email in the “To” field click next and apply label: school. Since my departmental email is addressed to something like I’ll apply a similar filter to also go to school or maybe a new phyiscs label. If you want all your email to stay in one pile, then you should just ignore the above instructions and everything will stay together in the inbox.

Now, I’m ready to send my email to

In my account, I go to settings then Forwarding/POP/IMAP. Here, I select forward a copy to and keep gmail’s copy in the inbox, as gmail says: so much storage, never delete another email again.

Now, I’m going to go back to my and set up the ability to send from different addresses. Specifically, since mail from 3 different accounts will be arriving in, I want to be able to send and reply using each of them. In, under settings->accounts I’ll add an email address that I own. I’ll type in and send the verification email. Now, I’ll be able to check to make sure that the email is forwarded correctly and the label is applied correctly. I’ll do this for my account as well.

My account doesn’t require any special work. Obviously, you can make labels as you see fit.

Though I think it may be enabled by default, the last thing that needs to be done is to enable IMAP under my accounts: and Since I’ve forwarded all my school mail to personal I don’t need to enable IMAP under that account. To turn on IMAP I go to settings Forwarding/POP/IMAP and select enable IMAP

Next post will be on how to set up offlineIMAP

Tags: , , , ,

2 Responses to “How to set up Gmail Mutt and OfflineIMAP with multiple accounts part 1”

  1. Yohan Says:

    I have been using gmail for quite a long time now(couple of years). Now it has thousands of emails. I ran offlineimap once and it tries to sync emails from the very begining. Is there a way that I can tell offlineimap to sync emails form last moth, or from last two weeks.. like that?..Thank you in advance.

  2. Using Mutt with Gmail (1) « 0ddn1x: tricks with *nix Says:

    […] Leave a Comment TrackBack URI […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: