Extracting Hard Bounce Email Addresses from Postfix Mail Logs with a One-liner

2022-07-20 13:10 (2 years ago) ytyng

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
Currently unrated
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.

Archive

2025
2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011