Is it possible to respond with custom 2xx response codes, or with 250 but include enhanced response codes for SMTP reception?
I’m playing around with the idea of including an indicator in the reception response when the recipient domain is toxic, from a temp mail domain, or is mistyped (e.g. gmil instead of Gmail).
That’s an interesting use case. If you know the domain is bad, why not reject it with a descriptive message? kumo.reject(557, 'rejecting because domain is toxic')
The thing is SMTP is a transfer protocol and want to keep it neutral, but at the same time I want to be able to somehow give some additional information to the sender in case the recipient is problematic. If I just reject the message, most people will ignore the SMTP error codes / message, and either retry with us or move on to a backup SMTP provider to try and deliver the message. If I accept it with 250 and just drop it, it will be confusing for the customer (and the end user, in case they used a temp mail provider or had a typo in the domain), will receive no indication of the error and will sit there waiting for an email that’ll never arrive.
Now that I think of it maybe it’s best to make these options that the customer can enable: “Reject messges to temp mail providers”, “Reject message with typos in recipient domain”, “Reject messages to toxic domains”. That way it’s decided on by the customer and not us, and if they explicitly enable them, they’ll be checking for the SMTP errors as well.
My idea was that if they don’t read the 250 status, that’s fine because it’s not gonna cause any problems, we’ve just gave them some helpful additional info that was ignored, they asked for a message to be sent and it was sent. But if we automatically reject with 5xx and they don’t read the rejection message, then they’ll just retry which isn’t ideal. I think making it optional and allowing them to explicitly enable it makes more sense, if they enable it they’ll be looking out for the rejection error messages.