# Email issue -- Unknown To: Address - Private Message

**URL:** https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577
**Category:** Support
**Created:** [8월 23, 2017, 3:47오전 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577 "2017-08-23T03:47:32Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Gareth\_Williams](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gareth_williams/32/120775_2.png) [@Gareth\_Williams](https://meta.discourse.org/u/Gareth_Williams)
#### Post date: [8월 23, 2017, 3:47오전 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/1 "2017-08-23T03:47:32Z")

</div>

Hey All,

I am seeing a really odd issue, our community manager is getting this email:

> Adore Beauty Community via [amazonses.com](http://amazonses.com)  
> 9:13 AM (4 hours ago)
> 
> to me  
> We’re sorry, but your email message to [“\*\*\*\*\*\* REMOVED \*\*\*\*\*”] (titled Re: Asap super b complex serum) didn’t work.
> 
> None of the destination email addresses are recognized. Please make sure that you are sending to the correct email address provided by staff.

When we try to contact a user by email im told, I believe this is from the community manager contacting via a PM in the start.

We have reply by email setup and its working:

 ![17 pm](https://global.discourse-cdn.com/meta/original/3X/e/5/e5fe93a6ba2673d50bec91c99873dc521e7e89d9.png)

For threads however, im struggling with this private email - is there something I need to prd / find out to debug this?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [8월 23, 2017, 8:46오전 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/2 "2017-08-23T08:46:59Z")

</div>

Amazon SES rewrites the “Message-IDs” of emails sent through it. This breaks one of Discourse’s security features related to incoming email.

To make it work, you can disable the “find related post with key” site setting, but be aware that it does open up the potential for users to be impersonated by email.

---

<div class="post-metadata">

### Author: ![Gareth\_Williams](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gareth_williams/32/120775_2.png) [@Gareth\_Williams](https://meta.discourse.org/u/Gareth_Williams)
#### Post date: [8월 24, 2017, 12:31오전 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/3 "2017-08-24T00:31:12Z")

</div>

Hey @david

Thanks for this - I will set it and lets see how we go.

---

<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: [8월 24, 2017, 12:36오전 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/4 "2017-08-24T00:36:48Z")

</div>

I wonder if we could improve the error message a bit to better indicate the need for the `Message-ID` to be intact?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [8월 24, 2017, 1:17오전 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/5 "2017-08-24T01:17:56Z")

</div>

I think it might actually be possible to actually fix the SES problem.

SES rewrites the message IDs, which is annoying, but it gives the client the new message id in the SMTP transaction. So if we can get hold of that at the point of sending the email then swapping some stuff around here might solve the problem:

> <https://github.com/discourse/discourse/blob/5012d46cbd3bcf79b7351f7d2d41003496a796c5/lib/email/sender.rb#L181-L187>

A slightly crude experiment I did was to set `return_response: true` in the Rails SMTP settings, then adjust the code above to

```plaintext
      begin
        val = @message.deliver_now!
        Rails.logger.error("SMTP says #{val.message}")
      rescue *SMTP_CLIENT_ERRORS => e
        return skip(e.message)
      end

```

And then in my logs I get

```plaintext
SMTP says 250 Ok 0102015e11ccfcb7-23e96y80-9c33-4cfd-baba-1555c5a26f38-000000

```

which is the actual message ID that SES is using.

Needs more investigation - who knows what else I’ve broken by changing those things 😆 - but it’s an idea.

---

<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: [8월 24, 2017, 1:18오전 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/6 "2017-08-24T01:18:44Z")

</div>

I think improving the error message is a lot easier.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [8월 24, 2017, 1:19오전 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/7 "2017-08-24T01:19:14Z")

</div>

That is most definitely true 😉

---

<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: [8월 24, 2017, 3:03오전 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/8 "2017-08-24T03:03:54Z")

</div>

OK I just changed it to

> None of the destination email addresses are recognized, **or the Message-ID header in the email has been modified.** Please make sure that you are sending to the correct email address provided by staff.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [9월 3, 2019, 12:46오후 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/9 "2019-09-03T12:46:50Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [3월 30, 2023, 9:55오전 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/10 "2023-03-30T09:55:05Z")

</div>



---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [3월 30, 2023, 9:25오후 UTC](https://meta.discourse.org/t/email-issue-unknown-to-address-private-message/68577/11 "2023-03-30T21:25:13Z")

</div>


