Re: Remove mail in smarthost Exim queues sent from specific IP address
On Tue, Feb 13, 2007 at 02:14:42PM +0100, Robert Tasarz wrote:
> Dan Harris wrote:
> > I hope this is not a stupid question (I've spent several hours googling and
> > not come up with anything useful).
> >
> > I work for an ISP and one of our customers has been reported to us for
> > sending Unsolicited Bulk Email via our smarthosts, which run Exim4. We've
> > disconnected the users DSL line so no more can be sent, but now we have the
> > problem of removing several thousand UBEs from the outbound exim queues,
> > when we only have a source IP address to go on. Is there an easy way to
> > achieve this?
>
> something easier than this? :)
>
> grep '\[192\.168\.11\.11\] P=' /var/log/exim4/mainlog |cut -d\
> -f3|while read id; do /usr/sbin/exim4 -Mrm $id; done
If there's thousands I suggest a slightly nicer way:
grep '\[192\.168\.11\.11\] P=' /var/log/exim4/mainlog | \
cut -d " " -f 3 | xargs /usr/sbin/exim4 -Mrm
Which means that you fire off lots less exim4 processes and still
achieves the desired effect.
Cheers,
--
Brett Parker
Reply to: