Commits

Zhang Huangbin  committed 70d393f

Fixed: Not detect returned values before processing (split string) in plugin sql_user_restrictions.py.
Thanks jford <jford _at_ cisp dot com> for the report.

  • Participants
  • Parent commits 7683d4f

Comments (0)

Files changed (2)

         + For MySQL/PostgreSQL backend: sql_force_change_password_in_days
 
     * Fixed:
+        + Not detect returned values before processing (split string) in
+          plugin sql_user_restrictions.py.
+          Thanks jford <jford _at_ cisp dot com> for the report.
         + Incorrect detection of sender domain (missing '@') in plugin
           sql_user_restrictions.py.
           Thanks Tim Lau for the report.

File plugins/sql_user_restrictions.py

         else:
             # Allowed first
             # single recipient, domain, sub-domain, catch-all
-            all_allowed_recipients = [s.lower().strip() for s in allowed_recipients.split(',')]
+            all_allowed_recipients = []
+            if allowed_recipients:
+                all_allowed_recipients = [s.lower().strip() for s in allowed_recipients.split(',')]
             logging.debug('All allowed recipient: %s' % str(all_allowed_recipients))
 
             if all_allowed_recipients:
                    or '@.' in all_allowed_recipients:
                     return SMTP_ACTIONS['accept']
 
-            all_rejected_recipients = [s.lower().strip() for s in rejected_recipients.split(',')]
+            all_rejected_recipients = []
+            if rejected_recipients:
+                all_rejected_recipients = [s.lower().strip() for s in rejected_recipients.split(',')]
             logging.debug('All rejected recipient: %s' % str(all_rejected_recipients))
 
             if all_rejected_recipients:
         else:
             # Allowed first
             # single recipient, domain, sub-domain, catch-all
-            all_allowed_senders = [s.lower().strip() for s in allowed_senders.split(',')]
+            all_allowed_senders = []
+            if allowed_senders:
+                all_allowed_senders = [s.lower().strip() for s in allowed_senders.split(',')]
             logging.debug('All allowed senders: %s' % str(all_allowed_senders))
 
             if all_allowed_senders:
                    or '@.' in all_allowed_senders:
                     return SMTP_ACTIONS['accept']
 
-            all_rejected_senders = [s.lower().strip() for s in rejected_senders.split(',')]
+            all_rejected_senders = []
+            if rejected_senders:
+                all_rejected_senders = [s.lower().strip() for s in rejected_senders.split(',')]
             logging.debug('All rejected senders: %s' % str(all_rejected_senders))
 
             if all_rejected_senders: