I had some problems to connect to Exchange 2003 IMAP server too.
So I looked to the code of modules/InboundEmail/InboundEmail.php.
In function connectMailserver there is a section starting after
$list = imap_getmailboxes($this->conn, $testConnectString, "*");
This call retrieves all - really ALL - accessable Echange folders - even the public folders.
Then the call
$mb = imap_utf7_decode(str_replace($testConnectString,'' ,$val->name));
tries to decode the folder names. In some cases (e.g. german characters äöü...) this decoding is incorrect.
As I was only interested in root-mailboxes ( I think normally you only want so receive from INBOX), I put a filter in the foreach loop as follows.
PHP Code:
$list = imap_getmailboxes($this->conn, $testConnectString, "*");
if (is_array($list)) {
sort($list);
$msg .= '<b>'.$mod_strings['LBL_FOUND_MAILBOXES'].'</b><p>';
foreach ($list as $key => $val) {
$mb = imap_utf7_decode(str_replace($testConnectString,'',$val->name));
//kuske
if (!strpos($mb,"/") ){
//kuske
$msg .= '<a onClick=\'setMailbox(\"'.$mb.'\"); window.close();\'>';
$msg .= $mb;
$msg .= '</a><br>';
//kuske
}
//kuske
}
} else {
$msg .= $errors;
$msg .= '<p>'.$mod_strings['ERR_MAILBOX_FAIL'].imap_last_error().'</p>';
$msg .= '<p>'.$mod_strings['ERR_TEST_MAILBOX'].'</p>';
}
} else {
$msg .= $mod_strings['LBL_POP3_SUCCESS'];
}
Now it works
Good luck
hk
Bookmarks