A one-liner to extract email addresses that failed to send (hard bounced) from Postfix logs.
You need to stop sending emails to the email addresses that hard bounced.
grep "said: 550 " /var/log/mail.log | sed -r 's/^.*to=<([^>]+)>.*$/\1/' | uniq > /tmp/hard-bounced-emails.txt
Comments