Tutorial Phcorner 1.4.0 - automated bounce email handling

Most website or forums need to deal with members whose email address becomes invalid. Sometimes the user will go ahead and change it, but other times forum will fire off emails to this now invalid address.

Email delivery failures can happen for a wide variety of reasons. If we continually send to an address that has been disabled, for example, this can count against our domain/IP's email reputation. A lower email reputation can lead to reduced email deliverability as our domain may appear to be a spammer.

Therefore, when we are notified that an email can't be delivered, we may want to prevent further emails from being sent to that user. PHCorner 1.3.0 added a new user state that represents an invalid email, but we had to manually change users into this state. With a decent size forum like PHC, this could be tedious and time consuming at best and impossible to manage at worst.

To handle this, PHCorner 1.4.0 implements an automated bounce email processing system. This is a fairly detailed and technical system, but it allows an important maintenance action to be automated.

Soft and Hard Bounces
Bounce notifications report a wide range of issues. Some of these are unlikely to ever be resolved and others may be temporary or specific to a single message. This is where a soft and hard bounce distinction becomes necessary.

When a hard bounce happens, action will be taken immediately (setting the user state to indicate that their email is invalid). These issues are unlikely to ever be resolved, except maybe through dumb luck. Most commonly, this will be an invalid mailbox (the part to the left of the @ in the address).

Soft bounces include:

The recipient's mailbox being full

DNS/connectivity issues

The message being too long (as other messages may go through)

Soft bounces don't trigger the user state change until multiple messages bounce. The exact behavior is defined by a set of criteria:{}

Using the values in the screenshot, the email would only be considered invalid if:

We received 3 or more bounce notifications

The bounce notifications happened on 3 or more distinct days

The amount of time between the first and last bounce is at least 5 days

So to keep your account here fully working (without being locked out), be sure to use a VALID email