[Twisted-Python] IMAP4Client closes connection cleanly during search()

Johannes Beigel johannes.beigel at brainbot.com
Wed Oct 26 04:27:51 EDT 2005


I'm using twisted.mail.imap4.IMAP4Client and sometimes the connection 
gets closed cleanly "in the middle" of a command. This occurs (in a 
reproducible way) when I do imapClient.search(imap4.Query(all=True)) on 
a really big mailbox folder. The big problem is: Neither callback nor 
errback added to the Deferred from search() is called!

I override factory.connectionLost() to get notified about the connection 
loss, but I'm not really sure what to do when I lose the connection 
(would be a lot of code to get to the same state the IMAP client has 
been in, when some command fails). If the errback connected to search() 
would be called the handling would be much easier, although I think this 
would just result in a new connection loss when trying again.

Any ideas about what happens? e-mail clients like Thunderbird have to 
problems listing the contents of this folder.

It's an courier-imap server, plain (non-TLS) connection.

Any help appreciated!


More information about the Twisted-Python mailing list