Get more from your Symbian OS Phone

How to: Get push GMail for free

Published by Steve Litchfield at 14:51 GMT, March 12th 2008

Real power users look away now - you'll have worked all this out for yourself - but I've been experimenting getting my GMail 'pushed' onto my S60 smartphone, for free. Herewith the results, comments and relevant how-to details.

[updated after comments on the original article - the auto-retrieval interval is different]

A little bit of background first, and a few notes. There's nothing special about GMail in the context of this article, except that it's highly recommended for the way it's universal, has an insanely good web interface and has bullet proof spam trapping. The key here is that GMail now supports IMAP access, but any other IMAP (Internet Message Access Protocol) email account will do just as well.

Now to 'push' email. It seems every man and his dog wants it, i.e. emails hitting your smartphone (with a beep) as soon as they're received into your mailbox. In other words, you don't have to wait the ten seconds or so to check your mail server when asking for your email in the 'old fashioned' way.

I can see the advantages of 'push' - there's no forgetting to hit 'Connect' every so often and there's the immediacy. If your business depends on you knowing something the instant someone emails you a fact, then push might be a lifesaver. And, of course, for businesses which already standardise on grown-up corporate email systems like Blackberry and Microsoft Exchange, it's easy and convenient to tie these into a dedicated email system pushing messages out to mobile devices.

GMail in the 'cloud'But for single user, home or semi-pro use, I really can't see much point in complicating your email handling by inserting a third party provider or service between you and your mailbox. Like many people, I standardised on a single GMail account last year and have been supremely happy. There's a GMail mobile client, but it's Java-based, which means slower startup, unnecessary RAM overheads (important on some devices), and a manual 'refreshing' of your inbox.

Much better is to spot the fact that GMail added IMAP support for their mail service last year. Now, IMAP is a proper, grown-up email protocol, wherein you effectively access your remote mailbox directly, without deleting information from it (unless you want to). By comparison, standard POP3 email usually involves deleting messages from the server after access - and even when you explicitly tell your email program to leave the messages on the server they sometimes disappear anyway - at least, in my experience.

Also important is that the 'Auto-retrieve' settings for POP3 accounts in S60 Messaging bottom out at 30 minutes. So your shown mailbox  could be up to half an hour out of date, at worst case. IMAP, while connected, passes on emails instantly - true push email and with no third parties in the way.

So, what happens is that I've set up (see below) my S60 smartphone with GMail as a mailbox and set it up to grab my email automatically. I've set a nominal auto-retrieve time of 15 minutes, meaning that every 15 minutes a fresh connection to the IMAP server is made, in case the existing one has dropped out (usually because of moving out of data coverage or changing data network). Up to those 15 minutes, provided the connection is maintained, the IMAP mail server is effectively always 'on'  (idle) and messages get passed through immediately. As and when emails arrive in my GMail mailbox, they're usually on my smartphone in seconds or, at absolute worst, there 15 minutes later. It's all simple, it's elegant and it's almost free.

I say 'almost' because the one downside of IMAP access, combined with frequent retrieval, is that your data bill is going to go up. We're still only taking about a few hundred Kilobytes per day though, unless you have it set to grab whole messages, complete with attachments. With modern data tariffs being more generous, the extra data needs of this solution aren't really a problem.

Setting up 'push' GMail

Tip: you'll need to enter your GMail username (e.g. jsdkjskdjk@gmail.com) three or four times during the setup dialogs - it would save typing on your keypad if you typed this previously into Contacts or Notes (or similar), selected it and then used 'Copy' (on the Edit or hash keys) to put it into the clipboard, ready for pasting in (with the same keys) at the appropriate points in the procedure.

  1. Go into 'Settings' in the GMail web interface, and click on 'Forwarding and POP/IMAP'. Down at the bottom of this page, enable IMAP and click on 'Save changes'.
     
    Screenshot
     
  2. Secondly, work through GMail's own IMAP Set-up page for S60 3rd Edition. It's important to go right through this, since both incoming and outgoing email services are encrypted and you have to get the security protocols and port numbers spot on - otherwise things simply won't work.
     
     ScreenshotScreenshotScreenshot
     
  3. Now, still in Messaging on your smartphone, within 'Settings | Email | Mailboxes | GMail', head for 'Automatic retrieval' and enable 'Email retrieval'. There's a dialog to complete with your preferred hours of operation (you don't really need GMail being checked throughout the night, for example!), frequency (I suggest 15 minutes) and then you can back out to the Messaging home screen.
     
    Screenshot

