[Twisted-Python] IMAP4 Proxy to add headers and modify body of an incoming message

Krzysztof Oblucki koblucki at yahoo.com
Wed Nov 27 17:02:40 MST 2013


Maybe I asked the wrong question?  Is it possible to use the imap4 library from twisted to write an imap4 proxy?


________________________________
 From: Krzysztof Oblucki <koblucki at yahoo.com>
To: "twisted-python at twistedmatrix.com" <twisted-python at twistedmatrix.com> 
Sent: Monday, November 25, 2013 11:27 AM
Subject: IMAP4 Proxy to add headers and modify body of an incoming message
 


Hello,
I am trying to write an IMAP proxy to modify headers and the body of an incoming message using twisted.  I am new to python and twisted so maybe this is why I either picked the wrong route or don't have the skills to get through some issues and I'm hoping that some you fine list members can point me in the right direction.

I started by using the IMAP4Client and IMAP4Server to do the proxying.  However, I realized that in certain cases, the IMAP4Server requires synchronous results but since I need to do an async call using the client the handling is not working properly.  I ran into this when implementing getFlags() in the IMessage and I am not sure how I can get out of this short of changing the IMAP4Server code to handle Deferreds.

Am I on the right track?  Is imap4 lib the right tool for this job?  If so, is modifying IMAP4Server to handle Deferreds the right thing to do?  If not, what would you recommend?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131127/614b175d/attachment.html>


More information about the Twisted-Python mailing list