zone-eu / zone-mta

📤 Modern outbound MTA cross platform and extendable server application
European Union Public License 1.2
599 stars 96 forks source link

Incorrect classification in bounce rules #324

Closed roshanjonah closed 1 year ago

roshanjonah commented 1 year ago

Is there a way to change the bounce rules or add a certain rule via a custom plugin?

Currently, we have an "other" category setup as soft fails and a mail server that returns 550 No user found is also being classified as a soft fail. It should be classified as a hard bounce.

A possible rule being applied from bounce.txt image_2023_03_09T09_04_05_550Z

How we see it coming in CleanShot 2023-03-13 at 08 29 50@2x

We can't really change it from soft to hard because most other reasons in that "other" category are actually soft failures. This is the odd one out. Recommendations? Thoughts anyone?

louis-lau commented 1 year ago

I feel like detecting a soft/hard bounce based on the error category in bounces.txt is the wrong approach anyway. But if you want then yes, you can edit bounces.txt. I don't think there's anything stopping you.

How we see it coming in

How are you getting the bounce data?

roshanjonah commented 1 year ago

Thanks for replying @louis-lau

Ahh...What do you think is the best way to approach classifying into either "Hard", "Soft", or "Misc" categories? Misc categories in our software involve things to do with, for example, IP reputation. My dev thinks it's not possible to edit bounces.txt so, therefore, this issue creation.

How are you getting the bounce data? -> We have a custom plugin that pushes whatever is happening with Zonemta to our HTTP webhook

louis-lau commented 1 year ago

If I were you I would submit a PR to zone-mta, so that it also passes along the action and not just the category. Pretty sure you should be able to add bounce.action to this object here: https://github.com/zone-eu/zone-mta/blob/b22909e23ec6fb31815a5aa550c9101c565ab199/lib/sender.js#L1477-L1498

Should also be useful to others, so I see no reason such a PR wouldn't be accepted. I'm not a maintainer on this project though.

roshanjonah commented 1 year ago

Great advice @louis-lau I will look into that. Appreciate your help.