From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A468A1F4C0; Tue, 15 Oct 2019 20:26:00 +0000 (UTC) Date: Tue, 15 Oct 2019 20:26:00 +0000 From: Eric Wong To: "Eric W. Biederman" Cc: meta@public-inbox.org Subject: Re: [PATCH 1/4] PublicInbox::Import Smuggle a raw message into add Message-ID: <20191015202600.GA10270@dcvr> References: <87imp05hlm.fsf@alyssa.is> <20191008001050.rwd7bh7cek7qrydi@dcvr> <87wodfctwd.fsf@x220.int.ebiederm.org> <20191008221108.3wsso25kviiwd7ek@dcvr> <87wodec1um.fsf@x220.int.ebiederm.org> <20191008224104.GA24142@dcvr> <87h84ibb9m.fsf@x220.int.ebiederm.org> <87wode9vxw.fsf_-_@x220.int.ebiederm.org> <87muea9vut.fsf_-_@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87muea9vut.fsf_-_@x220.int.ebiederm.org> List-Id: "Eric W. Biederman" wrote: > > Date: Tue, 15 Jan 2019 16:36:42 -0600 > > I don't trust the MIME type to not munge my email messages in horrible > ways upon occasion. Therefore allow for passing in the raw message > value instead of trusting the mime object to preserve it. > > Signed-off-by: "Eric W. Biederman" > --- > > As we discussed last time I was working to merge my imap import script. Thanks, pushed with the following interdiff: diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index b17c9d5c..e1f48771 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -394,8 +394,7 @@ sub add { } my $blob = $self->{mark}++; - my $raw_email = $mime->{-public_inbox_raw}; - $raw_email ||= $mime->as_string; + my $raw_email = $mime->{-public_inbox_raw} // $mime->as_string; my $n = length($raw_email); $self->{bytes_added} += $n; print $w "blob\nmark :$blob\ndata ", $n, "\n" or wfail;