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?
I got an answer on the Dovecot list. I used the %s (service variable) like this:
%L1s
uses the first letter of the%s
variable, which returnsimap
andsmtp
for the respective services.