Skip to content

Dns_trie.check maybe too strict #412

@reynir

Description

@reynir

In Dns_trie.check we check MX records pointing to a subdomain that the subdomain has an address:

| B (Mx, (ttl, mxs)) ->
if ttl < 0l then
Error (`Bad_ttl (name, v))
else if Rr_map.Mx_set.is_empty mxs then
Error (`Empty (name, K Mx))
else
let domain = match state' with `None -> name | `Soa zone -> zone in
Rr_map.Mx_set.fold (fun { mail_exchange ; _ } r ->
let* () = r in
if Domain_name.is_subdomain ~subdomain:mail_exchange ~domain then
guard (has_address mail_exchange) (`Missing_address mail_exchange)
else
Ok ())
mxs (Ok ())

This prevents mistakes adding MX records that cannot be delivered mail to. However, I don't think this should be a fatal error, and the domain might even have additional MX records some of which do have addresses making mail delivery possible (although not quite optimal). So maybe this can be promoted to a warning instead?

See also
robur-coop/dns-primary-git#29

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions