Source

iredapd / plugins / amavisd_block_blacklisted_senders.py

Diff from to

File plugins/amavisd_block_blacklisted_senders.py

 SENDER_SEARCH_ATTRLIST = []
 RECIPIENT_SEARCH_ATTRLIST = ['amavisBlacklistSender', 'amavisWhitelistSender']
 
+
 def restriction(**kwargs):
     smtpSessionData = kwargs['smtpSessionData']
     ldapRecipientLdif = kwargs['recipientLdif']
     #   -> @.cn
     splited_sender_domain = str(sender.split('@', 1)[-1]).split('.')
 
-    # Default senders (user@domain.ltd): ['@.', 'user@domain.ltd', @domain.ltd']
-    valid_amavisd_senders = set(['@.', sender, '@'+sender.split('@', 1)[-1],])
+    # Default senders (user@domain.ltd):
+    # ['@.', 'user@domain.ltd', @domain.ltd']
+    valid_amavisd_senders = set(['@.', sender, '@' + sender.split('@', 1)[-1], ])
     for counter in range(len(splited_sender_domain)):
         # Append domain and sub-domain.
         valid_amavisd_senders.update(['@.' + '.'.join(splited_sender_domain)])