1

Topic: Find and delete mails from all mailboxes

==== Required information ====
- iRedMail version (check /etc/iredmail-release):      v0.9.5-1
- Linux/BSD distribution name and version: Debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes  v2.4.0 (MySQL)
- Related log if you're reporting an issue:
====

I have blocked certain attachments for outbound emails. Whenever any user try to send attachment, he/she receive email "BANNED CONTENTS..."
A copy of same is also send to master account.

We can easily purge such emails from master account, but what about user account, deletion of such emails is on descretion of user.

So is there any way we could delete such emails from all users?

----

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

2

Re: Find and delete mails from all mailboxes

Instead of removing bounce message from users' mailboxes, how about set 'warnbannedsender =>0,' in Amavisd `$policy_bank{'ORIGINATING'} = {}`?

$policy_bank{'ORIGINATING'} = {
    ...
    warnbannedsender => 0,
}

This way Amavisd won't send an email to warn sender about this banned email.

3

Re: Find and delete mails from all mailboxes

But this way, user will not be notified and assume that mail has been successfully delivered.

4

Re: Find and delete mails from all mailboxes

So you want to notify user, but delete the notification emails from users' mailboxes? Please try 'doveadm expunge':
http://wiki2.dovecot.org/Tools/Doveadm/Expunge

5

Re: Find and delete mails from all mailboxes

Thanks a lot.
I will definitely try that.

6

Re: Find and delete mails from all mailboxes

I tried doveadm expunge, it is working fine and solved my purpose.

Thanks again!