From 03255d56a53d390a7f7bb069e0f1c6ea5d34756c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 26 Feb 2020 10:21:12 +0000 Subject: import: drop '<' and '>' characters in addresses Some strange "From:" lines will cause Email::Address::XS to leave '<' (and presumably '>') in the address which git-fast-import won't accept even if quoted. Workaround this problem by deleting '<' and '>' the same way we delete them for the ident name. Reported-by: Leah Neukirchen Link: https://public-inbox.org/meta/87h7zfemur.fsf@vuxu.org/ --- lib/PublicInbox/Import.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index d8dc49b8..68dc0c7e 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -293,6 +293,10 @@ sub extract_cmt_info ($) { } } if (defined $email) { + # Email::Address::XS may leave quoted '<' in addresses, + # which git-fast-import doesn't like + $email =~ tr/<>//d; + # quiet down wide character warnings with utf8::encode utf8::encode($email); } else { -- cgit v1.2.3-24-ge0c7