Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77515 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70548 invoked from network); 23 Sep 2014 09:02:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2014 09:02:28 -0000 Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.178 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 209.85.212.178 mail-wi0-f178.google.com Received: from [209.85.212.178] ([209.85.212.178:35795] helo=mail-wi0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/5A-09206-22731245 for ; Tue, 23 Sep 2014 05:02:27 -0400 Received: by mail-wi0-f178.google.com with SMTP id z2so4559375wiv.17 for ; Tue, 23 Sep 2014 02:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=4i5FZU6ME2GbD4aRM4fAkeRrmImeYwqbHGd15s+hpx4=; b=oe6pRm5LB+oAAfFALnF5q8VBbvG+3KkAqlJ50aIteSM9E0yUslyzIkwJeLkUH0ZEgY mybZLeC5er9wFXdgXIbMSZUtsXnhodhSh9po5KOdnEcFDnE5fCyzGCwp2utJ5A3R+Te0 86Ijb+Sp3bG0OvDe6RSVX6U97TETiEuRmaciq1X84vQBWbad25gTK492f9pYJ6cABWHL 6NsqsCQSTgIyzmw7+kK0GdQpKUJJP6jknrBuduBqVJoYpEbFnx22Dku2JFYqk/zHaDAT Fnfw6s4UGuvc9C3ATiB+uNGpI0yK0BtAqk29nJPIIYSNY68ED0/hIYb7Vs5/H4Yvbzpz rXeg== X-Received: by 10.181.23.196 with SMTP id ic4mr20730968wid.69.1411462944013; Tue, 23 Sep 2014 02:02:24 -0700 (PDT) Received: from [192.168.4.120] (178-18-170-101.customer.bnet.at. [178.18.170.101]) by mx.google.com with ESMTPSA id t8sm1516294wib.8.2014.09.23.02.02.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Sep 2014 02:02:23 -0700 (PDT) Sender: Michael Wallner Message-ID: <5421371E.6070601@php.net> Date: Tue, 23 Sep 2014 11:02:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Sanford Whiteman , Pierre Joye CC: Kris Craig , PHP Internals References: <54212042.7060600@php.net> <54213396.4080403@php.net> In-Reply-To: <54213396.4080403@php.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Change checkdnsrr() $type argument behavior From: mike@php.net (Michael Wallner) On 2014-09-23 10:47, Michael Wallner wrote: > On 2014-09-23 10:11, Sanford Whiteman wrote: >>> if somehost.example.com has the MX, it should return true with >>> checkdnsrr('somehost.example.com'). If example has the MX set to >>> somehost.example.com or similar, it should return true as well. Or am >>> I missing your point? >> >> You are missing it, as there are no MX records involved. I'm >> demonstrating that the function gives incorrect results in the absence >> of an MX record because there is a bug in CNAME handling (or a bug in >> A handling, if you prefer). >> >> somehost.example.com has no MX RR. It has a CNAME (per DNS rules, the >> CNAME must thus be the only record for somehost.example.com). The >> CNAME points to example.com. >> >> example.com has no MX RR. It has an A pointing to 1.2.3.4. >> >> checkdnsrr('somehost.example.com') should return false. It returns true. >> checkdnsrr('example.com') should return false. It returns false. >> >> You could try to revise the docs and say, "Oh, it doesn't really mean >> an MX lookup, it means an explicit MX *or* implicit MX, like how a >> basic smtp-sender works. So that's why the CNAME --> A one returns >> true." Except then 'example.com' should return true as well. It does >> not: it returns false. Changing the docs does not fix the bug. > > Ah okay, I think you're right. It shouldn't accept the CNAME. > Looking at the source, though, neither the code nor the docs make any assertions on the actual type of response they got. So it could still be seen as "works as expected", because it just checks if any answer is received. If that functionality is useful could be debatable. -- Regards, Mike