diff --git a/include/class.thread.php b/include/class.thread.php
index fb180a767b027fa12ee99cfe71e8f441cb2cc92a..a2a7cb91c44255d1271fd15d5dc5aab1d6e2fb05 100644
--- a/include/class.thread.php
+++ b/include/class.thread.php
@@ -891,8 +891,9 @@ Class ThreadEntry {
         // Search for the message-id token in the body
         if (preg_match('`(?:data-mid="|Ref-Mid: )([^"\s]*)(?:$|")`',
                 $mailinfo['message'], $match))
-            if ($thread = ThreadEntry::lookupByMessageId($match[1]))
-                   return $thread;
+            if ($thread = ThreadEntry::lookupByRefMessageId($match[1],
+                    $mailinfo['email']))
+                return $thread;
 
         return null;
     }
@@ -901,7 +902,7 @@ Class ThreadEntry {
      * Find a thread entry from a message-id created from the
      * ::asMessageId() method
      */
-    function lookupByMessageId($mid, $from) {
+    function lookupByRefMessageId($mid, $from) {
         $mid = trim($mid, '<>');
         list($ver, $ids, $mails) = explode('$', $mid, 3);
 
@@ -923,8 +924,8 @@ Class ThreadEntry {
 
     /**
      * Get an email message-id that can be used to represent this thread
-     * entry. The same message-id can be passed to ::lookupByMessageId() to
-     * find this thread entry
+     * entry. The same message-id can be passed to ::lookupByRefMessageId()
+     * to find this thread entry
      *
      * Formats:
      * Initial (version <null>)