Wednesday, January 26, 2011

Troubleshooting IMAP - Slaying the beast

I don't know a whole lot about IMAP other then it's a protocol used in mail and it's a pain in the butt. A couple of years ago we had to start using IMAP to support some internal processes that require systems to connect to the IMAP enabled mail file and process workflow. But when it breaks, it's a pain point.
This morning it broke again.
Normally when it breaks in our test environment, a reboot of the server clears up the connection errors that are occuring. But when one of the system administrators told me that they can see the inbox or other folders via telnet, I had to start looking into it more.

DISCLAIMER:  I am not an IMAP expert, nor do I play one on TV. The following is a list of steps I used to resolve my problem. Your mileage my vary.  Void where prohibited)

Step 1 - See for myself
When troubleshooting IMAP, the best thing to do is TELNET to the server and log in as the account you are having a problem with.
1. In Windows, open a command prompt.
2. Type telnet 143 (143 is the IMAP port number)
3. If the IMAP service is running correctly on the server, you should see a prompt like this

If you don't see this, check that IMAP is running
4. Type in the following:
1 login password
and press enter
5. If the account information is valid, you should see a OK LOGIN completed. If not, check that the username and password are correct
6. My problem was with folders, both built in and user created, not being visable to the workflow process. To see a list of folders, type in:
1 list "" "*" and press enter
7. If IMAP is working properly, you should see returned a list of folder names
* LIST (\Noinferiors \HasNoChildren) "\\" Inbox
* LIST (\Noinferiors \HasNoChildren) "\\" Trash
8. If you don't see something similar to this and only get a message returned
1 OK LIST completed
Then there may be a problem.

Step 2 - Troubleshooting
To use IMAP in Domino, you not only have to have IMAP running, but also make the mail file IMAP enabled.
1. In the mail file, go to File-Application-Properties.
2. Click on the info tab.
3. Look towards the bottom, (on mine, it's cut off).

4. If you see Database is IMAP enabled and Folder references attributes are enabled, that means that the mail file is ready for IMAP. In my situation, I had that, but it stil was not working.
5. If IMAP is not enabled on the mail file, you use the convert command from the Domino console.
load convert -e -m mail\file.nsf
-e enables IMAP
-m enables folder references
6. In my scenario, I wanted to disable IMAP on the database and re-enable it.  To disable IMAP, you use
load convert -e- mail\file.nsf
As you will note, there is an extra - after the "e".
7.  Once the process ran on the server to disable IMAP, I used the convert command to re-enabled it.
Presto!  If worked!  In the telnet session, it listed out all the folders and the workflow process was able to access the messages and put it through it's system.

I'm no where near being an expert on the topic of IMAP, but, I wanted to share what turned out to be simple steps in case someone hits a speed-bump along the way.

No comments: