Knowledgebase
Portal Home > Knowledgebase > How do i remove thousands of spam messages from qmail inbox queue?
How do i remove thousands of spam messages from qmail inbox queue?
| Use the following commands. Your paths may vary so please use caution!
# cd /var/qmail/mailnames/domain_name.com/mailbox_name/Maildir/cur # for file in *; do <hit enter> >grep -qil "MAIL_SUBJECT_OR_SEARCH_STRING" $file && (echo Deleting $file...; rm -f $file) <hit enter> >done <hit enter>
So for instance if your server got hit by a spam bomb about Viagra, and you know the subject line of the spam messages contains the words "Viagra at great prices", then you would use the following command as stated above to find them all and automaticall;y delete them;
grep -qil "Viagra at great prices" $file && (echo Deleting $file...; rm -f $file)
**Use these commands at your own risk. These commands can vary from distro to distro. Always consult your documentation for your distribution of Linux for the correct commands**
|
Add to Favourites
Print this Article
|