Skip to content

Conversation

@huntfx
Copy link

@huntfx huntfx commented Oct 14, 2025

Updated the MX domain name resolution logic, so that it follows any CNAME records through to the final MX server. This resolves an issue where a correct DNS setup still flags up a warning email saying it's incorrect.

Fixes #2575.

Tested on my own custom domain, which has these rules:

MX sl.domain.tld mx1.sl.domain.tld 10
MX sl.domain.tld mx2.sl.domain.tld 20
CNAME mx1.sl.domain.tld mx1.simplelogin.co
CNAME mx2.sl.domain.tld mx2.simplelogin.co

Before:

> python -c "from app.email_utils import get_mx_domains; print(get_mx_domains('sl.domain.tld'))"
{10: ['mx1.sl.domain.tld.'], 20: ['mx2.sl.domain.tld.']}

After:

> python -c "from app.email_utils import get_mx_domains; print(get_mx_domains('sl.domain.tld'))"
{10: ['mx1.simplelogin.co.'], 20: ['mx2.simplelogin.co.']}

Updates the MX record resolution logic to follow CNAME records for each domain, ensuring the final domain name is used in the result.
@acasajus
Copy link
Collaborator

@acasajus acasajus closed this Oct 15, 2025
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