Commits

Zhang Huangbin  committed e746e96

Short policy names:
* membersOnly -> members
* moderatorsOnly -> moderators
* public -> public or open

  • Participants
  • Parent commits 58b86a7

Comments (0)

Files changed (2)

File rc_scripts/iredapd.rhel

     start) start ;;
     stop) stop ;;
     status) status ;;
-    restart) stop && start ;;
+    restart) stop && sleep 1 && start ;;
     *)
         echo $"Usage: $0 {start|stop|restart|status}"
         RETVAL=1

File src/plugins/ldap_maillist_access_policy.py

 # This plugin is used for mail deliver restriction.
 #
 # Available access policies:
-#   - public:   Unrestricted
+#   - public or open:   Unrestricted
 #   - domain:   Only users under same domain are allowed.
 #   - subdomain:    Only users under same domain and sub domains are allowed.
-#   - membersOnly:  Only members are allowed.
-#   - moderatorsOnly:   Only moderators are allowed.
+#   - membersOnly or members:  Only members are allowed.
+#   - moderatorsOnly or moderators:   Only moderators are allowed.
 #   - membersAndModeratorsOnly: Only members and moderators are allowed.
 
 # ----------------------------------------------------------------------------
 
     # Set search filter, attributes based on policy.
     # Override base dn, scope if necessary.
-    if policy == 'membersonly':
+    if policy in ['membersonly', 'members']:
         basedn = domaindn
         # Filter: get mail list members.
         searchFilter = "(&(|(objectclass=mailUser)(objectClass=mailExternalUser))(accountStatus=active)(memberOfGroup=%s))" % (recipient, )
         # Get both mail and shadowAddress.
         searchAttrs = ['mail', 'shadowAddress',]
 
-    elif policy == 'allowedonly' or policy == 'moderatorsonly':
+    elif policy in ['allowedonly', 'moderatorsonly', 'moderators']:
         # Get mail list moderators.
         basedn = listDn
         searchScope = 0     # Use ldap.SCOPE_BASE to improve performance.
 
         logger.debug('(%s) Recipient domain and alias domains: %s' % (PLUGIN_NAME, ','.join(recipient_alias_domains)))
 
-    logger.debug('(%s) Sender: %s' % (PLUGIN_NAME, sender))
-    logger.debug('(%s) Recipient: %s' % (PLUGIN_NAME, recipient))
-    logger.debug('(%s) Policy: %s' % (PLUGIN_NAME, policy))
+    logger.debug('(%s) %s -> %s, policy: %s' % (PLUGIN_NAME, sender, recipient, policy))
 
-    if policy == "public":
+    if policy in ['public', 'open']:
         # No restriction.
         return 'DUNNO Access policy: public.'
     elif policy == "domain":