[Dovecot] Can we retrieve Dovecot Proxys 'hostName' from Directorinstead of LDAP?

Brad Davidson brandond at uoregon.edu
Wed Sep 29 21:46:13 EEST 2010


Edward,

> -----Original Message-----
> So far all examples I've seen on the dovecot
> site require the proxy to know the exact mail server to pass the user
to by
> way of an LDAP lookup.
> 
> Does anyone know of a way to have Dovecot Proxy pick a server from
> Directors
> status list instead of looking it up from LDAP?

Automatically setting the proxy destination is actually the core
function of the Director. It maintains an internal list of available
backend servers, and uses a hash algorithm to balance logins across
them. All you need to do to enable this is:

director_servers = <list of director nodes>
director_mail_servers = <list of mail servers>
service director {
  unix_listener login/director {
    mode = 0666
  }
  fifo_listener login/proxy-notify {
    mode = 0666
  }
}
passdb {
  driver = static
  args = nopassword=y proxy=y
}
userdb {
  driver = static
  args = uid=dovenull gid=dovenull home=/var/run/dovecot/empty
}
service imap-login {
  executable = imap-login director
}
service pop3-login {
  executable = pop3-login director
}

This tells the login processes to talk to the Director, and the static
passdb/userdb tells the Director to proxy all connections and let the
backend node handle authentication.

Note that this won't work if specific users need to be on specific
servers - the Director makes sure that all of a user's sessions end up
the same host, but it does not care which host it is.

> Also, how does Director discover that an IMAP server is up or down so
that
> it can adjust in the case of a server failure? Is this something that
> Director does automatically or do we need to manually change the mail
> servers vhost count in case of an IMAP node failure?

It does not handle failure on its own. Several of us are using this to
detect and react to node failures:
http://github.com/brandond/poolmon

-Brad


More information about the dovecot mailing list