1

Topic: Managing whitelist with wblist_admin.py

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version 1.4.0 OPENLDAP edition.:
- Deployed with iRedMail Easy or the downloadable installer? Not shure
- Linux/BSD distribution name and version: UBUNTU 20.04
- Store mail accounts in which backend LDAP Users / MySQL for admin
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with Samba-AD Users/iRedAdmin for admin
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi all,

i want to manage whitelist with wblist_admin.py and i'm wondering about 2 tables in my mysql database
in db amavisdb. It's mailaddr and wblist

The idea is that i hold the whitelist adresses on my own. Let's say in a textfile. However its irrelevant how.
If i 'sync' the textfile with amavis i do it this way:
Step 1: Delete old definition with
python3 wblist_admin.py --delete-all --whitelist
Step 2: Add each mail/domain/mask line by line with
python3 wblist_admin.py --add --whitelist mailadress

Well, works fine so far. But:
After deleting complete whitelist in step 1 table 'wblist' ist empty. That's fine.
But table 'mailaddr' ist still holding the mailadresses.
If i now run step 2 to add the whitelist all mailadresses are inserted again to 'mailaddr'.
So i have them twice... 3 times... 4 times... you know?
Is it a god idea to truncate table 'mailaddr' after step 1?
Or is this table used for further information?

Thanks.

Frank

----

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

2

Re: Managing whitelist with wblist_admin.py

Frank_at_work wrote:

If i now run step 2 to add the whitelist all mailadresses are inserted again to 'mailaddr'.
So i have them twice... 3 times... 4 times... you know?

This SQL table has unique index, why does it store same address 2/3/4 times?
https://github.com/iredmail/iRedMail/bl … .mysql#L21

3

Re: Managing whitelist with wblist_admin.py

ZhangHuangbin wrote:
Frank_at_work wrote:

If i now run step 2 to add the whitelist all mailadresses are inserted again to 'mailaddr'.
So i have them twice... 3 times... 4 times... you know?

This SQL table has unique index, why does it store same address 2/3/4 times?
...

Hi @ZhangHuangbin,
that is exactly my question in other words ;-)
But i saw what i have seen. :-O
I have actualy removed the 'truncate table' for test and now the table behaves as expected.
Is the unique indexed added lately? That might be the only reason.
Mysterious...

K. Thanks. Bye.
Frank

(might be closed)