Add a Second Inbox to Your Gmail
Last week I finally gave up and ditched Apple Mail in favor of using Gmail all the time for both work and personal email. I had been managing my work email via IMAP, but with such a large inbox I was beginning to notice performance issues. It was time to switch. I set my Sitening mailbox to forward all incoming mail to my Gmail account and got back to work.
It's been a week now and so far I'm happy with the switch. My only complaint is the lack of separation between the two accounts I have living inside of Gmail. All of my work email is flagged with a "Sitening" label, but that's not enough. I'm picky. I hate having to mouse all the way down the left side of the page to click the label just to see my work email. Viewing my Sitening outbox is even more of a pain. I have to search for "from:tyler@sitening.com". That's way too much effort. In lieu of an official Google one-click solution, I decided to fix the problem myself with Greasemonkey and a little javascript.
My goal was to add two new buttons to the top of my Gmail inbox. One to view my Sitening inbox and another to view my outbox. I won't go into all the gory details of how I accomplished this (you can view the source if you'd like), but I will give a high level overview:
- Create two buttons and insert them into the HTML where appropriate
- Attach a click event to each one that
- Fills in the Gmail search box
- "Clicks" the search button
It worked great. Here are a few screenshots showing my new inbox in action.
Before:

After:

You can see that I've added an extra two buttons that let me easily switch from one inbox to another. Also, I cleaned up the HTML a little bit so that instead of showing ugly search results like this:

I get a nice, clean title like this:

