Eric Wong <[email protected]> writes: > "Eric W. Biederman" <[email protected]> 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" <[email protected]> >> --- >> >> 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;
Looks good. I hadn't realized that // was an operator in perl. It is nice to see. Eric -- unsubscribe: [email protected] archive: https://public-inbox.org/meta/
