Author Topic: "Server Error! (OK)" when opening Inbox  (Read 5605 times)

Offline Hellkeeper

  • Jr. Member
  • **
  • Posts: 11
"Server Error! (OK)" when opening Inbox
« on: April 12, 2016, 07:53:12 AM »
Hi,

at one of our clients account the Inbox folder cant be displayed. He gets this message: "Server Error (OK)".

The Problem only occurs with the Inbox folder. Every other folder works fine, and in Thunderbird/Outlook we don't have any problem with the Inbox Folder.

Gettint this Error in Server Response:

Notice: No suitable function found for UTF-8 encoding in /var/www/kdn570/html/program/lib/Roundcube/rcube_charset.php on line 276

My colleague thinks it has something to do with this issue:
https://github.com/roundcube/roundcubemail/issues/4896

We are using Version 1.1.3

Any ideas?

Florian
« Last Edit: April 13, 2016, 10:53:30 AM by Hellkeeper »

Offline alec

  • Hero Member
  • *****
  • Posts: 1,165
Re: "Server Error! (OK)" when opening Inbox
« Reply #1 on: April 12, 2016, 08:49:19 AM »
Notice: No suitable function found for UTF-8 encoding in /var/www/kdn570/html/program/lib/Roundcube/rcube_charset
.php on line 276
You've got this notice in the server response or in the log only? If in the response then make sure your logging is configured correctly. Otherwise try with disabled all plugins.

Offline Hellkeeper

  • Jr. Member
  • **
  • Posts: 11
Re: "Server Error! (OK)" when opening Inbox
« Reply #2 on: April 13, 2016, 10:29:30 AM »
You've got this notice in the server response or in the log only? If in the response then make sure your logging is configured correctly. Otherwise try with disabled all plugins.

Getting this Error only within Server Response. Tried activating different Logs (SQL/IMAP/...) but can't find this Error in any of them?!
Also tried to deactivate all Plugins - Error still there.

Error Triggered: program/lib/Roundcube/rcube_charset.php - Line 276
$from is filled with: WINDOWS-1251 - but it seems only UTF7-IMAP, UTF-7 and ISO-8859-1 are allowed here? All other encodings will trigger this Error?

Andreas Schnederle-Wagner
« Last Edit: April 13, 2016, 10:38:36 AM by Hellkeeper »

Offline Hellkeeper

  • Jr. Member
  • **
  • Posts: 11
Re: "Server Error! (OK)" when opening Inbox
« Reply #3 on: April 13, 2016, 10:52:26 AM »
I was able to fix the Problem ... guess this should not introduce any Problems I guess?! Most likely there would be a better / leaner approach for this Problem - but I really don't know the Roundcube Source Code ... ;-)

Code: [Select]
        // convert charset using bundled classes/functions
        if ($to == 'UTF-8') {
            if ($from == 'UTF7-IMAP') {
                if ($_str = self::utf7imap_to_utf8($str)) {
                    return $_str;
                }
            }
            else if ($from == 'UTF-7') {
                if ($_str = self::utf7_to_utf8($str)) {
                    return $_str;
                }
            }
            else if ($from == 'ISO-8859-1' && function_exists('utf8_encode')) {                           
                return utf8_encode($str);
            }
            else if ($from == 'WINDOWS-1251' && function_exists('mb_convert_encoding')) {
                if($str = mb_convert_encoding($str, "windows-1251", "utf-8")){
                        return $str;
                }
            }
            else  {
                trigger_error("No suitable function found for UTF-8 encoding");
            }
        }

diff program/lib/Roundcube/rcube_charset.php:
Code: [Select]
274a275,279
>             else if ($from == 'WINDOWS-1251' && function_exists('mb_convert_encoding')) {
>               if($str = mb_convert_encoding($str, "windows-1251", "utf-8")){
>                       return $str;
>               }
>             }

Andreas Schnederle-Wagner
« Last Edit: April 13, 2016, 11:20:58 AM by Hellkeeper »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,325
Re: "Server Error! (OK)" when opening Inbox
« Reply #4 on: April 13, 2016, 11:50:03 AM »
I think what Alec meant was for you to check your server loggin settings rather than the Roundcube ones. See here https://github.com/roundcube/roundcubemail/blob/master/.htaccess#L5 it sets displaying errors to Off. Some server config can prevent .htaccess file rules from being applied and may be that is what is happening here. You should only see that notice in the Roundcube error log, never on the screen/in the response from the server to an ajax request.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline Hellkeeper

  • Jr. Member
  • **
  • Posts: 11
Re: "Server Error! (OK)" when opening Inbox
« Reply #5 on: April 13, 2016, 02:53:34 PM »
Hi,
thx for pointing me on this ... apache config was overriding display_error setting from .htaccess ... that was causing the Error.
Now the Inbox is loading - but with broken Encoding for the WINDOWS-1251 Mails ...
My little Workaround also fixed those encoding problems ... mhm ... at least for WINDOWS-1251 ;-)
(with mb_convert_encoding() easily adaptable to cover all encodings)
Andreas
« Last Edit: April 14, 2016, 04:18:24 AM by Hellkeeper »