Преглед изворни кода

Clear out tabs for proper spaces

simond пре 23 година
родитељ
комит
17f36392d0

+ 1 - 1
functions/imap_general.php

@@ -19,7 +19,7 @@ require_once('../functions/display_messages.php');
  *
  *
  * Sets an unique session id in order to avoid simultanous sessions crash.
  * Sets an unique session id in order to avoid simultanous sessions crash.
  *
  *
- * @return	string	a 4 chars unique string
+ * @return  string  a 4 chars unique string
  */
  */
 
 
 global $sqimap_session_id;
 global $sqimap_session_id;

+ 139 - 139
functions/imap_mailbox.php

@@ -385,145 +385,145 @@ function user_strcasecmp($a, $b) {
  ******************************************************************************/
  ******************************************************************************/
 function sqimap_mailbox_list($imap_stream) {
 function sqimap_mailbox_list($imap_stream) {
 
 
-	GLOBAL $boxesnew;
-
-	if ( !isset( $boxesnew ) ) {
-
-	    GLOBAL $data_dir, $username, $list_special_folders_first,
-	           $folder_prefix, $trash_folder, $sent_folder, $draft_folder,
-	           $move_to_trash, $move_to_sent, $save_as_draft,
-	           $delimiter;
-	
-	    $inbox_in_list = $inbox_subscribed = FALSE;
-	
-	    require_once('../src/load_prefs.php');
-	    require_once('../functions/array.php');
-	
-	    /** LSUB array **/
-	    $lsub_ary = sqimap_run_command ($imap_stream, "LSUB \"$folder_prefix\" \"*\"",
-	                                  TRUE, $response, $message);
-	
-	    /* Section about removing the last element was removed */
-	    /* We don't return "* OK" anymore from sqimap_read_data */
-	
-	    $sorted_lsub_ary = array();
-	    for ($i=0;$i < count($lsub_ary); $i++) {
-	        /* Workaround for EIMS */
-	        /* Doesn't work if the mailbox name is multiple lines */
-	        if (isset($lsub_ary[$i + 1]) &&
-	            ereg("^(\\* [A-Z]+.*)\\{[0-9]+\\}([ \n\r\t]*)$",
-	                 $lsub_ary[$i], $regs)) {
-	            $i ++;
-	            $lsub_ary[$i] = $regs[1] . '"' . addslashes(trim($lsub_ary[$i])) .
-	                '"' . $regs[2];
-	        }
-	        $temp_mailbox_name = find_mailbox_name($lsub_ary[$i]);
-	        $sorted_lsub_ary[] = $temp_mailbox_name;
-	        if (strtoupper($temp_mailbox_name) == 'INBOX') {
-	            $inbox_subscribed = TRUE;
-	        }
-	    }
-	    $new_ary = array();
-	    for ($i=0; $i < count($sorted_lsub_ary); $i++) {
-	        if (!in_array($sorted_lsub_ary[$i], $new_ary)) {
-	            $new_ary[] = $sorted_lsub_ary[$i];
-	        }
-	    }
-	    $sorted_lsub_ary = $new_ary;
-	    if (isset($sorted_lsub_ary)) {
-	        usort($sorted_lsub_ary, 'user_strcasecmp');
-	    }
-	
-	    /** LIST array **/
-	    $sorted_list_ary = array();
-	    for ($i=0; $i < count($sorted_lsub_ary); $i++) {
-	        if (substr($sorted_lsub_ary[$i], -1) == $delimiter) {
-	            $mbx = substr($sorted_lsub_ary[$i], 0, strlen($sorted_lsub_ary[$i])-1);
-	        }
-	        else {
-	            $mbx = $sorted_lsub_ary[$i];
-	        }
-	
-	        $read = sqimap_run_command ($imap_stream, "LIST \"\" \"$mbx\"",
-	                                  TRUE, $response, $message);
-	        /* Another workaround for EIMS */
-	        if (isset($read[1]) &&
-	            ereg("^(\\* [A-Z]+.*)\\{[0-9]+\\}([ \n\r\t]*)$",
-	                 $read[0], $regs)) {
-	            $read[0] = $regs[1] . '"' . addslashes(trim($read[1])) .
-	                       '"' . $regs[2];
-	        }
-	
-	        if (isset($sorted_list_ary[$i])) {
-	            $sorted_list_ary[$i] = '';
-	        }
-	
-	        if (isset($read[0])) {
-	            $sorted_list_ary[$i] = $read[0];
-	        }
-	        else {
-	            $sorted_list_ary[$i] = '';
-	        }
-	
-	        if (isset($sorted_list_ary[$i]) &&
-	            strtoupper(find_mailbox_name($sorted_list_ary[$i])) == 'INBOX') {
-	            $inbox_in_list = TRUE;
-	        }
-	    }
-	
-	    /**
-	     * Just in case they're not subscribed to their inbox,
-	     * we'll get it for them anyway
-	     */
-	    if ($inbox_subscribed == false || $inbox_in_list == false) {
-	        $inbox_ary = sqimap_run_command ($imap_stream, "LIST \"\" \"INBOX\"",
-	                                       TRUE, $response, $message);
-	        /* Another workaround for EIMS */
-	        if (isset($inbox_ary[1]) &&
-	            ereg("^(\\* [A-Z]+.*)\\{[0-9]+\\}([ \n\r\t]*)$",
-	                 $inbox_ary[0], $regs)) {
-	            $inbox_ary[0] = $regs[1] . '"' . addslashes(trim($inbox_ary[1])) .
-	                '"' . $regs[2];
-	        }
-	
-	        $sorted_list_ary[] = $inbox_ary[0];
-	        $sorted_lsub_ary[] = find_mailbox_name($inbox_ary[0]);
-	    }
-	
-	    $boxesall = sqimap_mailbox_parse ($sorted_list_ary, $sorted_lsub_ary);
-	
-	    /** Now, lets sort for special folders **/
-	    $boxesnew = $used = array();
-	
-	    /* Find INBOX */
-	    foreach ( $boxesall as $k => $box ) {
-	        if ( strtolower($box['unformatted']) == 'inbox') {
-	            $boxesnew[] = $box;
-	            $used[$k] = TRUE;
-	        } else {
-	            $used[$k] = FALSE;
-	        }
-	    }
-	
-	    /* List special folders and their subfolders, if requested. */
-	    if ($list_special_folders_first == TRUE) {
-	
-	        foreach ( $boxesall as $k => $box ) {
-	            if ( !$used[$k] &&
-	                 isSpecialMailbox( $box['unformatted'] ) ) {
-	                $boxesnew[] = $box;
-	                $used[$k] = TRUE;
-	            }
-	        }
-	
-	    }
-	
-	    /* Rest of the folders */
-	    foreach ( $boxesall as $k => $box ) {
-	        if ( !$used[$k] ) {
-	            $boxesnew[] = $box;
-	        }
-	    }
+    GLOBAL $boxesnew;
+
+    if ( !isset( $boxesnew ) ) {
+
+        GLOBAL $data_dir, $username, $list_special_folders_first,
+               $folder_prefix, $trash_folder, $sent_folder, $draft_folder,
+               $move_to_trash, $move_to_sent, $save_as_draft,
+               $delimiter;
+
+        $inbox_in_list = $inbox_subscribed = FALSE;
+
+        require_once('../src/load_prefs.php');
+        require_once('../functions/array.php');
+
+        /** LSUB array **/
+        $lsub_ary = sqimap_run_command ($imap_stream, "LSUB \"$folder_prefix\" \"*\"",
+                                      TRUE, $response, $message);
+
+        /* Section about removing the last element was removed */
+        /* We don't return "* OK" anymore from sqimap_read_data */
+
+        $sorted_lsub_ary = array();
+        for ($i=0;$i < count($lsub_ary); $i++) {
+            /* Workaround for EIMS */
+            /* Doesn't work if the mailbox name is multiple lines */
+            if (isset($lsub_ary[$i + 1]) &&
+                ereg("^(\\* [A-Z]+.*)\\{[0-9]+\\}([ \n\r\t]*)$",
+                     $lsub_ary[$i], $regs)) {
+                $i ++;
+                $lsub_ary[$i] = $regs[1] . '"' . addslashes(trim($lsub_ary[$i])) .
+                    '"' . $regs[2];
+            }
+            $temp_mailbox_name = find_mailbox_name($lsub_ary[$i]);
+            $sorted_lsub_ary[] = $temp_mailbox_name;
+            if (strtoupper($temp_mailbox_name) == 'INBOX') {
+                $inbox_subscribed = TRUE;
+            }
+        }
+        $new_ary = array();
+        for ($i=0; $i < count($sorted_lsub_ary); $i++) {
+            if (!in_array($sorted_lsub_ary[$i], $new_ary)) {
+                $new_ary[] = $sorted_lsub_ary[$i];
+            }
+        }
+        $sorted_lsub_ary = $new_ary;
+        if (isset($sorted_lsub_ary)) {
+            usort($sorted_lsub_ary, 'user_strcasecmp');
+        }
+
+        /** LIST array **/
+        $sorted_list_ary = array();
+        for ($i=0; $i < count($sorted_lsub_ary); $i++) {
+            if (substr($sorted_lsub_ary[$i], -1) == $delimiter) {
+                $mbx = substr($sorted_lsub_ary[$i], 0, strlen($sorted_lsub_ary[$i])-1);
+            }
+            else {
+                $mbx = $sorted_lsub_ary[$i];
+            }
+
+            $read = sqimap_run_command ($imap_stream, "LIST \"\" \"$mbx\"",
+                                      TRUE, $response, $message);
+            /* Another workaround for EIMS */
+            if (isset($read[1]) &&
+                ereg("^(\\* [A-Z]+.*)\\{[0-9]+\\}([ \n\r\t]*)$",
+                     $read[0], $regs)) {
+                $read[0] = $regs[1] . '"' . addslashes(trim($read[1])) .
+                           '"' . $regs[2];
+            }
+
+            if (isset($sorted_list_ary[$i])) {
+                $sorted_list_ary[$i] = '';
+            }
+
+            if (isset($read[0])) {
+                $sorted_list_ary[$i] = $read[0];
+            }
+            else {
+                $sorted_list_ary[$i] = '';
+            }
+
+            if (isset($sorted_list_ary[$i]) &&
+                strtoupper(find_mailbox_name($sorted_list_ary[$i])) == 'INBOX') {
+                $inbox_in_list = TRUE;
+            }
+        }
+
+        /**
+         * Just in case they're not subscribed to their inbox,
+         * we'll get it for them anyway
+         */
+        if ($inbox_subscribed == false || $inbox_in_list == false) {
+            $inbox_ary = sqimap_run_command ($imap_stream, "LIST \"\" \"INBOX\"",
+                                           TRUE, $response, $message);
+            /* Another workaround for EIMS */
+            if (isset($inbox_ary[1]) &&
+                ereg("^(\\* [A-Z]+.*)\\{[0-9]+\\}([ \n\r\t]*)$",
+                     $inbox_ary[0], $regs)) {
+                $inbox_ary[0] = $regs[1] . '"' . addslashes(trim($inbox_ary[1])) .
+                    '"' . $regs[2];
+            }
+
+            $sorted_list_ary[] = $inbox_ary[0];
+            $sorted_lsub_ary[] = find_mailbox_name($inbox_ary[0]);
+        }
+
+        $boxesall = sqimap_mailbox_parse ($sorted_list_ary, $sorted_lsub_ary);
+
+        /** Now, lets sort for special folders **/
+        $boxesnew = $used = array();
+
+        /* Find INBOX */
+        foreach ( $boxesall as $k => $box ) {
+            if ( strtolower($box['unformatted']) == 'inbox') {
+                $boxesnew[] = $box;
+                $used[$k] = TRUE;
+            } else {
+                $used[$k] = FALSE;
+            }
+        }
+
+        /* List special folders and their subfolders, if requested. */
+        if ($list_special_folders_first == TRUE) {
+
+            foreach ( $boxesall as $k => $box ) {
+                if ( !$used[$k] &&
+                     isSpecialMailbox( $box['unformatted'] ) ) {
+                    $boxesnew[] = $box;
+                    $used[$k] = TRUE;
+                }
+            }
+
+        }
+
+        /* Rest of the folders */
+        foreach ( $boxesall as $k => $box ) {
+            if ( !$used[$k] ) {
+                $boxesnew[] = $box;
+            }
+        }
     }
     }
 
 
     return( $boxesnew );
     return( $boxesnew );

+ 1 - 1
functions/imap_search.php

@@ -42,7 +42,7 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
             $search_string = '';
             $search_string = '';
     $count = count($multi_search);
     $count = count($multi_search);
             for ($x=0;$x<$count;$x++) {
             for ($x=0;$x<$count;$x++) {
-			trim($multi_search[$x]);
+                trim($multi_search[$x]);
                 $search_string = $search_string . ' ' . $search_where . ' "' . $multi_search[$x] . '"';
                 $search_string = $search_string . ' ' . $search_where . ' "' . $multi_search[$x] . '"';
             }
             }
     }
     }

+ 1 - 1
functions/mailbox_display.php

@@ -642,7 +642,7 @@ function get_selectall_link($start_msg, $sort) {
             $result .= "<a href=\"$PHP_SELF&amp;mailbox=" . urlencode($mailbox)
             $result .= "<a href=\"$PHP_SELF&amp;mailbox=" . urlencode($mailbox)
                     . "&amp;startMessage=$start_msg&amp;sort=$sort&amp;checkall=";
                     . "&amp;startMessage=$start_msg&amp;sort=$sort&amp;checkall=";
         }
         }
