[Dovecot] dovecot with ldap and allow_nets
Hi,
I'm using dovecot on debian etch: ||/ Name Version ii dovecot-common 1.0.rc15-2etch1 ii dovecot-imapd 1.0.rc15-2etch1 ii dovecot-pop3d 1.0.rc15-2etch1
# dovecot --version 1.0.rc15
Now here is my question.
Some of the mail users may only login from the LAN, while others can login from the LAN and the internet.
I've read about allow_nets but i can't find very much info when dovecot is used with ldap. Can someone give me a direction (url, configuration file, ...).
Thanks in advance.
-- Best regards,
Marc
On 11/25/2007, Marc Cuypers (m.cuypers@mgvd.be) wrote:
Charles Marcus wrote:
On 11/23/2007, Marc Cuypers (m.cuypers@mgvd.be) wrote:
# dovecot --version 1.0.rc15
Extremely old...
Upgrade...
Does your reply mean that allow_nets didn't work with version 1.0.
Not necessarily - it means its so old that I (and most likely more than a few others) don't want to hassle with checking to see what possible problems/bugs it had that are fixed in current releases.
Unlike myself, Timo could I'm sure answer a lot of question like this off the top of his head, but I'm also sure even he gets irritated by people who come here asking for help when they are running an ancient version.
In other words, as with all free software - the more current version, you are running, the easier it will be to get support...
--
Best regards,
Charles
Charles Marcus schreef:
On 11/25/2007, Marc Cuypers (m.cuypers@mgvd.be) wrote:
Charles Marcus wrote:
On 11/23/2007, Marc Cuypers (m.cuypers@mgvd.be) wrote:
# dovecot --version 1.0.rc15
Extremely old...
Upgrade...
Does your reply mean that allow_nets didn't work with version 1.0.
Not necessarily - it means its so old that I (and most likely more than a few others) don't want to hassle with checking to see what possible problems/bugs it had that are fixed in current releases.
Unlike myself, Timo could I'm sure answer a lot of question like this off the top of his head, but I'm also sure even he gets irritated by people who come here asking for help when they are running an ancient version.
In other words, as with all free software - the more current version, you are running, the easier it will be to get support...
You are probably right.
I'll try to compile dovecot 1.0.7 on a test machine (debian etch), and test again.
-- Marc
On Fri, 2007-11-23 at 16:12 +0100, Marc Cuypers wrote:
Some of the mail users may only login from the LAN, while others can login from the LAN and the internet.
I've read about allow_nets but i can't find very much info when dovecot is used with ldap. Can someone give me a direction (url, configuration file, ...).
You'll have to store the allow_nets field to LDAP using some name and tell Dovecot to use it in pass_attrs. On LDAP side you probably need some special schema (don't ask me about that) or you need to use some other existing field for that purpose.
pass_attrs anyway goes something like:
pass_attrs = uid=user,userPassword=password,someField=allow_nets
Timo Sirainen schreef:
On Fri, 2007-11-23 at 16:12 +0100, Marc Cuypers wrote:
Some of the mail users may only login from the LAN, while others can login from the LAN and the internet.
I've read about allow_nets but i can't find very much info when dovecot is used with ldap. Can someone give me a direction (url, configuration file, ...).
You'll have to store the allow_nets field to LDAP using some name and tell Dovecot to use it in pass_attrs. On LDAP side you probably need some special schema (don't ask me about that) or you need to use some other existing field for that purpose.
pass_attrs anyway goes something like:
pass_attrs = uid=user,userPassword=password,someField=allow_nets
I already added the field allownets to the ldap database. Then i compiled dovecot 1.0.7 on a test machine and set dovecot up to use ldap. # dovecot --version 1.0.7
The LAN is using the addresses in the range 10.0.0.0/24. The test machine (server) is 10.0.0.224 and the client is 10.0.0.110 Even when allow_nets contains 127.0.0.1/8, 192.168.1.0/24, i get access. With this setting I thought i only could login from 127.0.0.1 and from the network 192.168.1.0/24.
Hereunder the logs and de configuration files.
Configuration files used
protocol pop3 { pop3_uidl_format = %08Xu%08Xv } auth_debug = yes auth default { mechanisms = plain login passdb ldap { args = /etc/dovecot/dovecot-ldap.conf }
userdb ldap { args = /etc/dovecot/dovecot-ldap.conf } user = root socket listen { client { path = /var/spool/postfix/private/auth mode = 0660 user = postfix group = postfix } } } dict { } plugin { }
-- Marc
On Tue, 2007-11-27 at 09:20 +0100, Marc Cuypers wrote:
dovecot: 2007-11-27 09:04:14 Info: auth(default): ldap(marc,10.0.0.110): bind: dn=uid=marc,ou=accounts,ou=people,dc=mgvd,dc=be
So it binds.
auth_bind = no auth_bind_userdn = uid=%u,ou=accounts,ou=people,dc=mgvd,dc=be
I guess setting auth_bind_userdn makes Dovecot ignore auth_bind setting. Maybe I should change that.. Or I guess I'll do it only for v1.1. Anyway, do you want auth binds?
The problem is that if you set auth_bind_userdn, Dovecot doesn't do the pass_attrs/filter lookup at all, because that's what auth_bind_userdn optimization is for.
Timo Sirainen schreef:
On Tue, 2007-11-27 at 09:20 +0100, Marc Cuypers wrote:
dovecot: 2007-11-27 09:04:14 Info: auth(default): ldap(marc,10.0.0.110): bind: dn=uid=marc,ou=accounts,ou=people,dc=mgvd,dc=be
So it binds.
auth_bind = no auth_bind_userdn = uid=%u,ou=accounts,ou=people,dc=mgvd,dc=be
I guess setting auth_bind_userdn makes Dovecot ignore auth_bind setting. Maybe I should change that.. Or I guess I'll do it only for v1.1. Anyway, do you want auth binds?
The problem is that if you set auth_bind_userdn, Dovecot doesn't do the pass_attrs/filter lookup at all, because that's what auth_bind_userdn optimization is for.
Commenting out auth_bind_userdn helps.
Now the problem is solved.
Many thanks.
I got a remark.
When allownets doesn't exist in ldap. The user is allowed to login. From a point of security this is not safe. When allownets is accidently removed from ldap, the user gets access from everywhere. I know that removing allownets should not happen, but it could.
Wouldn't it be safer, to deny access when allownets does not exist?
-- Marc
participants (3)
-
Charles Marcus
-
Marc Cuypers
-
Timo Sirainen