Just wondering if the email validation option checkMX when used in conjunction with checkPort falls back to using the main A record for the domain to check if port 25 is open?
Does it just fail when there is no MX record and does not even bother checking the port?
I know this sounds strange but I was reading on stack overflow that some MTAs are configured to try the A record if no MX record exists for the domain.
(won’t let me post links so just imagine this has a preceding h t t p )
In my 10+ years of server admin I have not seen this behavior from an MTA but must admit I didn’t know it was even done. As far as I understood it MX records are what are checked by the MTA “out of the box”.
Could anyone say for certain that this practice is still a common place? To configure your MTA to use the A record if no MX exists?
Yii’s email validator used to check for port 25 of the fqdn right away until v1.1.11. What changed then was that code has been set in place that would fetch all MX records, sort them by priority and see if their port 25 has been opened. There is no fallback to any A records if that check fails.
Well, I went through quite a number of MTA installations and never observed this behaviour. Then again, I wasn’t actively looking for it.
You can always send an email to e.g. "firstname.lastname@example.org", even if there is no MX record for this domain. And from an MTA perspective there’s no difference between a second level and third level domain (“example.com” is treatet the same as “xyz.example.com”). So I’d say, that the fallback to A record is standard. I can’t point you to the RFC, where this is defined though.
Yeah that was my main question. So to make sure I am clear on this… a domain with no MX record set will still be checked by checkMX and checkPort options, it will just use the A record for the root domain? That is how it is working now?
Here’s what these options do in regard to MX records:
checkMX : Checks, if there’s a MX record for the given domain/hostname in DNS.
checkPort: First fetches the MX record (not A record!) from DNS and then checks, if the SMTP port 25 of that IP address is reachable.
So both options require a MX record in DNS for any given email domain. [size=“2”]Given what i said above, an email may still be deliverable, even if there is no MX record. So i’d be careful with these options. In fact, i personally never use them.[/size]