Browse Source

Some mail servers auto-create the Trash folder. With this tiny bit of code,
we automatically subscribe the Sent and Trash folders just in case they do
exist and aren't subscribed to. It's just part of the one-time overhead
when logging in.

Tyler Akins 24 years ago
parent
commit
e855a14289
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/left_main.php

+ 4 - 0
src/left_main.php

@@ -24,11 +24,15 @@
    	  if (isset ($sent_folder) && $sent_folder != "none") {
    	  if (isset ($sent_folder) && $sent_folder != "none") {
 	  	 if (!sqimap_mailbox_exists ($imapConnection, $sent_folder)) {
 	  	 if (!sqimap_mailbox_exists ($imapConnection, $sent_folder)) {
 		 	sqimap_mailbox_create ($imapConnection, $sent_folder, "");
 		 	sqimap_mailbox_create ($imapConnection, $sent_folder, "");
+		 } else {
+		    sqimap_subscribe($imapConnection, $sent_folder);
 		 }
 		 }
 	  }
 	  }
    	  if (isset ($trash_folder) && $trash_folder != "none") {
    	  if (isset ($trash_folder) && $trash_folder != "none") {
 	  	 if (!sqimap_mailbox_exists ($imapConnection, $trash_folder)) {
 	  	 if (!sqimap_mailbox_exists ($imapConnection, $trash_folder)) {
 		 	sqimap_mailbox_create ($imapConnection, $trash_folder, "");
 		 	sqimap_mailbox_create ($imapConnection, $trash_folder, "");
+		 } else {
+		    sqimap_subscribe($imapConnection, $trash_folder);
 		 }
 		 }
 	  }
 	  }
 	  $auto_create_done = true;
 	  $auto_create_done = true;