I've increased the timeout to 180 (3 minutes) and the problem still occurs. It only happens on certain messages. In an effort to track down the issue, I've run tcpdump on both the avast and qmail ports. I can supply both logs if necessary. There are two emails stuck in the queue. I can also provide copies of these as well. The packets for one email seems normal -- e.g., HELO, RCPT TO, MAIL FROM, DATA. But the packets for the other one is very odd. avast sends DATA, qmail acks, avast sends headers -- up to and including the X-Antivirus-Status. The headers are terminated by <CRLF>.<CRLF>. qmail acks again with:
10:39:51.201677 bellux.theotherbell.com.smtp-backdoor > bellux.theotherbell.com.34594: . ack 656 win 32767 <nop,nop,timestamp 196223691 196223691> (DF)
0x0000 4500 0034 7c2f 4000 4006 646e ac10 0103 E..4|/@.@.dn....
0x0010 ac10 0103 0339 8722 5df0 5f71 5da8 f419 .....9."]._q]...
0x0020 8010 7fff a61d 0000 0101 080a 0bb2 22cb ..............".
0x0030 0bb2 22cb ..".
Then nothing happens on that conversation for 3 minutes. After that, avast sends:
10:42:51.151127 bellux.theotherbell.com.34594 > bellux.theotherbell.com.smtp-backdoor: F 656:656(0) ack 131 win 32767 <nop,nop,timestamp 196241685 196223691> (DF)
0x0000 4500 0034 d357 4000 4006 0d46 ac10 0103 E..4.W@.@..F....
0x0010 ac10 0103 8722 0339 5da8 f419 5df0 5f71 .....".9]...]._q
0x0020 8011 7fff 5fd2 0000 0101 080a 0bb2 6915 ...._.........i.
0x0030 0bb2 22cb ..".
There are two final packets, but the mail is never delivered... and the actual body of the message is never sent. The conversation for the other email is similar except for the fact that the body is sent... but that one doesn't get delivered either. And deleting one of them has no effect on the other one not being delivered.
At the time this happens, other emails are being successfully scanned and delivered.