Now sit back and wait for email. Here's the proof of the pudding, showing my Nokia N95 8GB and my laptop, showing GMail's web interface, in perfect step.

Screenshots

One caveat to the above is that Messaging isn't as capable in some areas as the dedicated GMail Java-based client. In particular, there's no way to mark read items as 'unread', you can't apply 'stars', and so on. But the instant and automatic push-like retrieval is certainly a great tool in your armoury. Why not give it a try?

Steve Litchfield, AllAboutSymbian and the Smartphones Show, 13 March 2008

 

 

Share This (Digg, del.icio.us, Facebook, etc.)

Categories: How To
Platforms: Series 60, S60 3rd Edition

Feature Discussion

Unregistered
Set the polling time for 1 minute and pop3/smtp becomes virtually as good as push.
Unregistered
One of the great things of GMail Imap is that when you delete a message on your phone, GMail archives it (in stead of deleting it). This way you can easily and rapidly do some organizing on your phone and you don't have to go through the same mails again when you log into your GMail account.
Unregistered
I really don't know the technical details but I've been told that this isn't pseudo push email at all. It's how all push email works: The 'idle' feature of an IMAP connection.

It works flawlessly with the built in S60 messaging client & my email provider (fastmail.fm). Orange still slaughter me for data rates but it's nice (& free!) on a wireless connection at the office & home. I've never understood the need for 3rd party solutions.
malerocks
I agree. This is actually I am using my gmail. I do have a few cribs though:

1) I cannot delete mail in the inbox that I do not want. If I delete mail in the IMAP mailbox, GMail archives it and does not delete it. Fortunately, mail that has landed in the spam folder gets deleted when i delete it on the phone. I wish that deleting mail on phone deletes it on the GMail account too, and does not get archived.

2) Labels created in gmail come up as folders on the phone. Now this I am fine with, but I not able to move/mark a mail in the inbox to these gmail folders or labels

3) Cannot identify auto labels that have been marked to mails

These were gmail specific. Some generic ones:

4) While I am manually updating my mailbox, the messaging app does not let me access any other mailbox, message section.

5) No way to access the address book online.

6) Forwarding attachments requires the phone to re-upload them. They are already on the mail server. Why not just pick that and forward? Saves time and data volume charged to me.

I dont know how many would agree with my points. Or maybe I am asking too much from technology at this point. :)
Peter321
I can't seem to get my N95 to SEND messages.

