Commits

Zhang Huangbin  committed 7d20720

Typo.

  • Participants
  • Parent commits f2a304e

Comments (0)

Files changed (2)

File libs/ldaplib/conn_utils.py

 import logging
 import ldap
 import settings
-from libs import SMTP_ACTIONS
 
 
 def get_account_ldif(conn, account, attrlist=None):
     logging.debug('[+] Getting LDIF data of account: %s' % account)
 
-    ldap_filter = '(&(|(mail=%(account)s)(shadowAddress=%(account)s))(|(objectClass=mailUser)(objectClass=mailList)(objectClass=mailAlias)))' % {'account': account}
+    query_filter = '(&' + \
+                   '(|(mail=%(account)s)(shadowAddress=%(account)s))' + \
+                   '(|' + \
+                   '(objectClass=mailUser)' + \
+                   '(objectClass=mailList)' + \
+                   '(objectClass=mailAlias)' + \
+                   '))' % {'account': account}
 
-    logging.debug('search filter: %s' % ldap_filter)
-    logging.debug('search attributes: %s' % str(attrlist))
+    logging.debug('query filter: %s' % query_filter)
+    logging.debug('query attributes: %s' % str(attrlist))
     if not isinstance(attrlist, list):
         # Attribute list must be None or non-empty list
         attrlist = None
     try:
         result = conn.search_s(settings.ldap_basedn,
                                ldap.SCOPE_SUBTREE,
-                               ldap_filter,
+                               query_filter,
                                attrlist)
 
         if len(result) == 1:
     if policy in ['membersonly', 'members']:
         basedn = domaindn
         # Filter: get mail list members.
-        searchFilter = "(&(|(objectclass=mailUser)(objectClass=mailExternalUser))(accountStatus=active)(memberOfGroup=%s))" % (recipient, )
+        searchFilter = '(&(|(objectclass=mailUser)(objectClass=mailExternalUser))(accountStatus=active)(memberOfGroup=%s))' % (recipient)
 
         # Get both mail and shadowAddress.
         searchAttrs = ['mail', 'shadowAddress', ]
     except Exception, e:
         logging.debug('Error: %s' % str(e))
         return []
-

File plugins/sql_user_restrictions.py

 #
 # Valid sender/recipient addresses:
 #
-#   - @.:           all addresses (user, domain, sub-domain)
-#   - @domain.com:   single domain
-#   - @.domain.com:  single domain and its all sub-domains
+#   - @.:               all addresses (user, domain, sub-domain)
+#   - @domain.com:      single domain
+#   - @.domain.com:     single domain and its all sub-domains
 #   - user@domain.com:  single email address
 
 import logging