about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/PublicInbox.pm4
-rw-r--r--t/precheck.t3
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/PublicInbox.pm b/lib/PublicInbox.pm
index 899027be..56137d14 100644
--- a/lib/PublicInbox.pm
+++ b/lib/PublicInbox.pm
@@ -16,8 +16,10 @@ sub __drop_plus {
 # do not allow Bcc, only Cc and To if ORIGINAL_RECIPIENT (postfix) env is set
 sub precheck {
         my ($klass, $filter) = @_;
+        my $simple = $filter->simple;
+        return 0 unless $simple->header("Message-ID");
         return 0 unless defined($filter->from);
-        return 0 if length($filter->simple->as_string) > MAX_SIZE;
+        return 0 if length($simple->as_string) > MAX_SIZE;
         recipient_specified($filter);
 }
 
diff --git a/t/precheck.t b/t/precheck.t
index 6deead98..f9d61d8e 100644
--- a/t/precheck.t
+++ b/t/precheck.t
@@ -38,6 +38,7 @@ sub do_checks {
                         Cc => 'c@example.com',
                         'Content-Type' => 'text/plain',
                         Subject => 'this is a subject',
+                        'Message-ID' => '<MID>',
                 ],
                 body => "hello world\n",
         ));
@@ -51,6 +52,7 @@ sub do_checks {
                         Cc => 'John Doe <c@example.com>',
                         'Content-Type' => 'text/plain',
                         Subject => 'this is a subject',
+                        'Message-ID' => '<MID>',
                 ],
                 body => "hello world\n",
         ));
@@ -64,6 +66,7 @@ sub do_checks {
                         Cc => 'c@example.com',
                         'Content-Type' => 'text/plain',
                         Subject => 'this is a subject',
+                        'Message-ID' => '<MID>',
                 ],
                 body => "hello world\n",
         );