Duplicate mails when TO: ing two email addresses

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?

1 Like

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?

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.

6 Likes

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

4 Likes

Done and done, added #feature and #pr-welcome

1 Like