They are just added to the outbox with the status "in queue" (or something like that, I'm on a Danish phone) but are never sent.

All my settings seem to be correct, including smtp server and ports.

very annoying
Ratkat
After automatic retrieval, does your phone disconnect from Vodafone? I find when I use IMAP it doesn't drop the connection after it has checked the email.

Because of this, in a 3.5g area I could theoretically miss calls.

Drops the connection fine using POP
Schrijver
Set your retrieval time on IMAP to 30 minutes to gain real push!!!

30 minutes retreval for IMAP should be named as Idle.

Try it: When I set the retrieval to 30 minutes I get the notification and mail in only 1 second!!!
Unregistered
@Malerock: why do you want to delete messages in GMail? Space is almost infinite
crimper
If you read Gmail IMAP help you would know how to really delete a message and how to apply/remove labels. RTFM before claiming it's impossible.
Unregistered
Using Gmail with my N95 but with Profimail, I found that under POP is way faster than IMAP, Profimail allows to set any retrieval interval.
davidmaxwaterma
The IDLE mode in IMAP works by maintaining a connection with the server - this way the server can tell your client s/w immediately when there's a new message - your client s/w doesn't have to keep asking.

With IDLE, there's normally no point in having your client check for new messages so often - it only makes things worse, loading the server unnecessarily/etc and causing increased data traffic.

For example, my email provider, Fastmail.fm, recommends[1] setting the interval to 28 minutes because their server will disconnect IDLE sessions at 30 minutes with no activity, and checking just before then will keep the connection open constantly.

Of course, all this assumes that it is possible to maintain a constant connection. If you're using a cell phone network, that's like not possible. If for example, you go through a lot of tunnels or are in an area that isn't well covered, then I'd guess you're cell phone wouldn't keep a connection for too long. This can also happen if you're on the move a lot with wifi - I like to walk around my office building and have my phone switch automatically between all the different wifi networks in coffee shops and whatnot (see http://www.devicescape.com), so the connection gets lost in that situation too. In all these situations, a more frequent polling interval is unavoidable as far as I can tell.

So, if you only use email through wifi and are usually pretty static, then you might be doing your email service provider a favour (and lower their costs/improve their servier) by setting the polling interval to be longer than 5 minutes.

What I would like to see is a new version of Messaging that sets an Active Object waiting for signals from whatever server is giving it access to the internet - usually the radio, whether that be wifi or cell phone - and stop trying to connect when there's no connectivity, and start again automatically when connectivity resumes. It really should be pretty easy to do this, IINM.

BTW, Steve - Messaging does have a 'mark as unread' option, at least on my E90. It's not on the menu when you're viewing a single message, but it is on the menu when your viewing a list of messages. At least it works just fine on my E90 with Fastmail.fm - perhaps it's a problem with Gmail (I have an account, but I don't really use it).

NB. IDLE need support from both server and client s/w. Some servers don't support IDLE, and some clients don't either (eg Evolution). From testing, it seems like Nokia's Messaging client does, as well as Mozilla Thunderbird (a desktop client).

[1] http://www.fastmail.fm/docs/imap/thunderbird.htm
"
BE A GOOD NETIZEN: If you do choose to have your mailbox checked at regular intervals, then please change the default setting (10 minutes) to something more reasonable (more minutes) in case you leave Thunderbird running while you go out on vacation ;-)

I'm sure I don't need to spell out the problems it could cause for the nice people at FastMail.FM if lots of people left Thunderbird to check for mail every 10 minutes. You could also end up with a bigger bill from your ISP for Internet traffic.

You will get instant notifications of new mail since Thunderbird supports the IDLE command, however you should set this interval to just under 30 (say 28 for example) minutes since Fastmails IMAP server will disconnect you after 30 minutes with no activity. Checking for mail just prior to this timeout will prevent disconnections.
"
Unregistered
"If you read Gmail IMAP help you would know how to really delete a message and how to apply/remove labels. RTFM before claiming it's impossible."

Touchy aren't we?!

He didn't claim it wasn't possible, he said that he couldn't do it; not the same thing at all.
Unregistered
Hey I never seem to be able to download attachments, either via Gmail or this method. Can anyone help?
Shane
I too like the Gmail Imap version better than pop with it's virtual push. (polling every minute drains battery to get the same functionality via pop)

However, it does not work as nice as with my iphone for some reason.

When I move messages, delete, etc on my N95, I get the same frustrations as the others have listed above. When I do the same thing with my Gmail account from my iphone, everything is perfect. Never an issue. Whatever I do on the iphone shows up online from my laptop instantly, and vice versa.

I wonder what the difference is between how IMAP Gmail is done in S60 as opposed to iphone?

