Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Clearing Postfix Mail Queues

    Hi Guys,

    I'm having a little problem with writing a script to clear e-mails in the postfix queue that have the error "Domain Not Found.".

    My scripting skills aren't great by any means and the problem I'm having is when searching for this error message it's on a seperate line from the Queue ID, so how do I get the line above it to return as well? For example...

    5CAE47705F 4803 Wed Nov 21 15:12:54
    (host mail.server[] said: 450 4.1.2 <>: Recipient address rejected: Domain not found (in reply to RCPT TO command))

    I've tried thinking of various grep combinations, and/or using xargs somehow, but can't manage to get the line above the one that's been returned when grep'ing for said error message! Any help would be much appreciated, thanks!

  2. #2
    Just Joined!
    Join Date
    Nov 2007
    Camp Pendleton

    It looks like somebody already did what I wanted. Take a look at this and see if this will help you.

    [Mailman-Developers] Postfix mailq formatter/dumper/searcher: mq

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts