Thursday, 18 November 2010

Admin Notes: How to debug SMTP task

Sometimes things go wrong.   They just don't work.  For me, it was when someone complained that their emails weren't getting through to a mailbox, from a specific client.

Sure enough all I saw in the mail logs was:
11/18/2010 11:00:27 AM SMTP Server: connected
11/18/2010 11:00:28 AM SMTP Server: disconnected. 0 message[s] received
Yeah.   Really useful.

So, off to find out why.   First step, IBM support site.  And, I found what I was looking for: Domino Router notes.ini debug parameters for SMTP

The basic premise is this:  There are 2 debug parameters that will be useful.

SMTPDebug - This parameter can be set to enable the capture of inbound SMTP protocol conversations. This is for all messages received by the SMTP listener from all clients and servers via the SMTP protocol.
Possible values are:
1. Enable minimal logging of the SMTP listener
2. Enable information logging of data sent and received along with some additional debugging information. This setting indicates commands and responses being received/sent along with the number of bytes being transmitted, but does not include the text that is transmitted.
3. Enable verbose logging of data sent and received. Along with the information recorded at setting 2, this level shows the actual text received/sent via SMTP. Note that this does not include the text body of messages.
4. This is the most verbose you will get for logging (note that this is an undocumented value -- the documentation only lists up to 3, which is strange, as it is documented on the IBM support site...).
I, of course, jumped right to option 4.

SMTPDebugIO - Enables the logging of all data received by the SMTP listener task.
0. No logging
1. Number of bytes sent and received during the SMTP conversation
2. There is no number 2.
3. Logs all data received by the SMTP task
4. RFC822 data (all message data)
Again, I went for option 4.

I set the parameters through the Domino Server Console (You can do it through Domino Administrator, or directly at the server console) using the Set Config command.  In this case:
set config SMTPDebug=4
set config SMTPDebugIO=4
Now, send in test message yourself to see what you should see:

(names changed to protect the innocent)

You have a lot more information now to figure out why the message isn't being received.  Just don't forget to disable the 2 debug settings later using the following commands:
set config SMTPDebug=1
set config SMTPDebugIO=0