about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-18 01:11:04 +0000
committerEric Wong <e@80x24.org>2015-08-18 01:11:53 +0000
commit6a19d29cb98823ee3794d295e122ee265ab3016a (patch)
treef73aef5f9d98ab9205c7b76735415594058381c4 /t
parent7310cc79cea5ba64b1cc7c97169d811d8a4653a0 (diff)
downloadpublic-inbox-6a19d29cb98823ee3794d295e122ee265ab3016a.tar.gz
Some mail software incorrectly creates circular references
and causes us to create ghosts before the actual mail doc
is created.
Diffstat (limited to 't')
-rw-r--r--t/search.t19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/search.t b/t/search.t
index 0ad0886b..55abe9e8 100644
--- a/t/search.t
+++ b/t/search.t
@@ -243,6 +243,25 @@ sub filter_mids {
                 "quoted result returned if nothing else");
 }
 
+# circular references
+{
+        my $doc_id = $rw->add_message(Email::MIME->create(
+                header_str => [
+                        Date => 'Sat, 02 Oct 2010 00:00:01 +0000',
+                        Subject => 'Circle',
+                        'Message-ID' => '<circle@a>',
+                        'References' => '<circle@a>',
+                        'In-Reply-To' => '<circle@a>',
+                        From => 'Circle <circle@example.com>',
+                        To => 'list@example.com',
+                ],
+                body => "LOOP!\n"));
+        ok($doc_id > 0, "doc_id defined with circular reference");
+        my $smsg = $rw->lookup_message('circle@a');
+        $smsg->ensure_metadata;
+        is($smsg->{references}, undef, "no references created");
+}
+
 done_testing();
 
 1;