zone-eu / zone-mta

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

Override 4xx with bounces.txt? #396

Closed mxroute closed 6 months ago

mxroute commented 6 months ago

I'm trying to override specific 4xx reactions to treat them as rejections. For example:

"450 User is receiving mail too quickly tnmpmscs"

And in bounces.txt:

^450[ \-].* User is receiving mail too quickly,reject,recipient,Stop

But it just keeps deferring it. I'm sure I'm doing something stupid, I just can't see it. Is this possible?

andris9 commented 6 months ago

There's an extra space between .* and User, so the regex expects there to be 2 spaces in total which is not correct.

You can test your regexes with the check-bounces tool:

echo "450 User is receiving mail too quickly tnmpmscs" | node ./bin/check-bounce.js

This would give you the matching rule for that response message. Rules are processed from top to bottom, so if a rule with higher line nr matches it means your regex failed.