X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fsmtp.php;h=049b8da20a0bcb3d3d5f6c169fb3e68c836d29a0;hb=62d9ff4d1f893c2f4fc513f984fb5cff4014e316;hp=5e39ad40e0e936192ed04cb88e0db97778729812;hpb=17ce84673639e19c0d01cd6b59caea1732b1433f;p=squirrelmail.git diff --git a/functions/smtp.php b/functions/smtp.php index 5e39ad40..049b8da2 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -1,4 +1,4 @@ - +"; else $from = $from . " <$from_addr>"; + + /* Encoding 8-bit characters */ + $subject = encodeHeader($subject); + $from = encodeHeader($from); /* This creates an RFC 822 date */ $date = date("D, j M Y H:i:s ", mktime()) . timezone(); @@ -144,7 +148,7 @@ /* Make an RFC822 Received: line */ $header = "Received: from $REMOTE_ADDR by $SERVER_NAME with HTTP; "; - $header .= "$date\n"; + $header .= "$date\r\n"; /* Insert the rest of the header fields */ $header .= "Message-ID: $message_id\r\n"; @@ -170,7 +174,7 @@ $header .= "X-Mailer: SquirrelMail (version $version)\r\n"; // Identify SquirrelMail // Do the MIME-stuff - $header .= "MIME-Version: 1.0\n"; + $header .= "MIME-Version: 1.0\r\n"; if (isMultipart()) { $header .= "Content-Type: multipart/mixed; boundary=\""; @@ -212,7 +216,7 @@ $body .= stripslashes($passedBody) . "\r\n"; fputs ($fp, $body); - $attachmentlenght = attachFiles($fp); + $attachmentlength = attachFiles($fp); $postbody .= "\r\n--".mimeBoundary()."--\r\n\r\n"; fputs ($fp, $postbody); @@ -254,7 +258,7 @@ function sendSMTP($t, $c, $b, $subject, $body) { global $username, $domain, $version, $smtpServerAddress, $smtpPort, - $data_dir; + $data_dir, $color; $to = parseAddrs($t); $cc = parseAddrs($c); @@ -316,7 +320,7 @@ $tmp = nl2br(htmlspecialchars(fgets($smtpConnection, 1024))); $num = errorCheck($tmp); if ($num != 250) { - echo "
ERROR