Command line equivalent for...

Post Reply
jols
Junior Member
Posts: 111
Joined: 08 May 2007, 04:43

Command line equivalent for...

Post by jols »

What would be the command line equivalent for the following?

Delivery Queue
From does contain ".link"
Delete Emails

Thanks so much, coming up with a command line (where I could use different "contain" items) would literally save me hours per week.
jols
Junior Member
Posts: 111
Joined: 08 May 2007, 04:43

Re: Command line equivalent for...

Post by jols »

Possible? I am looking for the same kind of command line equivalent that can easily be generated with your other utility, eXploit Scanner, i.e. Generate CXS Commands. Except in this case I am not look for a front end feature like that, but more of a way to assemble a command line that contains the options I need.

I keep having to delete the same email messages over and over and over again, e.g. from [bounce], or from some "spam name" in the from that shows up again and again and again. I have to do this nightly just to keep the Delivery Queue from filling up with 10,000+ messages that our hosted members have already filtered out, and they are just sitting there.

So if I could just cron 5 or 6 command lines, this would save literally hundreds of hours of work per year having to do this via WHM per the manual method of working with the interface.

I know there must be a way to do this, as pretty much the way WHM works with server utilities is by calling some binary and just feeding it options, which can usually be done per the command line, ala the way your CSX utility works. So..... ?

Thanks very much for any assistance with this!
jols
Junior Member
Posts: 111
Joined: 08 May 2007, 04:43

Re: Command line equivalent for...

Post by jols »

I think I am getting very close with the following command:

exiqgrep -i|xargs exim -Mrm `grep -lr 'popularfastloans.com' /var/spool/exim/input | sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g'` 2> /dev/null

But oddly, this seems to work on the Pending Queue, but not the Delivery Queue.

What's the trick here with this I wonder?
alsmith
Junior Member
Posts: 24
Joined: 10 Dec 2006, 13:13

Re: Command line equivalent for...

Post by alsmith »

I thought I would post this since I was needing something to help.

Code: Select all

# Check the Email Delivery queue for From [bounce] and delete them
exim -bpa -C /etc/exim_outgoing.conf | grep "<>" |awk -F" " '{print $3}' | while
 read line
do
     exim -C /etc/exim_outgoing.conf -Mrm $line
done
Firewalls4Life
Junior Member
Posts: 73
Joined: 21 Nov 2011, 18:43

Re: Command line equivalent for...

Post by Firewalls4Life »

alsmith wrote: 17 Feb 2015, 18:15 I thought I would post this since I was needing something to help.

Code: Select all

# Check the Email Delivery queue for From [bounce] and delete them
exim -bpa -C /etc/exim_outgoing.conf | grep "<>" |awk -F" " '{print $3}' | while
 read line
do
     exim -C /etc/exim_outgoing.conf -Mrm $line
done
All these years later, thank you for this. I put this script into a .sh file, added a shebang, and put it into my crontab to run regularly. Thank you for this.

Code: Select all

#!/bin/sh
# Description: Remove frozen messages from Exim
# 
exim -bpa -C /etc/exim_outgoing.conf |grep "<>" |awk -F" " '{print $3}' | while read line
do
        exim -C /etc/exim_outgoing.conf -Mrm $line
done
Post Reply