- fixed bugs in sorting by from and subject
[squirrelmail.git] / src / download.php
index 9d6d25e5a1835fcbed30de9439db584dd2a27bd7..f5b2ac4640954c7d1f8308d71c5e626fbbda4e70 100644 (file)
    $filename = $header->filename;
 
    if (strlen($filename) < 1) {
-      $filename = "untitled$passed_ent_id.$type1";
+      # set some standard suffixes to the filenames if the filename isn't known
+
+      if ($type1 == "plain" && $type0 == "text")                  $suffix = "txt";
+      else if ($type1 == "richtext" && $type0 == "text")          $suffix = "rtf";
+      else if ($type1 == "postscript" && $type0 == "application") $suffix = "ps";
+      else if ($type1 == "message" && $type0 == "rfc822")         $suffix = "msg";
+      else $suffix = $type1;
+
+      $filename = "untitled$passed_ent_id.$suffix";
    }
 
    // Note: