Hi zhang,
Please find the below ldiff file
dn: mail=mailbounce@xxx.xx.in,ou=Groups,domainName=xxx.xx.in,o=domains,dc=abc,dc=com
accessPolicy: allowedOnly
accountStatus: active
cn: Bounced Email
enabledService: mail
enabledService: deliver
listAllowedUser: gmail.com
mail: mailbounce@xxx.xx.in
objectClass: mailList
shadowAddress: mailbounce@xx.in
Patch applied and tested working fine.. Thanks a lot zhang..:)
ZhangHuangbin wrote:
Hi Soundar,
Could you please try below patch for plugin: plugins/ldap_maillist_access_policy.py? Also, could you please show me LDIF data of this mail list account? Looks like there's some conflict in the log, i need the LDIF data to verify it.
diff -r 922bc7b5aa9d plugins/ldap_maillist_access_policy.py --- a/plugins/ldap_maillist_access_policy.py Sat Apr 20 17:21:06 2013 +0800 +++ b/plugins/ldap_maillist_access_policy.py Fri Apr 26 23:25:15 2013 +0800 @@ -25,6 +25,7 @@ conn = kwargs['conn'] base_dn = kwargs['base_dn'] sender = kwargs['sender'] + sender_domain = kwargs['sender_domain'] recipient = kwargs['recipient'] recipient_dn = kwargs['recipient_dn'] @@ -59,7 +60,6 @@ # No restriction. return 'DUNNO (Access policy: public)' elif policy == "domain": - sender_domain = sender.split('@', 1)[-1] # Bypass all users under the same domain. if sender_domain in recipient_alias_domains: return 'DUNNO (Access policy: domain)' @@ -77,7 +77,7 @@ elif policy in ['membersonly', 'allowedonly', 'membersandmoderatorsonly']: allowed_senders = recipient_ldif.get('listAllowedUser', []) if policy == 'allowedonly': - if sender in allowed_senders: + if sender in allowed_senders or sender_domain in allowed_senders: return 'DUNNO (Allowed explicitly)' logging.debug('Sender is not explicitly allowed, query user aliases and alias domains.')