Exim mail queue problem

_sander_

Verified User
Joined
Mar 21, 2008
Messages
9
Our Exim mail queue is filled with loads of bounce mails (around 150k) etc due a problem on a site of one of our costumers.
All those mails are addressed to for example: [email protected]

I want to remove all those mails with the command
Code:
exiqgrep -ir [email protected] | xargs exim -Mrm

When I run that command I am getting the error:
Line mismatch: 983d 1LCQIJ-0005Gn-7s <[email protected]>
exim: no message ids given after -Mrm option

I searched and found that I can remove those mails with the command:
Code:
# cd /var/spool/exim/
# rm */message-id*
(I found this in: http://www.directadmin.com/forum/showthread.php?t=24018)

But there seem to be loads of those malformed messages etc.
Is there a command I can use to remove all those messages?

(I also tried other commands for example those in: http://bradthemad.org/tech/notes/exim_cheatsheet.php and http://www.directadmin.com/forum/showthread.php?t=28596).

Thanks in advance!
 
I use this script which I found somewhere:
Code:
#!/bin/sh

if [ $1 ]; then
echo "`exim -bpru | tr '\n' + | sed -e "s/++/=/g" | tr -d + | tr = '\n' | grep "$1" | awk {'print $3'} | xargs exim -Mrm | wc -l` E-Mails deleted"
else
echo "If you want to delete ALL the `exim -bpc` E-Mails on mail queue, give this command:"
echo "exim -bpru | awk {'print $3'} | xargs exim -Mrm"
echo ""
echo "If you want to delete only mails with an specific sender/recipient, use:"
echo "$0 [sender/recipient]"
fi

First ofcourse find what you want to remove/delete.
 
Last edited:
This will remove just the frozen emails?
The exim -bp option lists the entire contents of the mail queue. The exiqgrep -i option greps out message IDs only.

And the exim -Mrm option will delete the message.

So this command will delete the entire queue.

To delete only all frozen messages:
Code:
# exiqgrep -z -i | xargs exim -Mrm

Jeff
 
Yes, posted in my post above. I had a typo which prevented it from being clear, but it should work for you. I've used it.

Jeff
 
>/usr/sbin/exigrep -z -i | xargs exim -Mrm
Unknown option: z
Unknown option: i
usage: exigrep [-I] [-l] [-t <seconds>] [-v] <pattern> [<log file>]...
exim: no message ids given after -Mrm option


That need to have the mail id i suppose... There a way to get all the frozen without do one by one?

For remove all spool i used to use

Code:
/usr/sbin/exim -Mrm `ls /var/spool/exim/input/ | grep -- -H$ | cut -c 1-16`
 
You mis-spelled it, and so called the wrong program.

exigrep and exiqgrep are two different programs.

Some DirectAdmin installations may not have exiqgrep installed. If yours doesn't, you can get it from my download site (nobaloney.net). It's a perl script and should on any OS DirectAdmin supports.

Jeff
 
Code:
>/usr/sbin/exiqgrep -z -i | xargs exim -Mrm
Message 1QyPC5-0003jq-Nu has been removed
Message 1QyluK-00088b-Nk has been removed


Thanks a lot :)

Worked perfectly
 
Back
Top