I used it on a Windows Mobile phone and my company issued blackberry too. Both were the java versions. They were slower, but had less sync issues than my N95. Can't figure out what the deal is.
Unregistered
I have one question about using this IDLE for IMAP thing though: if you do this, and you maintain a constant connection with the IMAP server, does this eat up battery life? Since you now have to keep an open connection with the cell tower. (Sorry if I didn't make this clear, I'm referring to using it on a cellular network, I guess if you keep Wi-Fi on all the time it WOULD drain your battery faster.)
davidmaxwaterma
Quote:
Originally Posted by Unregistered View Post
I have one question about using this IDLE for IMAP thing though: if you do this, and you maintain a constant connection with the IMAP server, does this eat up battery life? Since you now have to keep an open connection with the cell tower. (Sorry if I didn't make this clear, I'm referring to using it on a cellular network, I guess if you keep Wi-Fi on all the time it WOULD drain your battery faster.)
Good question. I would hope that it wouldn't drain battery any faster, though wouldn't be surprised if it did. The radio has to be on anyway, and AFAIK IDLE doesn't actually transmit any data - but I'm not 100% on that. If you configure the email client to check every 5 minutes, then it *does* transmit data and so use more battery life (and money). Note that a 'connection' isn't a physical thing but a logical one - no action is required in order to keep it 'open'.

Of course, if you don't check for email automatically *and* don't use IDLE, then it'll very likely use less battery.

Here's the RFC on it. It has an interesting example session which has 'time passes' where there is no traffic :

"Example: C: A001 SELECT INBOX
S: * FLAGS (Deleted Seen)
S: * 3 EXISTS
S: * 0 RECENT
S: * OK [UIDVALIDITY 1]
S: A001 OK SELECT completed
C: A002 IDLE
S: + idling
...time passes; new mail arrives...
S: * 4 EXISTS
C: DONE
S: A002 OK IDLE terminated
...another client expunges message 2 now...
C: A003 FETCH 4 ALL
S: * 4 FETCH (...)
S: A003 OK FETCH completed
C: A004 IDLE
S: * 2 EXPUNGE
S: * 3 EXISTS
S: + idling
...time passes; another client expunges message 3...
S: * 3 EXPUNGE
S: * 2 EXISTS
...time passes; new mail arrives...
S: * 3 EXISTS
C: DONE
S: A004 OK IDLE terminated
C: A005 FETCH 3 ALL
S: * 3 FETCH (...)
S: A005 OK FETCH completed
C: A006 IDLE
"

