diff options
author | Eric Wong <e@80x24.org> | 2021-03-22 07:54:02 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-03-23 00:07:15 +0000 |
commit | e7d13d7bc4a7b1e990602e796b7c2acbddb99a7b (patch) | |
tree | 3285bf7dd4d91f65daf4acd9505b2e8db2de8040 /lib | |
parent | bbf3bbfe8e45fb79e2b848966aac5792268b3d8f (diff) | |
download | public-inbox-e7d13d7bc4a7b1e990602e796b7c2acbddb99a7b.tar.gz |
Those headers only have meaning with for mboxes. Don't surprise users by trying to make sense of a header that is defined for mboxes. It's possible to send email with (Status|X-Status) headers and have those headers show up in a recipient's IMAP mailbox. This was bad because an IMAP user may want to import a single message through their MUA and pipe its contents to "lei import" without noticing a mischievious sender stuck "X-Status: F" (flagged/important) in there.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/LeiImport.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm index 767cae60..9ad2ff12 100644 --- a/lib/PublicInbox/LeiImport.pm +++ b/lib/PublicInbox/LeiImport.pm @@ -10,19 +10,19 @@ use PublicInbox::Eml; use PublicInbox::PktOp qw(pkt_do); sub eml_cb { # used by PublicInbox::LeiInput::input_fh - my ($self, $eml) = @_; - my $vmd; - if ($self->{-import_kw}) { # FIXME - my $kw = PublicInbox::MboxReader::mbox_keywords($eml); - $vmd = { kw => $kw } if scalar(@$kw); - } + my ($self, $eml, $vmd) = @_; my $xoids = $self->{lei}->{ale}->xoids_for($eml); $self->{lei}->{sto}->ipc_do('set_eml', $eml, $vmd, $xoids); } sub mbox_cb { # MboxReader callback used by PublicInbox::LeiInput::input_fh my ($eml, $self) = @_; - eml_cb($self, $eml); + my $vmd; + if ($self->{-import_kw}) { + my $kw = PublicInbox::MboxReader::mbox_keywords($eml); + $vmd = { kw => $kw } if scalar(@$kw); + } + eml_cb($self, $eml, $vmd); } sub import_done_wait { # dwaitpid callback |