-		else {
+        else {
             $result .= "<a href=\"$PHP_SELF?mailbox=" . urlencode($mailbox)
             $result .= "<a href=\"$PHP_SELF?mailbox=" . urlencode($mailbox)
                     . "&amp;startMessage=$start_msg&amp;sort=$sort&amp;checkall=";
                     . "&amp;startMessage=$start_msg&amp;sort=$sort&amp;checkall=";
         }
         }

+ 15 - 15
functions/mime.php

@@ -420,7 +420,7 @@ function mime_fetch_body($imap_stream, $id, $ent_id ) {
 *            if ( $base <> '' ) {
 *            if ( $base <> '' ) {
 *                $ret = "<base href=\"$base\">" . $ret;
 *                $ret = "<base href=\"$base\">" . $ret;
 *            }
 *            }
-*	    */
+*           */
         }
         }
     } else if (ereg('"([^"]*)"', $topline, $regs)) {
     } else if (ereg('"([^"]*)"', $topline, $regs)) {
         $ret = $regs[1];
         $ret = $regs[1];
@@ -609,22 +609,22 @@ function formatBody($imap_stream, $message, $color, $wrap_at) {
            $show_html_default, $has_unsafe_images, $view_unsafe_images, $sort;
            $show_html_default, $has_unsafe_images, $view_unsafe_images, $sort;
 
 
     $has_unsafe_images = 0;
     $has_unsafe_images = 0;
-    
+
     $id = $message->header->id;
     $id = $message->header->id;
     $urlmailbox = urlencode($message->header->mailbox);
     $urlmailbox = urlencode($message->header->mailbox);
-    
+
     // Get the right entity and redefine message to be this entity
     // Get the right entity and redefine message to be this entity
     // Pass the 0 to mean that we want the 'best' viewable one
     // Pass the 0 to mean that we want the 'best' viewable one
     $ent_num = findDisplayEntity ($message, 0);
     $ent_num = findDisplayEntity ($message, 0);
     $body_message = getEntity($message, $ent_num);
     $body_message = getEntity($message, $ent_num);
     if (($body_message->header->type0 == 'text') ||
     if (($body_message->header->type0 == 'text') ||
         ($body_message->header->type0 == 'rfc822')) {
         ($body_message->header->type0 == 'rfc822')) {
-    
+
         $body = mime_fetch_body ($imap_stream, $id, $ent_num);
         $body = mime_fetch_body ($imap_stream, $id, $ent_num);
         $body = decodeBody($body, $body_message->header->encoding);
         $body = decodeBody($body, $body_message->header->encoding);
         $hookResults = do_hook("message_body", $body);
         $hookResults = do_hook("message_body", $body);
         $body = $hookResults[1];
         $body = $hookResults[1];
-        
+
         // If there are other types that shouldn't be formatted, add
         // If there are other types that shouldn't be formatted, add
         // them here
         // them here
         if ($body_message->header->type1 == 'html') {
         if ($body_message->header->type1 == 'html') {
@@ -639,13 +639,13 @@ function formatBody($imap_stream, $message, $color, $wrap_at) {
         }
         }
 
 
         $body .= "<CENTER><SMALL><A HREF=\"../src/download.php?absolute_dl=true&amp;passed_id=$id&amp;passed_ent_id=$ent_num&amp;mailbox=$urlmailbox&amp;showHeaders=1\">". _("Download this as a file") ."</A></SMALL></CENTER><BR>";
         $body .= "<CENTER><SMALL><A HREF=\"../src/download.php?absolute_dl=true&amp;passed_id=$id&amp;passed_ent_id=$ent_num&amp;mailbox=$urlmailbox&amp;showHeaders=1\">". _("Download this as a file") ."</A></SMALL></CENTER><BR>";
-	if ($has_unsafe_images) {
-	    if ($view_unsafe_images) {
+        if ($has_unsafe_images) {
+            if ($view_unsafe_images) {
                 $body .= "<CENTER><SMALL><A HREF=\"read_body.php?passed_id=$id&amp;mailbox=$urlmailbox&amp;sort=$sort&amp;startMessage=$startMessage&amp;show_more=0\">". _("Hide Unsafe Images") ."</A></SMALL></CENTER><BR>\n";
                 $body .= "<CENTER><SMALL><A HREF=\"read_body.php?passed_id=$id&amp;mailbox=$urlmailbox&amp;sort=$sort&amp;startMessage=$startMessage&amp;show_more=0\">". _("Hide Unsafe Images") ."</A></SMALL></CENTER><BR>\n";
             } else {
             } else {
                 $body .= "<CENTER><SMALL><A HREF=\"read_body.php?passed_id=$id&amp;mailbox=$urlmailbox&amp;sort=$sort&amp;startMessage=$startMessage&amp;show_more=0&amp;view_unsafe_images=1\">". _("View Unsafe Images") ."</A></SMALL></CENTER><BR>\n";
                 $body .= "<CENTER><SMALL><A HREF=\"read_body.php?passed_id=$id&amp;mailbox=$urlmailbox&amp;sort=$sort&amp;startMessage=$startMessage&amp;show_more=0&amp;view_unsafe_images=1\">". _("View Unsafe Images") ."</A></SMALL></CENTER><BR>\n";
             }
             }
-	}
+        }
 
 
         /** Display the ATTACHMENTS: message if there's more than one part **/
         /** Display the ATTACHMENTS: message if there's more than one part **/
         if (isset($message->entities[0])) {
         if (isset($message->entities[0])) {
@@ -1090,11 +1090,11 @@ function MagicHTML( $body, $id ) {
 
 
 return( "\n\n<!-- HTML Output ahead -->\n" .
 return( "\n\n<!-- HTML Output ahead -->\n" .
         $ret .
         $ret .
-	/* Base is illegal within HTML
+        /* Base is illegal within HTML
         "\n<!-- END of HTML Output --><base href=\"".
         "\n<!-- END of HTML Output --><base href=\"".
         get_location() . '/'.
         get_location() . '/'.
         "\">\n\n" );
         "\">\n\n" );
-	*/
+        */
         "\n<!-- END of HTML Output -->\n\n" );
         "\n<!-- END of HTML Output -->\n\n" );
 }
 }
 
 
@@ -1199,14 +1199,14 @@ function stripEvent( &$i, $j, &$body, $id, $base ) {
                     $src = substr( $src, 4 );
                     $src = substr( $src, 4 );
                     $src = "../src/download.php?absolute_dl=true&amp;passed_id=$id&amp;mailbox=" .
                     $src = "../src/download.php?absolute_dl=true&amp;passed_id=$id&amp;mailbox=" .
                            urlencode( $message->header->mailbox ) .
                            urlencode( $message->header->mailbox ) .
-                           "&amp;passed_ent_id=" . find_ent_id( $src, $message );                       
-                } else if ( strtolower( substr( $src, 0, 4 ) ) <> 'http' || 
+                           "&amp;passed_ent_id=" . find_ent_id( $src, $message );
+                } else if ( strtolower( substr( $src, 0, 4 ) ) <> 'http' ||
                             stristr( $src, $base_uri ) ) {
                             stristr( $src, $base_uri ) ) {
                     /* Javascript and local urls goes out */
                     /* Javascript and local urls goes out */
-		    if (!$view_unsafe_images) {
+                    if (!$view_unsafe_images) {
                         $src = '../images/' . _("sec_remove_eng.png");
                         $src = '../images/' . _("sec_remove_eng.png");
-		    }
-		    $has_unsafe_images = 1;
+                    }
+                    $has_unsafe_images = 1;
                 }
                 }
                 $ret .= 'src="' . $src . '" ';
                 $ret .= 'src="' . $src . '" ';
                 $i = $k - 2;
                 $i = $k - 2;

+ 6 - 6
functions/options.php

@@ -389,10 +389,10 @@ function print_option_groups($option_groups) {
         if ($next_optgrp['name'] != '') {
         if ($next_optgrp['name'] != '') {
             echo '<TR><TD ALIGN=CENTER VALIGN=MIDDLE COLSPAN=2 NOWRAP><B>'
             echo '<TR><TD ALIGN=CENTER VALIGN=MIDDLE COLSPAN=2 NOWRAP><B>'
                .   $next_optgrp['name']
                .   $next_optgrp['name']
-	       . "</B></TD></TR>\n";
-	}
-	
-	/* Print each option in this option group. */
+               . "</B></TD></TR>\n";
+        }
+
+        /* Print each option in this option group. */
         foreach ($next_optgrp['options'] as $option) {
         foreach ($next_optgrp['options'] as $option) {
             if ($option->type != SMOPT_TYPE_HIDDEN) {
             if ($option->type != SMOPT_TYPE_HIDDEN) {
                 echo "<TR>\n";
                 echo "<TR>\n";
@@ -404,8 +404,8 @@ function print_option_groups($option_groups) {
                 echo $option->createHTMLWidget();
                 echo $option->createHTMLWidget();
             }
             }
         }
         }
-	
-	/* Print an empty row after this option group. */
+
+        /* Print an empty row after this option group. */
         echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
         echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>\n";
     }
     }
 }
 }

+ 2 - 2
functions/page_header.php

@@ -104,7 +104,7 @@ function displayPageHeader($color, $mailbox) {
                      "}\n";
                      "}\n";
             }
             }
         $js .= "// -->\n".
         $js .= "// -->\n".
-        	 "</script>\n";
+               "</script>\n";
         $onload = "onLoad=\"checkForm();\"";
         $onload = "onLoad=\"checkForm();\"";
         displayHtmlHeader ('Squirrelmail', $js);
         displayHtmlHeader ('Squirrelmail', $js);
         break;   
         break;   
@@ -207,7 +207,7 @@ function compose_Header($color, $mailbox) {
                 "}\n".
                 "}\n".
             "}\n";
             "}\n";
         $js .= "// -->\n".
         $js .= "// -->\n".
-        	 "</script>\n";
+               "</script>\n";
         $onload = "onLoad=\"checkForm();\"";
         $onload = "onLoad=\"checkForm();\"";
         displayHtmlHeader (_("Compose"), $js);
         displayHtmlHeader (_("Compose"), $js);
         break;   
         break;   

+ 29 - 29
functions/smtp.php

@@ -293,72 +293,72 @@ function write822Header ($fp, $t, $c, $b, $subject, $more_headers) {
                 $HTTP_X_FORWARDED_FOR = 'unknown';
                 $HTTP_X_FORWARDED_FOR = 'unknown';
             }
             }
             $received_from .= " (proxying for $HTTP_X_FORWARDED_FOR)";
             $received_from .= " (proxying for $HTTP_X_FORWARDED_FOR)";
-        }            
-        
+        }
+
         $header  = "Received: from $received_from\r\n";
         $header  = "Received: from $received_from\r\n";
         $header .= "        (SquirrelMail authenticated user $username)\r\n";
         $header .= "        (SquirrelMail authenticated user $username)\r\n";
         $header .= "        by $SERVER_NAME with HTTP;\r\n";
         $header .= "        by $SERVER_NAME with HTTP;\r\n";
         $header .= "        $date\r\n";
         $header .= "        $date\r\n";
