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.)



November 21st, 2006 at 9:44 am
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
November 21st, 2006 at 12:24 pm
You can change the script to search for “label:YourLabelName is:unread”. That should do the trick for ya.
November 22nd, 2006 at 10:23 am
[...] 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 [...]
November 22nd, 2006 at 11:33 am
[...] VÃa | Lifehacker. Más información | Sitening. Script. [...]
November 22nd, 2006 at 12:09 pm
[...] 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. [...]
November 22nd, 2006 at 4:05 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?
November 22nd, 2006 at 7:07 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.
November 22nd, 2006 at 10:18 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) [...]
November 23rd, 2006 at 9:37 am
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,
November 23rd, 2006 at 11:30 am
[...] http://www.sitening.com/blog/2006/11/20/add-a-second-inbox-to-your-gmail/ [...]
November 23rd, 2006 at 11:40 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 [...]
November 23rd, 2006 at 12:12 pm
[...] 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] [...]
November 23rd, 2006 at 11:23 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) [...]
November 24th, 2006 at 3:40 pm
Thanks, this is the first time I ever tried Greasemonkey & installing a script, and this works great! Nice work.
November 24th, 2006 at 9:45 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.
November 25th, 2006 at 4:10 am
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
November 26th, 2006 at 12:49 pm
[...] 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] [...]
November 26th, 2006 at 6:21 pm
[...] Add a Second Inbox to Your Gmail (tags: gmail howto) [...]
January 23rd, 2007 at 1:18 pm
Hi! Why I can’t fill my info in profile? Can somebody help me?
My login is Kisakookoo!
March 7th, 2007 at 11:15 am
[...] (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. [...]
March 9th, 2007 at 6:23 am
[...] 1/ install the greasemonkey script for adding a second inbox written by Tyler Hall [...]
April 9th, 2007 at 3:16 pm
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?
April 9th, 2007 at 3:29 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.
April 17th, 2007 at 2:36 am
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?
August 29th, 2007 at 1:40 pm
Yea, I need way more than three inboxes.. How do I do this?
October 11th, 2007 at 10:27 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
October 11th, 2007 at 10:56 pm
I found the script to modify but it is protected.
Thanks
Mish
October 11th, 2007 at 11:35 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
February 10th, 2008 at 9:28 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. [...]
February 11th, 2008 at 5:30 pm
[...] Add a Second Inbox to Your Gmail - Sitening Blog - Nashville SEO (Search Engine Optimization) and We… (tags: Firefox Gmail) [...]
February 11th, 2008 at 9:17 pm
[...] Add a Second Inbox to Your Gmail - Sitening Blog - Nashville SEO (Search Engine Optimization) and We… (tags: email firefox gmail lifehack tech) [...]
February 13th, 2008 at 7:39 am
[...] Add a second inbox to your Gmail account [...]
April 14th, 2008 at 9:44 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. [...]