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

Krzysztof Oblucki koblucki at yahoo.com
Wed Nov 27 19:39:13 MST 2013


Awesome, that's what I've been trying to do for the past couple of days.  Definitely learning a lot of new things :)


________________________________
 From: "exarkun at twistedmatrix.com" <exarkun at twistedmatrix.com>
To: Twisted general discussion <twisted-python at twistedmatrix.com> 
Sent: Wednesday, November 27, 2013 5:18 PM
Subject: Re: [Twisted-Python] IMAP4 Proxy to add headers and modify body of an incoming message
 

> 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?

Sounds like you diagnosed the problem correctly.  IMAP4Server needs to handle Deferreds here and doesn't currently.

Jean-Paul

_______________________________________________
Twisted-Python mailing list
Twisted-Python at twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131127/d564bbf5/attachment-0001.html>


More information about the Twisted-Python mailing list