Showing posts with label gmail. Show all posts
Showing posts with label gmail. Show all posts

Sunday, January 08, 2012

Efficient Gmail with OS X Mail.app

1000 Cranes - one by one effortGreetings and Happy New Year. I am using Mail.app on OS X Lion, to retrieve mail in my Google Apps for Business Gmail account, and I wanted to blog about my setup, because I think it is relatively efficient and might help others. My goals are:

  • To keep my inbox small, to allow Mail.app to perform well. This goes for any mailer, really. The larger the mail store, the slower it will get.
  • To keep minimize network traffic and keep round trip copying up and down to Gmail, to a minimum.
  • To be able to have a backup of mail just in case, outside the mail client.

My Formula for Mail.app Gmail Efficiency

Here is what I am doing:

To minimize network traffic, in GMail settings, I uncheck the "Show in IMAP" setting for the All Mail label, so that it does not copy down to Mail.app. If a message comes into Gmail, and this is turned on, it will download twice - to the Inbox folder and to the All Mail folder. Gmail does not store in folders, but rather works with labels, so there is some strangeness in interaction with typical IMAP clients as a result.

To keep the size of the local Inbox small, I am Archiving mail. Archiving mail in Gmail means to remove its Inbox label. It is important to note that when you Archive mail in Gmail, it just makes it disappear from the Inbox, but it is still present in All Mail.

To Archive inside the Gmail web GUI, select or open the mail, then -

  • … press "e" on the keyboard (see other keyboard shortcuts for Gmail). Or,
  • … click the Archive button on the toolbar (looks like a box with a downward-facing arrow).

There is an Archive button in Mail.app, and what this does is to move the selected mail into an Archive IMAP folder, which will be synced up to Gmail. To Archive mail using Mail.app, select or open the mail in Mail.app, then -

  1. … press Ctrl-⌘-A to Archive it.
  2. Confirm the email is present in the local "Archive" IMAP folder, which should be present in your Gmail folder list (in Mail.app, scroll down, in the left-hand folder list to find it).
  3. In Gmail, once the email is copied up and synced, select the mail or mails and click the "Remove Label" button, or, press "y" on the keyboard. Use Mail.app menu Window, Activity to confirm the sync, and, observe the labels in Gmail. At first, you will still see all the mails in the Archive label marked with an Inbox label as well, but, as they are synced up, these will be removed. Once it settles down, you can Remove the Label.

Why do it this way, taking more steps? I do this because it is easier to search and select in Mail.app, than it is in Gmail. You can search on a date range in Gmail, but it is a bit fiddly.

To keep a backup of mail, just in case, I use the excellent MailSteward utility. This lets me automatically keep a database of all my mail, which I can then periodically offload to DVD, Amazon S3 or Dropbox.

Bonus Tip

If you are happy deleting unneeded mail in Gmail and not Mail.app, then you can uncheck "Move deleted messages to the Trash Mailbox" in preferences (Mail.app, Preferences, Select Account, "Mailbox Behaviors"). This way, when you delete on Mail.app, the mail is removed from the Inbox on your local system, but, only the Inbox label is removed from the message up in Gmail. You would then have to go to Gmail and delete what you want to delete.

I hope these tips help someone.

Wednesday, December 10, 2008

Google Labs Adds Task List to GMail

Google Labs Adds Task ListWow, Google Labs just keeps adding and adding functionality to the Google stable of apps. Now you can have a task list in your GMail or Google Apps Premier Mail, made from the incoming mails you indicate.

How to Enable Your GMail Task List

You can enable the GMail or "GAPE" Mail Task List by visiting the Google Labs tab in your GMail settings, and enabling Tasks.

  1. Enable your Labs Tab if you have not already.
  2. Visit the Labs tab and Enable Tasks, per the screenshot in this article.

That's it. You can now check-select any mail item, choose Actions, and convert the mail into a Task. The Task list is accessible by the keyboard shortcut "gk".

The GMail task list is not uber-sophisticated, but it is functional. If you don't use something like OmniFocus, this might be your tool. Enjoy!

Saturday, November 29, 2008

HTML Signatures in GMail from BlankCanvas

HTML Signatures in GMail - from Blank CanvasI found a very useful Firefox plugin from "Blank Canvas", that enables your GMail to have HTML signatures. Because it is a Firefox plugin, I thought it might work in Flock, and sure enough, it does. Once you install it from this page on Blank Canvas' site, and restart your browser, you can create your signature in GMail's Compose window. This had been a GreaseMonkey script but the author converted it to a Firefox plugin. Thank you, Blank Canvas for a very useful tool.



Tuesday, October 28, 2008

New Google Gadgetry in Gmail

New Google Labs Features - Google Calendar and Docs or other Gadgets in GmailYou might have noticed a couple of new Google Labs features available in Gmail. If you have your Google Labs tab enabled, you can go there, scroll to the bottom, and check the new Google Gadget-related features out. Now you can get a Calendar view or a Docs view via Gadgets right within your Gmail, or specify any Gadget URL as well. Google moves so fast sometimes it is hard to keep up. Nice to have the new features, though!

