From 24fc5dd2a66bd6fa6c3885f0222b87379b5644b1 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Fri, 14 Jul 2000 08:36:15 +0000 Subject: [PATCH] - added "High Contrast" theme submitted by Casey A. Peel - fixed a few things in mime.txt - added configurable message statuses on folder list git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@616 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + README | 5 + config/conf.pl | 49 ++++++++++ config/config_default.php | 15 +++ config/high_contrast_theme.php | 20 ++++ doc/mime.txt | 161 ++++++++++++++++----------------- functions/imap_general.php | 1 - src/left_main.php | 30 +++++- src/load_prefs.php | 13 +++ src/options.php | 2 + src/options_folder.php | 26 +++++- 11 files changed, 233 insertions(+), 90 deletions(-) create mode 100644 config/high_contrast_theme.php diff --git a/ChangeLog b/ChangeLog index 7f97f085..c00e389e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Version 0.5pre1 -- DEVELOPMENT ------------------------------ +- Folder list now shows configurable details about messages - It is now possible to select multiple subscribes/unsubscribes - Removed a bunch of annoying "success" screens, improved navigation - Better IMAP session handling diff --git a/README b/README index c894b819..303c02c4 100644 --- a/README +++ b/README @@ -28,6 +28,11 @@ emails from people just telling us that they're using SquirrelMail. If you have a few minutes, please send us an email to let us know! You can send it to our mailing list: squirrelmail-list@sourceforge.net +You can also go to the page below and fill out a small form to get listed +with the list of people already using SquirrelMail. + + http://www.squirrelmail.org/index.php3?page=16 + Contact: -------- It is pretty easy to get in contact with the developers if you need help or diff --git a/config/conf.pl b/config/conf.pl index a05223e0..a8648ff0 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -111,6 +111,12 @@ if ($useSendmail ne "true") { if (!$sendmail_path) { $sendmail_path = "/usr/sbin/sendmail"; } +if (!$default_unseen_notify) { + $default_unseen_notify = 2; +} +if (!$default_unseen_type) { + $default_unseen_type = 1; +} ##################################################################################### @@ -168,6 +174,8 @@ while (($command ne "q") && ($command ne "Q")) { print "9. Auto Expunge : $WHT$auto_expunge$NRM\n"; print "10. Default Sub. of INBOX : $WHT$default_sub_of_inbox$NRM\n"; print "11. Show 'Contain Sub.' Option : $WHT$show_contain_subfolders_option$NRM\n"; + print "12. Default Unseen Notify : $WHT$default_unseen_notify$NRM\n"; + print "13. Default Unseen Type : $WHT$default_unseen_type$NRM\n"; print "\n"; print "R Return to Main Menu\n"; } elsif ($menu == 4) { @@ -261,6 +269,8 @@ while (($command ne "q") && ($command ne "Q")) { elsif ($command == 9) { $auto_expunge = command29 (); } elsif ($command == 10){ $default_sub_of_inbox = command210(); } elsif ($command == 11){ $show_contain_subfolders_option = command211(); } + elsif ($command == 12){ $default_unseen_notify = command212(); } + elsif ($command == 13){ $default_unseen_type = command213(); } } elsif ($menu == 4) { if ($command == 1) { $default_charset = command31 (); } elsif ($command == 2) { $data_dir = command33 (); } @@ -754,6 +764,43 @@ sub command211 { return $show_contain_subfolders_option; } +# Default Unseen Notify +sub command212 { + print "This option specifies where the users will receive notification\n"; + print "about unseen messages by default. This is of course an option that\n"; + print "can be changed on a user level.\n"; + print " 1 = No notification\n"; + print " 2 = Only on the INBOX\n"; + print " 3 = On all folders\n"; + print "\n"; + + print "Which one should be default (1,2,3)? [$WHT$default_unseen_notify$NRM]: $WHT"; + $new_show = ; + if ($new_show =~ /^[1|2|3]\n/i) { + $default_unseen_notify = $new_show; + } + $default_unseen_notify =~ s/[\r|\n]//g; + return $default_unseen_notify; +} + +# Default Unseen Type +sub command213 { + print "Here you can define the default way that unseen messages will be displayed\n"; + print "to the user in the folder listing on the left side.\n"; + print " 1 = Only unseen messages (4)\n"; + print " 2 = Unseen and Total messages (4/27)\n"; + print "\n"; + + print "Which one should be default (1,2)? [$WHT$default_unseen_type$NRM]: $WHT"; + $new_show = ; + if ($new_show =~ /^[1|2]\n/i) { + $default_unseen_type = $new_show; + } + $default_unseen_type =~ s/[\r|\n]//g; + return $default_unseen_type; +} + + ############# GENERAL OPTIONS ##################### # Default Charset @@ -1132,6 +1179,8 @@ sub save_data { print FILE "\t\$auto_expunge = $auto_expunge;\n"; print FILE "\t\$default_sub_of_inbox = $default_sub_of_inbox;\n"; print FILE "\t\$show_contain_subfolders_option = $show_contain_subfolders_option;\n"; + print FILE "\t\$default_unseen_notify = $default_unseen_notify;\n"; + print FILE "\t\$default_unseen_type = $default_unseen_type;\n"; print FILE "\n"; print FILE "\t\$default_charset = \"$default_charset\";\n"; diff --git a/config/config_default.php b/config/config_default.php index 2e6dc03f..719dfaba 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -199,6 +199,9 @@ $theme[9]["PATH"] = "../config/bluesteel_theme.php"; $theme[9]["NAME"] = "Blue Steel"; + $theme[10]["PATH"] = "../config/high_contrast_theme.php"; + $theme[10]["NAME"] = "High Contrast"; + // LDAP server(s) // // Array of arrays with LDAP server parameters. See @@ -223,4 +226,16 @@ $default_use_javascript_addr_book = false; + // these next two options set the defaults for the way that the users see + // their folder list. + // $default_unseen_notify specifies whether or not the users will see + // the number of unseen in each folder by default + // and alsy which folders to do this to. + // 1=none, 2=inbox, 3=all + // $default_unseen_type specifies the type of notification to give the + // users by default. + // 1=(4), 2=(4,25) + + $default_unseen_notify = 2; + $default_unseen_type = 1; ?> diff --git a/config/high_contrast_theme.php b/config/high_contrast_theme.php new file mode 100644 index 00000000..d0e7f806 --- /dev/null +++ b/config/high_contrast_theme.php @@ -0,0 +1,20 @@ + diff --git a/doc/mime.txt b/doc/mime.txt index 1636119c..7c5d316a 100644 --- a/doc/mime.txt +++ b/doc/mime.txt @@ -1,111 +1,108 @@ -mime.txt -by Luke Ehresman -June 22, 2000 - Last updated: June 22, 2000 +SquirrelMail MIME Support Introduction +====================================== -Who should read this? ---------------------- - The intended audience for this document are people who want to understand how - the MIME code works. This is a technical documentation of how mime.php - works and how it parses a MIME encoded message. +The intended audience for this document are people who want to understand how +the MIME code works. This is a technical documentation of how mime.php +works and how it parses a MIME encoded message. Object Structure ---------------- - There are two objects that are used: "message" and "msg_header". here is a - brief overview of what each object contains. +There are two objects that are used: "message" and "msg_header". here is a +brief overview of what each object contains. - msg_header - Contains variables for all the necessary parts of the header of a - message. This includes (but is not limited to) the following: to, from, - subject, type (type0), subtype (type1), filename ... +msg_header + Contains variables for all the necessary parts of the header of a + message. This includes (but is not limited to) the following: to, from, + subject, type (type0), subtype (type1), filename ... - message - This contains the structure for the message. It contains two parts: - $header and $entities[]. $header is of type msg_header, and $entities[] - is an array of type $message. The $entities[] array is optional. If - it does not exist, then we are at a leaf node, and have an actual - attachment (entity) that can be displayed. Here is a tree view of how - this object functions. - - header - entities - | - +--- header - | - +--- header - | entities - | | - | +--- header - | | - | +--- header - | - +--- header +message + This contains the structure for the message. It contains two parts: + $header and $entities[]. $header is of type msg_header, and $entities[] + is an array of type $message. The $entities[] array is optional. If + it does not exist, then we are at a leaf node, and have an actual + attachment (entity) that can be displayed. Here is a tree view of how + this object functions. + + header + entities + | + +--- header + | + +--- header + | entities + | | + | +--- header + | | + | +--- header + | + +--- header Getting the Structure --------------------- - Previously (version 0.4 and below), SquirrelMail handled all the parsing of - the email message. It would read the entire message in, search for - boundaries, and created an array similar to the $message object discribed - above. This was very inefficient. +Previously (version 0.4 and below), SquirrelMail handled all the parsing of +the email message. It would read the entire message in, search for +boundaries, and created an array similar to the $message object discribed +above. This was very inefficient. - Currently, all the parsing of the body of the message takes place on the - IMAP server itself. According to RFC 2060 section 7.4.2, we can use the - BODYSTRUCTURE function which will return the structure of the body (imagine - that). It goes into detail of how the bodystructure should be formatted, - and we have based our new MIME support on this specification. +Currently, all the parsing of the body of the message takes place on the +IMAP server itself. According to RFC 2060 section 7.4.2, we can use the +BODYSTRUCTURE function which will return the structure of the body (imagine +that). It goes into detail of how the bodystructure should be formatted, +and we have based our new MIME support on this specification. - A simple text/plain message would have a BODYSTRUCTURE similar to the - following: +A simple text/plain message would have a BODYSTRUCTURE similar to the +following: - ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 1152 23) + ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 1152 23) - A more complicated multipart message with an attachment would look like: +A more complicated multipart message with an attachment would look like: - (("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 1152 23)("TEXT" - "PLAIN" ("CHARSET" "US-ASCII" "NAME" "cc.diff") - "<960723163407.20117h@cac.washington.edu>" "Compiler diff" "BASE64" - 4554 73) "MIXED")) + (("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 1152 23)("TEXT" + "PLAIN" ("CHARSET" "US-ASCII" "NAME" "cc.diff") + "<960723163407.20117h@cac.washington.edu>" "Compiler diff" "BASE64" + 4554 73) "MIXED")) - Our MIME functionality implements different functions that recursively - run through this text and parses out the structure of the message. If you - want to learn more about how the structure of a message is returned with - the BODYSTRUCTURE function, please see RFC 2060 section 7.4.2. +Our MIME functionality implements different functions that recursively +run through this text and parses out the structure of the message. If you +want to learn more about how the structure of a message is returned with +the BODYSTRUCTURE function, please see RFC 2060 section 7.4.2. - NOTE: SquirrelMail passes the MIME Torture Test written by Mark - Crispin (author of the IMAP protocol). This message is crazy! It - has about 30 parts nested inside each other. A very good test, - and SquirrelMail passed it. It can be found here: +NOTE: SquirrelMail passes the MIME Torture Test written by Mark + Crispin (author of the IMAP protocol). This message is crazy! It + has about 30 parts nested inside each other. A very good test, + and SquirrelMail passed it. It can be found here: - ftp://ftp.lysator.liu.se/mirror/unix/imapd/mime/torture-test.mbox + ftp://ftp.lysator.liu.se/mirror/unix/imapd/mime/torture-test.mbox Getting the Body ---------------- - Once all of the structure of the message has been read into the $message - object, we then need to display the body of one entity. There are a number - of ways we decide which entity to display at a certain time, and I won't go - into that here. +Once all of the structure of the message has been read into the $message +object, we then need to display the body of one entity. There are a number +of ways we decide which entity to display at a certain time, and I won't go +into that here. - Each entity has its own ID. Entity IDs look something like "1.2.1", or - "4.1", or just "2". You can find a detailed description of how entities - should be identified by reading RFC 2060 section 6.4.5. To fetch the body - of a particular entity, we use the function "BODY[
]". For - instance, if we were wanting to return entity 1.2.1, we would send the - IMAP server the command: "a001 FETCH BODY[1.2.1]". +Each entity has its own ID. Entity IDs look something like "1.2.1", or +"4.1", or just "2". You can find a detailed description of how entities +should be identified by reading RFC 2060 section 6.4.5. To fetch the body +of a particular entity, we use the function "BODY[
]". For +instance, if we were wanting to return entity 1.2.1, we would send the +IMAP server the command: "a001 FETCH BODY[1.2.1]". - This returns a string of the entire body. Based upon what is in the header, - we may need to decode it or do other things to it. +This returns a string of the entire body. Based upon what is in the header, +we may need to decode it or do other things to it. Closing Notes ------------- - That is basically how it works. There is a variable in mime.php called - $debug_mime that is defined at the top of that file. If you set it to true, - it will output all kinds of valuable information while it tries to decode - the MIME message. +That is basically how it works. There is a variable in mime.php called +$debug_mime that is defined at the top of that file. If you set it to true, +it will output all kinds of valuable information while it tries to decode +the MIME message. - The code in mime.php is pretty well documented, so you might want to poke - around there as well to find out more details of how this works. - - If you have questions about this, please direct them to our mailing list: - squirrelmail-list@sourceforge.net +The code in mime.php is pretty well documented, so you might want to poke +around there as well to find out more details of how this works. + +If you have questions about this, please direct them to our mailing list: +squirrelmail-list@sourceforge.net diff --git a/functions/imap_general.php b/functions/imap_general.php index 133e9851..81426acf 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -247,7 +247,6 @@ } - /****************************************************************************** ** Returns the number of unseen messages in this folder ******************************************************************************/ diff --git a/src/left_main.php b/src/left_main.php index d4224a3a..0e6ef6c7 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -36,11 +36,31 @@ function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $unseen) { global $folder_prefix, $trash_folder, $sent_folder; global $color, $move_to_sent, $move_to_trash; + global $unseen_notify, $unseen_type; $mailboxURL = urlencode($real_box); - if($real_box=="INBOX") { + + if ($unseen_notify == 2 && $real_box == "INBOX") { + $unseen = sqimap_unseen_messages($imapConnection, $numUnseen, $real_box); + if ($unseen_type == 1 && $unseen > 0) { + $unseen_string = "($unseen)"; + $unseen_found = true; + } else if ($unseen_type == 2) { + $numMessages = sqimap_get_num_messages($imapConnection, $real_box); + $unseen_string = "($unseen/$numMessages)"; + $unseen_found = true; + } + } else if ($unseen_notify == 3) { $unseen = sqimap_unseen_messages($imapConnection, $numUnseen, $real_box); - } + if ($unseen_type == 1 && $unseen > 0) { + $unseen_string = "($unseen)"; + $unseen_found = true; + } else if ($unseen_type == 2) { + $numMessages = sqimap_get_num_messages($imapConnection, $real_box); + $unseen_string = "($unseen/$numMessages)"; + $unseen_found = true; + } + } $line .= ""; if ($unseen > 0) @@ -65,14 +85,14 @@ if ($unseen > 0) $line .= ""; - if ($unseen > 0) { - $line .= " ($unseen)"; + if ($unseen_found) { + $line .= " $unseen_string"; } if (($move_to_trash == true) && ($real_box == $trash_folder)) { $urlMailbox = urlencode($real_box); $line .= "\n\n"; - $line .= "     ("._("purge").")"; + $line .= "   ("._("purge").")"; $line .= "\n\n"; } $line .= ""; diff --git a/src/load_prefs.php b/src/load_prefs.php index 6047a815..726dafb6 100644 --- a/src/load_prefs.php +++ b/src/load_prefs.php @@ -53,6 +53,19 @@ $move_to_trash = $default_move_to_trash; + $unseen_type = getPref($data_dir, $username, "unseen_type"); + if ($default_unseen_type == "") + $default_unseen_type = 1; + if ($unseen_type == "") + $unseen_type = $default_unseen_type; + + $unseen_notify = getPref($data_dir, $username, "unseen_notify"); + if ($default_unseen_notify == "") + $default_unseen_notify = 2; + if ($unseen_notify == "") + $unseen_notify = $default_unseen_notify; + + $folder_prefix = getPref($data_dir, $username, "folder_prefix"); if ($folder_prefix == "") $folder_prefix = $default_folder_prefix; diff --git a/src/options.php b/src/options.php index c099cb8c..7e34591b 100644 --- a/src/options.php +++ b/src/options.php @@ -85,6 +85,8 @@ setPref($data_dir, $username, "sent_folder", ""); } setPref($data_dir, $username, "folder_prefix", $folderprefix); + setPref($data_dir, $username, "unseen_notify", $unseennotify); + setPref($data_dir, $username, "unseen_type", $unseentype); echo "
"._("Successfully saved folder preferences!")."
"; echo ""._("Refresh Folders")."

"; } diff --git a/src/options_folder.php b/src/options_folder.php index 7beab5fa..a6a03539 100644 --- a/src/options_folder.php +++ b/src/options_folder.php @@ -46,9 +46,9 @@ :
"; + echo "
"; else - echo "
"; + echo "
"; ?> @@ -109,6 +109,28 @@ echo "\n"; echo ""; ?> + + +
+ : + + + >
+ >
+ >
+
+ + + + +
+ : + + + 2) echo " checked"; ?>> - (4)
+ > - (4/27) + +   -- 2.25.1