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

Hello. 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! TIA -jojo

In reply to myself I want to mention some oddity I just figured out during debugging: The _lastCmd attribute of the IMAP4Client instance always contains the CAPABILITY command (I print it after every issued and completed IMAP command). This happens even if I run the test with a smaller mailbox folder, where everything works. -jojo

Hello. Yesterday I was a little short on time, so please excuse the lateness of this post containing the obligatory minimal example that reproduces the described bevhavior. Everything works just fine with small mailboxes for me. But using a big mailbox (approx. 5000 mails in it) results in "search failed" not printed and quit() being never called. Ciao -jojo

Could you please add the bug to http://twistedmatrix.com/bugs/ so we don't lose track of it? Thanks.

Itamar Shtull-Trauring schrieb:
Could you please add the bug to http://twistedmatrix.com/bugs/ so we don't lose track of it? Thanks.
OK, I just did it. It's Issue 1290. -jojo

In reply to myself I want to mention some oddity I just figured out during debugging: The _lastCmd attribute of the IMAP4Client instance always contains the CAPABILITY command (I print it after every issued and completed IMAP command). This happens even if I run the test with a smaller mailbox folder, where everything works. -jojo

Hello. Yesterday I was a little short on time, so please excuse the lateness of this post containing the obligatory minimal example that reproduces the described bevhavior. Everything works just fine with small mailboxes for me. But using a big mailbox (approx. 5000 mails in it) results in "search failed" not printed and quit() being never called. Ciao -jojo

Could you please add the bug to http://twistedmatrix.com/bugs/ so we don't lose track of it? Thanks.

Itamar Shtull-Trauring schrieb:
Could you please add the bug to http://twistedmatrix.com/bugs/ so we don't lose track of it? Thanks.
OK, I just did it. It's Issue 1290. -jojo
participants (2)
-
Itamar Shtull-Trauring
-
Johannes Beigel