Repository navigation
Dmarc dkim verification - #2802
Open
oliver-gordon wants to merge 8 commits into
Open
oliver-gordon wants to merge 8 commits into
oliver-gordon wants to merge 8 commits into
Conversation
oliver-gordon
requested review from
acasajus,
cquintana92 and
nguyenkims
as code owners
September 2, 2026 07:55
acasajus
reviewed
Sep 2, 2026
Comment on lines
+128
to
+130
| if custom_domain.is_sl_subdomain: | ||
| dkim_ok = True | ||
| dmarc_ok = True |
Collaborator
There was a problem hiding this comment.
id move this to the top and if it's is_sl_subdomain return like the custom_domain.user.disabled. There are some domains with whacky states and I'd avoid messing with those for now.
cquintana92
reviewed
Sep 4, 2026
| dmarc_ok = validator.validate_dmarc_records(custom_domain).success | ||
|
|
||
| domain_dns_url = f"{config.URL}/dashboard/domains/{custom_domain.id}/dns" | ||
| provider = "Proton" if user.has_used_alias_from_partner() else "SimpleLogin" |
Collaborator
There was a problem hiding this comment.
Probably we should check whether the domain has created via partner, as a user can have domains added via Pass or via SL
cquintana92
approved these changes
Sep 4, 2026
oliver-gordon
force-pushed
the
dmarc_dkim_verification
branch
from
October 6, 2026 14:17
c96ba41 to
fff0b82
Compare
The check_custom_domains cron alerted every MX-verified domain whose DKIM or DMARC records were missing, including users who never configured them, and called the mutating validators, which clear dkim_verified/dmarc_verified on a single transient DNS failure (disabling outbound DKIM signing). - Snapshot dkim_verified/dmarc_verified before any mutation; only count failures and alert when the record was previously verified. - Add read-only check_dkim_records/check_dmarc_record to CustomDomainValidation and use them in the cron; flags now only flip once the failure threshold is reached and the alert actually went out. - Apply the legacy single dkim._domainkey compatibility rule to the cron check so pre-multi-key domains are neither alerted nor de-verified. - Rate-limit alerts per domain (domain in the SentAlert key) so a second broken domain is not silenced by the first one's alert; if the alert is rate-limited, keep counting instead of de-verifying without notice. - validate_dmarc_records only writes the audit log entry when the flag flips. - Tests drive the flow through InMemoryDNSClient instead of patching validators.
Otherwise a stale *_nb_failed_checks_updated_at would throttle the counter for up to a day if the user re-verifies the records right after being alerted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce validation checks for dmarc and dkim, use the same issue counter as mx record checks to trigger notifications. This allows us to avoid new columns and a migration. Two new email templates for user notifications