Search code examples
gmailmailgun

Mailgun Message-Id is not recognised in In-Reply-To and Reference headers from gmail?


I am using mailgun to send emails to customers. There is an option to set Message-Id when we send out a message and the expectation is that whenever a reply happens on the email sent, the References and In-Reply-To header values will be populated with the Message-Id of the initiating email. But this is not currently happening for gmail. Is this expected? If so, then what is the way of keeping emails and replies grouped into a thread? Any direction will be appreciated. Thank you.


Solution

  • I found the answer to my question some time ago. Posting here if it helps someone: Gmail follows a certain format for MessageID (RFC 822) which is like an emailId by itself - @<email.com> My messageId was missing that "@email.com" part; once I added that it started sending back the In-Reply-To header with the same value.