# Spam with from address set to reply by email address

**URL:** https://meta.discourse.org/t/spam-with-from-address-set-to-reply-by-email-address/87786
**Category:** Support
**Created:** [May 17, 2018, 11:20pm UTC](https://meta.discourse.org/t/spam-with-from-address-set-to-reply-by-email-address/87786 "2018-05-17T23:20:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ryantm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryantm/32/134063_2.png) [@ryantm](https://meta.discourse.org/u/ryantm)
#### Post date: [May 17, 2018, 11:20pm UTC](https://meta.discourse.org/t/spam-with-from-address-set-to-reply-by-email-address/87786/1 "2018-05-17T23:20:44Z")

</div>

Our “reply by email address” is “forum-replies+%{reply\_key}@example.com”. Recently, we’ve started receiving spam with the from address set to “[forum-replies@example.com](mailto:forum-replies@example.com)”. When this happens, Discourse is sends a “Rejection Mail” to its own “reply by email address” (well, without the reply key part of course). After this, Discourse rejects the “Rejection Mail”, but thankfully the new “Rejection Mail” is sent to the “notification email”, which is what I’d guess Discourse uses as the From address for rejection mails.

Is there a way to turn off rejection emails for messages that do not match the format of the “reply by email address”?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 17, 2018, 11:59pm UTC](https://meta.discourse.org/t/spam-with-from-address-set-to-reply-by-email-address/87786/2 "2018-05-17T23:59:32Z")

</div>

Hmm, any thoughts in your mind grapes about this one @mpalmer?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [May 18, 2018, 12:20am UTC](https://meta.discourse.org/t/spam-with-from-address-set-to-reply-by-email-address/87786/3 "2018-05-18T00:20:13Z")

</div>

What’s the `To` address on these e-mails? If Discourse is rejecting them, then it’s presumably an invalid recipient, in which case [the fast-rejection code](https://github.com/discourse/mail-receiver/commit/cddc3669beeb60080afb27afbc4fb4b39129b1af) might need to be tweaked a little to catch whatever it is you’re seeing. That’ll stop Discourse sending a rejection back to itself, because it’ll never even see the message.

Discourse shouldn’t be rejecting the rejection e-mail, though, because the initial rejection should be marked as auto-generated, and we shouldn’t be responding to auto-generated mail. Presumably one of those "should"s isn’t true, which is a bug.

Otherwise, it’s reasonable that Discourse ignore e-mail sent to it from its own address; I can’t think of a legitimate circumstance in which that would happen.

Finally, it’s not a particularly good idea to disable rejections _entirely_ for messages sent to mangled variations of the reply-to address; e-mail clients (and servers) are universally terrible, and do all manner of unspeakable things. Having a response back saying “everything is awful” is more user-friendly (in general) than blackholing mail.

---

<div class="post-metadata">

### Author: ![ryantm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryantm/32/134063_2.png) [@ryantm](https://meta.discourse.org/u/ryantm)
#### Post date: [May 18, 2018, 12:34am UTC](https://meta.discourse.org/t/spam-with-from-address-set-to-reply-by-email-address/87786/4 "2018-05-18T00:34:23Z")

</div>

The `To` address is “[forum-replies@example.com](mailto:forum-replies@example.com)”.

I made a pull request for this

[https://github.com/discourse/discourse/pull/5843](https://github.com/discourse/discourse/pull/5843)

---

<div class="post-metadata">

### Author: ![ryantm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryantm/32/134063_2.png) [@ryantm](https://meta.discourse.org/u/ryantm)
#### Post date: [May 23, 2018, 8:36pm UTC](https://meta.discourse.org/t/spam-with-from-address-set-to-reply-by-email-address/87786/5 "2018-05-23T20:36:08Z")

</div>

The pull request was merged by @zogstrip 🎉 . Hopefully that fixes it; I’ll continue to monitor it.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:37pm UTC](https://meta.discourse.org/t/spam-with-from-address-set-to-reply-by-email-address/87786/6 "2024-06-08T12:37:28Z")

</div>

This topic was automatically closed after 2213 days. New replies are no longer allowed.
