My IMAP client hangs intermittently. When it does, Dovecot has prematurely stopped sending a response and entered the poll loop. My client is waiting for more data and Dovecot is waiting for an IMAP command.
This problem seems to occur when I connect to the dovecot process over the network and when I run the imap binary directly via an SSH tunnel.
Below is truss output from the imap process for one of the hangs. It is responding to a FETCH, gets EAGAIN, and then seems to give up sending the rest of the message and enters the poll loop. Below that is the log from my IMAP client to show its side of the story.
Nothing shows up in the normal Dovecot log. I haven't caught it in the act recently when running with rawlog. But rawlog output from before I was running with truss shows that Dovecot does not think it has finished sending its response.
truss output: 12951: stat64("/home/happy/Mail/banner-ss", 0xFFBFF200) = 0 12951: fstat64(12, 0xFFBFF388) = 0 12951: stat64("/home/happy/Mail/.imap/banner-ss/dovecot.index", 0xFFBFF2F0) = 0 12951: fstat64(18, 0xFFBFF388) = 0 12951: pread64(18, "\n F r o m b e v e r l".., 4096, 1592560) = 4096 12951: pread64(18, " S u n G a r d * S C".., 4094, 1596656) = 4094 12951: pread64(18, " M i c r o s o f t S a".., 4094, 1600750) = 4094 12951: pread64(18, " r g a r e t . d i l l a".., 4094, 1604844) = 3720 12951: pread64(18, 0x0025EEA2, 374, 1608564) = 0 12951: pread64(18, 0x0025EEA2, 374, 1608564) = 0 12951: pread64(18, " R e t u r n - P a t h :".., 4096, 1592616) = 4096 12951: write(1, " * 2 5 0 F E T C H ".., 4073) = 4073 12951: pread64(18, " a l v e r n , P A ".., 4095, 1596712) = 4095 12951: write(1, "\n W i l l i a m B . ".., 4060) = 4060 12951: pread64(18, " l ( i n c l u d i n g".., 4095, 1600807) = 4095 12951: write(1, "\n & # 8 2 2 6 ; < / b".., 4069) = 4069 12951: pread64(18, " m o z - t x t - l i n k".., 4095, 1604902) = 3662 12951: write(1, "\n ".., 4079) Err#11 EAGAIN 12951: write(1, "\n ".., 4096) Err#11 EAGAIN 12951: poll(0x000A0AD0, 3, 533) = 1 12951: write(1, "\n ".., 4096) = 4096 12951: poll(0x000A0AD0, 2, 532) = 0 12951: poll(0x000A0AD0, 2, 0) = 0 12951: poll(0x000A0AD0, 2, 999) (sleeping...) 12951: poll(0x000A0AD0, 2, 999) = 0
Here's the log from my IMAP client. I removed email addresses and most of the body of the message to protect the innocent. The "BYE" was caused by me running 'kill $PID' on the imap process.
3551 OK Fetch completed.! 3552 UID FETCH 252 BODY.PEEK[]
- 250 FETCH (UID 252 BODY[] {16341}! Return-Path: <abc@usg.edu>! Received: from usg.edu (abc.usg.edu [1.2.8.1])! by abc.usg.edu (8.12.11/8.12.11) with ESMTP id j9KFqoga012884! for <abc@USG.EDU>; Thu, 20 Oct 2005 11:52:50 -0400 (EDT)! Message-ID: <4357BD52.1020506@usg.edu>! Date: Thu, 20 Oct 2005 11:52:50 -0400! From: abc <abc@usg.edu>! User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)! X-Accept-Language: en-us, en! MIME-Version: 1.0! To: abc@usg.edu! Subject: [Fwd: [Fwd: Fw: Java Library Problem]] - URGENT, I'm sorry...! Content-Type: multipart/mixed;! boundary="------------010604070704040405060605"! X-USG-MailScanner: Found to be clean! X-USG-MailScanner-SpamCheck: ! X-MailScanner-From: abc@usg.edu! ! This is a multi-part message in MIME format.! --------------010604070704040405060605! Content-Type: multipart/alternative;! boundary="------------040009050704020209010709"! ! ! --------------040009050704020209010709! Content-Type: text/plain; charset=us-ascii; format=flowed! Content-Transfer-Encoding: 7bit! ! Guys,! Please create a ssh login on... from ! 24 hours now) with testing. His account should look like Patrick ! I've requested a static IP from Dan.! ! ...! </pre>! </body>! </html>! ! --------------040009050704020209010709--! ! --------------010604070704040405060605! Content-Type: text/x-vcard;! Content-Transfer-Encoding: 7bit! Content-Disposition: attachment;! ! begin:vcard! ...! tel;work:(xxx) xxx-2000! tel;fax:(xxx) xxx-xxxx! url:http://www.u* BYE Server shutting down.! imap(happy): Warning: Killed with signal 15
The mail message in question actually ends like this:
tel;work:(xxx) xxx-2000 tel;fax:(xxx) 583xxx-xxxx url:http://www.usg.edu version:2.1 end:vcard
--------------010604070704040405060605--