0

I was asked to write an IMAP proxy that would act as a 'real' IMAP server, except that it would translate all requests from clients to the backend IMAP server. In this setup, the client connects to proxy directly and doesn't necessarily know about the backend. The idea is to have the proxy monitor all the mail the client fetches.

I have been looking into Twisted for accomplishing this task, because Twisted has a proxy module and it also has implementations of IMAP4 for client and server.

I would like to know if there are any difficulties with secure connections that one should be aware of. The program must monitor all traffic, thus it must maintain two secure connections with two different certificates. Is this feasible if the proxy has a certificate that the client trusts? Are there any pitfalls?

Also, is it possible to use the proxy module for this? I've seen a simple IMAP proxy written with this module, but the docs say it's for HTTP proxying.

  • 1
    Lots of people do this sort of thing, the last similar question here is not many days old. You'll run into the same problem: IMAP clients generally don't fetch entire messages. Instead they fetch small pieces as they need to. Subject and from first, perhaps body text later, etc. – arnt Mar 01 '15 at 19:58
  • @arnt Thanks for your reply. I guess I'll need to keep track of what pieces of a message the client has fetched so far. – Ivan Kolosov Mar 02 '15 at 08:10
  • hi there, looks very similar to this question: https://stackoverflow.com/q/74480207/3880225 – cilap Jan 08 '23 at 19:53

0 Answers0