summaryrefslogtreecommitdiffstats
path: root/roles/common-LDAP/templates/etc/ldap
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2014-07-09 01:08:02 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-06-07 02:52:48 +0200
commit368540caee8fff8aa90b1542897188e9f98ac585 (patch)
treeb85f6ae068ffccb0c8647fe7f15c662e5eb40432 /roles/common-LDAP/templates/etc/ldap
parente0b6b5f49111883bbebf14e9648830027eeec6df (diff)
Ensure Postfix's LDAP searchBase exists when doing a lookup.
Postfix interprets Error Code 32 (No Such Object) as lookup failures, but that's ugly... Also, make Postfix simple bind against cn=postfix,ou=services,dc=fripost,dc=org.
Diffstat (limited to 'roles/common-LDAP/templates/etc/ldap')
-rw-r--r--roles/common-LDAP/templates/etc/ldap/database.ldif.j231
1 files changed, 20 insertions, 11 deletions
diff --git a/roles/common-LDAP/templates/etc/ldap/database.ldif.j2 b/roles/common-LDAP/templates/etc/ldap/database.ldif.j2
index d3915df..4c45219 100644
--- a/roles/common-LDAP/templates/etc/ldap/database.ldif.j2
+++ b/roles/common-LDAP/templates/etc/ldap/database.ldif.j2
@@ -264,16 +264,22 @@ olcAccess: to dn.subtree="ou=virtual,dc=fripost,dc=org"
by users =0 break
{% endif -%}
#
-# * Dovecot may use the base as a searchBase on the MDA (for the iterate
-# filter), when SASL-binding using the EXTERNAL mechanism and
-# connecting to a local ldapi:// socket.
-{% if 'MDA' in group_names -%}
+# * Postfix may use the base as a searchBase on the MX:es, when
+# connecting a local ldapi:// socket from the 'private' directory in
+# one of the non-default instance's chroot.
+# * So may Dovecot on the MDA (needed for the iterate filter), when
+# SASL-binding using the EXTERNAL mechanism and connecting to a local
+# ldapi:// socket.
olcAccess: to dn.exact="ou=virtual,dc=fripost,dc=org"
attrs=entry,objectClass
filter=(objectClass=FripostVirtual)
- by dn.exact="username=dovecot,cn=peercred,cn=external,cn=auth" sockurl.regex="^ldapi://" =sd
- by users =0 break
-{% endif -%}
+ {% if 'MDA' in group_names -%}
+ by dn.exact="username=dovecot,cn=peercred,cn=external,cn=auth" sockurl.regex="^ldapi://" =sd
+ {% endif -%}
+ {% if 'MX' in group_names -%}
+ by dn.exact="cn=postfix,ou=services,dc=fripost,dc=org" sockurl.regex="^ldapi://%2Fvar%2Fspool%2Fpostfix-[-[:alnum:]]+%2Fprivate%2F" =sd
+ {% endif -%}
+ by users =0 break
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Domain entries
@@ -335,13 +341,16 @@ olcAccess: to dn.regex="^fvd=[^,]+,ou=virtual,dc=fripost,dc=org$"
# the MX:es, when SASL-binding using the EXTERNAL mechanism and
# connecting to a local ldapi:// socket. This is required for the
# 'reserved-alias.pl' script.
-{% if 'MX' in group_names %}
olcAccess: to dn.regex="^fvd=[^,]+,ou=virtual,dc=fripost,dc=org$"
attrs=fripostOwner,fripostPostmaster
filter=(&(objectClass=FripostVirtualDomain)(!(objectClass=FripostPendingEntry)))
- by dn.exact="username=nobody,cn=peercred,cn=external,cn=auth" sockurl.regex="^ldapi://" =rsd
- by users =0 break
-{% endif %}
+ {% if 'LDAP-provider' in group_names and groups.MX | difference([inventory_hostname]) -%}
+ by dn.exact="cn=mX,ou=syncRepl,dc=fripost,dc=org" tls_ssf=128 =rsd
+ {% endif -%}
+ {% if 'MX' in group_names %}
+ by dn.exact="username=nobody,cn=peercred,cn=external,cn=auth" sockurl.regex="^ldapi://" =rsd
+ {% endif -%}
+ by users =0 break
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Alias domain entries