htmltest icon indicating copy to clipboard operation
htmltest copied to clipboard

Add basic checking of mx records for mailto links

Open tomtom5152 opened this issue 6 years ago • 6 comments

Helps ensure that the domain is registered and at least partially configured to recieve email.

tomtom5152 avatar Aug 20 '17 13:08 tomtom5152

Codecov Report

Merging #57 into master will decrease coverage by 2.21%. The diff coverage is 60.97%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
- Coverage   95.67%   93.45%   -2.22%     
==========================================
  Files          17       17              
  Lines         902      917      +15     
==========================================
- Hits          863      857       -6     
- Misses         34       49      +15     
- Partials        5       11       +6
Impacted Files Coverage Δ
htmltest/check-link.go 91.6% <60.97%> (-3.5%) :arrow_down:
htmltest/htmltest.go 89.18% <0%> (-8.63%) :arrow_down:
htmltest/options.go 89.06% <0%> (-0.17%) :arrow_down:
htmldoc/document.go 88.37% <0%> (+0.27%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d42cbee...75fff69. Read the comment docs.

codecov-io avatar Aug 20 '17 13:08 codecov-io

Coverage has decreased as I can't think of a way to trigger the errors to execute those lines of code. In theory they should never execute, but it is a bit of catch all error handling in a default and else statement.

tomtom5152 avatar Aug 20 '17 13:08 tomtom5152

Does this pass for the case that a domain has no MX records, but has a valid A/CNAME record? (I believe it should)

davidtaylorhq avatar Aug 20 '17 13:08 davidtaylorhq

I believe you are correct according to this RFC 5321 Section 5 but that doesn't current exist.

tomtom5152 avatar Aug 20 '17 14:08 tomtom5152

Looking at the changes coverage is fine.

Re. the RFC my understanding is as follows:

Checking items off as I read them

  • [x] DNS lookup must be performed
  • [x] First check for MX
  • [x] If CNAME present restart from beginning
  • [x] If neither, fallback to A or AAAA
  • [x] If NXDOMAIN then error
  • [ ] If haven't found a valid record then error

wjdp avatar Aug 23 '17 19:08 wjdp

Rebased and made the changes requested.

tomtom5152 avatar Sep 11 '17 11:09 tomtom5152