-1

There's almost 50k mails in my queue when i type "exim -bpc". I need to clean the mess ASAP before i get blacklisted by gmail, as these mails are being forwarded to my personnal gmail account.

How can i delete all mails from a specific sender e-mail address (or with a specific subject name) so i can target only the trash and still receive the legitimate mails ?

Thanks!

exim -bpc Blockquote

46582

jolib
  • 1
  • 1

1 Answers1

1

For a given sender:

# exim -q | awk '/sender@example.com/ {print $3}' | xargs exim -Mrm

The sender is listed as 4th field on the first line for each message; the internal queue ID is shown as 3rd field. So the awk command searches for the specified sender address, and for matching lines prints the 3rd field. This is fed into xargs which gathers up words on its standard input and runs the specified command with as many of those words as fit on a normal command line. exim -Mrm takes a list of queue IDs and removes those messages from the queue (mnemonic: rm is the Unix remove command).

wurtel
  • 3,806
  • 12
  • 15