AA
I need help regarding deleting files. I have a mail Server with CentOS+exim+dovecot and Horde Webmail. Also my server has Mailbox format. I means /home/username/Maildir/new, cur, etc folders.
Today my one of my client has spamming attack from an email account which sent almost 86000+ emails in its Inox. I have blocked this user for further spamming. Now I need help to remove these files at once from the Inbox "cur" folder. Can anyone help me regarding this specifically. I have searched through internet, but could not get my required results.
Regards,
Help required regardind files deletion!
-
- Naik
- Posts: 64
- Joined: Sat Dec 04, 2004 6:30 pm
- Location: Islamabad, Pakistan.
Help required regardind files deletion!
* * *
Shakeel Ahmed
Registered Linux User # 423792
"The Shortest Distance b/w a Problem & its solution, is distance between ur Knees & the Floor. The one who kneels to Allah can stand upto anything!!"
Shakeel Ahmed
Registered Linux User # 423792
"The Shortest Distance b/w a Problem & its solution, is distance between ur Knees & the Floor. The one who kneels to Allah can stand upto anything!!"
-
- Naik
- Posts: 64
- Joined: Sat Dec 04, 2004 6:30 pm
- Location: Islamabad, Pakistan.
No one did reply!
I had found the solution at that time by doing some tricks manually with find.
find . -maxdepth 1 -type f | xargs grep -l "email address" | xargs rm -rf
Thanks for all.
I had found the solution at that time by doing some tricks manually with find.
find . -maxdepth 1 -type f | xargs grep -l "email address" | xargs rm -rf
Thanks for all.
* * *
Shakeel Ahmed
Registered Linux User # 423792
"The Shortest Distance b/w a Problem & its solution, is distance between ur Knees & the Floor. The one who kneels to Allah can stand upto anything!!"
Shakeel Ahmed
Registered Linux User # 423792
"The Shortest Distance b/w a Problem & its solution, is distance between ur Knees & the Floor. The one who kneels to Allah can stand upto anything!!"
Re: Help required regardind files deletion!
I made one for me years back.
change your spool path and supply a unique word to identify spam like Ip address, sender, anything unique from body or subject etc.
Code: Select all
#!/bin/bash
path=/home/azfar/scripts/mail
if [ $# -ne 2 ]
then
echo "Usage: $0 keyword keyword."
echo "Both keywords should be same."
exit
fi
if [ $1 == $2 ]
then
grep -lr "$1" $path/* > deletedfiles
no=`wc -l deletedfiles | awk '{print $1}'`
xargs rm -rf < deletedfiles
echo "$no files deleted. See the deletedfiles for details."
else
echo "Supplied keyword does not matched."
fi
Azfar Hashmi
Email : azfarhashmi@hotmail.com
Email : azfarhashmi@hotmail.com