What is the best way to figure out which email users can be removed from their bounce mail message?
Example being a bounce mail error code of 5.1.1, where the mailbox no longer exists.
I'm using the mbox file format from Thunderbird.
My ideas include searching for Status: 5.1.1 then looking ~2 lines down to see the X-Display-Name: example@online.de.
Does anyone know how to do this?
One way you handle bounces is the way the ezmlm bounce handler does it. It sends a series of bounce messages to the address that bounced to test whether the bounce was temporary or permanent. They describe their technique in a fair bit of detail on their Bounces and Automated Bounce Handling help page.
There is Jason Rowe's excellent blog post on Sending Email and Bounce Handling Rules.
Also check out these Bounce Handling Best Practices.
Or you can manually code which messages you want to bounce based on the bounce mail code. You can get the list of all codes in RFC 3463 which explains what each one means and what type of failure they are.
Deciding what is a hard or soft bounce isn't a science. It's an art. I've researched and thought of programming this myself, but found it was opening a can of worms. Then I was going to use phpList and figure out how its bounce handler worked. That was no easier.
What I ended up doing was taking the easy way out and using LuxSci for my bulk emailing and simply using their Bounce Analysis to inform me which emails are "permanent delivery failures" of any kind.