how to mass delete after a hacked mail?
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" <MAILER-DAEMON@emu.sbt.net.au>")
or what other ways to clean the mess ?
thanks,
V
On Sat, Sep 17, 2016 at 09:03:48AM +1000, voytek@sbt.net.au wrote:
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
voytek@sbt.net.au wrote:
How about this -
find <maildir>/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.
participants (4)
-
Per Jessen
-
Peter Chiochetti
-
Sean Greenslade
-
voytek@sbt.net.au