1

Topic: No whitelist/blacklist in iredapd

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version: Debian 8.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mysql
- Web server (Apache or Nginx): apache
- Manage mail accounts with iRedAdmin-Pro? iRedAdmin but no pro (iRedMail-0.9.4)
- Related log if you're reporting an issue:

Hello,
I try to add some account to white list. I use tutorial from docs (http://www.iredmail.org/docs/amavisd.wblist.html)
When I put any command using wblist_admin.py scripts I got information No  whitelist/blacklist.

root@mail:/opt/iredapd/tools# python wblist_admin.py --list --whitelist
* Establishing SQL connection.
* Manage (inbound) wblist for account: @.
* Operation: show existing wblist (--list).
* wblist type: whitelist (--whitelist).
* No whitelist.

root@mail:/opt/iredapd/tools# python wblist_admin.py --list --blacklist
* Establishing SQL connection.
* Manage (inbound) wblist for account: @.
* Operation: show existing wblist (--list).
* wblist type: blacklist (--blacklist).
* No blacklist.

service iredapd is up and running
root@mail:/opt/iredapd/tools# /etc/init.d/iredapd status
iredapd is running.
telent to port 7777 working fine.
iredapd is added to postfix configuration
root@mail:/opt/iredapd/tools# postconf |grep 7777
smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:7777
smtpd_recipient_restrictions = reject_unknown_recipient_domain reject_non_fqdn_recipient reject_unlisted_recipient check_policy_service inet:127.0.0.1:7777 permit_mynetworks permit_sasl_authenticated reject_unauth_destination

what action is required to use whitelist/blacklist ? ;-)

----

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

2

Re: No whitelist/blacklist in iredapd

There's some bugs in /opt/iredapd/tools/wblist_admin.py, it doesn't correctly query SQL db to get black/whitelists. All bugs are supposed to be fixed in the latest development edition, you can give it a try this way:

- Download the latest development edition: https://bitbucket.org/zhb/iredapd/get/tip.tar.bz2
- Extract download file
- Copy /opt/iredapd/settings.py to extracted directory
- Run 'tools/wblist_admin.py' in extracted directory.

3

Re: No whitelist/blacklist in iredapd

Strange. 0.9.5.1 working here:
python wblist_admin.py --list --blacklist | wc -l
158
python wblist_admin.py --account some@foo.tld --list --blacklist | wc -l
1068

4

Re: No whitelist/blacklist in iredapd

Hi all,
thanks for fast answer, when i use  package from Zhang I got this same error.

root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools# python wblist_admin.py --list --whitelist
* Establishing SQL connection.
* List all inbound whitelist for account: @.
* No whitelist/blacklist.

Any other idea ? Maybe I can do this manualy on mysql, do You know correctly query SQL for add account to whitelist ?
Should be added to which table greylisting_whitelist_domains or greylisting_whitelists ?
+-------------------------------+
| Tables_in_iredapd             |
+-------------------------------+
| greylisting                   |
| greylisting_tracking          |
| greylisting_whitelist_domains |
| greylisting_whitelists        |
| throttle                      |
| throttle_tracking             |
+-------------------------------+

thanks,

5

Re: No whitelist/blacklist in iredapd

The data for whitelist/blacklist is managed in database amavisd, specifically table wblist.

mysql> describe wblist;
+-------+------------------+------+-----+---------+-------+
| Field | Type             | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+-------+
| rid   | int(10) unsigned | NO   | PRI | NULL    |       |
| sid   | int(10) unsigned | NO   | PRI | NULL    |       |
| wb    | varchar(10)      | NO   |     | NULL    |       |
+-------+------------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

rid is found in table maddr (id) while sid is found in mailaddr (id)

6

Re: No whitelist/blacklist in iredapd

mir wrote:

rid is found in table maddr (id) while sid is found in mailaddr (id)

As far as I know, 'wblist' rid is local user and they are located at 'users', sid is external user located at 'mailaddr'. Then there's also 'outbound_wblist' where rid is external and sid local.

7

Re: No whitelist/blacklist in iredapd

witek1811 wrote:

root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools# python wblist_admin.py --list --whitelist

Try to add wblist with this script first, then try the '--list' argument again.

8

Re: No whitelist/blacklist in iredapd

Hi all,
when I try first with --add second with --list
I got something like this.

root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools# python wblist_admin.py --account example@domain.com --add --whitelist
* Establishing SQL connection.
* Add inbound whitelist for account: example@domain.com
* Add senders:
root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools# python wblist_admin.py --list --whitelist
* Establishing SQL connection.
* List all inbound whitelist for account: @.
* No whitelist/blacklist.

9

Re: No whitelist/blacklist in iredapd

witek1811 wrote:

root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools# python wblist_admin.py --account example@domain.com --add --whitelist

You didn't have any whitelist sender in this command. Please try again.

10

Re: No whitelist/blacklist in iredapd

Hello,
this is output from this command :

root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools# python wblist_admin.py --account example@domain.com --add --whitelist
* Establishing SQL connection.
* Add inbound whitelist for account: example@domain.com
* Add senders:
'long' object is not iterable
root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools#

and when I try list all whitelist I got this:

root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools# python wblist_admin.py --list --whitelist
* Establishing SQL connection.
* List all inbound whitelist for account: @.
* No whitelist/blacklist.
root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools#

thanks,

11

Re: No whitelist/blacklist in iredapd

witek1811 wrote:

root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools# python wblist_admin.py --account example@domain.com --add --whitelist

Again, you do NOT have whitelist sender address in this command AFTER '--whitelist'.

12

Re: No whitelist/blacklist in iredapd

Hi,
probable I don't understand correctly (sorry for my english)
it should be something like this :

root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools# python wblist_admin.py --account example@domain.com --add --whitelist example@domain.com
* Establishing SQL connection.
* Add inbound whitelist for account: example@domain.com
* Add senders: example@domain.com
root@mail:~/fix_for_iredapd/zhb-iredapd-84a453d7d82e/tools# python wblist_admin.py --list --whitelist example@domain.com
* Establishing SQL connection.
* List all inbound whitelist for account: @.
* No whitelist/blacklist.

I can add only whitelist when I put sources account and target account ?
I want to have example@domain.com in whitelist for all my domain. It is possible ?

13

Re: No whitelist/blacklist in iredapd

If you want to whitelist something for all your accounts, you don't need to specify the account or you can use "@.".

For example, you want to disable all gmail accounts for all you local users:
python wblist_admin.py --add --whitelist @gmail.com OR
python wblist_admin.py --account @. --add --whitelist @gmail.com

14

Re: No whitelist/blacklist in iredapd

thanks RikuS for this claryfication.
Now I know how to add and I can list whitelist.