-        
+
         /* Insert the rest of the header fields */
         /* Insert the rest of the header fields */
         $header .= "Message-ID: $message_id\r\n";
         $header .= "Message-ID: $message_id\r\n";
         $header .= "Date: $date\r\n";
         $header .= "Date: $date\r\n";
         $header .= "Subject: $subject\r\n";
         $header .= "Subject: $subject\r\n";
         $header .= "From: $from\r\n";
         $header .= "From: $from\r\n";
         $header .= "To: $to_list\r\n";    // Who it's TO
         $header .= "To: $to_list\r\n";    // Who it's TO
-        
+
         if (isset($more_headers["Content-Type"])) {
         if (isset($more_headers["Content-Type"])) {
-	  $contentType = $more_headers["Content-Type"];
-	  unset($more_headers["Content-Type"]);
-	}
+            $contentType = $more_headers["Content-Type"];
+            unset($more_headers["Content-Type"]);
+        }
         else {
         else {
-	  if (isMultipart()) {
-	    $contentType = "multipart/mixed;";
-	  }
-	  else {
-	    if ($default_charset != '') {
-                $contentType = 'text/plain; charset='.$default_charset;
+            if (isMultipart()) {
+                $contentType = "multipart/mixed;";
             }
             }
             else {
             else {
-                $contentType = 'text/plain;';
-            } 
-	  }
+                if ($default_charset != '') {
+                    $contentType = 'text/plain; charset='.$default_charset;
+                }
+                else {
+                    $contentType = 'text/plain;';
+                }
+            }
         }
         }
