about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-02-26 10:21:12 +0000
committerEric Wong <e@yhbt.net>2020-03-01 17:18:53 -0600
commit03255d56a53d390a7f7bb069e0f1c6ea5d34756c (patch)
treeded98a63726e1600893d12d3e6f35ab080e1febc /lib
parent9dfddf147f4c8e45eae18d3684e9f60c8a631704 (diff)
downloadpublic-inbox-03255d56a53d390a7f7bb069e0f1c6ea5d34756c.tar.gz
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 <leah@vuxu.org>
Link: https://public-inbox.org/meta/87h7zfemur.fsf@vuxu.org/
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Import.pm4
1 files changed, 4 insertions, 0 deletions
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 {