[Dovecot] Dovecot + SASL + allow_nets
Hi,
When using dovecot for authentication of an SASL (postfix) request, i cannot use the allow_nets parameter. The IP-address of the requester is not known in dovecot.
I would like to allow sasl for certain users, others are not allowed to access via SASL. Some users can have access to imap and pop3 from certain IP-addresses.
How could i combine this in then dovecot configuration?
-- Best regards,
Marc
On Mon, 2007-12-03 at 14:36 +0100, Marc Cuypers wrote:
When using dovecot for authentication of an SASL (postfix) request, i cannot use the allow_nets parameter. The IP-address of the requester is not known in dovecot.
I would like to allow sasl for certain users, others are not allowed to access via SASL. Some users can have access to imap and pop3 from certain IP-addresses.
How could i combine this in then dovecot configuration?
Since Postfix doesn't send the IP to Dovecot, there isn't anything on Dovecot's side you can do. You could try asking about this in Postfix list.. Someone at least had a patch which allowed sending local IP to Dovecot (http://marc.info/?t=119306971600010&r=1&w=2). Maybe it sends remote IP as well.
Timo Sirainen schreef:
On Mon, 2007-12-03 at 14:36 +0100, Marc Cuypers wrote:
When using dovecot for authentication of an SASL (postfix) request, i cannot use the allow_nets parameter. The IP-address of the requester is not known in dovecot.
I would like to allow sasl for certain users, others are not allowed to access via SASL. Some users can have access to imap and pop3 from certain IP-addresses.
How could i combine this in then dovecot configuration?
Since Postfix doesn't send the IP to Dovecot, there isn't anything on Dovecot's side you can do. You could try asking about this in Postfix list.. Someone at least had a patch which allowed sending local IP to Dovecot (http://marc.info/?t=119306971600010&r=1&w=2). Maybe it sends remote IP as well.
Would it be possible to use a different authentication method for pop/imap and sasl?
-- Marc
On 3.12.2007, at 17.39, Marc Cuypers wrote:
When using dovecot for authentication of an SASL (postfix)
request, i cannot use the allow_nets parameter. The IP-address
of the requester is not known in dovecot.I would like to allow sasl for certain users, others are not
allowed to access via SASL. Some users can have access to imap and pop3 from certain IP- addresses.How could i combine this in then dovecot configuration? Since Postfix doesn't send the IP to Dovecot, there isn't anything on Dovecot's side you can do. You could try asking about this in Postfix
On Mon, 2007-12-03 at 14:36 +0100, Marc Cuypers wrote: list.. Someone at least had a patch which allowed sending local IP to Dovecot (http://marc.info/?t=119306971600010&r=1&w=2). Maybe it sends remote IP as well. Would it be possible to use a different authentication method for
Timo Sirainen schreef: pop/imap and sasl?
What do you mean by different authentication method? Also all of POP,
IMAP and SMTP use SASL actually, so I guess by SASL you mean Postfix?
http://wiki.dovecot.org/Sasl and http://wiki.dovecot.org/
Authentication/Mechanisms might be useful to read.
In any case if you want to add some IP checks to SMTP authentication,
there's no way to do that on Dovecot's side without changing Postfix.
Timo Sirainen schreef:
On 3.12.2007, at 17.39, Marc Cuypers wrote:
When using dovecot for authentication of an SASL (postfix) request, i cannot use the allow_nets parameter. The IP-address of the requester is not known in dovecot.
I would like to allow sasl for certain users, others are not allowed to access via SASL. Some users can have access to imap and pop3 from certain IP-addresses.
How could i combine this in then dovecot configuration? Since Postfix doesn't send the IP to Dovecot, there isn't anything on Dovecot's side you can do. You could try asking about this in Postfix
On Mon, 2007-12-03 at 14:36 +0100, Marc Cuypers wrote: list.. Someone at least had a patch which allowed sending local IP to Dovecot (http://marc.info/?t=119306971600010&r=1&w=2). Maybe it sends remote IP as well. Would it be possible to use a different authentication method for
Timo Sirainen schreef: pop/imap and sasl?
What do you mean by different authentication method? Also all of POP, IMAP and SMTP use SASL actually, so I guess by SASL you mean Postfix? http://wiki.dovecot.org/Sasl and http://wiki.dovecot.org/Authentication/Mechanisms might be useful to read.
In any case if you want to add some IP checks to SMTP authentication, there's no way to do that on Dovecot's side without changing Postfix. What i meant was, is there a way to: IMAP/POP3: authenticate with dovecot and checking for allow_nets SASL (postfix): authenticate with dovecot without the checking for allow_nets (just another pass_attrs)
-- Marc
On Mon, 2007-12-03 at 16:49 +0100, Marc Cuypers wrote:
What i meant was, is there a way to: IMAP/POP3: authenticate with dovecot and checking for allow_nets SASL (postfix): authenticate with dovecot without the checking for allow_nets (just another pass_attrs)
Hmm. There's no easy way with LDAP. You'd need to either run a separate Dovecot installation with a different config file, or alternatively have separate accounts in LDAP for SMTP and non-SMTP (where only non-SMTP has allow_nets).
Timo Sirainen schreef:
On Mon, 2007-12-03 at 16:49 +0100, Marc Cuypers wrote:
What i meant was, is there a way to: IMAP/POP3: authenticate with dovecot and checking for allow_nets SASL (postfix): authenticate with dovecot without the checking for allow_nets (just another pass_attrs)
Hmm. There's no easy way with LDAP. You'd need to either run a separate Dovecot installation with a different config file, or alternatively have separate accounts in LDAP for SMTP and non-SMTP (where only non-SMTP has allow_nets).
In the configuration file there is a section 'auth default { }'. Is it possible to have another section like 'auth smtp { }' where i declare the client socket for postfix?
-- Marc
On Wed, 2007-12-05 at 15:23 +0100, Marc Cuypers wrote:
Timo Sirainen schreef:
On Mon, 2007-12-03 at 16:49 +0100, Marc Cuypers wrote:
What i meant was, is there a way to: IMAP/POP3: authenticate with dovecot and checking for allow_nets SASL (postfix): authenticate with dovecot without the checking for allow_nets (just another pass_attrs)
Hmm. There's no easy way with LDAP. You'd need to either run a separate Dovecot installation with a different config file, or alternatively have separate accounts in LDAP for SMTP and non-SMTP (where only non-SMTP has allow_nets).
In the configuration file there is a section 'auth default { }'. Is it possible to have another section like 'auth smtp { }' where i declare the client socket for postfix?
It's possible to create such section, but it doesn't do what you want. I'm planning on fixing this for v2.0.
On Dec 3, 2007 7:36 AM, Marc Cuypers m.cuypers@mgvd.be wrote:
Hi,
When using dovecot for authentication of an SASL (postfix) request, i cannot use the allow_nets parameter. The IP-address of the requester is not known in dovecot.
I would like to allow sasl for certain users, others are not allowed to access via SASL. Some users can have access to imap and pop3 from certain IP-addresses.
How could i combine this in then dovecot configuration?
-- Best regards,
Marc
You can do this in postfix main.cf using the smtpd_sasl_exceptions_networks parameter. Normally this parameter lists networks *not* allowed to use AUTH, but you can exempt certain hosts by proceeding them with a "!". Note that order matters, here; exceptions must come before the static:all entry.
For example. to offer AUTH only to 192.0.2.0-192.0.2.255: # main.cf smtpd_sasl_exceptions_networks = !192.0.2.0/24 static:all
See also http://www.postfix.org/postconf.5.html#smtpd_sasl_exceptions_networks Or for an alternative method: http://www.postfix.org/postconf.5.html#smtpd_discard_ehlo_keyword_address_ma...
-- Noel Jones
Noel Jones schreef:
On Dec 3, 2007 7:36 AM, Marc Cuypers m.cuypers@mgvd.be wrote:
Hi,
When using dovecot for authentication of an SASL (postfix) request, i cannot use the allow_nets parameter. The IP-address of the requester is not known in dovecot.
I would like to allow sasl for certain users, others are not allowed to access via SASL. Some users can have access to imap and pop3 from certain IP-addresses.
How could i combine this in then dovecot configuration?
-- Best regards,
Marc
You can do this in postfix main.cf using the smtpd_sasl_exceptions_networks parameter. Normally this parameter lists networks *not* allowed to use AUTH, but you can exempt certain hosts by proceeding them with a "!". Note that order matters, here; exceptions must come before the static:all entry.
For example. to offer AUTH only to 192.0.2.0-192.0.2.255: # main.cf smtpd_sasl_exceptions_networks = !192.0.2.0/24 static:all
See also http://www.postfix.org/postconf.5.html#smtpd_sasl_exceptions_networks Or for an alternative method: http://www.postfix.org/postconf.5.html#smtpd_discard_ehlo_keyword_address_ma...
OK, thanks,
But it is not user related. I want some user to be able to SASL, others don't.
-- Marc
participants (3)
-
Marc Cuypers
-
Noel Jones
-
Timo Sirainen