Yii Framework Forum: Does Email Validation Mx Fallback To A Record? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Does Email Validation Mx Fallback To A Record? Rate Topic: -----

#1 User is offline   foftoogs 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 16-May 13

Posted 16 May 2013 - 07:10 PM

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.

stackoverflow.com/questions/1666807/email-validation-mx-lookup

(won't let me post links so just imagine this has a preceding h t t p :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?

en.wikipedia.org/wiki/MX_record#History_of_fallback_to_A

Cheers,
Geoff T
0

#2 User is offline   Da:Sourcerer 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,222
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 30 May 2013 - 01:07 AM

View Postfoftoogs, on 16 May 2013 - 07:10 PM, said:

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?

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.

View Postfoftoogs, on 16 May 2013 - 07:10 PM, said:

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?

Well, I went through quite a number of MTA installations and never observed this behaviour. Then again, I wasn't actively looking for it.
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code
0

#3 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 30 May 2013 - 05:04 AM

You can always send an email to e.g. "mike@mytesthost.example.com", 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.
0

#4 User is offline   Da:Sourcerer 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,222
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 13 June 2013 - 04:00 AM

View PostMike, on 30 May 2013 - 05:04 AM, said:

"example.com" is treatet the same as "xyz.example.com"

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!
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code
0

#5 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 13 June 2013 - 05:39 AM

Of course there must be an A- or CNAME- or wildcard record for that host - how else would the sender resolve it? But the question was, if a MX is required. It's not.
0

#6 User is offline   foftoogs 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 16-May 13

Posted 13 June 2013 - 07:13 PM

View PostMike, on 13 June 2013 - 05:39 AM, said:

But the question was, if a MX is required. It's not.


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?
0

#7 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 14 June 2013 - 02:19 AM

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. 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.
0

#8 User is offline   foftoogs 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 16-May 13

Posted 14 June 2013 - 03:31 AM

Thanks Mike
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users