The Sugar Email Client > 5.0.0 has some problems with non ASCII charsets in mail server directory names.
I suppose you have same ια-problems.
To solver this you must edit modules/InboundEmail/InboundEmail.php
The php function imap_utf7_encode does not work as designed.
It must be replaced by mb_convert_encoding like this:
PHP Code:
// $mb = imap_utf7_decode(str_replace($testConnectString,'',$val->name));
$mb = mb_convert_encoding(str_replace($testConnectString,'',$val->name), "ISO_8859-1", "UTF7-IMAP" );
Then it makes no sense to test all IMAP direcories, you have IMAP?
I added some if statement after the statement above.
PHP Code:
//KUS
// $mb = imap_utf7_decode(str_replace($testConnectString,'',$val->name));
$mb = mb_convert_encoding(str_replace($testConnectString,'',$val->name), "ISO_8859-1", "UTF7-IMAP" );
$GLOBALS['log']->debug("***INBOUNDEMAIL: VAL: ".print_r($val->name,true));
$GLOBALS['log']->debug("***INBOUNDEMAIL: TST: ".print_r($testConnectString,true));
$GLOBALS['log']->debug("***INBOUNDEMAIL: $MB: ".print_r($mb,true));
if (!strpos($mb,"/") /* && !strpos($mb,"?") */ ){
//KUS
$msg .= '<a onClick=\'setMailbox(\"'.$mb.'\"); window.close();\'>';
$msg .= $mb;
$msg .= '</a><br>';
//KUS
}
//KUS
The same game in function getMailboxes (I restricted the mailbox names)
PHP Code:
foreach($boxes as $k => $mbox) {
//KUS
// $raw[] = str_replace($serviceString, "", $mbox->name);
$raw_boxname = str_replace($serviceString, "", mb_convert_encoding($mbox->name, "ISO_8859-1", "UTF7-IMAP" ));
$GLOBALS['log']->debug("***INBOUNDEMAIL: BOX: ".print_r($raw_boxname,true));
if ( ($raw_boxname == "INBOX")
or ($raw_boxname == "Gesendete Objekte") )
{
$raw[] = $raw_boxname;
//KUS
if ($mbox->delimiter) {
$delimiter = $mbox->delimiter;
}
//KUS
}
//KUS
}
Just find these code in your 5.1 module and patch it.
Bookmarks