It also (as well as Fastmail.fm's help) has a statement advising against having such short polling intervals as 5 minutes :

"The server MAY consider a client inactive if it has an IDLE command
running, and if such a server has an inactivity timeout it MAY log
the client off implicitly at the end of its timeout period. Because
of that, clients using IDLE are advised to terminate the IDLE and
re-issue it at least every 29 minutes to avoid being logged off.
This still allows a client to receive immediate mailbox updates even
though it need only "poll" at half hour intervals.
"

but it seems like it still assumes that the client has reliable and constant connectivity, which isn't the case with a mobile phone. I don't know enough about the network stack to know what parts of it can change without affecting applications using parts higher up the stack.

I'd repeat what I said earlier, that you should set the polling period to be the maximum you can live with, depending on how often your phone becomes disconnected from the internet. If your phone can keep a reliable connection, then 28 minutes is more advisable - less load on the IMAP server, less data transmission so lower cost for you and longer battery life.

It would be interesting to know what can cause a disconnect while in IDLE.

I would imagine a change in IP address would cause a disconnect.
This can happen if your IP address is dynamic (assigned by DHCP), which is the case for a lot of DSL connection, but I also imagine that all phones are set to DHCP too. It might be that it is only dependant on the public interface's IP address, which might not change if you're ISP is assigning private addresses.

I don't know what happens when your cell phone switches from tower to tower, but I hope that it would just be at the physical level and not involve any IP address changes.

If you lose touch with towers completely, that might be another issue. If you have your email client set to poll every 5 minutes, then when it fails to connect, it might well time out, resulting in the client disabling the polling (which I think Nokia's Messaging app does) and you not getting notified of any new messages until you enable it again.
If you have the polling set to longer, then perhaps it would give the physical layer longer to recover, and you can go for longer without a connection and still maintain IDLE at no cost since there's no IP traffic.

Yes, I think this is an important point - for people who use Nokia's Messaging client at least. Polling at a high frequency might be something you definitely don't want to do.

I would appreciate input from an expert on this issue. Steve, do you know of anyone?
davidmaxwaterma
Quote:
Originally Posted by Shane View Post
However, it does not work as nice as with my iphone for some reason.
What client are you using on your N95?

The plain fact of the matter is that all email clients are not created equal (some IMAP clients don't even support IDLE). It could be that the Apple one works better than the Nokia one. I know of several annoyances with the Nokia one (automatically disabling polling, for example) and it could certainly do with an upgrade - I hope Nokia do with with a firmware upgrade on my E90.

Personally, I've noticed less sync problems when you don't try to do things simultaneously. Use only one device at a time.

On the Nokia, of course, you can install a completely different email client - I'm sure there are many out there that some think work much better than Nokia's Messaging client. This is one advantage in the Nokia, since you can't install another email client on the iPhone (AFAIK) - or any client actually (unless it's always visible).

S60 is better than the Apple in that respect, but (from my understanding at least) Android is one step better than even S60 since you can *replace* the installed email client with a completely new one (I guess it gets unplugged rather than removed since it'll likely be in firmware). On S60, you have to have two installed, which is at least inellegant and just a little annoying. ...but Android is still alpha s/w and who knows what it'll be like on shipping devices - perhaps they (or, more likely SPs) will introduce restrictions of some sort to prevent you completely screwing up your device (resulting in high support costs, perhaps).
Unregistered
davidmaxwaterma,
I have tried both the built in email client on the N95 and ProfiMail. ProfiMail has more options obviously, but I still have the same issues.

I have thought about trying to scale back to just one device, but I'm too much of a gadget geek. Plus I like being able to compare and contrast all the devices strengths and weaknesses.

I agree with you on the S60 vs Apple. S60 is vastly more flexible. Apple is really rigid about using things their way which I hate. I'm hopeful but sceptical that with the SDK release that there will be more options out there. However, I do have to admit that when Apple creates something, they do a pretty good job. It is well designed, very clean and has few if any glitches. The email client on the iphone is a good example.

But they just left out too many things I like to use on a daily basis which is why I go back to my N95 and Kaiser a lot. (ie, downloading from the internet browser. Safari on the iphone is the best out there for browsing experience, period. But you cannot download or save pics, etc. Grrrr)

The N95 is far superior, but I just use it for email too much, and that is a weakness. (especially since there is no keyboard) I live in Gmail and love using the push IMAP, so as much as I love my N95, I find myself going back to my iphone more and more. I'd rather do without all my games and GPS than my Gmail.

The Kaiser's email app does a better job than my N95 with Gmail IMAP, but still has glitches that I never see with iphone. I've used a few 3rd party email clients for WM that do a little better job, but not as sleek. But it often ends up the best median conpromise of both, and so I use it most often. But it's a little bulky for a everyday phone for me, which is why I never went to the E90. Plus the WM interface is not very finger friendly. (I hate using the stylus)

I guess we may wait forvever for the perfect phone. You just have to decide what you use most, and what is most important to you. Gmail and internet browsing are my biggest needs above all else (other than phone calls obviously) so those end up pushing me more.

If there is ever a E90 that comes out that is a little thinner, and has an improved email client for Gmail IMAP, that will likely be my new everyday phone. Otherwise I'm doomed to switch back and forth based on my needs that day.
Sergey Zak
A "real" push e-mail is P-IMAP, based on WAP Push messages.
It does not require a running TCP over GPRS connection.
This would truly give user freedom (no logging into e-mail required).
Just switch on the phone and it's ready to receive.
But roaming could be a concern (needs cell-ops cooperation), since wap pushes are not inter-network. Then, of course, P-IMAP also allows for SMS as an option.
All those options require proper handset platform support.
Unregistered
I have to agree my N95 8GB gets stuck in a sense on IMAP. Sometimes it doesnt get the message in ime maybe hours until i disconnect it.

Hopefully there is a fix.

I just dont think Nokia really have an interesting platform anymore the 6630 was the last phone by Nokia i truly enoyed. The rest are great hardware upgrades but poor software upgrades.
RogerPodacter
How exactly are you guys having problems with n95 default email app via gmail IMAP? it works perfect for me, i can delete mails from the phone or phone and server, and its always instantly updated with my online inbox. in fact, when i send a new email or receive an email from someone, it shows up on my n95 IMAP about 10 seconds before the gmail website! i also use profimail which is much nicer than the s60 email, but i still use both.
davidmaxwaterma
Quote:
Originally Posted by Unregistered View Post
davidmaxwaterma,
I have tried both the built in email client on the N95 and ProfiMail. ProfiMail has more options obviously, but I still have the same issues.
Well, I doubt that the issue is inherently an N95/S60/Symbian one (though that's possible, I suppose). Perhaps the two clients do have the same problem and trying another would be good, or perhaps the problem is caused by the iPhone (did you say you have the same problems on a desktop client?).

It's a difficult problem to figure out without some serious debugging/network sniffing - have you tried that? I can't see how it'd be possible to do that with a cell connection - you might be able to get tcpdump running on S60, but good luck on an iPhone - but it should be possible with a wifi connection.

Max.
Sergey Zak
Roger, David - IMAP is more flexible than POP and the issues could be in the server implementation and supported features, not necessary with the e-mail client. Of course, the e-mail client could "know" the workarounds...but I have personally found that Comminigate Pro servers have the best-fitting features/support for mobile IMAP clients. Of the 4 servers I used, that platform work best. Of course, Apple Mail/Outlook Express handles them ALL nicely...but mobile client (SE P910i, N95-1) have some issues.
You might want to check the software name from the server header (if it's not hidden by the server admin) from a PC Start-Run- cmd:
C:\> telnet server.name.com 143
Unregistered
Hi,

For all those who are looking for a free push client to get your emails on your phone, instantly...
please visit: www.consilient.com
follow the simple steps and you're done.

HighwayStranger@gmail.com
BigRedBall
I also use IMAP with IDLE on my N95 8GB. I previously used it on my E61. I also use Fastmail.fm as my main email service provider.

It's great - and gets received emails quicker than my Mac, in most cases (IDLE was added to Apple Mail in Leopard).

To answer somebody's question about battery life - no, it's not a problem. On both my phones I have had Messaging set to check on my Fastmail account and my corporate IMAP mail account from 8:30am, through the day until 1am. The E61 used to last slightly longer but even on the N85 8GB, I still have four bars (or possibly three on days with more calls than usual) of battery life available at midnight or so. I charge my phone every night so it's not so much of a concern anyway.

I'm almost certain that IMAP IDLE is more power-efficient than polling a server.

Someone in the thread also suggested that one would miss calls if the phone is checking for mail or connected through IMAP. That's not true - if you're on GSM/EDGE, the data session will be suspended until the call is over. If you're on 3G, the data session will continue at a reduced speed. Either way, your call will not be affected. I've had emails come through while I'm on the phone...

My only slight niggle with S60 email is that you can't save drafts on the server. That seems like a big omission.

To all of you still using POP - please note that it is now 2008.

:)

31 Comments / Post New Comment

Close
  • Social Web
  • About

You can use this widget to send bookmarks or notes for this page to your favourite sharing / bookmarking service. You will need an account at mnay of these services and may need to log in to use them.

Copyright Notes || Contact Us || Privacy Policy