Re: how to mass delete after a hacked mail?

2016-09-17 Thread Per Jessen
voy...@sbt.net.au wrote:

> I had a hacked user account resulting in several thousand bounces back
> to that email inbox, account now corrected, but, how can I mass delete
> bounces with say subject like:
> 
> "Undelivered Mail Returned to Sender"
> (by from ? ""Mail Delivery System" ")
> 

How about this - 

find /cur  -type f -ctime -7 | xargs
grep -l '^Subject:.*Undelivered Mail Returned to Sender' | xargs rm

(the -7 will limit the search to files created in the last week). 

Obviously run some tests first _without_ "xargs rm".


-- 
Per Jessen, Zürich (15.8°C)
http://www.dns24.ch/ - free dynamic DNS, made in Switzerland.


Re: how to mass delete after a hacked mail?

2016-09-16 Thread Sean Greenslade
On Sat, Sep 17, 2016 at 09:03:48AM +1000, voy...@sbt.net.au wrote:
> I had a hacked user account resulting in several thousand bounces back to
> that email inbox, account now corrected, but, how can I mass delete
> bounces with say subject like:
> 
> "Undelivered Mail Returned to Sender"
> (by from ? ""Mail Delivery System" ")
> 
> or what other ways to clean the mess ?
> 
> thanks,
> 
> V

Easiest way for a one-time thing is to use an IMAP client. I like mutt,
so in mutt, I would connect to the account, then run a limit command (l)
like so:

~s "Undelivered Mail Returned to Sender"

(or perhaps limit by From, or both)

Then manually check over the results to make sure it hasn't trapped
anything important, then tag and delete the whole set.

--Sean


Re: how to mass delete after a hacked mail?

2016-09-16 Thread Peter Chiochetti

Am 2016-09-17 um 01:03 schrieb voy...@sbt.net.au:

I had a hacked user account resulting in several thousand bounces back to
that email inbox, account now corrected, but, how can I mass delete
bounces with say subject like:

"Undelivered Mail Returned to Sender"
(by from ? ""Mail Delivery System" ")

or what other ways to clean the mess ?

thanks,

V



Please excuse if you find my take objectionable: If the user invited the 
mischief, he or she ought to clean that up themselves ;)


Otherwise, there is doveadm search and doveadm expunge …

--
peter


how to mass delete after a hacked mail?

2016-09-16 Thread voytek
I had a hacked user account resulting in several thousand bounces back to
that email inbox, account now corrected, but, how can I mass delete
bounces with say subject like:

"Undelivered Mail Returned to Sender"
(by from ? ""Mail Delivery System" ")

or what other ways to clean the mess ?

thanks,

V