Postfix Script to list sent email addresses

Discussion in 'General' started by SamTzu, Dec 24, 2020.

  1. SamTzu

    SamTzu Active Member

    I made this script to quickly list where email has been sent.
    It works great on Debian based ISPconfig servers.

    nano /root/bin/mail-sent.sh
    chmod +x /root/bin/mail-sent.sh

    Code:
    # Script to list sent emails on Postfix/Debian
    log='/var/log/mail.log'
    grep "status=sent" $log | \
    egrep -ve 'postfix/(cleanup|pickup|master|qmgr|smtpd|local|pipe)' | cut -f2 -d"="  | cut -f1 -d">" | cut -c2-
    Enjoy.
     

Share This Page