IMAP proxy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

IMAP proxy

Gandalf Corvotempesta-2
I'm migrating an old server to another old server (same dovecot
version in both servers)
The migration itself is straightforward, stop dovecot on the old
server, migrate everything via rsync, start dovecot to the new server.

There is only one step left: change the dns configuration, pointing
from the old server to the newer one.
As most of domains are not managed by me and some other domains are
pointing to our server via IP, I can't simply change the A record or
wait for all users to change their domain configuration.

TL;DR: is possible to use dovecot as IMAP proxy so that even after
changing our dns records, any user directly connecting to my old
server would be proxied to the newer one automatically ?

Any additional software or only a configuration change is required ?
Reply | Threaded
Open this post in threaded view
|

Re: IMAP proxy

Aki Tuomi-2

> On December 15, 2017 at 6:57 PM Gandalf Corvotempesta <[hidden email]> wrote:
>
>
> I'm migrating an old server to another old server (same dovecot
> version in both servers)
> The migration itself is straightforward, stop dovecot on the old
> server, migrate everything via rsync, start dovecot to the new server.
>
> There is only one step left: change the dns configuration, pointing
> from the old server to the newer one.
> As most of domains are not managed by me and some other domains are
> pointing to our server via IP, I can't simply change the A record or
> wait for all users to change their domain configuration.
>
> TL;DR: is possible to use dovecot as IMAP proxy so that even after
> changing our dns records, any user directly connecting to my old
> server would be proxied to the newer one automatically ?
>
> Any additional software or only a configuration change is required ?

Return from passdb, 'proxy host=your-new-host port=143 ssl=starttls'

Aki
x9p
Reply | Threaded
Open this post in threaded view
|

Re: IMAP proxy

x9p

On Fri, December 15, 2017 3:21 pm, Aki Tuomi wrote:
>
>> On December 15, 2017 at 6:57 PM Gandalf Corvotempesta
>> <[hidden email]> wrote:
>>
>>
...
>> server would be proxied to the newer one automatically ?
>>
>> Any additional software or only a configuration change is required ?
>
> Return from passdb, 'proxy host=your-new-host port=143 ssl=starttls'
>
> Aki
>

Or masquerade all traffic to the new server with firewall rules:

iptables -t nat -A PREROUTING -i ethX -p tcp -m tcp --dport 143 -j DNAT
--to-destination 1.1.1.1

iptables -t nat -A POSTROUTING -d 1.1.1.1/32 -p tcp -m tcp --dport 143 -j
MASQUERADE

ethX --> interface where connections come from
1.1.1.1 --> new server IP address

Maybe smth is wrong up there, didnt tested, but I think its cool.


cheers.

--
x9p | PGP : 0x03B50AF5EA4C8D80 / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE
1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: IMAP proxy

Gandalf Corvotempesta-2
In reply to this post by Aki Tuomi-2
2017-12-15 18:21 GMT+01:00 Aki Tuomi <[hidden email]>:
> Return from passdb, 'proxy host=your-new-host port=143 ssl=starttls'

So, instead of returning the current db output: "user, password,
userdb_mail, userdb_sieve, ......"
is enough to only return "proxy host=your-new-host port=143 ssl=starttls" ?

Will dovecot automatically proxy pop3/imap on the new server ?

What about LDA ?