remove similar mails from mailqueue

DearWebby

Greylisted
How can I delete a big bunch of mails from the mailqueue without hunting each ones two files down with locate and manually delete them?
Is there a command for that?
Or has somebody ever written a bash script for that, that takes for example the FROM address and dumps all mails with that FROM address from the queue?
I hope whoever comes up with a bash script for that can accept PayPal!
Thanks
DearWebby
 

EQ Admin

EQ Forum Admin
Staff member
Hello,

Here is the example for Postfix in case anyone looking for a solution for that MTA lands here:

http://www.emailquestions.com/postfix/9369-delete-all-email-domain-one-email-address.html

I found this example for sendmail but did not test it yet:

> find /var/spool/mqueue -name "[d,q,Q,D]f*" -exec grep -nil "username@example.com" {} \; | xargs rm

It needs to be adjusted to match your queue directory and the email address of the sender of you want removed from the queue.

If this happens to be a lot of spam on a web server I'd also check your web sites for compromised web forms and/or WordPress plugins being used to send spam.
 
Top