Friday, October 17, 2008

Enabling Labs Tab in Gmail

If you would like to use some of the Google Labs features in Gmail but cannot find the Labs tab, you can enable it by visiting the following URL after you log in:

https://mail.google.com/mail/?labs=1#settings/labs

Now you can just click the Labs tab and start selecting the Labs features you want, like "Advanced IMAP Controls" to avoid downloading the entire All Mail folder. Gmail will remember you want the Labs tab for next time.

Sunday, October 12, 2008

Save Local Disk with Gmail "Advanced IMAP Controls"

Google Labs GMail Advanced IMAP ControlsI outlined "Setting up Leopard Mail.app with Google Gmail IMAP" previously, and Google Labs has released a new feature for regular and Google Applications Premier Edition Gmail - Advanced IMAP Controls. This tip shows you how to avoid having to sync the GMail "All Mail" folder, thus saving a considerable amount of local hard disk space in many cases. Before enabling Google Labs features, note the caveat mentioned by Google on this FAQ.

Google Labs - Configuring Gmail IMAP Folder SyncingAt any rate, here's how to enable Advanced IMAP Controls:

  1. Close Mail.app.
  2. In Gmail settings, Labs tab, turn on "Advanced IMAP Controls" by enabling it.
  3. Delete the locally sync'ed All Mail Folder.
  4. Start Mail.app and confirm. You can press Cmd-0 to check activity in Mail.app.

You can easily delete your local copy of the All Mail folder from Terminal. Use the sudo command to run a bash shell within your shell, and feed the password prompt your administrator password. You can check the size of the various folders using du, and rm -rf to force-delete the folder. Exit will get you out of the sudo'ed bash prompt and back to your normal prompt.

jrc $ cd ~/Library/Mail/IMAP-rick.cogley\@imap.gmail.com/[Gmail]
jrc $ sudo bash
Password: *********
bash-3.2 # ls
All Mail.imapmbox Drafts.imapmbox Reference.imapmbox Starred.imapmbox
Expiring.imapmbox	Sent Mail.imapmbox	Trash.imapmbox OmniFocus.imapmbox Spam.imapmbox
bash-3.2 # du -h -d 1
bash-3.2 # rm -rf All \Mail.imapmbox/
bash-3.2 # exit
jrc $ 

When you restart Mail.app, the folders for which you had sync enabled which are now disabled, will take a moment to disappear. I saved myself 2 GB of disk space by enabling this.

Thursday, January 17, 2008

Tutorial - Setting up Leopard Mail.app with Google Gmail IMAP - The Basics

Tutorial Introduction

I switched from Windows to Mac OS X Tiger on a MacBook Pro about two years ago in early 2006, and have been enjoying the experience immensely; even more so with Leopard. I purchased Entourage with Office 2004 for Mac and had been using it with my corporate Exchange server at my company eSolia, but had grown weary of the monolithic local message store, so in December 2007, I decided to give Mail.app, iCal and Address Book a go on Leopard. Looking back, it's funny that I was so diehard Windows-only.

This tutorial describes how I set up Mail.app in OS X Leopard to handle both private and work email, using Google Mail accessed via the IMAP protocol, and sending mail via my ISP's SMTP server to avoid the Outlook "sent on behalf of" problem.

I'll make these naming conventions for this tutorial:

  • Your "private" email is your Google Mail account
  • Your "corporate" email is your account on a domain you or your company owns

Prerequisites

Here's what you need to prep before you begin:

  1. Google Mail Account information
  2. Information for a forward-able "Corporate" Mail Account
  3. ISP login and SMTP information

Let's get started.

Setup Forwarding for your Corporate Email

Setup your corporate email address to forward to your Google Mail address. In my case, I did this in Active Directory on my Exchange server, so that anything that comes in to my corporate address gets forwarded to Google Mail and does not get saved on Exchange. Other systems have other methods, like the use of hidden .forward files in the ~ home folder on a *nix server, and this is going to be slightly different for each person. The thing to watch out for is whether forwarding will take place server-side, or, you have to be logged in with your mail agent started for the forwarding to happen. Using Outlook's client-side rules is an example of the latter.

Setup an Account in Mail.app for Gmail

Setup an Account in Mail.app. You do this in Mail.app Preferences, Accounts, clicking the + sign as per usual in (usually) nice, consistent Apple applications. When the wizard starts, you'll have a choice to go for an automatic setup, but don't select that option. Go for the manual setup.

There are plenty of sites, Google's included, that explain how to set up Mail.app for basic IMAP access, so I won't bore you too much. In the Account Information tab, you can have both your corporate and private addresses. Note I have rick dot cogley @ esolia ... followed by a comma, followed by my private Gmail address, in "Email Address." The incoming mail server should be imap.gmail.com, and the username is your Gmail account without the @gmail.com.

Avoid the Outlook "On Behalf Of" Problem - Use your ISP's SMTP

