Our discourse serves a wide community of different groups that do not interact regularly, but need to sometimes share information. The problem is that if someone forwards a received mail from one category to another category via email-in then the message ends up the the original topic instead of the category which email was used.
We have email-in and reply-by-mail enabled in our instance
Each category has an email assigned of the form discourse+CATEGORY@...
Steps to reproduce:
One receives an email notification of a new post in category A
One forwards the received email to category B using it’s email discourse+CAT-B@...
The forwarded message ends up in the original thread in category A
Question: how to ensure the forwarded email ends up in the right category B? (without modifying any email header!)
I can’t seem to reproduce this. These are my steps so far:
Set up CategoryA and CategoryB, and assign them email-in addresses (categorya@[MyTestSite] and categoryb@[MyTestSite])
Set test_user to Watching for both categories
Set email time window mins to 1 min (optional, but speeds things up)
Admin posts topic to CategoryA
Test_user receives notification email of new topic in CategoryA, and forwards it with message to CategoryB
New topic is created in CategoryB (with a very ugly title - Fwd: [JammyDodger's Test Site] [categorya] Topic for Category A), but only includes the added message, and not the intended forwarded information
I can’t seem to replicate the issue where a forwarded email to a category ends up as a reply to an existing topic? Is there something extra I could try instead?
I’ve just tried repro-ing this as well (a key difference seemed to be pressing ‘Reply’ and then manually changing the To address, rather than Forwarding), but mine ended up as a new topic in Category B again. Perhaps this does make it client specific? @artur Which are you using?
I just tried with my gmail but the mail still ended up in the original category.
Weird – I’m surprised it worked for you!
Could you check the headers of the forwarded mail?
I see e.g. that the References contains the original topic id - could that have priority over the to: field?
I keep typing out a reply, and then thinking of something else to try. But so far I have had no luck replicating your issue. Some maybe relevant things - I have the mail-receiver set up for my test site, rather than POP3, and are you forwarding a first post/OP or a reply?
Hi @JammyDodger I just realised that most my categories where historically set to Category mirrors a mailing list. Could you try to reproduce the issue when enabling this option?
I just tried disabling this on my test instance and it seems to solve the odd behaviour.
Usually find_related_post_with_key is enabled in the site settings. Disabling it for the whole site is not recommended, since it allows user impersonation based on email address. Incoming emails that were sent to the mailing list always use the email’s Message-ID to find related posts and disregard the value of that site setting.
I mainly kept the option because of another point:
Normally Discourse expects incoming emails to contain text formatted as Markdown. Mailing list users are usually unaware of that requirement, so Discourse doesn’t interpret any Markdown (except for code blocks enclosed in three backticks) or HTML within plain text emails and posts them with the original formatting intact.
Which makes sense for people who have no idea of markdown
So I think that for a pure mail list mirror site it does its job correctly.
I will see how the users will deal with markdown - they are certainly not aware this is expected!
One issue that actually arose when I disabled mailing list mirror throughout is that in case of auto-generated messages which are sent on behalf of some users the Discourse::InvalidAccess error comes up. With the rejection message saying
Your account does not have the privileges to post new topics in that category.
Even though that has worked before for the same user. So I guess the mirror option disables some kind of protection for that.