Duplicate mails when TO: ing two email addresses

AI-generated summary

In a discussion regarding duplicate emails sent to multiple addresses (sales@ and shop@) mapped to the same Discourse group mailbox, carlokok reported receiving two identical posts when emailing both addresses simultaneously. They requested a feature to automatically drop such duplicates. codinghorror questioned the frequency of this issue, suggesting the mail server might handle it, but mpalmer clarified that MTAs are not designed for deduplication. mpalmer proposed a potential solution involving a message ID cache within the app to track seen IDs over a 24-hour period, though noted it is non-trivial work and rare enough to be placed in the pr-welcome pile. kpfleming added that comparing Message-IDs alongside message body hashes would effectively solve the problem. Finally, sam confirmed the feature request was accepted and tagged with #feature and #pr-welcome, inviting community contributions.

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 лайк

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 лайков

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

4 лайка

Сделано, добавлены Contribute > Feature и pr-welcome

1 лайк