Log in

View Full Version : TIP: How can I entirely get rid of the auto-synchronization feature of Messaging?

02-18-2006, 07:12 PM
You may already have noticed that the built-in mailer client in Windows Mobile, Messaging (was also known as (Pocket) Inbox in pre-Windows Mobile 2003SE operating systems) automatically synchronizes the contents of the active POP3/IMAP mailbox with your last-used POP3/IMAP Messaging mailbox when you cradle/dock your Pocket PC.

This, in cases, may lead to unwanted consequences. Many POP3/IMAP servers prohibit multiple, parallel connections to the same mailbox. With servers like these, you'll always run into access problems if you try to access your mailboxes from your, say, desktop mailer client, while your PDA is cradled.

The reason for this is very simple. As has been pointed out, when you cradle your Pocket PC, Messaging is invoked and it automatically synchronizes the contents of the last-used mailbox, keeping the connection open (that is, it doesn't log out of the mail server when it's done fetching mail).

The connection being kept open results in other clients' inability to log into the same mailbox while the PDA is cradled. Unfortunately, the error messages you'll receive in cases like this can be rather cryptic and help little in tracking down the problem; this is why so many Pocket PC users are suffering from the problem and posting questions about it to Pocket PC boards.

What's the solution?

Before cradling the PDA, I used to make sure the selected, active Messaging account is not the one(s) that prohibit(s) multi log-ins. This made it possible to continue accessing even my single-login mailboxes on my desktop PC, even with my PDA docked and synchronized.

Of course, this solution is pretty awkward as you will end up having to change your account every time before cradling your PPC. This is why I've continued investigating the file system, the WinCE databases and, finally, the Registry to find out what causes Messaging to be auto-invoked upon docking and how you can combat this.

The solution is, fortunately, very easy. Read on!

Get a registry editor (look around here (http://www.pocketpcmag.com/blogs/menneisyys/UltimateRoundupOfRegistryEditors.asp) if you need to choose one) and navigate to the registry key \HKEY_LOCAL_MACHINE\ SOFTWARE\ Microsoft\Shell\Event\ Dock\Inbox:


Tap and hold the value named command in the above key and choose Rename from the context menu:


Give the value another name (it can be anything); say, dummycommand.


Alternatvely, you can also entirely remove this value or, for that matter, the entire Inbox key. Then, however, you will have a harder time to set it back if you still need the auto-synchronization functionality (unless you export the key before deleting it and just reimport it later when needed).

Remember not to touch the contents of 'command' to refer to a non-existing file because, then, you'll get an error message every time you cradle your PDA, as can be seen in this screenshot (http://www.winmobiletech.com/kuvat/DontLetInboxSyncInBackground-4.bmp.png) (taken on a WM5 x51v, after renaming tmail.exe to atmail.exe).

For techies: how did I find this out?

First, I've checked whether it's \Windows\Startup\poutlook.lnk that keeps Messaging running in the background and looking for the synchronization to start. After removing the above autostart link file and restarting my test PDA's, the problem remained, showing something other was the problem.

Then, I turned to the DB_notify_events WinCE database, which notifies applications on certain system events like being switched on/connected to the outside world via a serial connection and is a cause for a lot of problems (http://www.pocketpcthoughts.com/forums/viewtopic.php?t=36471). There were no signs of tmail.exe (the executable for Messaging/Pocket Inbox) in here, as can be seen in this screenshot (http://www.winmobiletech.com/kuvat/DontLetInboxSync-dbView.bmp.png) (taken using the excellent dbView (http://www.pocketpcfreewares.com/en/index.php?soft=152) application).

I didn't give up and continued researching. Knowing that the Windows Mobile OS, as with the DB_notify_events WinCE database, in most cases, requires the use of the executable file name top operate, I've also scrutinized the Registry for the executable name of Messaging that is, tmail.exe. And yes, I've found something - I found out that the Windows Mobile operating system also keeps a separate registry key for applications to be invoked on the PDA being cradled/docked. It's \HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Shell\Event\Dock\.

Here, there may be any number of subkeys; by default, there is only one, Inbox. These subkeys must contain a value named 'command' that contains the name of the program (and the optional parameters to pass to it) to run in order to operate; if the value command is missing, nothing happens.

Patrick Y.
02-19-2006, 05:23 PM
Great tip as usual!! :way to go: THough, is this problem fixed in WM5?

BTW, what's your progress on the bluetooth stack project for WM5 Axims?? Everyone is dying to see the results!! :wink: :D

02-19-2006, 06:52 PM
Thanks for the tip esp for the "techie stuff"

Sunny :D

02-20-2006, 12:11 AM
Great tip as usual!! :way to go: THough, is this problem fixed in WM5?

BTW, what's your progress on the bluetooth stack project for WM5 Axims?? Everyone is dying to see the results!! :wink: :D

dunno about WM5;will check it with my test POP3 server to see whether the underlying protocol/connection model has been changed. (In pre-WM5 OS'es, the connection model was connected - that is, after a successful session, the POP3 client didn't disonnect from the server by issuing QUIT but remained connected; this was the cause for this bug.

I'm pretty sure the connection model has been changed in WM5, along with a lot of other things; for example, theWM5 version of Messaging no longer tries to fetch mail as soon as you instruct it to do so with choosing 'Mark for download' for a given mail. also, the '(dis)connect' menu item is totally missing from the WM5 Messaging.

These may mean it's no longer using connected sessions.

I'll go back to investigating the BT stuff as soon as I have some time - right now, I'm really busy writing new stuff for the entire Pocket PC community. My next tutorial will be about Qmail, the best mailer+NNTP+RSS client for the PPC.