1 (edited by web2works 2012-03-01 02:35:35)

Topic: Quarantined Mail - "Delete all in database" does nothing.

==== Provide required information to help troubleshoot and get quick answer ====
- Linux/BSD distribution name and version: Squeeze
- iRedMail version and backend (LDAP/MySQL): iRedAdmin-Pro v1.6.3 (LDAP)
- Any related log? Log is helpful for troubleshooting.
====

In iRedAdmin-Pro LDAP when I view the Quarantined Mails I would like to be able to delete all of these in one action. At the moment the "Delete all in database" doesn't delete any of the emails and returns the message "Mails were deleted".

It works fine if I go to each page and "Delete selected"

----

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

2

Re: Quarantined Mail - "Delete all in database" does nothing.

It's a bug in iRedAdmin-Pro-LDAP-1.6.3 and iRedAdmin-Pro-MySQL-1.3.1. Attachment is patch to fix this issue.

Thanks for your feedback. smile

Post's attachments

delete_all.patch 447 b, 8 downloads since 2012-03-01 

You don't have the permssions to download the attachments of this post.

3 (edited by web2works 2012-03-02 06:25:03)

Re: Quarantined Mail - "Delete all in database" does nothing.

Do you have any guides how to apply a patch file?

I found this http://www.iredmail.org/forum/topic630- … il051.html
but was never answered.

mail:/usr/share/apache2/iredadmin# patch --dry-run -p1 < delete_all.patch
patching file amavisd/log.py
Hunk #1 FAILED at 186.
1 out of 1 hunk FAILED -- saving rejects to file amavisd/log.py.rej

4

Re: Quarantined Mail - "Delete all in database" does nothing.

Please use 'patch --dry-run -p0' instead.

5

Re: Quarantined Mail - "Delete all in database" does nothing.

Thanks this time it appear to apply to patch.

mail:/usr/share/apache2/iredadmin# patch --dry-run -p0 < delete_all.patch
patching file controllers/amavisd/log.py
Reversed (or previously applied) patch detected!  Assume -R? [n] y
Hunk #1 succeeded at 185 (offset -1 lines).

But still no change in iredadmin when deleting all. Do I need to restart anything?

6

Re: Quarantined Mail - "Delete all in database" does nothing.

Reversed (or previously applied) patch detected!  Assume -R? [n] y

Seems you already have patch applied.

You can open this patch file, its content is:

diff -r 0261efcdad1f controllers/amavisd/log.py
--- controllers/amavisd/log.py    Thu Mar 01 15:11:01 2012 +0800
+++ controllers/amavisd/log.py    Thu Mar 01 15:19:23 2012 +0800
@@ -186,7 +186,7 @@
         else:
             msg = 'INVALID_ACTION'
 
-        if not len(mailids) > 0:
+        if self.action != 'deleteAll' and not mailids:
             raise web.seeother('/activities/quarantined?msg=%s' % msg)
 
         if self.action == 'release':

You can edit controllers/amavisd/log.py manually to fix this issue.

7

Re: Quarantined Mail - "Delete all in database" does nothing.

Yes it works correctly now.

I checked the file and it has been packed successfully(maybe I ran the code twice without realising) and needed to log out to see the changes.

Thanks for your support on this issue.

8

Re: Quarantined Mail - "Delete all in database" does nothing.

Glad to hear that it works for you. smile