* Fixed text attachment handling (adds \r\n because we don't know
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 20 May 2001 14:57:57 +0000 (14:57 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 20 May 2001 14:57:57 +0000 (14:57 +0000)
  if the text file has one at the end or not)
* Fixed the user -> <user>@domain (now adds domain before adding <> around
  address)

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1377 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/smtp.php

index d531f1dc8f779571bff5ef004db9c230e42e7766..64db214aae750a3c437db1e9252353c4abf37734 100644 (file)
          }
         else
         {
+           if (strpos($array[$i], '@') === false)
+              $array[$i] .= '@' . $domain;
            $array[$i] = '<' . $array[$i] . '>';
         }
-        
-        if (strpos($array[$i], '@') === false) {
-           $array[$i] .= '@' . $domain;
-        }
       }
       return $array;
    }
@@ -78,6 +76,9 @@
       if (isMultipart()) {
          foreach ($attachments as $info)
         {
+//         echo "<pre>Attachment Info:\n";
+//         var_dump($info);
+//         echo "\n</pre>\n";
            if (isset($info['type']))
               $filetype = $info['type'];
             else
                  $tmp = str_replace("\r\n", "\n", $tmp);
                  $tmp = str_replace("\r", "\n", $tmp);
                  $tmp = str_replace("\n", "\r\n", $tmp);
+                 $tmp .= "\r\n";
                  fputs($fp, $tmp);
                  $length += strlen($tmp);
               }