Authenticate Postfix through Dovecot with slightly different LDAP settings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Authenticate Postfix through Dovecot with slightly different LDAP settings

Jakob Lenfers
Hi,

I'm setting up a server with Dovecot (2.2.2) and Postfix (3.1.0).
Dovecot authenticates against LDAP and Postfix uses Dovecots SASL. That
already works fine. But I would like to have slightly different LDAP
settings for Dovecot and Postfix. Current setup:

passdb {
  driver = ldap
  args = /etc/dovecot/dovecot-ldap.conf.ext
}
userdb {
  driver = ldap
  args = /etc/dovecot/dovecot-ldap.conf.ext
}

Excerpt from dovecot-ldap.conf.ext:

user_filter = (& \
    (objectClass=gosaMailAccount) \
    (allowedServices=*I*) \
    (uid=%u) \
)

I wanted to have sparate LDAP filters (allowedServices=*I* for Dovecot
and allowedServices=*S* for Postfix), to be able to disable SMTP and
IMAP independently. Does anybody know a way to separate those settings?

Thanks in advance,
Jakob
Reply | Threaded
Open this post in threaded view
|

Re: Authenticate Postfix through Dovecot with slightly different LDAP settings

Aki Tuomi-2


On 15.11.2017 14:16, Jakob Lenfers wrote:

> Hi,
>
> I'm setting up a server with Dovecot (2.2.2) and Postfix (3.1.0).
> Dovecot authenticates against LDAP and Postfix uses Dovecots SASL. That
> already works fine. But I would like to have slightly different LDAP
> settings for Dovecot and Postfix. Current setup:
>
> passdb {
>   driver = ldap
>   args = /etc/dovecot/dovecot-ldap.conf.ext
> }
> userdb {
>   driver = ldap
>   args = /etc/dovecot/dovecot-ldap.conf.ext
> }
>
> Excerpt from dovecot-ldap.conf.ext:
>
> user_filter = (& \
>     (objectClass=gosaMailAccount) \
>     (allowedServices=*I*) \
>     (uid=%u) \
> )
>
> I wanted to have sparate LDAP filters (allowedServices=*I* for Dovecot
> and allowedServices=*S* for Postfix), to be able to disable SMTP and
> IMAP independently. Does anybody know a way to separate those settings?
>
> Thanks in advance,
> Jakob

You can use %1Ls variable to produce I or S.

Aki
Reply | Threaded
Open this post in threaded view
|

Re: Authenticate Postfix through Dovecot with slightly different LDAP settings

Jakob Lenfers
On 15.11.2017 13:18, Aki Tuomi wrote:
> On 15.11.2017 14:16, Jakob Lenfers wrote:

>> user_filter = (& \
>>     (objectClass=gosaMailAccount) \
>>     (allowedServices=*I*) \
>>     (uid=%u) \
>> )
>>
>> I wanted to have sparate LDAP filters (allowedServices=*I* for Dovecot
>> and allowedServices=*S* for Postfix), to be able to disable SMTP and
>> IMAP independently. Does anybody know a way to separate those settings?
> You can use %1Ls variable to produce I or S.

Genius, thanks, that works!

Thanks,
Jakob