For the outgoing SMTP server, I used my ISP @Nifty's provided one. Drop down the server list, and choose Edit server list. Then add your SMTP server's information. @Nifty requires us to log in (smtp-auth) to use their SMTP servers, and they require port 587 (as opposed to the more generic port 25). Set this up as specified by your provider. You might use your company's SMTP server as well if it is convenient and accessible from both inside your company network and outside.

Why not use Google's smtp.gmail.com? After all, if you do, everything you send out via it gets put into your sent items, which is convenient. The reason is an esoteric one, which has to do with the way Outlook or Exchange treat mail headers. If you send via smtp.gmail.com to an Outlook / Exchange user, they will see "From rick@gmail on behalf of rick@corporate" which is not very professional, is it.

Setup Advanced Settings

In the Advanced tab, enable the account, include it in checks for mail, decide how much of a mail and its attachments you want to keep for offline viewing. Set the IMAP path prefix to "[Gmail]" (without the quotes, of course) if you want a cleaner look for your folders in the main Mail.app interface. However, a warning: changing this means that Mail.app will RESYNC your entire mail store with Gmail. If you have a lot of mail stored in Gmail already, this could take a serious amount of time. I have about 1.5 GB, and it took days to sync.

Setup Mailbox Behaviors

Next use the Account's Mailbox Behavior's tab to set up what Gmail folder goes where, and what sync's with what. Here's how I set up mine, with Drafts, Junk and Trash stored in the server, Notes stored in the Inbox, and Sent mail NOT stored on the server. Later we'll make settings that will get your sent mail into the Gmail sent mail folder automatically, so never fear.

You can also make these settings by choosing the target folder in your mail folder hierarchy, and assigning the folder using the menu Mailbox, Use This Mailbox For.

Setup Junk Mail Processing

Gmail has excellent anti-Virus and Junk mail processing already, so I chose to leave any junk mail that got through in my main mailbox. This works well because Mail.app and Gmail get "confused" when there are multiple Junk mail locations. In Junk settings, I chose to trust the ISP's junk mail headers, and to not mark as Junk if the sender is in my Address Book.

Setup Google Mail Processing

Now you have to do a few things to make your mail go into the correct folders. First, BCC yourself on all messages in Mail.app. This is in Preferences, Composing.

Next in the Gmail interface, set up a Filter to bypass the Inbox for anything that comes from yourself (while viewing the Inbox, click Create a Filter next to the Search the Web button). I created one filter each for both my corporate and private addresses. The filter should be set to match all mails From your address(es), and the Next Step should be to bypass the Inbox and send it straight to the Archive.

Google's IMAP implementation is different from the true standard. It seems they keep everything in one big folder per person and tag the mail so that it appears to be in certain folders in the web interface. Now, any mail that you send out of Mail.app is BCC'ed yourself, so that mail To: someone From: yourself will also be forwarded to your "private" Gmail address, and acted upon by the Gmail filters you create. The filter will fire, notice that the mail is from yourself, and automatically tag it correctly as sent mail so that it is visible in the correct place. Despite the fact that you are not storing Sent mail on the server, your local Sent Mail folder will still have a copy of the mail when it is sent from Mail.app.

Not to forget, additionally, you have to set up Gmail to use your "corporate" address. Do this in Gmail settings, Accounts tab. I added my corporate address, and verified as directed by Google.

So the Flow Goes

Someone sends mail to you@your.corporate.com, which is forwarded to your private@Gmail account. If it is a virus or spam, Gmail's filters for those will act upon the mail. If it passes through the gauntlet, Mail.app downloads the mail, runs another Spam check and processes any rules you have set, then copies the mail into your Inbox folder. You reply to the mail and Mail.app copies your reply into your local Sent Items folder. Because you have BCC'ed yourself, the reply gets routed to you@your.corporate.com again, forwarded to Gmail, and Gmail's filters act upon it, noticing it is From: you. The mail is automagically copied into the Gmail Sent Mail folder (tagged as Sent).

When you create an email, you choose which email you wish to send from, both of which you entered in Preferences, Accounts, "Email Address", separated by a comma. Your outgoing SMTP server would be your ISP's one or your corporate one depending on your setup. Your BCC address is automatically entered in based on your auto BCC setting. You click send, and Mail.app logs into your outgoing SMTP server to process the send, and the mail is processed into the right IMAP folder as appropriate.

Decision Summary

During this setup, we made the following decisions:

  • Use the IMAP protocol not POP, because IMAP allows you to access your mail from multiple IMAP clients.
  • Use your ISP's SMTP server to resolve the Outlook "on behalf of" problem, and use a Gmail Filter to make sure your mails get put in the Sent Items folder. The Gmail filter will skip the Inbox, and archive the mail from yourself immediately.
  • BCC yourself to make sure the aforementioned filter always fires, putting sent mail in its place.
  • Setup and verify your "corporate" account in Gmail, Settings, Account, so that you can choose From: me@corporate when you compose a mail in Mail.app.

It's a little bit complex, but it is nice to have a robust backend with great anti-virus and anti-spam measures, plus a large amount of storage space, for free. Kudos to Google for giving us such a wonderful service.