2

having this situation:

In a local network two completely different / independent mailservers exist for completey different maildomains. There is just one public IP address available.

Now it should be possible to get IMAP access from "the outside" to both mailservers. Therefore just the default IMAP Port 143 should be forwarded which of course just can be done to one single server in the local network. So this single server has to forward IMAP traffic to the correct mailserver based on the maildomain (or IMAP Host set in the MailClient? Or EMail Address?)

How could this be realized? I think of some sort of "Reverse Proxy" for IMAP in a similar way for what is possible for Apache concerning HTTP ("ProxyPass" / "ProxyPassReverse").

Thx in advance for any hint!

T0mc@

T0mcat
  • 21
  • 1
  • 2
  • 2
    There is no reverse proxy for IMAP. You can do portforwarding to multiple target servers with different ports on the gateway. – Gerald Schneider Apr 21 '17 at 12:11
  • I stand corrected, [nginx is able to work as a proxy for IMAP](https://www.nginx.com/resources/admin-guide/mail-proxy/). I don't know if it is able to differentiate between different domains though, since (AFAIK) the IMAP protocol doesn't send the requested server name, as HTTP does. It may be possible that this is different if you use IMAPS, but this is pure speculation on my part. – Gerald Schneider Apr 21 '17 at 12:34
  • 2
    @GeraldSchneider: Dovecot can proxy to other IMAP servers. https://wiki2.dovecot.org/PasswordDatabase/ExtraFields/Proxy, and it can do this based on the user, so different endpoints for different users is a possibility. – Sven Apr 21 '17 at 12:37
  • Which IMAP server (software, I mean) are you using on those two servers? Which protocols, exactly, do you want to offer (IMAP, POP, with TLS or SSL)? Do usernames includes a "@domain" suffix and, ad such, suffix can bè used to properly route user to his/her own mailbox? Which is your authenticaion backend on the two servers? – Damiano Verzulli Apr 22 '17 at 23:29

0 Answers0