from .ldap import BaseLdapApplication
from ..xlate import XLATOR
-__version__ = '0.8.3'
+__version__ = '0.8.4'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
self.ldap_mail_dns = {}
inst = self.ldap_instances[0]
- ldap_filter = '(|(mail=*)(mailAlternateAddress=*)(mailEquivalentAddress=*))'
+ ldap_filter = (
+ '(&(|'
+ '(objectClass=inetLocalMailRecipient)'
+ '(objectClass=inetMailGroup)'
+ '(objectclass=inetMailUser)'
+ ')(|'
+ '(mail=*)'
+ '(mailAlternateAddress=*)'
+ '(mailEquivalentAddress=*)'
+ '))'
+ )
attributes = ['dn', 'mail', 'mailAlternateAddress', 'mailEquivalentAddress']
result = self.get_all_entries(inst, ldap_filter=ldap_filter, attributes=attributes)
if dn not in self.ldap_mail_dns[mail]:
self.ldap_mail_dns[mail].append(dn)
- if self.verbose > 2:
- msg = _('LDAP Barracuda:')
- msg += '\n' + pp(result)
+ if self.verbose > 1:
+ msg = _('LDAP entries with mail attributes except them for Barracuda:')
+ msg += '\n' + pp(self.ldap_mail_dns)
LOG.debug(msg)
# -------------------------------------------------------------------------