You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed this package doesn't properly parse null MX records (RFC7505).
A null MX record can be used to signal that the domain does not accept any mail. A valid null MX record would be example.com. 86400 IN MX 0 .
In a null MX record the target is a single dot. However, in spatie/dns the validation/sanitation flow trims dots, which turns the target into an empty string, which results in a parsing error. This means you get the same result when you query a domain with no MX records as with a domain with a null MX record.
I could create a pull request that bypasses this in the MX castTarget() function, but I'm not sure if there are other types of records which also would allow dots as valid hostnames/targets, in which case the fix might have to be made in a different place.
Is "." always a valid target? Or is this something MX specific?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've noticed this package doesn't properly parse null MX records (RFC7505).
A null MX record can be used to signal that the domain does not accept any mail. A valid null MX record would be
example.com. 86400 IN MX 0 .
In a null MX record the target is a single dot. However, in spatie/dns the validation/sanitation flow trims dots, which turns the target into an empty string, which results in a parsing error. This means you get the same result when you query a domain with no MX records as with a domain with a null MX record.
I could create a pull request that bypasses this in the MX castTarget() function, but I'm not sure if there are other types of records which also would allow dots as valid hostnames/targets, in which case the fix might have to be made in a different place.
Is "." always a valid target? Or is this something MX specific?
Beta Was this translation helpful? Give feedback.
All reactions