postalsys / mailauth

Command line utility and a Node.js library for email authentication
Other
127 stars 10 forks source link

SPF check of domains containing the MX mechanism #33

Closed schack closed 1 year ago

schack commented 1 year ago

Describe the bug I think but I'm not entirely sure the SPF tester is unhappy with domain names having MX records pointing at uppercase mail exchange hostnames

To Reproduce Steps to reproduce the behavior:

Testing SPF record validity on a domain like: vgpt.dk results in this error: permanent error in processing during lookup of hsje@vgpt.dk: Invalid domain ASPMX.L.GOOGLE.COM)\r\n

dig vgpt.dk MX vgpt.dk. 3505 IN MX 5 ALT1.ASPMX.L.GOOGLE.COM. vgpt.dk. 3505 IN MX 5 ALT2.ASPMX.L.GOOGLE.COM. vgpt.dk. 3505 IN MX 10 ALT3.ASPMX.L.GOOGLE.COM. vgpt.dk. 3505 IN MX 1 ASPMX.L.GOOGLE.COM. vgpt.dk. 3505 IN MX 10 ALT4.ASPMX.L.GOOGLE.COM.

Expected behavior Uppercase mail exchanger hostnames should not be an issue

andris9 commented 1 year ago

Thanks. Fixed it with v4.3.2 by making the domain validation case-insensitive.

$ mailauth --version
4.3.2
$ mailauth spf -f vgpt.dk -i 49.12.83.126 | jq .status.result
"pass"

Can't use MX IP address for SPF validation as Google returns a different IP address every time for the MX hostname, so used the fixed IP from the SPF record instead

schack commented 1 year ago

Thank you, that was super fast and much appreciated.