How to delete all email From: a domain or one email address

Discussion in 'Postfix' started by popowich, May 19, 2014.

  1. popowich

    popowich EQ Forum Admin Staff Member

    Joined:
    Aug 12, 2008
    Messages:
    9,001
    Likes Received:
    120
    Hello,

    Do you need to cleanup a postfix mail queue?

    To delete all email from one specific email address, or all email From: a specific domain name, please choose the appropriate command from the following list.

    To delete all email in the queue from a domain run this command as root:

    postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } /@example\.com/ { print $1 }' | tr -d '*!' | postsuper -d -

    To delete all email in the queue From: a specific email address run this command as root:

    postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } /username@example\.com/ { print $1 }' | tr -d '*!' | postsuper -d -
     


  2. popowich

    popowich EQ Forum Admin Staff Member

    Joined:
    Aug 12, 2008
    Messages:
    9,001
    Likes Received:
    120
    To delete ALL email from the queue regardless of domain name or email address use:

    postsuper -d ALL
     

Want to reply or ask your own question?

It only takes a minute to sign up (and it's free!). Click the orange sign up button to choose a username and then you can ask your own questions on the forum.
Loading...