-            
-	/* Insert headers from the $more_headers array */
-	if(is_array($more_headers)) {
+
+        /* Insert headers from the $more_headers array */
+        if(is_array($more_headers)) {
             reset($more_headers);
             reset($more_headers);
             while(list($h_name, $h_val) = each($more_headers)) {
             while(list($h_name, $h_val) = each($more_headers)) {
                 $header .= sprintf("%s: %s\r\n", $h_name, $h_val);
                 $header .= sprintf("%s: %s\r\n", $h_name, $h_val);
             }
             }
         }
         }
-        
+
         if ($cc_list) {
         if ($cc_list) {
             $header .= "Cc: $cc_list\r\n"; // Who the CCs are
             $header .= "Cc: $cc_list\r\n"; // Who the CCs are
         }
         }
-        
+
         if ($reply_to != '') {
         if ($reply_to != '') {
             $header .= "Reply-To: $reply_to\r\n";
             $header .= "Reply-To: $reply_to\r\n";
         }
         }
-        
+
         if ($useSendmail) {
         if ($useSendmail) {
             if ($bcc_list) {
             if ($bcc_list) {
                 // BCCs is removed from header by sendmail
                 // BCCs is removed from header by sendmail
-                $header .= "Bcc: $bcc_list\r\n"; 
+                $header .= "Bcc: $bcc_list\r\n";
             }
             }
         }
         }
