Monday, March 28, 2011

Troubleshooting IMAP

Troubleshooting IMAP.
Unless you’re working at an ISP chances are you may never use IMAP if you’re a straight MS shop since outlook uses MAPI for its connections.  However, if you want to connect an application to your mail environment then you’ll probably be using IMAP.  This is because IMAP connections provide flexibility for connecting to subfolders, monitoring for new message arrival and downloading the messages that is not available in a POP connection. 
Enabling IMAP in Exchange 2007 is very straightforward.  One thing to keep in mind is that the Exchange IMAP service works just like the Exchange Transport Service Any changes to the configuration will require that the service be restarted.
My goal last week was to get our Siebel system connected to a mailbox on my Exchange 2007 server.  Sounds like a simple process.  I have another application using IMAP to import mail into an archive system. It works just fine.  So far Siebel does not play well with others. So I needed to convince myself and my consultants that the problems were specific to the application and not IMAP
Troubleshooting IMAP begins with a telnet session just like troubleshooting SMTP.  However, the similarities stop there.  If you have TLS enforced for IMAP then you’ll need to telnet to port 993. For non-encrypted connections port 143 is used.
This is really important - Just connecting is not enough.  You’re connecting to a mailbox, not relaying anonymous mail.  Some type of authentication is required so you must at least test that part of the process. Then, once you’ve authenticated, you’ll want to verify that you can see the folders in the mailbox. Often the application process will be able to connect but cannot authenticate or cannot list the items in the mailbox. Your job is to follow the same process the application is using to attempt to duplicate the problem.
You also need to know that IMAP supports multiple connections so each command must start with a unique connection tag.  It can be something as simple as a period or you can get fancy and use an alpha-numeric tag like A01. I won’t go into the details of the commands.  Rather I’ll give you a link to one of the best pages I’ve found explaining IMAP, here. He also covers POP. You’ll want to review it too since there’s a good chance the application will want to send mail using POP.
At a minimum I’d suggest the following:
telnet <server> 143
. login mailbox@domain.com password
. list "" "*"
. status INBOX (messages)

These commands will test the basic connectivity.  Again, I suggest that you duplicate the process your application is uses using the commands to fetch a message and read it.

No comments:

Post a Comment