[Dovecot] Proxying for some users and having the rest local?
I'm migrating a load of mailboxes from cyrus to a new dovecot server.
What I'd like to do is to switch the DNS to dovecot, and set things up so that all old imap mailboxes are accessed through the dovecot proxy. That way I can migrate them one at a time independent of DNS issues.
I've got a load of users specified in mysql, and that configuration works well for local mailboxes.
How do I configure things so that I can switch proxy access on and off?
What's I've got so far is:
password_query = SELECT user, domain, password, "masteruser" as master, "masterpass" as pass, proxy, "remoteimap.server" as host FROM mailboxes
WHERE user = '%n' AND isMailbox AND active AND domain = '%d'
I imagined that I could switch the proxy per user by setting proxy='n' or proxy=null for any users that want to be local, and proxy='y' for any users that I want to forward on to the original server.
It doesn't appear to work that way though. Irrespective of the proxy value dovecot appears to try and proxy all users.
What am I doing wrong? I can't work it out from the docs, and the source will take quite a bit of studying to get to the bottom of it all.
Thanks :), Joe
On 7.5.2012, at 22.21, Dr Josef Karthauser wrote:
password_query = SELECT user, domain, password, "masteruser" as master, "masterpass" as pass, proxy, "remoteimap.server" as host FROM mailboxes
WHERE user = '%n' AND isMailbox AND active AND domain = '%d'I imagined that I could switch the proxy per user by setting proxy='n' or proxy=null for any users that want to be local, and proxy='y' for any users that I want to forward on to the original server.
It doesn't appear to work that way though. Irrespective of the proxy value dovecot appears to try and proxy all users.
If you return a host setting, Dovecot handles it as login referral: http://wiki2.dovecot.org/PasswordDatabase/ExtraFields/Host
So you need to return proxy=null and host=null.
If that doesn't seem to help, set auth_debug=yes and verify from the logs that neither of them are returned by auth process.
On 7 May 2012, at 20:28, Timo Sirainen wrote:
On 7.5.2012, at 22.21, Dr Josef Karthauser wrote:
password_query = SELECT user, domain, password, "masteruser" as master, "masterpass" as pass, proxy, "remoteimap.server" as host FROM mailboxes
WHERE user = '%n' AND isMailbox AND active AND domain = '%d'I imagined that I could switch the proxy per user by setting proxy='n' or proxy=null for any users that want to be local, and proxy='y' for any users that I want to forward on to the original server.
It doesn't appear to work that way though. Irrespective of the proxy value dovecot appears to try and proxy all users.
If you return a host setting, Dovecot handles it as login referral: http://wiki2.dovecot.org/PasswordDatabase/ExtraFields/Host
So you need to return proxy=null and host=null.
If that doesn't seem to help, set auth_debug=yes and verify from the logs that neither of them are returned by auth process.
Perfect, thanks for the quick feedback. (Would it be possible to fix the docs a tweak; it's exactly this kind of information that would be useful to know :).
Thanks, Joe
On 7 May 2012, at 20:28, Timo Sirainen wrote:
If you return a host setting, Dovecot handles it as login referral: http://wiki2.dovecot.org/PasswordDatabase/ExtraFields/Host
So you need to return proxy=null and host=null.
If that doesn't seem to help, set auth_debug=yes and verify from the logs that neither of them are returned by auth process.
Ok, setting proxy and host to null is having the desired behaviour. Thanks :).
Joe
participants (2)
-
Dr Josef Karthauser
-
Timo Sirainen