[Dovecot] More Descriptive Logging Needed

Joseph D. Wagner technojoecoolusa at comcast.net
Sun Jul 15 09:58:38 EEST 2007


(Everything herein refers to dovecot-1.0.1.)

I'm sorry to say that I've been having troubles with dovecot.  While 
attempting to troubleshoot them, I've found the existing logs to be lacking.

In particular, I've had a lot of difficulty with the client<->server 
connection disconnecting, but the only message I get in the logs is 
"Disconnected".  After dissecting the code a bit, I've found quite a 
number of places where the code will close the connection logging 
nothing more than the word "Disconnected", or worse, it will not specify 
a reason in which case the code in client_destroy() will log the default 
"Disconnected".  Because of this, isolating the offending code has been 
a bit difficult.  (I realize the problem may lie with the client, but I 
cannot even begin to program a work around until I isolate the exact 
place and cause of failure.)

In an attempt to change the logging to be more descriptive myself, I 
already changed src/imap/cmd-fetch.c:85 on my own copy of dovecot from:
client_disconnect(cmd->client, "Disconnected");
to:
client_disconnect(cmd->client, "Disconnected in FETCH");
This makes the logging both more descriptive and more in line with other 
parts of code, like src/imap/cmd-append.c:50 which already say:
client_destroy(client, "Disconnected in APPEND");

As luck would have it, my problem was not in the FETCH command.


I'm now looking at the client_read() function in 
src/imap-login/client.c:318-334.  If I'm reading the code right, then 
"i_stream_read(client->input)" returning "-1" means that the 
socket/stream is already disconnected, right?  In other words, some 
function attempted to read off of a socket/stream that was already 
closed, right?  If so, shouldn't the client_read() function not have 
been called in the first place?

Please let me know if I'm wrong.  I've been banging my head against the 
wall trying to make sense of all the different code.  Any assistance you 
can offer would be appreciated.

Joseph D. Wagner


More information about the dovecot mailing list