-        
+
         $header .= "X-Mailer: SquirrelMail (version $version)\r\n"; /* Identify SquirrelMail */
         $header .= "X-Mailer: SquirrelMail (version $version)\r\n"; /* Identify SquirrelMail */
 
 
         /* Do the MIME-stuff */
         /* Do the MIME-stuff */
         $header .= "MIME-Version: 1.0\r\n";
         $header .= "MIME-Version: 1.0\r\n";
-        
+
         if (isMultipart()) {
         if (isMultipart()) {
             $header .= 'Content-Type: '.$contentType.' boundary="';
             $header .= 'Content-Type: '.$contentType.' boundary="';
             $header .= mimeBoundary();
             $header .= mimeBoundary();
             $header .= "\"\r\n";
             $header .= "\"\r\n";
         } else {
         } else {
-	    $header .= 'Content-Type: '.$contentType."\r\n";
+            $header .= 'Content-Type: '.$contentType."\r\n";
             $header .= "Content-Transfer-Encoding: 8bit\r\n";
             $header .= "Content-Transfer-Encoding: 8bit\r\n";
         }
         }
         $header .= "\r\n"; // One blank line to separate header and body
         $header .= "\r\n"; // One blank line to separate header and body
@@ -406,7 +406,7 @@ function writeBody ($fp, $passedBody) {
         $postbody = "\r\n";
         $postbody = "\r\n";
         fputs ($fp, $postbody);
         fputs ($fp, $postbody);
     }
     }
