From 3a0847f13ae655a2a370357b331b9dc5c2789d31 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 17 Nov 2023 22:03:00 +1100 Subject: [PATCH] For DNS records that we resolve for, return nodata if we dont serve that data type --- app/Classes/Protocol/DNS.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/Classes/Protocol/DNS.php b/app/Classes/Protocol/DNS.php index 79050e8..ffe2d61 100644 --- a/app/Classes/Protocol/DNS.php +++ b/app/Classes/Protocol/DNS.php @@ -232,12 +232,9 @@ final class DNS extends BaseProtocol switch ($this->query->type) { case self::DNS_TYPE_SRV: - if (! $ao->system->address) - return $this->nameerr(); - Log::info(sprintf('%s:= Returning [%s] for DNS query [%s]',self::LOGKEY,$ao->system->address,$ao->ftn)); - if ($xx=$ao->system->mailers->where('id',$mailer->id)->pop()) { + if (($ao->system->address) && ($xx=$ao->system->mailers->where('id',$mailer->id)->pop())) { return $this->reply( self::DNS_NOERROR, [serialize([ @@ -262,7 +259,7 @@ final class DNS extends BaseProtocol Log::info(sprintf('%s:= Returning [%s] for DNS query [%s]',self::LOGKEY,$ao->system->address,$ao->ftn)); return (! $ao->system->address) - ? $this->nameerr() + ? $this->nodata() : $this->reply( self::DNS_NOERROR, [serialize($this->domain_split($ao->system->address)) => self::DNS_TYPE_CNAME]);