Don't flag a mailbox address without a distinct name as spoofed.

This fixes annoying, albeit legit addresses like "mike@vee.net
<mike@vee.net>" from being flagged.

Followup to commit b7eea857.

* src/engine/rfc822/rfc822-mailbox-address.vala (MailboxAddress): Don't
  test name for spoofyness if it's not distinct. Add unit test.
This commit is contained in:
Michael James Gratton 2018-02-02 01:05:24 +10:30
parent 7073206c8d
commit f8ef491cca
2 changed files with 4 additions and 2 deletions

View file

@ -156,6 +156,7 @@ class Geary.RFC822.MailboxAddressTest : Gee.TestCase {
assert(new MailboxAddress("test test", "example@example.com").is_spoofed() == false);
assert(new MailboxAddress("test test", "example@example.com").is_spoofed() == false);
assert(new MailboxAddress("test?", "example@example.com").is_spoofed() == false);
assert(new MailboxAddress("test@example.com", "test@example.com").is_spoofed() == false);
assert(new MailboxAddress("test@example.com", "example@example.com").is_spoofed() == true);
assert(new MailboxAddress("test @ example . com", "example@example.com").is_spoofed() == true);