1

I tried to search for similar questions in SO, and also on the web, but no hits.

tl;dr: What happens in the threading logic when both, references and in-reply-to headers are not available (missing/null)? Is it possible that the email service provider adds these headers to selective messages, and not all?

Background:

I understand that the references headers contain the breadcrumb trail of message-ids, and the in-reply-to headers point to the immediate node in the linked list/thread.

But what happens in the threading logic when both, references and in-reply-to headers are not available (missing/null)? In my case, I am seeing that unrelated messages are ending up in the same thread. For example,

Message 1
    in-reply-to: <350576222@ip-xxx-xx-x-72.eu-west-1.compute.internal>
    references: <350576222@ip-xxx-xx-x-72.eu-west-1.compute.internal>
    message-id: <trinity-d2cd4e72-@app-gmx-bap21>

Message 2 - no in-reply-to, and references headers
    message-id: <2E0FA10B@icloud.com>

There is no correlation at least from the headers, but these two end up in the same thread. The only common element is the subject line, and it remains unchanged from the root message, in both. All the other messages that have the same subject line, and contain the references and in-reply-to headers get their own separate thread.

Environment:

I am using a shared inbox tool (FrontApp), with a sync-based GMail, not my own code in any way. The tool has its own "de-duplication" logic, but I am unaware if it modifies/trashes the headers. The root message is always sent from our systems - Java Mail via GMail SMTP, and contains a BCC field for internal auditing.

Also, if it helps, I see that this mostly happens in cases when Message 1 is from a GMail/Yahoo accounts, and Message 2 is from either web.de, or gmx.de account.

Do all email from gmx, and web de have these headers missing/null? No, I have evidence of some gmx and web de email that contain these headers, and they are perfectly living in their respective thread, no issues of collision.

Another critical thing is, the issue is not present in GMail itself, when I login into the account, and look at these messages, they are in their own respective thread (each has its own google thread_id).

julie
  • 37
  • 1
  • 8
  • Your latter point is related to either you have conversion view enabled or disabled, see [here](https://support.google.com/mail/answer/5900?co=GENIE.Platform%3DDesktop&hl=en). As for the rest of your questions - I do not fully understand your problem. – ziganotschka Jan 18 '21 at 08:54
  • Thank you for responding, @ziganotschka. What I mean is, what happens to emails that do not contain a In-Reply-To headers - are they still threaded in the same email chain, just based on the subject line/sender? – julie Jan 20 '21 at 22:38

1 Answers1

0

As per documentation

The References and In-Reply-To headers follow the RFC 2822 standard.

if they are provided. However, you do not need to provide those parameters to make a message thread.

What is necessary for threading is

  1. The subject needs to match
  2. The threadId needs to be provided in the Request body (however outside of the raw body).
ziganotschka
  • 25,866
  • 2
  • 16
  • 33
  • Thank you for the reference, @ziganotschka. What is happening in our account is that only some emails are grouped into a thread, and others that have the same subject line are not. These emails are replies to the root email - a majority of the replies that appear in one thread have the references, and in-reply-to headers missing. – julie Jan 26 '21 at 17:29
  • The replies that arrive are from regular email accounts, so they would not know how to modify/manipulate Google threadId. – julie Jan 26 '21 at 17:30
  • You say "The replies that arrive are from regular email accounts". So you mean that the replies from regular users replying to an email via UI rather than API are not threaded correctly? – ziganotschka Jan 26 '21 at 20:24
  • Yes, that is correct. The replies come from users that most definitely use the UI to send them - regular customer communication. All these emails have the same subject line, but some of these replies end up in the same thread and some don't. The ones that end up in the same thread do not have the references and in-reply-to headers. So far, that is the only difference I found between the two sets – julie Jan 26 '21 at 20:35
  • I see, so your question is not related to the Gmail API, but the UI? If your question is not coding related, I am afraid Stackoverflow is not the right place for it. You might be more succesful posting on another forum, maybe [Web Applications](https://webapps.stackexchange.com/). – ziganotschka Jan 27 '21 at 09:54
  • It is not related to coding, but it is also not a UI question. Sorry if it was not clear. The issue is (GMail) threading - we send emails to customers, they reply back. As per the documentation, we expect replies with same subject line to arrive in the same thread - they don't, some have their own separate thread. What drives it to behave differently? Thank you for your attention. – julie Jan 27 '21 at 10:01
  • Unfortunately this is out of my scope. – ziganotschka Jan 27 '21 at 10:22