Does Email Validation Mx Fallback To A Record?
Posted 16 May 2013 - 07:10 PM
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?
Posted 30 May 2013 - 01:07 AM
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.
Posted 30 May 2013 - 05:04 AM
Posted 13 June 2013 - 04:00 AM
I'd say that were only the case iff there is either an a-level record for xyz.example.com or a wildcard record for *.example.com. In all other cases, resolving xyz.example.com should fail.
Back to the original issue: If this is really a common approach, we should patch CEmailValidator. If someone could point out an RFC => all the better!
Posted 13 June 2013 - 07:13 PM
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?
Posted 14 June 2013 - 02:19 AM
* 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. 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.