If you'd like to add this feature to your own Gmail account you'll need to be using Firefox and have the Greasemonkey extension installed. Then, just click this link to install. You'll need to edit the script to match your email address. (Instructions are included in the script.)
posted by /
Tyler Hall
posted on /
11/20/2006
- categories /
- Firefox
- JavaScript
- Just for Fun
- Productivity
comments /
34
Great script. I had a label that did the same thing basically but like you said this does it a little better. How would I change the script to only show the unread messages in the work mailbox? Thanks
david
11/21/06
09:44 am
You can change the script to search for "label:YourLabelName is:unread". That should do the trick for ya.
Tyler Hall
11/21/06
12:24 pm
[...] you can see screenshots and download the script at tyler’s site: sitening blog The Editor posted the above blurb 3:22 pm in: Look and Feel Tools , Firefox Only [...]
Gmail.pro, News, Tools, Gmail Hacks and more for Gmail Junkies or Gmail Professional types » Blog Archive » Add a Second Inbox to Gmail
11/22/06
10:23 am
[...] VÃa | Lifehacker. Más información | Sitening. Script. [...]
Consigue dos bandejas de entrada en Gmail
11/22/06
11:33 am
[...] Ho trovato un bellissimo post sul blog Sitening che descrive come unendo Greasmonkey, uno script js fornito e le labels di Gmail potete facilmente forwardare le mail da un indirizzo esterno al vostro indirizzo GMail e accederci facilmente. L’ho provato e funziona, ora nella mia casella GMail c’ho tutte le mail del lavoro, e passo da un insieme all’altro tramite un tasto. [...]
Il Nissardo, chez Andrea » Blog Archive » Unire due mailbox in un unico account GMail (solo con Firefox)
11/22/06
12:09 pm
Why won't this work for me. I've edited the scrpt, adding my labels and email address, but get the message "No messages matched your search. You can broaden your search to include spam and deleted items" in my new inbox and the "ugly" search results, not the nice clean title. Have I missed something?
Chris Proudlove
11/22/06
04:05 pm
Sorry, I don't know why it's not working for you, Chris. It's a hard problem to debug without being able to see your inbox.
Tyler Hall
11/22/06
07:07 pm
[...] Add a Second Inbox to Your Gmail adds a link to your second addresses’ “inbox” and sent mail in the upper bar of the Gmail interface. When clicked, you can see a search of all messages to and from the specified alternate address (tags: GMail Greasemonkey) [...]
All in a days work…
11/22/06
10:18 pm
Tyler - I installed the script and edited it. The buttons appear perfectly. But when I press them, all they do is fill in the relevant string into the search box - but does not actually execute the search. Pls help. (Am relatively new to editing scripts). Many thanks,
Mali
11/23/06
09:37 am
[...] http://www.sitening.com/blog/2006/11/20/add-a-second-inbox-to-your-gmail/ [...]
Double up Gmail « 0ddn1x: tricks with *nix
11/23/06
11:30 am
[...] Here’s a Greasemonkey script to add a second inbox to your Gmail account- useful if you are like me and forward work email through Gmail. Tags [...]
-willrodes.com/blog- better than Playstation 3 » Second Inbox
11/23/06
11:40 am
[...] Add a second Gmail inbox with Greasemonkey November 22nd, 2006 by Lifehacker Gmail user Tyler Hall started forwarding all his work email to his personal Gmail account and wanted an easy way to view his work inbox and sent mail. So he whipped up a useful Greasemonkey user script called Work Buttons to do just that. Basically the script adds a link to your second addresses' "inbox" and sent mail in the upper bar of the Gmail interface. When clicked, you can see a search of all messages to and from the specified alternate address. To get this working yourself you have to download the script, and add your second address and label. I set it up for Lifehacker's tips email and my personal address and it worked like a charm. The Work Buttons user script is a free download which requires Firefox and the Greasemonkey extension to run. Thanks, Jon! — Gina Trapani Add a Second Inbox to Your Gmail [Sitening] [...]
Kolz Blog » Blog Archive » Add a second Gmail inbox with Greasemonkey
11/23/06
12:12 pm
[...] Sitening Blog : Blog Archive : Add a Second Inbox to Your Gmail - Nashville SEO (Search Engine Optimization) and Web Design (tags: google gmail hacks 2do) [...]
links for 2006-11-24 « Sanjeev.NET
11/23/06
11:23 pm
Thanks, this is the first time I ever tried Greasemonkey & installing a script, and this works great! Nice work.
leslie
11/24/06
03:40 pm
Mali - I had the same problem. My label had spaces in it. Replace the spaces in the script with hyphens, if you have spaces.
tim
11/24/06
09:45 pm
does this hack require that you still forward from one gmail acct to another (and then just automate searching), or does it actually view the inbox of another acct you own? -g
gooroov
11/25/06
04:10 am
[...] Basically the script adds a link to your second addresses’ “inbox” and sent mail in the upper bar of the Gmail interface. When clicked, you can see a search of all messages to and from the specified alternate address. To get this working yourself you have to download the script, and add your second address and label. I set it up for Lifehacker’s tips email and my personal address and it worked like a charm. The Work Buttons user script is a free download which requires Firefox and the Greasemonkey extension to run. Thanks, Jon! — Gina Trapani Add a Second Inbox to Your Gmail [Sitening] [...]
Add a second Gmail inbox with Greasemonkey « Paul´s Blog
11/26/06
12:49 pm
[...] Add a Second Inbox to Your Gmail (tags: gmail howto) [...]
fonolog.com » Blog Archive » links for 2006-11-26
11/26/06
06:21 pm
Hi! Why I can't fill my info in profile? Can somebody help me? My login is Kisakookoo!
Kisakookoo
01/23/07
01:18 pm
[...] (0.5, I’m assuming you’re already doing this) install Firefox and upgrade your life (1) install greasemonkey for firefox (2) install this greasemonkey script (details) (3) edit the js (javascript) by going to Tools > Greasemonkey > Manage User Scripts in Firefox. You’ll open the script up with textedit (Mac) or notepad (PC) and follow the directions. (4) launch gmail. You’ll have a button at the top assigned to your work inbox. [...]
gmail - ultimate utilization of resources at avclub.us / ken wilson
03/07/07
11:15 am
[...] 1/ install the greasemonkey script for adding a second inbox written by Tyler Hall [...]
d. otted rhythm » Blog Archive » hkusua inbox, sitting in your gmail!
03/09/07
06:23 am
I'm going to echo this question... "does this hack require that you still forward from one gmail acct to another (and then just automate searching), or does it actually view the inbox of another acct you own?" I have no experience with Greasemonkey--I'm just learning--but I imagine that you would HAVE to forward all your work email to your personal account and tag it with a certain label for this script to work, right?
N.T.
04/09/07
03:16 pm
It still relies on you forwarding a second email address to your Gmail account and tagging those emails as such. It automates the search process. You may want to check into Gmail's new POP3 checking feature. You can configure it to pull email from your other accounts automatically.
Tyler Hall
04/09/07
03:29 pm
Hi thanks for the great script...works fine with my G.Monk..., is it possible to get a third inbox? i tried coping and pasting the script in the editor with few parrameters changed reflecting my third gmail a/c..., The buttons show when i reloaded but when i press them, my third gmail a/ct comes into play. even when iam pressing the second a/c buttons,it doesnt show up ....only the third a/c settings defaults....is there a way that we can get my third a/c to get displayed?
Venki Das
04/17/07
02:36 am
Yea, I need way more than three inboxes.. How do I do this?
tdog
08/29/07
01:40 pm
I installed Greasemonkey I clicked on the link to add the buttons. I have new buttons Where the heck is the script to modify? Thanks Mish
mike Shedlock
10/11/07
10:27 pm
Got it all figured out. Tool Edit greasemonkey select an editor Then I had to change this line in the script document.getElementById("s").firstChild.value = LabelName; It used to say "Label" + LabelName If anyone else is having problems not finding anaything Remove the "Label" + from that line I am working now Mish
mike Shedlock
10/11/07
11:35 pm
[...] Add a second inbox to your Gmail account - Quickly and easily toggle between Gmail inboxes. Perfect for those with a business and personal email accounts at Gmail. [...]
25 Firefox Extensions to Make You More Productive
02/10/08
09:28 pm
[...] Add a Second Inbox to Your Gmail - Sitening Blog - Nashville SEO (Search Engine Optimization) and We... (tags: Firefox Gmail) [...]
links for 2008-02-11 « ??????
02/11/08
05:30 pm
[...] Add a Second Inbox to Your Gmail - Sitening Blog - Nashville SEO (Search Engine Optimization) and We... (tags: email firefox gmail lifehack tech) [...]
links for 2008-02-12 « J.Uma Shankar Ladha
02/11/08
09:17 pm
[...] Add a second inbox to your Gmail account [...]
25 Extensiones de Firefox para ser más productivo
02/13/08
07:39 am
[...] Add a second inbox to your Gmail account - Quickly and easily toggle between Gmail inboxes. Perfect for those with a business and personal email accounts at Gmail. [...]
TheWebMirror.com | 25 Firefox Extensions to Make You More Productive
04/14/08
09:44 am
useless - no instruction are with the script!!!! directions pls!!!!
Zee
06/21/08
04:00 am