postalserver / postal

📮 A fully featured open source mail delivery platform for incoming & outgoing e-mail
https://postalserver.io
MIT License
14.86k stars 1.05k forks source link

MessageBounced event lacks RFC code for bounce type (Hard or Soft bounce) #3089

Closed benstaf closed 1 month ago

benstaf commented 2 months ago

MessageBounced event lacks RFC code to identify Bounce type:

Screenshot_2024-08-14-19-07-14-456_com android chrome-edit

SendGrid documentation explains that bounce message gives important information to identify the reason for the email delivery failure: the RFC code. According to the RFC, hard bounces are depicted by a 5XX code and soft bounces by a 4XX code (in general)

The best practice is that upon reception of the webhook, the mailing list software (Mautic, etc...) should unsubscribe hard bounces immediately, and leave soft bounces.

That's why bounce type is included in webhooks of all providers: Mailgun, Postmark, Amazon and others

However, bounce type seems missing from Postal bounce webhook

I can help for implementation if it hasn't been done before

willpower232 commented 2 months ago

If you want to make a PR then go for it, I'm not sure where the information could be sourced from off the top of my head

benstaf commented 2 months ago

If you want to make a PR then go for it, I'm not sure where the information could be sourced from off the top of my head

There are several special-purpose libraries for bounce classification, my favorite is Sisimai and it's written in Ruby.

It is quite popular on GitHub, mature and well-maintained (10 years old, latest version in July 2024)

Sisimai can decode all types of bounces with optimized accuracy and speed, and especially make the classification of Hard and Soft bounces (critical feature currently lacking on Postal)

Screenshot_2024-08-15-21-14-14-228_com android chrome-edit

Sisimai also handles FBL complaints mentioned in issue https://github.com/postalserver/postal/issues/3084

Sisimai integration will improve and simplify the way Postal handles bounces

I can do a PR of course, but since it will require an in-depth modification of the codebase, more core contributors might prefer to do it.

Let me know either way

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.