Understanding how LiveAgent processes incoming emails

If you prefer watching a video over reading an article, see the video below:

Upon receiving a new email, the software determines whether to generate a new ticket or add it to an existing ticket by examining the email's source code. The source code includes various email headers that contain useful information. The system checks the following in the order shown and adds the email to the first ticket that matches:

  • In-Reply-To header — the value is looked up against the Message-IDs previously stored for existing tickets.
  • References header — the same lookup is performed for every Message-ID listed in the References header.
  • Thread-Index header (used by Outlook) — matched against the ticket code stored for existing tickets.
  • Ticket ID in the subject — the subject is scanned for a LiveAgent ticket ID in the format AAA-BBBBB-999 (three uppercase letters, five uppercase letters, three digits — for example ABC-DEFGH-123).
  • Feedback-ID header — used only for eBay's eBayStarship notifications, and only when combined with an eBay item ID (e.g. #123456789012) in the subject.

If none of these produce a match, a new ticket is created.

Check this article to see how to retrieve the source of an email message.

The example screenshot below illustrates how two seemingly unrelated emails with different subjects were merged into a single ticket. By accessing their source codes and examining the headers, we can deduce that the second email is actually a reply to the first, despite its different content. This is because the Message-ID value of the first email is noted in the In-Reply-To and References headers of the second email.

Ticket status considerations

There are special situations where, regardless of the email's source code or ticket ID in the subject, an email that should be added to an existing ticket instead creates a new ticket. This is related to the status of the ticket that the message should be added to:

  • If the ticket is in the Closed or Deleted status, any reply always creates a new ticket.
  • If the ticket is in the Resolved status, the reply is added to it as long as the Reopen Resolved Ticket setting is enabled under Configuration > System > General. This setting is enabled by default; if it is turned off, replies to Resolved tickets create new tickets instead.

IDs overwritten by email servers

In some rare cases, the sending email server may overwrite the Message-ID generated by LiveAgent. In such instances, the customer's response does not contain the Message-ID value generated by LiveAgent, resulting in the creation of a new ticket rather than appending the reply to the existing one. An example of this is Amazon SES (Simple Email Service) (learn more here), which we do not recommend using due to this behavior.

This problem can be bypassed by making LiveAgent include the Message-ID of each outbound message inside the References header of that same outbound message. Normally LiveAgent leaves its own Message-ID out of the outgoing References header; with this option enabled, the original ID is preserved inside References even if the mail server overwrites the Message-ID field. When the customer replies, the reply's In-Reply-To or References header still contains the original ID and LiveAgent can match it back to the existing ticket. Cloud-hosted customers are welcome to contact our support and request to activate this function for their account. Customers with self-hosted installations can activate this function in the database by adding a new record "mail_references_myself = Y" to the "qu_g_settings" database table.

×