[Dovecot] Proxy setup between two servers
Hi,
I am trying to set up a proxy between two dovecot servers. I have the following set up here.
Dovecot version: 1.0.rc15 dovecot -n: # /etc/dovecot/dovecot.conf info_log_path: /var/log/dovecot.log log_timestamp: %Y-%m-%d %H:%M:%S protocols: pop3 imap login_dir: /var/run/dovecot/login login_executable(default): /usr/lib/dovecot/imap-login login_executable(imap): /usr/lib/dovecot/imap-login login_executable(pop3): /usr/lib/dovecot/pop3-login mail_extra_groups: mail mail_debug: yes mail_executable(default): /usr/lib/dovecot/imap mail_executable(imap): /usr/lib/dovecot/imap mail_executable(pop3): /usr/lib/dovecot/pop3 mail_plugin_dir(default): /usr/lib/dovecot/modules/imap mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3 pop3_uidl_format(default): pop3_uidl_format(imap): pop3_uidl_format(pop3): %08Xu%08Xv auth default: verbose: yes debug: yes passdb: driver: ldap args: /etc/dovecot/dovecot-ldap.conf userdb: driver: prefetch
In dovecot-ldap.conf: hosts = localhost dn = <dn> dnpass = <dnpass> sasl_bind = no auth_bind = yes ldap_version = 2 base = <ldap-base-dn> pass_attrs = uid=user,userPassword=password,homeDirectory=userdb_home,uidNumber=userdb_uid, gidNumber=userdb_gid,mailQuota=quota,mailHost=proxy
If I set the mailHost attribute for a user as "localhost" or "127.0.0.1", I get the following error message in syslog:
mail.err: Sep 27 13:01:06 dovecot: auth(default): Master request 5534.1 not found
and at the same time, in info_log_path (/var/log/dovecot.log), I get the following messages:
Info: auth(default): client in: AUTH 1 PLAIN service=IMAP secured lip=127.0.0.1 rip=127.0.0.1 resp=<hidden> Info: auth(default): ldap(hoskeri,127.0.0.1): bind search: base=dc=deeproot,dc=co,dc=in filter=(&(objectClass=posixAccount)(uid=hoskeri)) Info: auth(default): ldap(hoskeri,127.0.0.1): result: uid(user)=hoskeri uidNumber(userdb_uid)=1004 homeDirectory(userdb_home)=/home/hoskeri mailHost(proxy)=127.0.0.1 gidNumber(userdb_gid)=1000 Info: auth(default): ldap(hoskeri,127.0.0.1): bind: dn=uid=hoskeri,ou=People,dc=deeproot,dc=co,dc=in Info: auth(default): client out: OK 1 user=hoskeri proxy pass=<hidden>
# I notice that in the above line, proxy does not any value associated with it. Can't understand why.
Info: auth(default): master in: REQUEST 1 5534 1 Info: auth(default): master out: NOTFOUND 1 Info: imap-login: Internal login failure: user=<hoskeri>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
I have not yet tried to proxy to some other host.
Also, I have another question. In the setup I need to do, I need to use the hostname itself for the mailhost, and not IPs, but I understand that it is not implemented and only IP addresses are acceptable. Any major reason why this is so? Could I help implement it?
Thanks in advance...
-Abhijit
Hi
I have not yet tried to proxy to some other host.
See my question a week or so previously. (Using mysql though).
Basically you need to return a null entry to mean "this machine", otherwise you return the IP of the machine you want to proxy to. Timo suggested a very interesting patch (which I haven't had time to try) which would allow an IP matching "this machine" to be the same as a NULL
- would probably help you out to - perhaps you can help test?
Good luck
Ed W
On Thu, Sep 27, 2007 at 09:38:16PM +0100, Ed W wrote:
Hi
I have not yet tried to proxy to some other host.
See my question a week or so previously. (Using mysql though).
I am trying out that patch now. Thanks.
Basically you need to return a null entry to mean "this machine",
I have surmounted my initial error, by using the userdb as LDAP also.
I also discovered, very late, that I needed to set another a total of two variables for proxying to work, from the wiki [PasswordDatabase/ExtraFields/Proxy].
proxy: which just needs to be 'set' no value is required. host: which points to the IP address of the host being proxied to.
So now I have this config:
dovecot -n: # /etc/dovecot/dovecot.conf info_log_path: /var/log/dovecot.log log_timestamp: %Y-%m-%d %H:%M:%S protocols: pop3 imap login_dir: /var/run/dovecot/login login_executable(default): /usr/lib/dovecot/imap-login login_executable(imap): /usr/lib/dovecot/imap-login login_executable(pop3): /usr/lib/dovecot/pop3-login mail_extra_groups: mail mail_debug: yes mail_executable(default): /usr/lib/dovecot/imap mail_executable(imap): /usr/lib/dovecot/imap mail_executable(pop3): /usr/lib/dovecot/pop3 mail_plugin_dir(default): /usr/lib/dovecot/modules/imap mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3 auth default: verbose: yes debug: yes passdb: driver: ldap args: /etc/dovecot/dovecot-ldap.conf userdb: driver: ldap args: /etc/dovecot/dovecot-ldap.conf
/etc/dovecot/dovecot-ldap.conf: hosts = localhost dn = <dn> dnpass = <dn-pass> sasl_bind = no auth_bind = yes ldap_version = 2 base = <dn-base> user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid pass_attrs = uid=user,userPassword=password,mailHost=host,qmailUID=proxy
I have set the proxy to qmailUID above simply because I need to give it some value, I think..
Still I get the following error.
Info: Dovecot v1.0.rc15 starting up Info: auth(default): client in: AUTH 1 PLAIN service=POP3 secured lip=127.0.0.1 rip=127.0.0.1 resp=<hidden> Info: auth(default): ldap(hoskeri,127.0.0.1): bind search: base=dc=deeproot,dc=co,dc=in filter=(&(objectClass=posixAccount)(uid=hoskeri)) Info: auth(default): ldap(hoskeri,127.0.0.1): result: uid(user)=hoskeri qmailUID(proxy)=1004 mailHost(host)=192.168.1.5 Info: auth(default): ldap(hoskeri,127.0.0.1): bind: dn=uid=hoskeri,ou=People,dc=deeproot,dc=co,dc=in Info: auth(default): client out: OK 1 user=hoskeri proxy host=192.168.1.5 pass=<hidden> Info: auth(default): master in: REQUEST 1 7067 1 Info: auth(default): master out: NOTFOUND 1 Info: pop3-login: Internal login failure: user=<hoskeri>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
In addition to that, If I change the dovecot-ldap.conf to the following I can log in and the logs show the proxy and host variable, but I get logged in to the localhost!
/etc/dovecot/dovecot-ldap.conf: hosts = localhost dn = uid=deepofix,ou=people,dc=deeproot,dc=co,dc=in dnpass = abhijit sasl_bind = no auth_bind = yes ldap_version = 2 base = dc=deeproot,dc=co,dc=in user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid,mailHost=host,qmailUID=proxy pass_attrs = uid=user,userPassword=password
Basically what I have done here is that I have moved the proxy detection variables to the user_attrs.
2007-09-28 15:18:14 Info: auth(default): ldap(hoskeri,127.0.0.1): bind: dn=uid=hoskeri,ou=People,dc=deeproot,dc=co,dc=in 2007-09-28 15:18:14 Info: auth(default): client out: OK 1 user=hoskeri 2007-09-28 15:18:14 Info: auth(default): master in: REQUEST 1 7328 1 2007-09-28 15:18:14 Info: auth(default): ldap(hoskeri,127.0.0.1): user search: base=dc=deeproot,dc=co,dc=in scope=subtree filter=(&(objectClass=posixAccount)(uid=hoskeri)) fields=homeDirectory,uidNumber,gidNumber,mailHost,qmailUID 2007-09-28 15:18:14 Info: auth(default): master out: USER 1 hoskeri uid=1004 home=/home/hoskeri proxy=1004 gid=1000 host=192.168.1.5 2007-09-28 15:18:14 Info: pop3-login: Login: user=<hoskeri>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured 2007-09-28 15:18:14 Info: POP3(hoskeri): Effective uid=1004, gid=1000 2007-09-28 15:18:14 Info: POP3(hoskeri): maildir: root exists (/home/hoskeri/Maildir) 2007-09-28 15:18:14 Info: POP3(hoskeri): maildir: root=/home/hoskeri/Maildir, index=/home/hoskeri/Maildir, control=, inbox= 2007-09-28 15:18:27 Info: POP3(hoskeri): Disconnected: Logged out top=0/0, retr=1/494, del=0/1, size=478
As you can see, even though it seems to have detected the proxy variables correctly, it still uses the local mailbox. I don't know what else I need to do :-(.
Thanks for any clue.
-Abhijit
participants (3)
-
Abhijit Hoskeri
-
Ed W
-
Timo Sirainen