[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Remove mail in smarthost Exim queues sent from specific IP address

[This message has also been posted to linux.debian.isp.]
In article <7O6mB-8fD-15@gated-at.bofh.it>, Brett Parker wrote:
> On Tue, Feb 13, 2007 at 02:14:42PM +0100, Robert Tasarz wrote:
>> Dan Harris wrote:
>> 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
> lots less exim4 processes

Are you sure?  xargs(1) says "-l[max-lines]  Use  at  most max-lines
nonblank input lines per command line; max-lines defaults to 1 if
omitted."  ITYM

  cut -d" " -f3 | xargs -l30 /usr/sbin/exim4 -Mrm

otherwise you're still running one exim4 -Mrm per message.


Reply to: