1

Topic: remove record in White/Blacklist does not work

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Debian 7 (Wheezy)
- Related log if you're reporting an issue: ?
- iRedAdmin-Pro: 2.2.1
- Amavis-configuration: Default amavis configuration of iredmail-0.9.0 and the extra suggested lines in "http://www.iredmail.org/docs/quarantining.html
====

When I add a new line in the White/Blacklists with a random user it will be succesfull saved.
But when I now remove this line, and then hit the save button, it will give you the message "Records were successfully updated.", but the line(s) you just deleted are now there again.

So I can't delete any White/Blacklists records.

----

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

2

Re: remove record in White/Blacklist does not work

Looks like a bug in iRedAdmin-Pro-LDAP-2.2.1, i will try to reproduce this issue and come back with a fix later.
Thanks for the feedback. smile

3

Re: remove record in White/Blacklist does not work

Here's patch to fix this bug (for iRedAdmin-Pro-LDAP-2.2.1, iRedAdmin-Pro-MySQL-1.9.1, iRedAdmin-Pro-PGSQL-1.5.1):

diff -r 26e456f87e50 controllers/amavisd/wblist.py
--- a/controllers/amavisd/wblist.py    Wed Jan 14 10:15:24 2015 +0800
+++ b/controllers/amavisd/wblist.py    Fri Jan 16 11:00:25 2015 +0800
@@ -23,7 +23,7 @@
                       msg=web.input().get('msg'))
 
 
-def update_wblist_from_form(form, account, post_url, success_msg):
+def update_wblist_from_form(form, account, post_url, success_msg, flush_before_import=False):
     wl_senders = get_wblist_from_form(form, 'wl_sender')
     bl_senders = get_wblist_from_form(form, 'bl_sender')
 
@@ -31,7 +31,7 @@
     qr = wblist_lib.add_wblist(account=account,
                                wl_senders=wl_senders,
                                bl_senders=bl_senders,
-                               flush_before_import=False)
+                               flush_before_import=flush_before_import)
 
     if qr[0]:
         raise web.seeother(post_url + '?msg=' + success_msg)
@@ -53,7 +53,8 @@
         return update_wblist_from_form(form=form,
                                        account='@.',
                                        post_url='/create/wblist',
-                                       success_msg='WBLIST_CREATED')
+                                       success_msg='WBLIST_CREATED',
+                                       flush_before_import=False)
 
 
 class GlobalWBList(object):
@@ -67,7 +68,8 @@
         return update_wblist_from_form(form=form,
                                        account='@.',
                                        post_url='/system/wblist',
-                                       success_msg='WBLIST_UPDATED')
+                                       success_msg='WBLIST_UPDATED',
+                                       flush_before_import=True)
 
 
 class UserWBList(object):
@@ -85,4 +87,5 @@
         return update_wblist_from_form(form=form,
                                        account=account,
                                        post_url='/preferences/wblist',
-                                       success_msg='WBLIST_UPDATED')
+                                       success_msg='WBLIST_UPDATED',
+                                       flush_before_import=True)

4

Re: remove record in White/Blacklist does not work

ZhangHuangbin wrote:

Here's patch to fix this bug (for iRedAdmin-Pro-LDAP-2.2.1, iRedAdmin-Pro-MySQL-1.9.1, iRedAdmin-Pro-PGSQL-1.5.1):

Hi Zhang, Thanks for the fast patch!
It will indeed now be succesful deleted.... but... if I now send an email to the just deleted blacklisted record, it will still be marked as spam...? Could there be still another bug?

5

Re: remove record in White/Blacklist does not work

Merijn wrote:

if I now send an email to the just deleted blacklisted record, it will still be marked as spam...? Could there be still another bug?

I will try to reproduce this issue and come back with a fix later.

6

Re: remove record in White/Blacklist does not work

what patch syntax should I be using to implement?

7

Re: remove record in White/Blacklist does not work

Dear sgroom,

If you're not familiar with patch command, i can send you a patched version. Please contact us to get one: http://www.iredmail.org/contact.html

8

Re: remove record in White/Blacklist does not work

I'm familiar but patch differs quite a bit from distro to distro...

I'll email you. Thanks