Quellcode durchsuchen

made it possible to have a base imap directory for folders

Luke Ehresman vor 25 Jahren
Ursprung
Commit
38e28293bb
7 geänderte Dateien mit 56 neuen und 16 gelöschten Zeilen
  1. 4 4
      AUTHORS
  2. 0 2
      UPDATES
  3. 14 0
      config/config_default.php
  4. 5 2
      functions/imap_mailbox.php
  5. 1 1
      functions/page_header.php
  6. 10 2
      src/folders_create.php
  7. 22 5
      src/move_messages.php

+ 4 - 4
AUTHORS

@@ -1,10 +1,10 @@
-Luke Ehresman
-Nathan Ehresman
+Luke Ehresman (lehresma@css.tayloru.edu)
+Nathan Ehresman (nathan@usa.om.org)
 Gustav Foseid
-Sergiusz Pawlowicz
+Pål Løberg
 Shane Wilson
+Sergiusz Pawlowicz
 Steve Gare
-Pål Løberg
 
 Translations:
 

+ 0 - 2
UPDATES

@@ -1,2 +0,0 @@
-Add your name, and the update in this file.
--------------------------------------------

+ 14 - 0
config/config_default.php

@@ -35,6 +35,20 @@
 //  folders will be the same color as the other folders
     $use_special_folder_color = true;
 
+//  Many servers store mail in your home directory.  With this, they
+//  store them in a subdirectory: ~/mail or ~/Mail, etc.  If your
+//  server does this, please set this to what the default mail folder
+//  should be.  This is still a user preference, so they can change
+//  it if it is different for each user.
+//
+//  Example:
+//     $folder_prefix = "mail/";
+//        -- or --
+//     $folder_prefix = "Mail/folders/";
+//
+//  If you do not use this, please set it to "".
+    $folder_prefix = "";
+
 //  The following are related to deleting messages.
 //    $move_to_trash
 //         - if this is set to "true", when "delete" is pressed, it

+ 5 - 2
functions/imap_mailbox.php

@@ -94,7 +94,7 @@
     **  The array returned looks like this:
     ******************************************************************************/
    function sqimap_mailbox_list ($imap_stream) {
-      global $special_folders, $list_special_folders_first;
+      global $special_folders, $list_special_folders_first, $folder_prefix;
       
       if (!function_exists ("ary_sort"))
          include ("../functions/array.php");
@@ -140,7 +140,10 @@
 
          if (!$read_ary[$i+1]) {
             if ($phase == "inbox") {
-               fputs ($imap_stream, "a001 LSUB \"\" *\r\n");
+               if ($folder_prefix && (substr($folder_prefix, -1) != $dm))
+                  $folder_prefix = $folder_prefix . $dm;
+                           
+               fputs ($imap_stream, "a001 LSUB \"$folder_prefix\" *\r\n");
                $read_ary = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
                $phase = "lsub";
                $i--;

+ 1 - 1
functions/page_header.php

@@ -58,7 +58,7 @@
       echo "         <A HREF=\"folders.php\">" . _("Folders") . "</A>&nbsp&nbsp";
       echo "         <A HREF=\"options.php\">" . _("Options") . "</A>&nbsp&nbsp";
       echo "      </TD><TD ALIGN=right WIDTH=30%>";
-      echo "         <A HREF=\"http://squirrelmail.sourceforge.net\" TARGET=_top>SquirrelMail</A>";
+      echo "         <A HREF=\"http://squirrelmail.sourceforge.net/index.php3?from=1\" TARGET=_top>SquirrelMail</A>";
       echo "      </TD>";
       echo "</TABLE>";
   }

+ 10 - 2
src/folders_create.php

@@ -25,8 +25,16 @@
    if ($contain_subs == true)
       $folder_name = "$folder_name$dm";
 
-   if (trim($subfolder) == "[ None ]") {
-      sqimap_mailbox_create ($imapConnection, $folder_name, "");
+   if ($folder_prefix && (substr($folder_prefix, -1) != $dm)) {
+      $folder_prefix = $folder_prefix . $dm;
+   }
+   if ($folder_prefix && (substr($subfolder, 0, strlen($folder_prefix)) != $folder_prefix)){
+      $subfolder_orig = $subfolder;
+      $subfolder = $folder_prefix . $subfolder;
+   }
+
+   if (trim($subfolder_orig) == "[ None ]") {
+      sqimap_mailbox_create ($imapConnection, $folder_prefix.$folder_name, "");
    } else {
       sqimap_mailbox_create ($imapConnection, $subfolder.$dm.$folder_name, "");
    }

+ 22 - 5
src/move_messages.php

@@ -12,7 +12,7 @@
 
    include("../src/load_prefs.php");
 
-   echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+//   echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
 
    function putSelectedMessagesIntoString($msg) {
       $j = 0;
@@ -42,7 +42,7 @@
 
    // If the delete button was pressed, the moveButton variable will not be set.
    if (!$moveButton) {
-      displayPageHeader($color, $mailbox);
+ //     displayPageHeader($color, $mailbox);
       if (is_array($msg) == 1) {
          // Marks the selected messages ad 'Deleted'
          $j = 0;
@@ -59,12 +59,21 @@
          }
          if ($auto_expunge)
             sqimap_mailbox_expunge($imapConnection, $mailbox);
-         messages_deleted_message($mailbox, $sort, $startMessage, $color);
+
+         if ($auto_forward) {   
+            header ("Location: right_main.php");
+         } else {
+            echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+            displayPageHeader($color, $mailbox);
+            messages_deleted_message($mailbox, $sort, $startMessage, $color);
+         }
       } else {
+         echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+         displayPageHeader($color, $mailbox);
          error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
       }
    } else {    // Move messages
-      displayPageHeader($color, $mailbox);
+//      displayPageHeader($color, $mailbox);
       // lets check to see if they selected any messages
       if (is_array($msg) == 1) {
          $j = 0;
@@ -84,8 +93,16 @@
          if ($auto_expunge == true)
             sqimap_mailbox_expunge($imapConnection, $mailbox);
 
-         messages_moved_message($mailbox, $sort, $startMessage, $color);
+         if ($auto_forward) {   
+            header ("Location: right_main.php");
+         } else {
+            echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+            displayPageHeader($color, $mailbox);
+            messages_moved_message($mailbox, $sort, $startMessage, $color);
+         }
       } else {
+         echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+         displayPageHeader($color, $mailbox);
          error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
       }
    }