[Twisted-Python] need to make imap server replies

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Tue Jun 26 10:47:25 EDT 2012


On 24 Jun, 09:21 pm, ghanavatian.ali at gmail.com wrote:
>hello there,
>here's the code i got:
>http://pastebin.ubuntu.com/1058070/
>
>it's implementing an imap server, problem is it does not retrieve 
>emails.
>mail client can capture new emails only once and after that, it should
>disconnect and reconnect again to receive new emails (again only once).
>
>any idea what's wrong here?

There doesn't appear to be any attempt at reconnection logic in that 
example.  There is only one call to `reactor.connectTCP` and there is 
even a call to `reactor.stop()` after the first connection is done.

If you want the client to reconnect, you need to call 
`reactor.connectTCP` again at some point, not `reactor.stop()`.

Jean-Paul
>thanks in advance
>
>--
>Sincerely
>A. Ghanavatian <http://www.google.com/profiles/ghanavatian.ali>



More information about the Twisted-Python mailing list