Commits

Zhang Huangbin  committed 78143bb

Fixed: Cannot correctly hander mail list access policy 'subdomain'.

  • Participants
  • Parent commits 4cf7460

Comments (0)

Files changed (3)

 iRedAPD-1.3.8:
     * Add rc scripts for OpenBSD.
     * Fixed:
+        + Cannot correctly hander mail list access policy 'subdomain'.
         + Cannot handle '@.' (without quotes) to match all destinations.
 
 iRedAPD-1.3.7:

File src/plugins/ldap_maillist_access_policy.py

         # Bypass all users under the same domain and sub domains.
         returned = False
         for d in recipient_alias_domains:
-            if sender.endswith('.' + d):
+            if sender.endswith(d) or sender.endswith('.' + d):
                 return 'DUNNO Access policy: subdomain (%s)' % (d)
 
         if returned is False:

File src/plugins/sql_alias_access_policy.py

             return SMTP_ACTIONS['reject']
     elif policy == POLICY_SUBDOMAIN:
         # Bypass all users under the same domain or sub domains.
-        if senderReceiver['sender'].endswith('.' + senderReceiver['recipient_domain']):
+        if senderReceiver['sender'].endswith(senderReceiver['recipient_domain']) or \
+           senderReceiver['sender'].endswith('.' + senderReceiver['recipient_domain']):
             return 'DUNNO'
         else:
             return SMTP_ACTIONS['reject']