From 66487129ba8e0c53cbf20f6420a5d8824f65e804 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Tue, 24 Feb 2026 20:53:56 +0000 Subject: [PATCH 1/2] Remove Yahoo dash address normalization Yahoo dash addresses (e.g. nickname-keyword@) are distinct accounts, not aliases of the base address (nickname@). The DASH_ADDRESSING rule was incorrectly normalizing them as equivalent, causing unrelated addresses to be treated as the same. Base addresses themselves are not deliverable inboxes. This change removes all normalization rules from the Yahoo provider. The provider class remains to explicitly denote that Yahoo addresses are not to be normalized. --- email_normalize/__init__.py | 2 -- email_normalize/providers.py | 7 +++++-- tests/test_normalize.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/email_normalize/__init__.py b/email_normalize/__init__.py index 4a8cd8c..14e6cfd 100644 --- a/email_normalize/__init__.py +++ b/email_normalize/__init__.py @@ -197,8 +197,6 @@ async def normalize(self, email_address: str) -> Result: local_part = local_part.replace('.', '') if provider.Flags & providers.Rules.PLUS_ADDRESSING: local_part = local_part.split('+')[0] - if provider.Flags & providers.Rules.DASH_ADDRESSING: - local_part = local_part.split('-')[0] return Result(email_address, '@'.join([local_part, domain_part]), mx_records, provider.__name__ if provider else None) diff --git a/email_normalize/providers.py b/email_normalize/providers.py index 098b73a..ad30543 100644 --- a/email_normalize/providers.py +++ b/email_normalize/providers.py @@ -12,7 +12,7 @@ class Rules(enum.Flag): Used to determine how to normalize provider specific email addresses. """ - DASH_ADDRESSING = enum.auto() + NONE = 0 PLUS_ADDRESSING = enum.auto() LOCAL_PART_AS_HOSTNAME = enum.auto() STRIP_PERIODS = enum.auto() @@ -55,7 +55,10 @@ class Rackspace(MailboxProvider): class Yahoo(MailboxProvider): - Flags: Rules = Rules.DASH_ADDRESSING + # No normalization rules — Yahoo disposable addresses use the format + # nickname-keyword@, where the nickname alone is not a deliverable + # address. See https://help.yahoo.com/kb/SLN28815.html + Flags: Rules = Rules.NONE MXDomains: typing.Set[str] = {'yahoodns.net'} diff --git a/tests/test_normalize.py b/tests/test_normalize.py index f64fe55..c1231c7 100644 --- a/tests/test_normalize.py +++ b/tests/test_normalize.py @@ -111,7 +111,7 @@ def test_yahoo(self): address = '{}@{}'.format(local_part, domain_part) mx_records = [(1, 'mta5.am0.yahoodns.net')] self._perform_test( - address, '{}@{}'.format(local_part.split('-', 1)[0], domain_part), + address, '{}@{}'.format(local_part, domain_part), mx_records, 'Yahoo') def test_yandex(self): From 228113aa29ba4c190b42e9d20e8684095efa765a Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Tue, 24 Feb 2026 17:06:29 -0500 Subject: [PATCH 2/2] Enable tests for pull requests --- .github/workflows/testing.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 5b106b8..7764ede 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -1,5 +1,11 @@ name: Testing on: + pull_request: + paths-ignore: + - 'docs/**' + - 'setup.*' + - '*.md' + - '*.rst' push: branches: ["*"] paths-ignore: