Remove smtp_should_reject & discourse-smtp-fast-rejection

Continuing the discussion from Seeing smtp_should_reject "400 bad request" failures on bounce processing:

I’m making this topic to summarise some internal discussion we’ve had.

We’ve identified that the codepath in smtp_should_reject is not functioning correctly and causing mail to be rejected in situations where it should not be.

Specifically:

  • bounce messages (having a null envelope-from)
  • forwarded mail to mismatch (the fast-rejection check used the envelope-to, whereas Discourse uses the To/CC headers)

This has caused problems for self-hosters using this:

There’s no interest in maintaining this code so we’re looking to remove it entirely.

Discourse PR:

(this doesn’t remove the endpoint as people’s installs will be trying to hit it - it changes it to always say “do not reject”)

mail-receiver PR: