Re: Email Verfication Regular Expression - Mailing list pgsql-general

From merlyn@stonehenge.com (Randal L. Schwartz)
Subject Re: Email Verfication Regular Expression
Date
Msg-id 86br33mk5f.fsf@blue.stonehenge.com
Whole thread Raw
In response to Re: Email Verfication Regular Expression  ("Cristian Prieto" <cristian@clickdiario.com>)
List pgsql-general
>>>>> "Cristian" == Cristian Prieto <cristian@clickdiario.com> writes:

Cristian>  res = res_query(name, C_IN, T_MX, answer, sizeof(answer));

This incorrectly fails if an address has an "A" record but no "MX"
record.  According to RFC 2821 Section 5:

   The lookup first attempts to locate an MX record associated with
   the name.  If a CNAME record is found instead, the resulting name
   is processed as if it were the initial name.  If no MX records are
   found, but an A RR is found, the A RR is treated as if it was
   associated with an implicit MX RR, with a preference of 0, pointing
   to that host.

So, your function will say "no good" if the domain has an A record but
no MX record, even though the RFC says that's OK and deliverable.

Man, is there a lot of bogus knowledge and cargo culting around this
subject!

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

pgsql-general by date:

Previous
From: "Michael Schmidt"
Date:
Subject: Re: EMS PostgreSQL Manager vs. TheKompany DataArchitect
Next
From: snacktime
Date:
Subject: per user logging