Re: mailq output modification to feed into postsuper -d

From: Craig Sanders (no email)
Date: Wed Jul 31 2002 - 18:40:52 EDT


On Tue, Jul 30, 2002 at 09:25:13AM -0400, Michael Breton wrote:
> On Tue, Jul 30, 2002 at 05:47:49PM +1000, Craig Sanders wrote:
> > mailq | grep -v "^[^0-9A-Z]+" | grep MAILER-DAEMON | awk '{print $1}' |
> > postsuper -d -
> >
> >note: the first "grep -v ..." excludes all lines that don't start with a
> >queue-ID.
>
> The grep you mentioned does not do what you said:
>
> bash-2.03# mailq | grep -v "^[^0-9A-Z]+"

sorry, get rid of the + at the end. also, it's better to grep for
matching lines than to exclude non-matching lines.

mailq | grep "^[0-9A-Z]"

> -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
> 1DE91264F8* 3784 Tue Jul 30 09:16:27
>
>
> 5CC5026506* 2430 Tue Jul 30 09:16:31
>

also need to strip the "*" from the queue-ids before piping them into
postsuper.

  mailq | grep "^[0-9A-Z]+" | grep MAILER-DAEMON | awk '{print $1}' |
  sed -e 's/\*//' | postsuper -d -

craig

-- 
craig sanders <>
Fabricati Diem, PVNC.
 -- motto of the Ankh-Morpork City Watch
-
To unsubscribe, send mail to  with content
(not subject): unsubscribe postfix-users







Hosted Email Solutions

Invaluement Anti-Spam DNSBLs



Powered By FreeBSD   Powered By FreeBSD