From b56d2917d2103665824990c869a2bcf80b563fe0 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Wed, 18 Nov 2015 12:48:41 +0100 Subject: [PATCH] Fix mail thread grouping for separate check runs Don't keep In-Reply-To between success/failure cycles not to have all reports from a particular check in the same thread. Fixes a bug introduced in the previous commit, 3c3ca1cf9d7c14ad3f8b7054a947607df06f283f --- picomon/mails.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/picomon/mails.py b/picomon/mails.py index 898b24e..eaf460f 100644 --- a/picomon/mails.py +++ b/picomon/mails.py @@ -135,7 +135,7 @@ def send_email_for_check(check, removed=False): extra_headers = {} extra_headers['Message-ID'] = make_msgid(type(check).__name__) # if it's a follow up, set In-Reply-To - if hasattr(check, 'mails_msgid'): + if (check.ok or removed) and hasattr(check, 'mails_msgid'): extra_headers['In-Reply-To'] = check.mails_msgid extra_headers['References'] = check.mails_msgid check.mails_msgid = extra_headers['Message-ID'] -- GitLab