1

Topic: Cant remove entry in greylisting_whitelists with greylisting_admin.py

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: Centos 7.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  LDAP
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Problem:
For some reasons, I managed to goof my Greylisting settings.
The result is that all sending clients are whitelisted
I cant find the option to remove the item using greylisting_admin.py

How to reproduce:
Probably I ran
   python greylisting_admin.py --add-whitelist
without any option (defaults to '@' ? )

But there is no option to remove a whitelisted entry from the table "greylisting_whitelists" ?

Work arround:
If I delete from SQL table manually, it is OK though, and Greylisting works as intended again.
   delete from greylisting_whitelists where ID = 1;


Evidences:
------------------
[root@mailserver tools]# python greylisting_admin.py --list-whitelists
@. -> @., ""
103.11.200.0/22 -> @., "AUTO-UPDATE: tumblr.com"
103.13.69.0/24 -> @., "AUTO-UPDATE: zendesk.com"
103.237.104.0/22 -> @., "AUTO-UPDATE: fishbowl.com"
103.28.42.0/24 -> @., "AUTO-UPDATE: ebay.com"
...
...(674 entries)


and
MariaDB [iredapd]> select * from greylisting_whitelists;
+----+---------+--------+---------+
| id | account | sender | comment |
+----+---------+--------+---------+
|  1 | @.      | @.     |         |
+----+---------+--------+---------+
1 row in set (0.00 sec)

MariaDB [iredapd]> select * from greylisting_whitelist_domain_spf
    -> ;
+---------+---------+------------------+------------------------------+
| id      | account | sender           | comment                      |
+---------+---------+------------------+------------------------------+
| 1117584 | @.      | 103.28.42.0/24   | AUTO-UPDATE: ebay.com        |
| 1117656 | @.      | 103.237.104.0/22 | AUTO-UPDATE: fishbowl.com    |
| 1117946 | @.      | 103.13.69.0/24   | AUTO-UPDATE: zendesk.com     |
| 1118125 | @.      | 103.11.200.0/22  | AUTO-UPDATE: tumblr.com      |
...
...




And in iredapd.log

2017-09-27 09:48:22 DEBUG --> Apply plugin: greylisting
2017-09-27 09:48:22 DEBUG [SQL] Query greylisting whitelists from `greylisting_whitelist_domain_spf`:
SELECT id, sender, comment
                   FROM greylisting_whitelist_domain_spf
                  WHERE account IN ('support@mydomain.com', '@mydomain.com', '@.', '@.mydomain.com', '@.com')
2017-09-27 09:48:22 DEBUG [2607:f8b0:4001:c0b::22d] No whitelist found.
2017-09-27 09:48:22 DEBUG [SQL] Query greylisting whitelists from `greylisting_whitelists`:
SELECT id, sender, comment
                   FROM greylisting_whitelists
                  WHERE account IN ('support@mydomain.com', '@mydomain.com', '@.', '@.mydomain.com', '@.com')
2017-09-27 09:48:22 INFO [2607:f8b0:4001:c0b::22d] Client is whitelisted for greylisting service: @.
2017-09-27 09:48:22 DEBUG <-- Result: DUNNO
2017-09-27 09:48:22 DEBUG --> Apply plugin: throttle

----

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

2

Re: Cant remove entry in greylisting_whitelists with greylisting_admin.py

You can try 2 options to remove a whitelisted sender:

python greylisting_admin.py --delete ...
python greylisting_admin.py --remove-whitelist-domain ...

For more details, please read our tutorial:
http://www.iredmail.org/docs/manage.iredapd.html