Replies to e-mails not linked to document

When I send e.g. a sales invoice, the e-mail is sent by and when the customer replies to the e-mail, it is shown in the Communications List, but it isn’t linked to the Sales Invoice document.

I assume this is because the reply-to address in the e-mail sent by ERPNext is also When the customer sends an email to the address that includes the Sales Invoice number (e.g., the received email gets correctly linked to the Sales Invoice.

Is there a setting such that the reply-to address includes the document number so replies by the customer automatically get linked to the correct document?

Hello Brontos

As I’ve been told, the linking works through the “message-id” in the email headers.

Any chance you are using office365?
Because we have issues with that too.

Interesting. We are not using office365; in the tests I did I was sending e-mails to/from my personal gmail address. But we use AWS to send e-mails from ERPNext, it may be possible that it modifies the headers. I will dig into it more.

The issue was using the Amazon SES SMTP server for sending e-mails. We changed to google ( and it works as expected now. The gmail SMTP server does not modify the Message-ID in the header, while Amazon SES does.