crontab exim queue

evilkalah

New member
Joined
Apr 8, 2006
Messages
3
Hello,

we got a lot of frozen msg's in our exim queue. Now we have a little script to clean this. SO they don't stay there for some long time.

#!/bin/sh

echo "removing frozen messages"
/usr/sbin/exim -bp |grep "*** frozen ***" |awk {'print $3'}|xargs exim -Mrm
echo "removing invalid return adresses"
/usr/sbin/exim -bpru|grep '<>'|awk {'print $3'}|xargs exim -Mrm


and in our crontab we have
0-59 * * * * /root/scripts/clean-queue.sh >> /root/scripts/clean-queue.log

Now is the problem that he executes the script but only some parts of them. like for example the text writting in the log file. the rest he doesn't do.

Any help about this?
 
That's a great script for deleting messages from exim mail queue:

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
 
vingertop said:
#exiqgrep -z -i | xargs exim -Mrm
exiqgrep isn't included in the RedHat ES DA exim install; perhaps not in others either.

If you've got a working exiqgrep file please attach it to a forum reply, and I'll make it work for RH and for CentOS, and post it back.

Jeff
 
I have one in this path: '/usr/src/redhat/BUILD/da_exim-4.63/src/exiqgrep.src' on one CentOS 4.4, You not?
 
No, I don't. Running CentOS 4.4.

I never installed exim from source; I have DA install it from an RPM.

I don't even have a /usr/src/redhat directory. Nor do I have a /usr/src/CentOS (or any other capitalization) directory.

And the .src doesn't work as is. It needs some changes.

If you've got a file that works (find out with whereis exiqgrep please attach it to a post. And I'll make it work with CentOS and post it.

Thanks.

Jeff
 
exigrep and exiqgrep are different files.

I'm looking for a working copy of exiqgrep.

Thanks!

Jeff
 
Back
Top