quickstart: check if domain was registered recently, and warn about potential deliverability issues

we use 6 weeks as the cutoff, but this is fuzzy, and will vary by mail
server/service provider.

we check the domain age using RDAP, the replacement for whois. it is a
relatively simple protocol, with HTTP/JSON requests. we fetch the
"registration"-related events to look for a date of registration.
RDAP is not available for all country-level TLDs, but is for most (all?) ICANN
global top level domains. some random cctlds i noticed without rdap: .sh, .au,
.io.

the rdap implementation is very basic, only parsing the fields we need. we
don't yet cache the dns registry bootstrap file from iana. we should once we
use this functionality from the web interface, with more calls.
This commit is contained in:
Mechiel Lukkien
2025-02-07 11:16:30 +01:00
parent c7354cc22b
commit 2f0997682b
5 changed files with 322 additions and 3 deletions

21
doc.go
View File

@ -110,6 +110,7 @@ any parameters. Followed by the help and usage information for each command.
mox dnsbl check zone ip
mox dnsbl checkhealth zone
mox mtasts lookup domain
mox rdap domainage domain
mox retrain [accountname]
mox sendmail [-Fname] [ignoredflags] [-t] [<message]
mox spf check domain ip
@ -186,7 +187,7 @@ output of "mox config describe-domains" and see the output of
-hostname string
hostname mox will run on, by default the hostname of the machine quickstart runs on; if specified, the IPs for the hostname are configured for the public listener
-skipdial
skip check for outgoing smtp (port 25) connectivity
skip check for outgoing smtp (port 25) connectivity or for domain age with rdap
# mox stop
@ -1456,6 +1457,24 @@ should be used, and how long the policy can be cached.
usage: mox mtasts lookup domain
# mox rdap domainage
Lookup the age of domain in RDAP based on latest registration.
RDAP is the registration data access protocol. Registries run RDAP services for
their top level domains, providing information such as the registration date of
domains. This command looks up the "age" of a domain by looking at the most
recent "registration", "reregistration" or "reinstantiation" event.
Email messages from recently registered domains are often treated with
suspicion, and some mail systems are more likely to classify them as junk.
On each invocation, a bootstrap file with a list of registries (of top-level
domains) is retrieved, without caching. Do not run this command too often with
automation.
usage: mox rdap domainage domain
# mox retrain
Recreate and retrain the junk filter for the account or all accounts.