-    
+
     return (strlen($body) + strlen($postbody) + $attachmentlength);
     return (strlen($body) + strlen($postbody) + $attachmentlength);
 }
 }
 
 
@@ -658,13 +658,13 @@ function errorCheck($line, $smtpConnection, $verbose = false) {
         $error_num = '001';
         $error_num = '001';
         break;
         break;
     }
     }
-    
+
     if ($status == 0) {
     if ($status == 0) {
         include_once('../functions/page_header.php');
         include_once('../functions/page_header.php');
         if ($compose_new_win == '1') {
         if ($compose_new_win == '1') {
             compose_Header($color, 'None');
             compose_Header($color, 'None');
         }
         }
-		else {
+        else {
             displayPageHeader($color, 'None');
             displayPageHeader($color, 'None');
         }
         }
         include_once('../functions/display_messages.php');
         include_once('../functions/display_messages.php');

+ 3 - 3
functions/strings.php

@@ -192,9 +192,9 @@ function getLineOfAddrs($array) {
 function translateText(&$body, $wrap_at, $charset) {
 function translateText(&$body, $wrap_at, $charset) {
     global $where, $what; /* from searching */
     global $where, $what; /* from searching */
     global $color; /* color theme */
     global $color; /* color theme */
-    
+
     require_once('../functions/url_parser.php');
     require_once('../functions/url_parser.php');
-    
+
     $body_ary = explode("\n", $body);
     $body_ary = explode("\n", $body);
     $PriorQuotes = 0;
     $PriorQuotes = 0;
     for ($i=0; $i < count($body_ary); $i++) {
     for ($i=0; $i < count($body_ary); $i++) {
@@ -209,7 +209,7 @@ function translateText(&$body, $wrap_at, $charset) {
 
 
         $Quotes = 0;
         $Quotes = 0;
         $pos = 0;
         $pos = 0;
-	$j = strlen( $line );
+        $j = strlen( $line );
 
 
         while ( $pos < $j ) {
         while ( $pos < $j ) {
             if ($line[$pos] == ' ') {
             if ($line[$pos] == ' ') {

+ 16 - 16
functions/url_parser.php

@@ -21,7 +21,7 @@ function replaceBlock (&$in, $replace, $start, $end) {
 /* Having this defined in just one spot could help when changes need
 /* Having this defined in just one spot could help when changes need
  * to be made to the pattern
  * to be made to the pattern
  * Make sure that the expression is evaluated case insensitively
  * Make sure that the expression is evaluated case insensitively
- * 
+ *
  * Here's pretty sophisticated IP matching:
  * Here's pretty sophisticated IP matching:
  * $IPMatch = '(2[0-5][0-9]|1?[0-9]{1,2})';
  * $IPMatch = '(2[0-5][0-9]|1?[0-9]{1,2})';
  * $IPMatch = '\[?' . $IPMatch . '(\.' . $IPMatch . '){3}\]?';
  * $IPMatch = '\[?' . $IPMatch . '(\.' . $IPMatch . '){3}\]?';
@@ -29,40 +29,40 @@ function replaceBlock (&$in, $replace, $start, $end) {
 /* Here's enough: */
 /* Here's enough: */
 global $IP_RegExp_Match, $Host_RegExp_Match, $Email_RegExp_Match;
 global $IP_RegExp_Match, $Host_RegExp_Match, $Email_RegExp_Match;
 $IP_RegExp_Match = '\\[?[0-9]{1,3}(\\.[0-9]{1,3}){3}\\]?';
 $IP_RegExp_Match = '\\[?[0-9]{1,3}(\\.[0-9]{1,3}){3}\\]?';
-$Host_RegExp_Match = '(' . $IP_RegExp_Match . 
+$Host_RegExp_Match = '(' . $IP_RegExp_Match .
     '|[0-9a-z]([-.]?[0-9a-z])*\\.[a-z][a-z]+)';
     '|[0-9a-z]([-.]?[0-9a-z])*\\.[a-z][a-z]+)';
-$Email_RegExp_Match = '[0-9a-z]([-_.+]?[0-9a-z])*(%' . $Host_RegExp_Match . 
+$Email_RegExp_Match = '[0-9a-z]([-_.+]?[0-9a-z])*(%' . $Host_RegExp_Match .
     ')?@' . $Host_RegExp_Match;
     ')?@' . $Host_RegExp_Match;
-      
+
 function parseEmail (&$body) {
 function parseEmail (&$body) {
     global $color, $Email_RegExp_Match, $compose_new_win;
     global $color, $Email_RegExp_Match, $compose_new_win;
     $Size = strlen($body);
     $Size = strlen($body);
-      
+
     /*
     /*
      * This is here in case we ever decide to use highlighting of searched
      * This is here in case we ever decide to use highlighting of searched
      * text.  this does it for email addresses
      * text.  this does it for email addresses
-     *   
+     *
      * if ($what && ($where == "BODY" || $where == "TEXT")) {
      * if ($what && ($where == "BODY" || $where == "TEXT")) {
      *    eregi ($Email_RegExp_Match, $body, $regs);
      *    eregi ($Email_RegExp_Match, $body, $regs);
      *    $oldaddr = $regs[0];
      *    $oldaddr = $regs[0];
      *    if ($oldaddr) {
      *    if ($oldaddr) {
      *       $newaddr = eregi_replace ($what, "<b><font color=\"$color[2]\">$what</font></font></b>", $oldaddr);
      *       $newaddr = eregi_replace ($what, "<b><font color=\"$color[2]\">$what</font></font></b>", $oldaddr);
-     *       $body = str_replace ($oldaddr, "<a href=\"../src/compose.php?send_to=$oldaddr\">$newaddr</a>", $body); 
+     *       $body = str_replace ($oldaddr, "<a href=\"../src/compose.php?send_to=$oldaddr\">$newaddr</a>", $body);
      *    }
      *    }
-     * } else { 
+     * } else {
      *    $body = eregi_replace ($Email_RegExp_Match, "<a href=\"../src/compose.php?send_to=\\0\">\\0</a>", $body);
      *    $body = eregi_replace ($Email_RegExp_Match, "<a href=\"../src/compose.php?send_to=\\0\">\\0</a>", $body);
      * }
      * }
      */
      */
-     
+
     if( eregi($Email_RegExp_Match, $body, $regs) ) {
     if( eregi($Email_RegExp_Match, $body, $regs) ) {
-		if ($compose_new_win == '1') {
-        	$body = str_replace($regs[0],  '<a href="../src/compose.php?send_to='.urlencode($regs[0]).'" target="compose_window" onClick="comp_in_new()">'.$regs[0].'</a>', $body);
-		}
-		else {
-        	$body = str_replace($regs[0],  '<a href="../src/compose.php?send_to='.
+        if ($compose_new_win == '1') {
+            $body = str_replace($regs[0],  '<a href="../src/compose.php?send_to='.urlencode($regs[0]).'" target="compose_window" onClick="comp_in_new()">'.$regs[0].'</a>', $body);
+        }
+        else {
+            $body = str_replace($regs[0],  '<a href="../src/compose.php?send_to='.
             urlencode($regs[0]).'">'.$regs[0].'</a>', $body);
             urlencode($regs[0]).'">'.$regs[0].'</a>', $body);
-		}
-    } 
+        }
+    }
 
 
     /* If there are any changes, it'll just get bigger. */
     /* If there are any changes, it'll just get bigger. */
     if ($Size != strlen($body)) {
     if ($Size != strlen($body)) {

+ 1 - 1
src/addrbook_search.php

@@ -189,7 +189,7 @@ if ($show == 'form' && empty($listall)) {
     }
     }
         
         
     echo '</TD></TR><TR><TD></TD><TD align=left>'.
     echo '</TD></TR><TR><TD></TD><TD align=left>'.
-					'<INPUT TYPE=submit VALUE="' . _("Search") . '" NAME=show>' .
+         '<INPUT TYPE=submit VALUE="' . _("Search") . '" NAME=show>' .
          '&nbsp;|&nbsp;<INPUT TYPE=submit VALUE="' . _("List all") .
          '&nbsp;|&nbsp;<INPUT TYPE=submit VALUE="' . _("List all") .
          '" NAME=listall>' . "\n" .
          '" NAME=listall>' . "\n" .
          '&nbsp;|&nbsp;<INPUT TYPE=button VALUE="' . _("Close") .
          '&nbsp;|&nbsp;<INPUT TYPE=button VALUE="' . _("Close") .

+ 1 - 1
src/folders.php

@@ -242,7 +242,7 @@ for ($i = 0, $q = 0; $i < count($boxes_all); $i++) {
             $use_folder = false;
             $use_folder = false;
         }
         }
     }
     }
-    if ($use_folder == true) {	
+    if ($use_folder == true) {
         $box[$q] = $boxes_all[$i]["unformatted-dm"];
         $box[$q] = $boxes_all[$i]["unformatted-dm"];
         $box2[$q] = $boxes_all[$i]["unformatted-disp"];
         $box2[$q] = $boxes_all[$i]["unformatted-disp"];
         $q++;
         $q++;

+ 1 - 1
src/options.php

@@ -212,7 +212,7 @@ echo '<BR>' .
 /*******************************************************************/
 /*******************************************************************/
 
 
 /* If in submit mode, select a save hook name and run it. */
 /* If in submit mode, select a save hook name and run it. */
-if ($optmode == SMOPT_MODE_SUBMIT)	 {
+if ($optmode == SMOPT_MODE_SUBMIT) {
     /* Select a save hook name. */
     /* Select a save hook name. */
     switch ($optpage) {
     switch ($optpage) {
         case SMOPT_PAGE_PERSONAL:
         case SMOPT_PAGE_PERSONAL:

+ 7 - 7
src/options_personal.php

@@ -122,23 +122,23 @@ function load_optpage_data_personal() {
     while (!feof ($fd)) {
     while (!feof ($fd)) {
         $zone = fgets($fd, 1024);
         $zone = fgets($fd, 1024);
         if( $zone ) {
         if( $zone ) {
-	    $zone = trim($zone);
+            $zone = trim($zone);
             $TZ_ARRAY["$zone"] = "$zone";
             $TZ_ARRAY["$zone"] = "$zone";
         }
         }
     }
     }
     fclose ($fd);
     fclose ($fd);
-    
+
     $optgrps[SMOPT_GRP_TZ] = _("Timezone Options");
     $optgrps[SMOPT_GRP_TZ] = _("Timezone Options");
     $optvals[SMOPT_GRP_TZ] = array();
     $optvals[SMOPT_GRP_TZ] = array();
 
 
     $optvals[SMOPT_GRP_TZ][] = array(
     $optvals[SMOPT_GRP_TZ][] = array(
         'name'    => 'timezone',
         'name'    => 'timezone',
-	'caption' => _("Your current timezone"),
-	'type'    => SMOPT_TYPE_STRLIST,
-	'refresh' => SMOPT_REFRESH_NONE,
-	'posvals' => $TZ_ARRAY
+        'caption' => _("Your current timezone"),
+        'type'    => SMOPT_TYPE_STRLIST,
+        'refresh' => SMOPT_REFRESH_NONE,
+        'posvals' => $TZ_ARRAY
     );
     );
-											     
+
     /*** Load the Reply Citation Options into the array ***/
     /*** Load the Reply Citation Options into the array ***/
     $optgrps[SMOPT_GRP_REPLY] = _("Reply Citation Options");
     $optgrps[SMOPT_GRP_REPLY] = _("Reply Citation Options");
     $optvals[SMOPT_GRP_REPLY] = array();
     $optvals[SMOPT_GRP_REPLY] = array();

+ 2 - 2
src/read_body.php

@@ -315,7 +315,7 @@ if (isset($view_hdr)) {
         }
         }
         parseEmail($s);
         parseEmail($s);
         if (isset($f)) {
         if (isset($f)) {
-        	echo "<nobr><tt><b>$f</b>$s</tt></nobr>";
+            echo "<nobr><tt><b>$f</b>$s</tt></nobr>";
         }
         }
     }
     }
     echo "</td></tr></table>\n" .
     echo "</td></tr></table>\n" .
@@ -910,7 +910,7 @@ if ($default_use_mdn) {
             $sendreceipt = 'removeMDN';
             $sendreceipt = 'removeMDN';
             $url = "\"read_body.php?mailbox=$mailbox&amp;passed_id=$passed_id&amp;startMessage=$startMessage&amp;show_more=$show_more&amp;sendreceipt=$sendreceipt\"";
             $url = "\"read_body.php?mailbox=$mailbox&amp;passed_id=$passed_id&amp;startMessage=$startMessage&amp;show_more=$show_more&amp;sendreceipt=$sendreceipt\"";
             $sendreceipt='';
             $sendreceipt='';
-			/*
+            /*
             if ($MDNDebug && $supportMDN) {
             if ($MDNDebug && $supportMDN) {
             echo "      <TR>\n" .
             echo "      <TR>\n" .
                     "         <TD BGCOLOR=\"$color[9]\"  ALIGN=RIGHT VALIGN=TOP>\n" .
                     "         <TD BGCOLOR=\"$color[9]\"  ALIGN=RIGHT VALIGN=TOP>\n" .