Need (desperately) a cron job

Post Reply
shpilkus
Junior Member
Posts: 1
Joined: 02 Jul 2015, 01:00

Need (desperately) a cron job

Post by shpilkus »

Exim just doesn't work. It won't remove Bounce messages no matter what we try putting in the Exim config. I deal with this using CMQ but it adds HOURS to my week as we maintain multiple servers. I asked Configservers and they politely refused to assist since it is free software, and suggested I ask on this or the cPanel forum. I see that these questions have been asked over and over again on this forum, going back 8 years, and no one has provided a solution. So I am not optimistic... but maybe this time will be the one?

What I need is the code that can be run from the command line that will delete BOUNCE messages from the MailScanner queue. Right now this happens with a few radio buttons and checkboxes but I need to set it up so it runs at least daily. Unchecked, these grow to 2000+ messages every 24-48 hours. Multiplied by multiple servers and we are just spending WAY too much time cleaning out the queue because Exim refuses to do what it is told. Surely this is an easy request, if I knew enough to reverse-engineer the CMQ program I would have already done so to extract the command.

So has anybody found a way to do this yet?
alsmith
Junior Member
Posts: 24
Joined: 10 Dec 2006, 13:13

Re: Need (desperately) a cron job

Post by alsmith »

This is a lilttle script that may help

Code: Select all

#!/bin/sh
# removebounces.sh - remove bounce emails from email queue
# clear junk from queue
# remove all the [bounce] from the queue

echo "<br>Removing [bounce] emails from queue...";

/usr/sbin/exim -bpa | /bin/grep "<>" | /bin/awk -F" " '{print $3}' | while
read line
do
        #/usr/sbin/exim -C /etc/exim_outgoing.conf -Mrm $line
        /usr/sbin/exim -Mrm $line
done
echo "<br>Done Removing [bounce] emails from queue...";
sawbuck
Junior Member
Posts: 366
Joined: 10 Dec 2006, 16:20

Re: Need (desperately) a cron job

Post by sawbuck »

Nice one. Thanks Al
ebizindia
Junior Member
Posts: 4
Joined: 23 Mar 2017, 05:49

Re: Need (desperately) a cron job

Post by ebizindia »

This looks interesting. However, I use Mailscanner which moves the outbound queue to another instance of Exim.

Can someone please advise how to change the above script to refer to that instance of Exim?
ebizindia
Junior Member
Posts: 4
Joined: 23 Mar 2017, 05:49

Re: Need (desperately) a cron job

Post by ebizindia »

I will also like to delete emails from some addresses (these are autoresponses to spam which will never be delivered).

However, I will like to only delete the mails which are older than 2 hours.

Is it possible?
Dorothy356
Junior Member
Posts: 1
Joined: 18 Feb 2019, 13:13

Re: Need (desperately) a cron job

Post by Dorothy356 »

Interesting fix. I'll give it a try, since I'm having a similar problem.
Post Reply