diff --git a/include/class.mailer.php b/include/class.mailer.php
index 7dfb867e34780e74b29693fa431a5aa6a11a3619..41c0005aeb682e6d94d40b7ca054c6113e685a34 100644
--- a/include/class.mailer.php
+++ b/include/class.mailer.php
@@ -304,11 +304,13 @@ class Mailer {
         if (isset($options['thread'])
             && $options['thread'] instanceof ThreadEntry
         ) {
-            $headers += array('References' => $options['thread']->getEmailReferences());
             if ($irt = $options['thread']->getEmailMessageId()) {
                 // This is an response from an email, like and autoresponse.
                 // Web posts will not have a email message-id
-                $headers += array('In-Reply-To' => $irt);
+                $headers += array(
+                    'In-Reply-To' => $irt,
+                    'References' => $options['thread']->getEmailReferences()
+                );
             }
             elseif ($parent = $options['thread']->getParent()) {
                 // Use the parent item as the email information source. This