exiqgrep
exiqgrep allows you to search exim mail queue.
To search for a particular recipients, run
1 |
exiqgrep -r EMAIL_ADDR_HERE |
To search for all emails from a particular email account, use
1 |
exiqgrep -f EMAIL_ADDR_HERE |
You can use -i option to list only message id. This is useful when you need to delete mails from a particular account.
To delete all email sent from a particular email account, run
1 |
exiqgrep -f EMAIL_ADDR_HERE -i | xargs exim -Mrm |
To delete all frozen emails from queue, run
1 |
exiqgrep -iz | xargs exim -Mrm |
If you have too many emails, then use xargs -P option to specify how many mails to delete at a time
1 |
exiqgrep -iz | xargs -P20 exim -Mrm |
This command will delete 20 mails at a time.
Delete all mails in queue
To delete all emails in queue run
1 |
exiqgrep -i | xargs -P20 exim -Mrm |