Email forward ends up in original topic

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.

Details:

  • Running 2.9.0.beta1
  • 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!)

2 Likes

Do you mean it ends up in the originalte thread in category A?

Again Iā€™m answering knowing nothing and quite soon someone comes to tell how things really are ā€” but AFAIK that should go that way and a reply doesnā€™t change to new topic just changing email.

true, thanks ā€“ fixed that!

To clarify: the person does not reply to the email via reply-to, but forwards it setting the to: address manually to the discourse+cat-B@ email.

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 :slightly_smiling_face: - 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?

2 Likes

Thanks for trying!

Could it have anything to do with the email client? I ā€œblamedā€ discourse for grouping messages by the ā€œin-reply-toā€ field rather than the ā€œtoā€ fieldā€¦

ha, what do you have for that setting?

Iā€™m not sure? I used gmail for my tests, if thatā€™s useful to know?

I also have that as the default. :+1:

Reminds me of A mail reply may end up in the wrong category

4 Likes

Nice spot @Moin :+1:

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?

1 Like

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?

Thanks for the link!
Seems to be a similar situation except that in my case itā€™s about forwarding a mail and not replying. Hence I still donā€™t understand that behavior.

I keep typing out a reply, and then thinking of something else to try. :slight_smile: 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?

Iā€™m using POP3 and forwarding the First post.

Thanks for helping!

1 Like

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.

1 Like

I have just tested this with Category mirrors a mailing list enabled for both Category A and Category B and I can now replicate the issue. :partying_face:

  • Set up CategoryA and CategoryB, and assign them email-in addresses (categorya@[MyTestSite] and categoryb@[MyTestSite])
  • Set Category mirrors a mailing list for each category
  • 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
  • The forward appears as a reply to the original topic in Category A

Iā€™m not that hot on mailing lists, would this be a bug or a settings conflict?

And does this sound like it could help with your issue too @dachary?

Thanks for checking!

Well, given that I reread the features of the mirror mail list option I guess itā€™s not a bug but intended as such:

  • 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 :slight_smile:

3 Likes

My pleasure. :slight_smile: And Iā€™ve slid this topic over into support :+1:

Now you know more about how the settings work together, can you get a fair approximation of how you want it to work?

2 Likes

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.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.