X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fsmtp.php;h=b033490ee210868615155363a8a97cc7eb0a7b98;hp=3b9e657911483b6bb39b18b66d598f02cbd18b0d;hb=d5f3486369f9f286acd5994d1530e4e05f71a746;hpb=9c6d83883620bdd2688cea59b25c3e90c67d97b2
diff --git a/functions/smtp.php b/functions/smtp.php
index 3b9e6579..b033490e 100644
--- a/functions/smtp.php
+++ b/functions/smtp.php
@@ -343,7 +343,7 @@
exit;
}
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
$to_list = getLineOfAddrs($to);
$cc_list = getLineOfAddrs($cc);
@@ -352,51 +352,51 @@
if (! isset ($use_authenticated_smtp) || $use_authenticated_smtp == false) {
fputs($smtpConnection, "HELO $domain\r\n");
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
} else {
fputs($smtpConnection, "EHLO $domain\r\n");
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
fputs($smtpConnection, "AUTH LOGIN\r\n");
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
fputs($smtpConnection, base64_encode ($username) . "\r\n");
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
fputs($smtpConnection, base64_encode ($OneTimePadDecrypt($key, $onetimepad)) . "\r\n");
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
}
/** Ok, who is sending the message? */
fputs($smtpConnection, "MAIL FROM: <$from_addr>\r\n");
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
/** send who the recipients are */
for ($i = 0; $i < count($to); $i++) {
fputs($smtpConnection, "RCPT TO: $to[$i]\r\n");
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
}
for ($i = 0; $i < count($cc); $i++) {
fputs($smtpConnection, "RCPT TO: $cc[$i]\r\n");
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
}
for ($i = 0; $i < count($bcc); $i++) {
fputs($smtpConnection, "RCPT TO: $bcc[$i]\r\n");
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
}
/** Lets start sending the actual message */
fputs($smtpConnection, "DATA\r\n");
$tmp = fgets($smtpConnection, 1024);
- errorCheck($tmp, $smtpConnection);
+ if (errorCheck($tmp, $smtpConnection)!=5) return(0);
// Send the message
$headerlength = write822Header ($smtpConnection, $t, $c, $b, $subject, $more_headers);
@@ -404,10 +404,15 @@
fputs($smtpConnection, ".\r\n"); // end the DATA part
$tmp = fgets($smtpConnection, 1024);
- $num = errorCheck($tmp, $smtpConnection);
+ $num = errorCheck($tmp, $smtpConnection, verbose);
if ($num != 250) {
- $tmp = nl2br(htmlspecialchars($tmp));
- echo "ERROR
Message not sent!
Reason given: $tmp