diff options
Diffstat (limited to 'scripts/ssoma-replay')
-rwxr-xr-x | scripts/ssoma-replay | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scripts/ssoma-replay b/scripts/ssoma-replay index 46b15d7e..70d0081d 100755 --- a/scripts/ssoma-replay +++ b/scripts/ssoma-replay @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright (C) 2015-2020 all contributors <meta@public-inbox.org> +# Copyright (C) 2015-2021 all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> # # A work-in-progress, but one day I hope this script is no longer @@ -29,11 +29,8 @@ use strict; use Email::Simple; use URI::Escape qw/uri_escape_utf8/; use File::Temp qw/tempfile/; -my ($fh, $filename) = tempfile('ssoma-replay-XXXXXXXX', TMPDIR => 1); -my $msg = eval { - local $/; - Email::Simple->new(<STDIN>); -}; +my ($fh, $filename) = tempfile('ssoma-replay-XXXX', TMPDIR => 1); +my $msg = Email::Simple->new(do { local $/; <STDIN> }); select $fh; # Note: the archive URL makes assumptions about where the @@ -52,7 +49,7 @@ if (defined $list_id) { if (defined $domain) { $archive_url = "https://$domain/$user/"; my $mid = $header_obj->header('Message-Id'); - if ($mid =~ /\A<(.+)>\z/) { + if ($mid =~ /<[ \t]*([^>]+)?[ \t]*>/s) { $mid = $1; } $mid = uri_escape_utf8($mid, |