encoding/decoding fix for MDN receipts
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 3 Jul 2003 18:35:39 +0000 (18:35 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 3 Jul 2003 18:35:39 +0000 (18:35 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5205 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/read_body.php

index 8d8076101661af0b87f170b78432dacf4798566e..facd93542b5658fb34167632293e05badaf44413 100644 (file)
@@ -165,7 +165,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
     }
     $rfc822_header->content_type = $content_type;
     $rfc822_header->to[] = $header->dnt;
     }
     $rfc822_header->content_type = $content_type;
     $rfc822_header->to[] = $header->dnt;
-    $rfc822_header->subject = _("Read:") . ' ' . decodeHeader($header->subject);
+    $rfc822_header->subject = _("Read:") . ' ' . encodeHeader($header->subject);
 
 
     $reply_to = '';
 
 
     $reply_to = '';
@@ -202,8 +202,8 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
     $now = getLongDateString( time() );
     set_my_charset();
     $body = _("Your message") . "\r\n\r\n" .
     $now = getLongDateString( time() );
     set_my_charset();
     $body = _("Your message") . "\r\n\r\n" .
-            "\t" . _("To:") . ' ' . decodeHeader($to) . "\r\n" .
-            "\t" . _("Subject:") . ' ' . decodeHeader($header->subject) . "\r\n" .
+            "\t" . _("To:") . ' ' . decodeHeader($to,true,false) . "\r\n" .
+            "\t" . _("Subject:") . ' ' . decodeHeader($header->subject,true,false) . "\r\n" .
             "\t" . _("Sent:") . ' ' . $senton . "\r\n" .
             "\r\n" .
             sprintf( _("Was displayed on %s"), $now );
             "\t" . _("Sent:") . ' ' . $senton . "\r\n" .
             "\r\n" .
             sprintf( _("Was displayed on %s"), $now );
@@ -272,10 +272,10 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
         require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
         $deliver = new Deliver_SMTP();
         global $smtpServerAddress, $smtpPort, $smtp_auth_mech, $pop_before_smtp;
         require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
         $deliver = new Deliver_SMTP();
         global $smtpServerAddress, $smtpPort, $smtp_auth_mech, $pop_before_smtp;
-               if ($smtp_auth_mech == 'none') {
-                       $user = '';
-                       $pass = '';
-               } else {
+        if ($smtp_auth_mech == 'none') {
+            $user = '';
+            $pass = '';
+        } else {
             global $key, $onetimepad;
             $user = $username;
             $pass = OneTimePadDecrypt($key, $onetimepad);
             global $key, $onetimepad;
             $user = $username;
             $pass = OneTimePadDecrypt($key, $onetimepad);