* Set headers for proper threading: GMail will not group messages, even if they have same subject, but don't have "In-Reply-To" and
* "References" headers. TODO investigate threading in other clients like KMail, Thunderbird, Outlook
*/
if (StringUtils.isNotEmpty(emailMessage.getMessageId())) {
String messageId = "<" + emailMessage.getMessageId() + "@" + host + ">";
email.addHeader(IN_REPLY_TO_HEADER, messageId);
email.addHeader(REFERENCES_HEADER, messageId);
}
// Set headers for proper filtering
email.addHeader(LIST_ID_HEADER, "SonarQube <sonar." + host + ">");
email.addHeader(LIST_ARCHIVE_HEADER, configuration.getServerBaseURL());