}
function find_mailbox_name ($mailbox) {
+ if (preg_match('/\*.+\"([^\r\n\"]*)\"[\s\r\n]*$/', $mailbox, $regs))
+ return $regs[1];
if (ereg(" *\"([^\r\n\"]*)\"[ \r\n]*$", $mailbox, $regs))
return $regs[1];
ereg(" *([^ \r\n\"]*)[ \r\n]*$",$mailbox,$regs);
function user_strcasecmp($a, $b) {
global $delimiter;
+ return strnatcasecmp($a, $b);
+
/* Calculate the length of some strings. */
$a_length = strlen($a);
$b_length = strlen($b);
$delimiter_length = strlen($delimiter);
/* Set the initial result value. */
- $result = 0;
-
+ $result = 0;
/* Check the strings... */
for ($c = 0; $c < $min_length; ++$c) {
$a_del = substr($a, $c, $delimiter_length);
if (isset($sorted_lsub_ary)) {
usort($sorted_lsub_ary, 'user_strcasecmp');
}
-
+ $sorted_list_ary = $sorted_lsub_ary;
/* LIST array */
- $sorted_list_ary = array();
- for ($i=0; $i < count($sorted_lsub_ary); $i++) {
+// $sorted_list_ary = array();
+// for ($i=0; $i < count($sorted_lsub_ary); $i++) {
+ if (false) {
if (substr($sorted_lsub_ary[$i], -1) == $delimiter) {
$mbx = substr($sorted_lsub_ary[$i], 0, strlen($sorted_lsub_ary[$i])-1);
}
$inbox_in_list = true;
}
}
-
+// $inbox_in_list = true;
/*
* Just in case they're not subscribed to their inbox,
* we'll get it for them anyway
*/
- if (!$inbox_subscribed || !$inbox_in_list) {
+ if (!$inbox_subscribed) {// || !$inbox_in_list) {
$inbox_ary = sqimap_run_command ($imap_stream, "LIST \"\" \"INBOX\"",
true, $response, $message);
/* Another workaround for EIMS */