Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
Fixed a bug in retrieving the DKIM public key:

For some emails, the DKIM public key is not stored TXT record directly in `selector._domainkey.domain`, but instead points to a CNAME.

For example, when retrieving the DKIM public key for the following domain: `protonmail._domainkey.proton.me`, we first need to resolve the CNAME for this domain: `protonmail.domainkey.drfeyjwh4gwlal4e2rhajsytrp6auv2nhenecpzigu7muak6lw6ya.domains.proton.ch`.

However, using the "dns" npm package, the CNAME cannot be resolved.

With this update, all DNS resolutions will be performed using google DNS-over-HTTPS (DoH).
  • Loading branch information
jayden-sudo authored and SoraSuegami committed Sep 1, 2024
1 parent 6bb9af8 commit f5a9ae3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/helpers/src/lib/mailauth/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,7 @@ export const getPublicKey = async (
resolver: (...args: [name: string, type: string]) => Promise<any>
) => {
minBitLength = minBitLength || 1024;
if (!IS_BROWSER) {
resolver = resolver || require("dns").promises.resolve;
} else {
resolver = resolveDNSHTTP;
}
resolver = resolveDNSHTTP;

let list = await resolver(name, "TXT");
let rr =
Expand Down

0 comments on commit f5a9ae3

Please sign in to comment.