1

Topic: Blacklisted and Whitelisted senders in iRedAdmin-Pro

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
======== Required information ====
- iRedAdmin-Pro-MySQL-1.8.2
= iRedAPD-1.4.3
- iRedMail-0.8.7
- RoundcubeMail-1.0.1
- Linux/BSD distribution name and version: FreeBSD 9.2-RELEASE
- Store mail accounts in which backend: MySQL Server 5.5.28
- Web server: Apache 2.2.23
- Manage mail accounts with iRedAdmin-Pro: YES
- Related log if you're reporting an issue:
====

In iRedAdmin-Pro, change settings in blacklisted senders and whitelisted senders doesn't work, tried different combination in the settings:
Single user: user@domain.ltd
User with wildcard: user@*
Entire domain: @domain.ltd
Domain and its sub-domains: @.domain.ltd
All accounts: @.

The only way makes the blacklist and whitelist work is to edit database table policyd.blacklist_sender, add record in the table and it works fine.

Also, I disabled greylist function but I have few senders cannot send me e-mail. I checked maillog....

Aug 13 00:12:54 mail postfix/smtpd[74016]: connect from m50-212.qiye.163.com[123.125.50.212]
Aug 13 00:12:54 mail postfix-policyd-sf: rcpt=120638, whitelist_sender=update, host=123.125.50.212 (m50-212.qiye.163.com), from=[sender_email_address_not_disclosed_here], to=[recipient_email_address_not_disclosed_here], size=0
Aug 13 00:12:54 mail postfix/smtpd[74016]: 8330319FD441: client=m50-212.qiye.163.com[123.125.50.212]
Aug 13 00:12:54 mail postfix/smtpd[74016]: lost connection after DATA (776 bytes) from m50-212.qiye.163.com[123.125.50.212]
Aug 13 00:12:54 mail postfix/smtpd[74016]: disconnect from m50-212.qiye.163.com[123.125.50.212]


I have no idea where my configurations went wrong? How do I identify whether greylist is enabled or not in the system? Please kindly help to solve this problem.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

Do you have plugin 'amavisd_wblist' enabled in /opt/iredapd/settings.py?

3

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

Yes, I have   plugins = ['sql_alias_access_policy', 'amavisd_wblist']   this parameter in /optiredapd/settings.py file.

4

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

Could you please turn on debug mode in iRedAPD, send a testing email from whitelisted domain, then copy related log in /var/log/iredapd.log and paste here for troubleshooting?

Reference:
http://www.iredmail.org/docs/debug.iredapd.html

5

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

1) I changed the /opt/iredapd/settings.py   log_level = 'debug'   then restart iredapd.
2) Add a sender domain into whitelist through iRedAdmin-Pro web interface.
3) Send a test e-mail from the whitelisted sender.

Here's the /var/log/iredapd.log

2015-08-21 21:05:18 INFO Starting iRedAPD (version: 1.4.4, backend: mysql), listening on 127.0.0.1:7777.
2015-08-21 21:05:18 INFO Loading plugin: sql_alias_access_policy
2015-08-21 21:05:18 INFO Loading plugin: amavisd_wblist

The iredapd.log seems no information logged.

6

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

Could you please show me output of command below?

# postconf smtpd_recipient_restrictions

7

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

Hello ZhangHuangbin, here is the output of the command:

# postconf smtpd_recipient_restrictions
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service inet:127.0.0.1:10031, permit

8

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

So you don't have iRedAPD enabled in Postfix. Please add it and the white/blacklists will work immediately:

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service inet:127.0.0.1:7777, check_policy_service inet:127.0.0.1:10031, permit

Reloading or restarting Postfix service is required.

9

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

Thanks ZhangHuangbin, I have changed the smtpd_recipient_restrictions to include check_policy_service inet:127.0.0.1:7777 and it seems working as I can see large information is logged in iredapd.log. When I put a gmail user into blacklist and then make a test e-mail sent from him, why I still can receive his e-mail? I also tried blacklist another user and I still receive e-mail.

10

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

1) Please upgrade iRedAPD to the latest 1.6.0, we have upgrade tutorial for you (just run a script, then all done):
http://www.iredmail.org/docs/upgrade.iredapd.html

2) After upgraded iRedAPD, send testing emails and show us log in /var/log/iredapd.log.

11

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

Follow the instructions to upgrade to iRedAPD-1.6.0, when restart the service I got this error...

# /usr/local/etc/rc.d/iredapd start
Starting iredapd ...
Traceback (most recent call last):
  File "/opt/iredapd/iredapd.py", line 11, in <module>
    from sqlalchemy import create_engine
ImportError: No module named sqlalchemy

12

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

Please install port 'databases/py-sqlalchemy' then restart iRedAPD service and try again.

13

Re: Blacklisted and Whitelisted senders in iRedAdmin-Pro

Hello ZhangHuangbin, working fine now. Thanks for your time and help.