Here is the iredapd log:
2016-11-08 20:55:22 INFO Starting iRedAPD (version: 1.9.0, backend: ldap), listening on 127.0.0.1:7777.
2016-11-08 20:55:22 INFO Log rotate type: time, interval: W6, backup copies: 12.
2016-11-08 20:55:22 INFO Loading plugin: reject_null_sender
2016-11-08 20:55:22 INFO Loading plugin: greylisting
2016-11-08 20:55:22 INFO Loading plugin: throttle
2016-11-08 20:55:22 INFO Loading plugin: ldap_maillist_access_policy
2016-11-08 20:55:22 INFO Loading plugin: amavisd_wblist
2016-11-08 20:56:16 DEBUG Connect from 127.0.0.1, port 37108.
2016-11-08 20:56:16 DEBUG smtp session: request=smtpd_access_policy
2016-11-08 20:56:16 DEBUG smtp session: protocol_state=RCPT
2016-11-08 20:56:16 DEBUG smtp session: protocol_name=ESMTP
2016-11-08 20:56:16 DEBUG smtp session: client_address=127.0.0.1
2016-11-08 20:56:16 DEBUG smtp session: client_name=mx1.ansspc.com
2016-11-08 20:56:16 DEBUG smtp session: reverse_client_name=mx1.ansspc.com
2016-11-08 20:56:16 DEBUG smtp session: helo_name=_
2016-11-08 20:56:16 DEBUG smtp session: sender=user1@mydomain.com
2016-11-08 20:56:16 DEBUG smtp session: recipient=user2@mydomain.com
2016-11-08 20:56:16 DEBUG smtp session: recipient_count=0
2016-11-08 20:56:16 DEBUG smtp session: queue_id=
2016-11-08 20:56:16 DEBUG smtp session: instance=68b5.5822ac70.ad4cc.0
2016-11-08 20:56:16 DEBUG smtp session: size=0
2016-11-08 20:56:16 DEBUG smtp session: etrn_domain=
2016-11-08 20:56:16 DEBUG smtp session: stress=
2016-11-08 20:56:16 DEBUG smtp session: sasl_method=LOGIN
2016-11-08 20:56:16 DEBUG smtp session: sasl_username=user1@mydomain.com
2016-11-08 20:56:16 DEBUG smtp session: sasl_sender=
2016-11-08 20:56:16 DEBUG smtp session: ccert_subject=
2016-11-08 20:56:16 DEBUG smtp session: ccert_issuer=
2016-11-08 20:56:16 DEBUG smtp session: ccert_fingerprint=
2016-11-08 20:56:16 DEBUG smtp session: encryption_protocol=TLSv1
2016-11-08 20:56:16 DEBUG smtp session: encryption_cipher=DHE-RSA-AES256-SHA
2016-11-08 20:56:16 DEBUG smtp session: encryption_keysize=256
2016-11-08 20:56:16 DEBUG LDAP connection initialied success.
2016-11-08 20:56:16 DEBUG LDAP bind success.
2016-11-08 20:56:16 DEBUG --> Apply plugin: reject_null_sender
2016-11-08 20:56:16 DEBUG Local sender.
2016-11-08 20:56:16 DEBUG <-- Result: DUNNO
2016-11-08 20:56:16 DEBUG --> Apply plugin: greylisting
2016-11-08 20:56:16 DEBUG Found SASL username, bypass greylisting for outbound email.
2016-11-08 20:56:16 DEBUG <-- Result: DUNNO
2016-11-08 20:56:16 DEBUG --> Apply plugin: throttle
2016-11-08 20:56:16 DEBUG Sender domain (@mydomain.com) is same as recipient domain, skip throttling.
2016-11-08 20:56:16 DEBUG <-- Result: DUNNO
2016-11-08 20:56:16 DEBUG [+] Getting LDIF data of account: user2@mydomain.com
2016-11-08 20:56:16 DEBUG search base dn: o=domains,dc=ansspc,dc=com
2016-11-08 20:56:16 DEBUG search scope: SUBTREE
2016-11-08 20:56:16 DEBUG search filter: (&(|(mail=user2@mydomain.com)(shadowAddress=user2@mydomain.com))(|(objectClass=mailUser)(objectClass=mailList)(objectClass=mailAlias)))
2016-11-08 20:56:16 DEBUG search attributes: ['objectClass', 'listAllowedUser', 'accessPolicy']
2016-11-08 20:56:16 DEBUG result: [('mail=user2@mydomain.com,ou=Users,domainName=mydomain.com,o=domains,dc=ansspc,dc=com', {'objectClass': ['inetOrgPerson', 'mailUser', 'shadowAccount', 'amavisAccount']})]
2016-11-08 20:56:16 DEBUG --> Apply plugin: ldap_maillist_access_policy
2016-11-08 20:56:16 DEBUG <-- Result: DUNNO (Not a mail list account)
2016-11-08 20:56:16 DEBUG --> Apply plugin: amavisd_wblist
2016-11-08 20:56:16 DEBUG Possible policy senders: ['@.', 'user1@mydomain.com', '@mydomain.com', '@.mydomain.com', '@com', '@.com']
2016-11-08 20:56:16 DEBUG Possible policy recipients: ['@.', 'user2@mydomain.com', '@mydomain.com', '@.mydomain.com', '@com', '@.com']
2016-11-08 20:56:16 DEBUG Apply wblist for outbound message.
2016-11-08 20:56:16 DEBUG [SQL] Query local addresses:
SELECT id, email
FROM users
WHERE email IN ('@.', 'user1@mydomain.com', '@mydomain.com', '@.mydomain.com', '@com', '@.com')
ORDER BY priority DESC
2016-11-08 20:56:16 DEBUG Local addresses (in `users`): [(2L, '@.')]
2016-11-08 20:56:16 DEBUG [SQL] Query external addresses:
SELECT id, email
FROM mailaddr
WHERE email IN ('@.', 'user2@mydomain.com', '@mydomain.com', '@.mydomain.com', '@com', '@.com')
ORDER BY priority DESC
2016-11-08 20:56:16 DEBUG Addresses (in `mailaddr`): [(2L, '@.')]
2016-11-08 20:56:16 DEBUG [SQL] Query outbound wblist:
SELECT rid, sid, wb
FROM outbound_wblist
WHERE sid IN (2) AND rid IN (2)
2016-11-08 20:56:16 DEBUG No wblist found.
2016-11-08 20:56:16 DEBUG <-- Result: DUNNO
2016-11-08 20:56:16 DEBUG Session ended
2016-11-08 20:56:16 INFO [127.0.0.1] RCPT, user1@mydomain.com => user2@mydomain.com, DUNNO
2016-11-08 20:56:16 DEBUG Close LDAP connection.
2016-11-08 20:56:16 DEBUG smtp session: request=smtpd_access_policy
2016-11-08 20:56:16 DEBUG smtp session: protocol_state=END-OF-MESSAGE
2016-11-08 20:56:16 DEBUG smtp session: protocol_name=ESMTP
2016-11-08 20:56:16 DEBUG smtp session: client_address=127.0.0.1
2016-11-08 20:56:16 DEBUG smtp session: client_name=mx1.ansspc.com
2016-11-08 20:56:16 DEBUG smtp session: reverse_client_name=mx1.ansspc.com
2016-11-08 20:56:16 DEBUG smtp session: helo_name=_
2016-11-08 20:56:16 DEBUG smtp session: sender=user1@mydomain.com
2016-11-08 20:56:16 DEBUG smtp session: recipient=user2@mydomain.com
2016-11-08 20:56:16 DEBUG smtp session: recipient_count=1
2016-11-08 20:56:16 DEBUG smtp session: queue_id=B8E161E0BF0
2016-11-08 20:56:16 DEBUG smtp session: instance=68b5.5822ac70.ad4cc.0
2016-11-08 20:56:16 DEBUG smtp session: size=369
2016-11-08 20:56:16 DEBUG smtp session: etrn_domain=
2016-11-08 20:56:16 DEBUG smtp session: stress=
2016-11-08 20:56:16 DEBUG smtp session: sasl_method=LOGIN
2016-11-08 20:56:16 DEBUG smtp session: sasl_username=user1@mydomain.com
2016-11-08 20:56:16 DEBUG smtp session: sasl_sender=
2016-11-08 20:56:16 DEBUG smtp session: ccert_subject=
2016-11-08 20:56:16 DEBUG smtp session: ccert_issuer=
2016-11-08 20:56:16 DEBUG smtp session: ccert_fingerprint=
2016-11-08 20:56:16 DEBUG smtp session: encryption_protocol=TLSv1
2016-11-08 20:56:16 DEBUG smtp session: encryption_cipher=DHE-RSA-AES256-SHA
2016-11-08 20:56:16 DEBUG smtp session: encryption_keysize=256
2016-11-08 20:56:16 DEBUG LDAP connection initialied success.
2016-11-08 20:56:16 DEBUG LDAP bind success.
2016-11-08 20:56:16 DEBUG Skip plugin: reject_null_sender (protocol_state != END-OF-MESSAGE)
2016-11-08 20:56:16 DEBUG Skip plugin: greylisting (protocol_state != END-OF-MESSAGE)
2016-11-08 20:56:16 DEBUG --> Apply plugin: throttle
2016-11-08 20:56:16 DEBUG Sender domain (@mydomain.com) is same as recipient domain, skip throttling.
2016-11-08 20:56:16 DEBUG <-- Result: DUNNO
2016-11-08 20:56:16 DEBUG Skip plugin: ldap_maillist_access_policy (protocol_state != END-OF-MESSAGE)
2016-11-08 20:56:16 DEBUG Skip plugin: amavisd_wblist (protocol_state != END-OF-MESSAGE)
2016-11-08 20:56:16 DEBUG Session ended
2016-11-08 20:56:16 INFO [127.0.0.1] END-OF-MESSAGE, user1@mydomain.com => user2@mydomain.com, DUNNO
2016-11-08 20:56:16 DEBUG Close LDAP connection.
2016-11-08 20:56:58 DEBUG Connect from 127.0.0.1, port 37170.
2016-11-08 20:56:58 DEBUG smtp session: request=smtpd_access_policy
2016-11-08 20:56:58 DEBUG smtp session: protocol_state=RCPT
2016-11-08 20:56:58 DEBUG smtp session: protocol_name=ESMTP
2016-11-08 20:56:58 DEBUG smtp session: client_address=127.0.0.1
2016-11-08 20:56:58 DEBUG smtp session: client_name=mx1.ansspc.com
2016-11-08 20:56:58 DEBUG smtp session: reverse_client_name=mx1.ansspc.com
2016-11-08 20:56:58 DEBUG smtp session: helo_name=_
2016-11-08 20:56:58 DEBUG smtp session: sender=user2@mydomain.com
2016-11-08 20:56:58 DEBUG smtp session: recipient=user1@mydomain.com
2016-11-08 20:56:58 DEBUG smtp session: recipient_count=0
2016-11-08 20:56:58 DEBUG smtp session: queue_id=
2016-11-08 20:56:58 DEBUG smtp session: instance=68b3.5822ac9a.8b4e.0
2016-11-08 20:56:58 DEBUG smtp session: size=0
2016-11-08 20:56:58 DEBUG smtp session: etrn_domain=
2016-11-08 20:56:58 DEBUG smtp session: stress=
2016-11-08 20:56:58 DEBUG smtp session: sasl_method=LOGIN
2016-11-08 20:56:58 DEBUG smtp session: sasl_username=user2@mydomain.com
2016-11-08 20:56:58 DEBUG smtp session: sasl_sender=
2016-11-08 20:56:58 DEBUG smtp session: ccert_subject=
2016-11-08 20:56:58 DEBUG smtp session: ccert_issuer=
2016-11-08 20:56:58 DEBUG smtp session: ccert_fingerprint=
2016-11-08 20:56:58 DEBUG smtp session: encryption_protocol=TLSv1
2016-11-08 20:56:58 DEBUG smtp session: encryption_cipher=DHE-RSA-AES256-SHA
2016-11-08 20:56:58 DEBUG smtp session: encryption_keysize=256
2016-11-08 20:56:58 DEBUG LDAP connection initialied success.
2016-11-08 20:56:58 DEBUG LDAP bind success.
2016-11-08 20:56:58 DEBUG --> Apply plugin: reject_null_sender
2016-11-08 20:56:58 DEBUG Local sender.
2016-11-08 20:56:58 DEBUG <-- Result: DUNNO
2016-11-08 20:56:58 DEBUG --> Apply plugin: greylisting
2016-11-08 20:56:58 DEBUG Found SASL username, bypass greylisting for outbound email.
2016-11-08 20:56:58 DEBUG <-- Result: DUNNO
2016-11-08 20:56:58 DEBUG --> Apply plugin: throttle
2016-11-08 20:56:58 DEBUG Sender domain (@mydomain.com) is same as recipient domain, skip throttling.
2016-11-08 20:56:58 DEBUG <-- Result: DUNNO
2016-11-08 20:56:58 DEBUG [+] Getting LDIF data of account: user1@mydomain.com
2016-11-08 20:56:58 DEBUG search base dn: o=domains,dc=ansspc,dc=com
2016-11-08 20:56:58 DEBUG search scope: SUBTREE
2016-11-08 20:56:58 DEBUG search filter: (&(|(mail=user1@mydomain.com)(shadowAddress=user1@mydomain.com))(|(objectClass=mailUser)(objectClass=mailList)(objectClass=mailAlias)))
2016-11-08 20:56:58 DEBUG search attributes: ['objectClass', 'listAllowedUser', 'accessPolicy']
2016-11-08 20:56:58 DEBUG result: [('mail=user1@mydomain.com,ou=Users,domainName=mydomain.com,o=domains,dc=ansspc,dc=com', {'objectClass': ['inetOrgPerson', 'mailUser', 'shadowAccount', 'amavisAccount']})]
2016-11-08 20:56:58 DEBUG --> Apply plugin: ldap_maillist_access_policy
2016-11-08 20:56:58 DEBUG <-- Result: DUNNO (Not a mail list account)
2016-11-08 20:56:58 DEBUG --> Apply plugin: amavisd_wblist
2016-11-08 20:56:58 DEBUG Possible policy senders: ['@.', 'user2@mydomain.com', '@mydomain.com', '@.mydomain.com', '@com', '@.com']
2016-11-08 20:56:58 DEBUG Possible policy recipients: ['@.', 'user1@mydomain.com', '@mydomain.com', '@.mydomain.com', '@com', '@.com']
2016-11-08 20:56:58 DEBUG Apply wblist for outbound message.
2016-11-08 20:56:58 DEBUG [SQL] Query local addresses:
SELECT id, email
FROM users
WHERE email IN ('@.', 'user2@mydomain.com', '@mydomain.com', '@.mydomain.com', '@com', '@.com')
ORDER BY priority DESC
2016-11-08 20:56:58 DEBUG Local addresses (in `users`): [(19L, 'user2@mydomain.com'), (2L, '@.')]
2016-11-08 20:56:58 DEBUG [SQL] Query external addresses:
SELECT id, email
FROM mailaddr
WHERE email IN ('@.', 'user1@mydomain.com', '@mydomain.com', '@.mydomain.com', '@com', '@.com')
ORDER BY priority DESC
2016-11-08 20:56:58 DEBUG Addresses (in `mailaddr`): [(2L, '@.')]
2016-11-08 20:56:58 DEBUG [SQL] Query outbound wblist:
SELECT rid, sid, wb
FROM outbound_wblist
WHERE sid IN (19, 2) AND rid IN (2)
2016-11-08 20:56:58 DEBUG Found outbound wblist: [(2L, 19L, 'B')]
2016-11-08 20:56:58 INFO Blacklisted: outbound_wblist=(2, 19, 'B')
2016-11-08 20:56:58 DEBUG <-- Result: REJECT Blacklisted
2016-11-08 20:56:58 DEBUG Session ended
2016-11-08 20:56:58 INFO [127.0.0.1] RCPT, user2@mydomain.com => user1@mydomain.com, REJECT Blacklisted
2016-11-08 20:56:58 DEBUG Close LDAP connection.
And the command outputs:
[root@mx1 ~]# ls -l /opt
total 4
lrwxrwxrwx. 1 root root 18 Oct 29 14:12 iredapd -> /opt/iRedAPD-1.9.1
dr-x------. 7 root root 4096 Nov 8 20:55 iRedAPD-1.9.1
[root@mx1 ~]# cd /opt/iredapd/tools/
[root@mx1 tools]# python wblist_admin.py --account user1@mydomain.com --list --whitelist
* Establishing SQL connection.
* List all inbound whitelist for account: user1@mydomain.com
* No whitelist.
[root@mx1 tools]# python wblist_admin.py --account user1@mydomain.com --list --blacklist
* Establishing SQL connection.
* List all inbound blacklist for account: user1@mydomain.com
* No blacklist.
[root@mx1 tools]# python wblist_admin.py --account user2@mydomain.com --list --whitelist
* Establishing SQL connection.
* List all inbound whitelist for account: user2@mydomain.com
* No whitelist.
[root@mx1 tools]# python wblist_admin.py --account user2@mydomain.com --list --blacklist
* Establishing SQL connection.
* List all inbound blacklist for account: user2@mydomain.com
@.