<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Awesome, that's what I've been trying to do for the past couple of days.  Definitely learning a lot of new things :)</span></div><div><br></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> "exarkun@twistedmatrix.com" <exarkun@twistedmatrix.com><br> <b><span style="font-weight: bold;">To:</span></b> Twisted general discussion <twisted-python@twistedmatrix.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, November 27, 2013 5:18 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Twisted-Python] IMAP4 Proxy to add headers
 and modify body of an incoming message<br> </font> </div> <div class="y_msg_container"><br>
> From: Krzysztof Oblucki <<a ymailto="mailto:koblucki@yahoo.com" href="mailto:koblucki@yahoo.com">koblucki@yahoo.com</a>><br>> To: "<a ymailto="mailto:twisted-python@twistedmatrix.com" href="mailto:twisted-python@twistedmatrix.com">twisted-python@twistedmatrix.com</a>" <twisted- <a ymailto="mailto:python@twistedmatrix.com" href="mailto:python@twistedmatrix.com">python@twistedmatrix.com</a>><br>> Sent: Monday, November 25, 2013 11:27 AM<br>> Subject: IMAP4 Proxy to add headers and modify body of an incoming message<br>> <br>> Hello,<br>> 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.<br>> <br>> 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.<br>> <br>> 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?<br><br>Sounds like you diagnosed the problem correctly.  IMAP4Server needs to handle Deferreds here and doesn't currently.<br><br>Jean-Paul<br><br>_______________________________________________<br>Twisted-Python mailing list<br><a ymailto="mailto:Twisted-Python@twistedmatrix.com"
 href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python<br><br><br></div> </div> </div>  </div></body></html>