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
Am 2016-09-17 um 01:03 schrieb voytek@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" MAILER-DAEMON@emu.sbt.net.au")
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
On Sat, Sep 17, 2016 at 09:03:48AM +1000, voytek@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" MAILER-DAEMON@emu.sbt.net.au")
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
voytek@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" MAILER-DAEMON@emu.sbt.net.au")
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