Massive delete mails from specific sender

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
JYvViva
Posts: 15
Joined: Wed Apr 20, 2016 10:20 pm

Massive delete mails from specific sender

Post by JYvViva »

Hi Team,

Here is my scenario. ZCS 8.6, 3K+ Users. We have Marketing and Com' Department broadcasting to all users, tons of mail per day; Including embedded images or attachments. The result of course is that, the Server's storage just gets saturated very quickly.
How to delete all the emails coming from the Com' Dept. on an well given earlier period. For example, delete from all accounts, emails dating from January 1st to December 31st 2016 ?
ganeshpore
Posts: 2
Joined: Mon Jan 23, 2017 9:23 am

Massive delete mails from specific sender

Post by ganeshpore »

I am using zimbra and we have around 1500 uses configured and they are also part of some distribution list as well.
we want to delete all old mails older than 1 year, I have gone through posts to delete older mails and they are suggesting to delete mails by using zmmailbox command
But it can possible with one mailbox as per given in example and I have list of users is more than 1500 accounts configured on zimbra,
can someone please suggest how do I perform mass volume deletion.

Thanks in Advance
JYvViva
Posts: 15
Joined: Wed Apr 20, 2016 10:20 pm

Re: Massive delete mails from specific sender

Post by JYvViva »

Did you have any update since ?
iomarmochtar
Posts: 41
Joined: Sat Sep 13, 2014 3:54 am
Location: Indonesia
Contact:

Re: Massive delete mails from specific sender

Post by iomarmochtar »

Here's the example command for deleting all email in queue by sender, you may change it by your self for timerange filter.
(this command must be ran as root user)

Code: Select all

/opt/zimbra/postfix/sbin/postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } / sender@mail\.com/ { print $1 }' | tr -d '*' | /opt/zimbra/postfix/sbin/postsuper -d -
JYvViva
Posts: 15
Joined: Wed Apr 20, 2016 10:20 pm

Re: Massive delete mails from specific sender

Post by JYvViva »

What I am looking for is to :
delete all mails, in all accounts, received from a specific sender, from a certain period.
Have you any idea how to script that ?
Post Reply