From d1825c3c21550fb972179693ca6f5ed823584591 Mon Sep 17 00:00:00 2001 From: stekkel Date: Thu, 5 Sep 2002 12:07:55 +0000 Subject: [PATCH] extra error checking git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3562 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- class/deliver/Deliver_SMTP.class.php | 35 +++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/class/deliver/Deliver_SMTP.class.php b/class/deliver/Deliver_SMTP.class.php index 2a8ac7ca..17573898 100644 --- a/class/deliver/Deliver_SMTP.class.php +++ b/class/deliver/Deliver_SMTP.class.php @@ -87,26 +87,33 @@ class Deliver_SMTP extends Deliver { /* send who the recipients are */ for ($i = 0, $cnt = count($to); $i < $cnt; $i++) { if (!$to[$i]->host) $to[$i]->host = $domain; - fputs($stream, 'RCPT TO: <'.$to[$i]->mailbox.'@'.$to[$i]->host.">\r\n"); - $tmp = fgets($stream, 1024); - if ($this->errorCheck($tmp, $stream)) { - return(0); + if ($to[$i]->mailbox) { + fputs($stream, 'RCPT TO: <'.$to[$i]->mailbox.'@'.$to[$i]->host.">\r\n"); + $tmp = fgets($stream, 1024); + if ($this->errorCheck($tmp, $stream)) { + return(0); + } } } + for ($i = 0, $cnt = count($cc); $i < $cnt; $i++) { - if (!$cc[$i]->host) $cc[$i]->host = $domain; - fputs($stream, 'RCPT TO: <'.$cc[$i]->mailbox.'@'.$cc[$i]->host.">\r\n"); - $tmp = fgets($stream, 1024); - if ($this->errorCheck($tmp, $stream)) { - return(0); + if (!$cc[$i]->host) $cc[$i]->host = $domain; + if ($cc[$i]->mailbox) { + fputs($stream, 'RCPT TO: <'.$cc[$i]->mailbox.'@'.$cc[$i]->host.">\r\n"); + $tmp = fgets($stream, 1024); + if ($this->errorCheck($tmp, $stream)) { + return(0); + } } } for ($i = 0, $cnt = count($bcc); $i < $cnt; $i++) { - if (!$bcc[$i]->host) $bcc[$i]->host = $domain; - fputs($stream, 'RCPT TO: <'.$bcc[$i]->mailbox.'@'.$bcc[$i]->host.">\r\n"); - $tmp = fgets($stream, 1024); - if ($this->errorCheck($tmp, $stream)) { - return(0); + if (!$bcc[$i]->host) $bcc[$i]->host = $domain; + if ($bcc[$i]->mailbox) { + fputs($stream, 'RCPT TO: <'.$bcc[$i]->mailbox.'@'.$bcc[$i]->host.">\r\n"); + $tmp = fgets($stream, 1024); + if ($this->errorCheck($tmp, $stream)) { + return(0); + } } } /* Lets start sending the actual message */ -- 2.25.1