Hi all,

I'm still currently using Dovecot 2.3 on Debian, with a view to moving 2.4 asap. I have a requirement at this time as below, the scenario is:

LDAP is used as the auth backend, one user is receiving occasional ipalockouts caused by repeated attempts to authenticate unsuccessfully as that user.

To address this, this user will only be allowed to login from a particular ipv4 subnet, all other users should be able to login from any ipv4 address.

I have done much reading and searched the list archives for 'allow_nets ldap' which did bring up some interesting results.

My understanding of the current setup:

/etc/dovecot/conf.d/10-auth.conf has near the end !include auth-ldap.conf.ext

/etc/dovecot/conf.d/auth-ldap.conf.ext is where the passdb and userdb blocks are defined

The current passdb block in this file is:

passdb {

   driver = ldap

   args = /etc/dovecot/dovecot-ldap.conf.ext

   override_fields = home=/path/to/mailstore/dir/%u uid=user_for_mail gid=user_for_mail

}

In /etc/dovecot/dovecot-ldap.conf.ext has the settings for the ldap server.

What I think should happen:

In auth-ldap.conf.ext I have another passdb block before the above with only the username that should be restricted and in there with allow_nets of the ip address it should be allowed to connect from.

What I'm not sure of:

1/ New (first passdb block which contains the restricted user), what is the layout of the passdb block, is it :

passdb {

    driver = passwd-file

   args = username_format=%Lu /etc/dovecot/restricted-users

   Do I need a setting here to say it was correct or not and to continue to the second passdb block

}

In /etc/dovecot/restricted-users I have the username of the restricted user along with allow_nets, what other information should be present. The docs give an example for passwd-file (https://doc.dovecot.org/2.3/configuration_manual/authentication/allow_nets/) but not LDAP.

Should the driver be passwd-file or ldap, if ldap do I do a lookup for that user and store the ip's in LDAP. If not do I use pass_attrs so define them so I don't need to store them in ldap.

I have read posts such as https://dovecot.org/mailman3/archives/list/[email protected]/message/UV4BZXQMCHFNAEHPFQJRSMWW4FUTKPA5/ which I think provide valuable information.

I've not had to set authentication configuration before, this is new to me, I'd appreciate some guidance in this matter.

Exim4, I believe this may need to be setup separately or will the authenticator work accordingly because it is checking Dovecot as the source of truth?

Many thanks

Daniel

_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to