From dc5a57207d558981579148aafaf49a515270209c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bauland?= Date: Fri, 15 Apr 2016 12:33:45 +0200 Subject: [PATCH] Changing EHLO message with from dns hostname. --- src/EmailValidator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EmailValidator.php b/src/EmailValidator.php index 2a3c0be..b8e06c5 100644 --- a/src/EmailValidator.php +++ b/src/EmailValidator.php @@ -107,7 +107,7 @@ private function send($message) { if ($result === false) { throw new Exception('Failed to write to socket for message : '.$message); } - + $text = $line = $this->recv(); while (preg_match("/^[0-9]+-/", $line) || !strncmp($line, '220', 3)) { $line = $this->recv(); @@ -144,7 +144,7 @@ private function check() { try { if ($this->connect($mxrecord)) { // TODO replace foo.com with fromemail domain. - $this->send('EHLO foo.com'); + $this->send('EHLO '.explode('@', $this->_from)[1]); $this->send('NOOP'); foreach ($domain['emails'] as $email => $status) { $this->send('MAIL FROM: <'.$this->_from.'>');