Zhang Huangbin avatar Zhang Huangbin committed 21cf0f3

Use 'OK' instead of 'DUNNO' for whitelisted senders.

Comments (0)

Files changed (2)

src/libs/__init__.py

 __author__ = 'Zhang Huangbin <zhb@iredmail.org>'
 __version__ = '1.3.7'
 
-SMTP_ACTIONS = {'accept': 'DUNNO',
+SMTP_ACTIONS = {'accept': 'OK',
                 'defer': 'DEFER_IF_PERMIT Service temporarily unavailable',
                 'reject': 'REJECT Not authorized',
                 'default': 'DUNNO',

src/plugins/block_amavisd_blacklisted_senders.py

 
 PLUGIN_NAME = 'block_amavisd_blacklisted_senders'
 
+from libs import SMTP_ACTIONS
+
 def restriction(smtpSessionData, ldapRecipientLdif, logger, **kargs):
     # Get sender address.
     sender = smtpSessionData.get('sender').lower()
 
     # Bypass whitelisted senders.
     if len(valid_amavisd_senders & wlSenders) > 0:
-        return 'DUNNO Whitelisted'
+        return SMTP_ACTIONS['accept']
 
     # Reject blacklisted senders.
     if len(valid_amavisd_senders & blSenders) > 0:
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.