Commits

Zhang Huangbin committed 09651e7

Fixed: Incorrect variable name in plugins/sql_alias_access_policy.py.

Comments (0)

Files changed (2)

 iRedAPD-1.4.1:
     * Fixed:
+        + Incorrect variable name in plugins/sql_alias_access_policy.py.
         + Not quote email address and domain name in SQL command in plugins
           sql_alias_access_policy.py, sql_user_restrictions.py.
           Thanks Petr Pytelka <pytelka _at_ lightcomp.cz> for the report.

plugins/sql_alias_access_policy.py

 def restriction(**kwargs):
     conn = kwargs['conn']
     sender = kwargs['sender']
+    sender_domain = kwargs['sender_domain']
     recipient = kwargs['recipient']
     recipient_domain = kwargs['recipient_domain']
 
         return 'DUNNO'
     elif policy == MAILLIST_POLICY_DOMAIN:
         # Bypass all users under the same domain.
-        if senderReceiver['sender_domain'] == senderReceiver['recipient_domain']:
+        if sender_domain == recipient_domain:
             return 'DUNNO'
         else:
             return SMTP_ACTIONS['reject']
     elif policy == MAILLIST_POLICY_SUBDOMAIN:
         # Bypass all users under the same domain or sub domains.
-        if senderReceiver['sender'].endswith(senderReceiver['recipient_domain']) or \
-                senderReceiver['sender'].endswith('.' + senderReceiver['recipient_domain']):
+        if sender.endswith(recipient_domain) or sender.endswith('.' + recipient_domain):
             return 'DUNNO'
         else:
             return SMTP_ACTIONS['reject']
     elif policy == MAILLIST_POLICY_MEMBERSONLY:
         # Bypass all members.
-        if senderReceiver['sender'] in members:
+        if sender in members:
             return 'DUNNO'
         else:
             return SMTP_ACTIONS['reject']
     elif policy == MAILLIST_POLICY_ALLOWEDONLY:
         # Bypass all moderators.
-        if senderReceiver['sender'] in moderators:
+        if sender in moderators:
             return 'DUNNO'
         else:
             return SMTP_ACTIONS['reject']
     elif policy == MAILLIST_POLICY_MEMBERSANDMODERATORSONLY:
         # Bypass both members and moderators.
-        if senderReceiver['sender'] in members or senderReceiver['sender'] in moderators:
+        if sender in members or sender in moderators:
             return 'DUNNO'
         else:
             return SMTP_ACTIONS['reject']
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.