# Reducing backscatter in email interface?

**URL:** <https://meta.discourse.org/t/reducing-backscatter-in-email-interface/59974>\
**Category:** Feature\
**Created:** [March 27, 2017, 3:36pm UTC](https://meta.discourse.org/t/reducing-backscatter-in-email-interface/59974 "2017-03-27T15:36:31Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![Simon\_Manning](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon_manning/32/198596_2.png) [@Simon\_Manning](https://meta.discourse.org/u/Simon_Manning)\
**Post date:** [May 7, 2022, 10:51pm UTC](https://meta.discourse.org/t/reducing-backscatter-in-email-interface/59974/21 "2022-05-07T22:51:38Z")

</div>

I am also seeing this, which I noticed as being problematic when bogus spam recently used the reply to address (replies+abc123@instance) for From, triggering Discourse to create a series of automatic responses to itself.

From what I can tell, all of the fast rejection functionality was merged and the readme for mail-receiver talks about using `BLACKLISTED_SENDER_DOMAINS` which is part of fast rejection, however fast rejection is disabled by default.

[https://github.com/discourse/discourse\_docker/pull/344/files](https://github.com/discourse/discourse_docker/pull/344/files)

The above change was never merged, citing a need to investigate backwards compatibility and with the absence of `DISCOURSE_BASE_URL`, fast rejection is disabled by the following line.

> <https://github.com/discourse/mail-receiver/blob/08a25ae38f80115dc87fe05359f274210c99ea83/lib/mail_receiver/fast_rejection.rb#L16-L18>

The mail receiver app is written such that it handles either `DISCOURSE_BASE_URL` or `DISCOURSE_MAIL_ENDPOINT` as shown below and the readme doesn’t mention the latter, so I think it would be safe to apply the change from [that pull request](https://github.com/discourse/discourse_docker/pull/344), using `https` rather than `http` to reflect a more recent change to the sample.

The change as proposed by the pull request will mean that fast rejection is enabled by default for new operators of mail-receiver, that is operators who copy the sample as a starting point.

Existing operators will continue to have it disabled until the yml is manually updated to use `DISCOURSE_BASE_URL`. If my assertions here are accurate, perhaps something about this should be posted to #feature:announcements after the sample is updated.

> <https://github.com/discourse/mail-receiver/blob/08a25ae38f80115dc87fe05359f274210c99ea83/lib/mail_receiver/discourse_mail_receiver.rb#L21-L30>

It would also be straightforward to do something very similar to the `handle_mail` endpoint for the fast rejection endpoint, that is infer the endpoint from `DISCOURSE_MAIL_ENDPOINT` if `DISCOURSE_BASE_URL` doesn’t exist.

Fast rejection can then be enabled by default for both new and existing operators. I would be happy to make a pull request for this change if enabling it for everyone (who rebuilds mail-receiver after the change) is desirable.

---

_[View the full topic](https://meta.discourse.org/t/reducing-backscatter-in-email-interface/59974)._
