diff options
author | Eric Wong <e@80x24.org> | 2019-12-14 05:22:18 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-12-15 19:43:33 +0000 |
commit | 3d20f6e4c214747b3e700d30e4cac70a33a817d8 (patch) | |
tree | cf0165f83f30c61ee50477a147a226aef0e66967 /t | |
parent | 69ae87044ca499aa401c73a9a1d764013539fb2d (diff) | |
download | public-inbox-3d20f6e4c214747b3e700d30e4cac70a33a817d8.tar.gz |
Apparently, neither our previous address parsing code nor Email::Address::XS recognizes local, username-only addresses in the form of <username> (without "@host"). Without this change, Email::Address::XS->address would return "undef", so we need to filter it out via "grep { defined }" It seems the cases where users email each other on the same machine is small and public-inbox won't be able to index addresses for those cases... Oh well :/
Diffstat (limited to 't')
-rw-r--r-- | t/address.t | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/address.t b/t/address.t index e7c0d6a8..1f20702a 100644 --- a/t/address.t +++ b/t/address.t @@ -38,6 +38,11 @@ sub test_pkg { @names = $names->('"Quote Unneeded" <user@example.com>'); is_deeply(['Quote Unneeded'], \@names, 'extra quotes dropped'); + + my @emails = $emails->('Local User <user>'); + is_deeply([], \@emails , 'no address for local address'); + @names = $emails->('Local User <user>'); + is_deeply([], \@names, 'no address, no name'); } test_pkg('PublicInbox::Address'); |