# Duplicate mails when TO: ing two email addresses

**URL:** https://meta.discourse.org/t/duplicate-mails-when-to-ing-two-email-addresses/45090
**Category:** Feature
**Tags:** pr-welcome
**Created:** [6월 1, 2016, 4:23오후 UTC](https://meta.discourse.org/t/duplicate-mails-when-to-ing-two-email-addresses/45090 "2016-06-01T16:23:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![carlokok](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/carlokok/32/115951_2.png) [@carlokok](https://meta.discourse.org/u/carlokok)
#### Post date: [6월 1, 2016, 4:23오후 UTC](https://meta.discourse.org/t/duplicate-mails-when-to-ing-two-email-addresses/45090/1 "2016-06-01T16:23:29Z")

</div>

We have sales@ and shop@ going to the same group mailbox in Discourse which is working great for us. However 1 minor issue that if someone mails both of those addresses, we get two copies of the exact same post. Is there some way discourse could drop duplicates like this?

---

<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: [6월 1, 2016, 5:28오후 UTC](https://meta.discourse.org/t/duplicate-mails-when-to-ing-two-email-addresses/45090/2 "2016-06-01T17:28:41Z")

</div>

Good question, but not sure how often this comes up. I think we would need a few more reports of it in the wild, otherwise maybe your mail server could detect and block this somehow?

---

<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: [6월 1, 2016, 10:52오후 UTC](https://meta.discourse.org/t/duplicate-mails-when-to-ing-two-email-addresses/45090/3 "2016-06-01T22:52:12Z")

</div>

I don’t think the MTA could do it; it’s job is to deliver mail, not de-dupe it. We could add a message ID cache in the app that kept a record of all “seen” message IDs for the past (say) 24 hours, and didn’t create a new topic if it would just be a dupe of an existing one. It’s not trivial work, though, and I’d say it’s a vanishingly rare occurance, so it’s probably best on the pr-welcome pile.

---

<div class="post-metadata">

### Author: ![kpfleming](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kpfleming/32/116414_2.png) [@kpfleming](https://meta.discourse.org/u/kpfleming)
#### Post date: [6월 2, 2016, 3:31오후 UTC](https://meta.discourse.org/t/duplicate-mails-when-to-ing-two-email-addresses/45090/4 "2016-06-02T15:31:36Z")

</div>

Comparison of Message-ID along with a double-check comparing hashes of the message bodies would certainly do the trick.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [6월 6, 2016, 2:20오전 UTC](https://meta.discourse.org/t/duplicate-mails-when-to-ing-two-email-addresses/45090/5 "2016-06-06T02:20:43Z")

</div>

Done and done, added #Contribute > Feature and #pr-welcome
