echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
$count_special_folders = 0;
- $num_max = 1;
- if ($move_to_trash)
- $num_max++;
- if ($move_to_sent)
- $num_max++;
+ $num_max = 1;
+ if (strtolower($imap_server_type) == "courier" || $move_to_trash)
+ $num_max++;
+ if ($move_to_sent)
+ $num_max++;
- for ($p = 0; $p < count($boxes) && $count_special_folders < $num_max; $p++) {
+ for ($p = 0; $p < count($boxes) && $count_special_folders < $num_max; $p++) {
if (strtolower($boxes[$p]["unformatted"]) == "inbox")
$count_special_folders++;
- else if ($boxes[$p]["unformatted"] == $trash_folder && $trash_folder)
+ else if (strtolower($imap_server_type) == "courier" &&
+ strtolower($boxes[$p]["unformatted"]) == "inbox.trash")
$count_special_folders++;
- else if ($boxes[$p]["unformatted"] == $sent_folder && $sent_folder)
+ else if ($boxes[$p]["unformatted"] == $trash_folder && $trash_folder)
$count_special_folders++;
}
echo "<TT><SELECT NAME=mailbox>\n";
for ($i = 0; $i < count($boxes); $i++) {
$use_folder = true;
- if ((strtolower($boxes[$i]["unformatted"]) != "inbox") &&
- ($boxes[$i]["unformatted"] != $trash_folder) &&
- ($boxes[$i]["unformatted"] != $sent_folder))
- {
+ if ((strtolower($boxes[$i]["unformatted"]) != "inbox") &&
+ ($boxes[$i]["unformatted"] != $trash_folder) &&
+ ($boxes[$i]["unformatted"] != $sent_folder) &&
+ (strtolower($imap_server_type) != "courier" ||
+ strtolower($boxes[$i]["unformatted"]) != "inbox.trash"))
+ {
$box = $boxes[$i]["unformatted-dm"];
$box2 = replace_spaces($boxes[$i]["formatted"]);
echo " <OPTION VALUE=\"$box\">$box2\n";
echo _("as a subfolder of");
echo "<BR>";
echo "<TT><SELECT NAME=subfolder>\n";
- if ($default_sub_of_inbox == false)
- echo "<OPTION SELECTED>[ None ]\n";
- else
- echo "<OPTION>[ None ]\n";
+ if (strtolower($imap_server_type) != "courier"){
+ if ($default_sub_of_inbox == false)
+ echo "<OPTION SELECTED>[ None ]\n";
+ else
+ echo "<OPTION>[ None ]\n";
+ }
for ($i = 0; $i < count($boxes); $i++) {
if (count($boxes[$i]["flags"]) > 0) {
} else {
$box = $boxes[$i]["unformatted"];
$box2 = replace_spaces($boxes[$i]["formatted"]);
- echo "<OPTION VALUE=\"$box\">$box2\n";
+ if (strtolower($imap_server_type) != "courier" ||
+ strtolower($box) != "inbox.trash")
+ echo "<OPTION VALUE=\"$box\">$box2\n";
}
}
} else {
} else {
$box = $boxes[$i]["unformatted"];
$box2 = replace_spaces($boxes[$i]["formatted"]);
- echo "<OPTION VALUE=\"$box\">$box2\n";
+ if (strtolower($imap_server_type) != "courier" ||
+ strtolower($box) != "inbox.trash")
+ echo "<OPTION VALUE=\"$box\">$box2\n";
}
}
}
else
$mailbox_no_dm = $mailbox;
- /** lets see if we CAN move folders to the trash.. otherwise, just delete them **/
- for ($i = 0; $i < count($boxes); $i++) {
- if ($boxes[$i]["unformatted"] == $trash_folder) {
- $can_move_to_trash = true;
- for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
- if (strtolower($boxes[$i]["flags"][$j]) == "noinferiors")
+ /** lets see if we CAN move folders to the trash.. otherwise,
+ ** just delete them **/
+ if (strtolower($imap_server_type) == "courier") {
+ // Courier IMAP doesn't like subfolders of Trash
+ $can_move_to_trash = false;
+ } else {
+ for ($i = 0; $i < count($boxes); $i++) {
+ if ($boxes[$i]["unformatted"] == $trash_folder) {
+ $can_move_to_trash = true;
+ for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
+ if (strtolower($boxes[$i]["flags"][$j]) == "noinferiors")
$can_move_to_trash = false;
+ }
}
}
}
-
/** First create the top node in the tree **/
for ($i = 0;$i < count($boxes);$i++) {
if (($boxes[$i]["unformatted-dm"] == $mailbox) && (strlen($boxes[$i]["unformatted-dm"]) == strlen($mailbox))) {