Skip to content

Conversation

Copy link

Copilot AI commented Oct 14, 2025

Problem

Email addresses are case-insensitive according to RFC standards, but the email forwarding worker was treating aliases as case-sensitive. This meant that [email protected] would work, but [email protected] or [email protected] would be rejected, causing confusion for users.

Solution

This PR normalizes all alias and group comparisons to lowercase throughout the codebase, making email address matching case-insensitive while maintaining all existing functionality.

Changes Made

Core Logic Updates:

  • Modified alias matching in Config.recipientConfig to convert both aliases and recipient accounts to lowercase before comparison
  • Updated Config.aliases and Config.groups getters to return lowercase values
  • Fixed group matching in Config.targetIsGroup to use lowercase comparison
  • Updated delimited target matching in Config.targetFromRecipientWithDelimiter to use lowercase recipient account
  • Enhanced Config.emailAddressesForGroup to perform case-insensitive group lookups
  • Updated Processor._handleDelimitedTarget to use case-insensitive alias matching

Type Safety Improvements:

  • Made groups and type fields optional in AccountsForConfigType interface to reflect actual usage patterns and prevent runtime errors

Testing

Added comprehensive test coverage for case-insensitive matching:

All 15 tests passing (10 existing + 5 new).

Impact

✅ No breaking changes - existing lowercase aliases continue to work exactly as before
✅ Improved user experience - uppercase and mixed-case variations now work correctly
✅ Aligns with standard email behavior per RFC specifications

Original prompt

This section details on the original issue you should resolve

<issue_title>Address aliases are case sensitive</issue_title>
<issue_description>It's common for email addresses to be case insensitive, so let's support that and eliminate any issues that may arise from differently cased aliases.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #30


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix case sensitivity for address aliases Make email aliases case-insensitive Oct 14, 2025
Copilot AI requested a review from kenyonj October 14, 2025 15:54
Copilot finished work on behalf of kenyonj October 14, 2025 15:54
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.

Address aliases are case sensitive

2 participants