Skip to content

Comments

treat email addresses case-insensitively in conflict resolution#42

Merged
printminion-co merged 1 commit intofeature/provider_mails_adminfrom
mk/dev/mailboxadmin-fix-email-casing
Feb 23, 2026
Merged

treat email addresses case-insensitively in conflict resolution#42
printminion-co merged 1 commit intofeature/provider_mails_adminfrom
mk/dev/mailboxadmin-fix-email-casing

Conversation

@printminion-co
Copy link

@printminion-co printminion-co commented Feb 23, 2026

This pull request improves the handling of email address comparisons in the IONOS account conflict resolution logic by making the comparison case-insensitive. Additionally, it adds a new unit test to ensure this behavior is correctly implemented.

Conflict resolution improvements:

  • Updated the email comparison in IonosAccountConflictResolver.php to use a case-insensitive check (strcasecmp) when determining if the retrieved email matches the expected email address. This ensures that email addresses with different casing are treated as equivalent.

Testing enhancements:

  • Added a new unit test testResolveConflictWithMatchingEmailCaseInsensitive in IonosAccountConflictResolverTest.php to verify that the conflict resolver correctly handles email addresses that differ only in case, ensuring the new logic is covered by tests.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the robustness of the IONOS account conflict resolution by making email matching case-insensitive. Email addresses are case-insensitive per RFC 5321, so this change ensures proper matching regardless of casing variations that might be returned from the API.

Changes:

  • Updated email comparison logic in IonosAccountConflictResolver to use strcasecmp for case-insensitive comparison
  • Added comprehensive test to verify case-insensitive email matching works correctly

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/Provider/MailAccountProvider/Implementations/Ionos/Service/IonosAccountConflictResolver.php Changed email comparison from strict equality to case-insensitive strcasecmp
tests/Unit/Provider/MailAccountProvider/Implementations/Ionos/Service/IonosAccountConflictResolverTest.php Added test case for case-insensitive email matching with uppercase email from API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ively in conflict resolution

Replace strict === comparison with strcasecmp() in IonosAccountConflictResolver
so that foo@bar.lol and FOO@BAR.LOL resolve to the same account, consistent
with all other email comparisons in the codebase.

Add a unit test covering the case where the IONOS API returns an email in
different casing than the requested address.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
@printminion-co printminion-co force-pushed the mk/dev/mailboxadmin-fix-email-casing branch from c6bf308 to caffda3 Compare February 23, 2026 10:58
@printminion-co printminion-co changed the title IONOS(ionos-mail): test(IonosAccountConflictResolver): Add case-insen… treat email addresses case-insensitively in conflict resolution Feb 23, 2026
Copy link

@Arsalanulhaq Arsalanulhaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Its a minor change

@printminion-co printminion-co added this to the ncw-4 milestone Feb 23, 2026
@printminion-co printminion-co merged commit abec44f into feature/provider_mails_admin Feb 23, 2026
6 of 27 checks passed
@printminion-co printminion-co deleted the mk/dev/mailboxadmin-fix-email-casing branch February 23, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants