Roundcube Community Forum

 

Error after upgrading to 1.2.1

Started by Jools, August 31, 2016, 03:52:02 AM

Previous topic - Next topic

Jools

Hi All,

Upgraded to 1.2.1 about 5 weeks ago and on of our users has just tried adding a folder.  The folder added OK but the background of the settings page shows the following:


( ! ) Warning: strpos(): Empty needle in /var/www/html/roundcube/program/steps/settings/folders.inc on line 333
Call Stack
#   Time   Memory   Function   Location
1   0.0000   235008   {main}( )   ../index.php:0
2   0.0251   2454368   include_once( '/var/www/html/roundcube/program/steps/settings/folders.inc' )   ../index.php:291
3   0.0268   2803464   rcmail_output_html->send( )   ../folders.inc:196
4   0.0268   2803704   rcmail_output_html->parse( )   ../rcmail_output_html.php:478
5   0.0272   2816776   rcmail_output_html->parse_xml( )   ../rcmail_output_html.php:619
6   0.0272   2817344   preg_replace_callback ( )   ../rcmail_output_html.php:1004
7   0.0368   2849640   rcmail_output_html->xml_command( )   ../rcmail_output_html.php:1004
8   0.0369   2850872   call_user_func:{/var/www/html/roundcube/program/include/rcmail_output_html.php:1131} ( )   ../rcmail_output_html.php:1131
9   0.0369   2850904   rcmail_subscription_form( )   ../rcmail_output_html.php:1131
10   13.3274   53572328   strpos ( )   ../folders.inc:333

( ! ) Warning: strpos(): Empty needle in /var/www/html/roundcube/program/steps/settings/folders.inc on line 333
Call Stack
#   Time   Memory   Function   Location
1   0.0000   235008   {main}( )   ../index.php:0
2   0.0251   2454368   include_once( '/var/www/html/roundcube/program/steps/settings/folders.inc' )   ../index.php:291
3   0.0268   2803464   rcmail_output_html->send( )   ../folders.inc:196
4   0.0268   2803704   rcmail_output_html->parse( )   ../rcmail_output_html.php:478
5   0.0272   2816776   rcmail_output_html->parse_xml( )   ../rcmail_output_html.php:619
6   0.0272   2817344   preg_replace_callback ( )   ../rcmail_output_html.php:1004
7   0.0368   2849640   rcmail_output_html->xml_command( )   ../rcmail_output_html.php:1004
8   0.0369   2850872   call_user_func:{/var/www/html/roundcube/program/include/rcmail_output_html.php:1131} ( )   ../rcmail_output_html.php:1131
9   0.0369   2850904   rcmail_subscription_form( )   ../rcmail_output_html.php:1131
10   13.3298   53580720   strpos ( )   ../folders.inc:333
Window controlAbout Get support <email address removed>
Application tasksMailMail Address BookAddress Book HelpHelp TasksTasks CalendarCalendar SettingsSettings LogoutLogout Logo

Has any one else had this and is there a cure?

Thanks,.

Jools

alec

Did you set any of imap_ns_* options in config? If not, what returns your IMAP server in NAMESPACE response (you can find it by enabling imap_debug)?

Jools

#2
Hiya,

imap_ns settings are at their defaults.

Got this back out of the log:

[26-Jul-2016 09:34:36 +0100]: <pomf6td5> [AD86] C:
[26-Jul-2016 09:34:36 +0100]: <pomf6td5> [AD86] S: A0002 OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY CATENATE CONDSTORE ESEARCH SORT SORT=MODSEQ SORT=DISPLAY THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE LIST-EXTENDED WITHIN QRESYNC SCAN XLIST URLAUTH URLAUTH=BINARY X-NETSCAPE LOGINDISABLED COMPRESS=DEFLATE IDLE] Success (no protection) SESSIONID=<mail.domain-removed-9975-1469522076-1>
[26-Jul-2016 09:34:36 +0100]: <pomf6td5> [AD86] C: A0003 NAMESPACE
[26-Jul-2016 09:34:36 +0100]: <pomf6td5> [AD86] S: * NAMESPACE (("INBOX." ".")) (("user." ".")) (("" "."))

alec

Right. This looks unusual that shared namespace has empty prefix. I'd say it's an issue on IMAP server side. You can probably workaround this by setting $config['imap_ns_shared'] = ''. Anyway, these are warnings and should not appear in browser, so you should modify display_errors setting in php.ini.

Jools

Nice one thanks.  I'm using Cyrus IMAP with the top folder being INBOX.  .  What format does Roundcube take the setting in?

alec

I don't understand your question. You don't have a problem with personal namespace, but with the shared namespace and I provided a possible fix for you. In general in imap_ns_* options you provide namespace prefix string. You don't have to do this if NAMESPACE extension is supported and valid.

Anyway, I created a ticket and we'll fix these warnings. https://github.com/roundcube/roundcubemail/issues/5420

Jools

That's what I thought  as namespace appeared in the capability section but I was going to try setting it manually anyway to see what happened.  My question was what should I set in the imap_ns_shared line.

Thanks,

Julian

alec

An empty string would work because configured namespaces are parsed slightly different than these provided by IMAP server.

Some examples:
$config['imap_ns_personal'] = 'INBOX.';                // one namespace root
$config['imap_ns_personal'] = array('', 'INBOX.'); // two namespace roots (first empty)

Warning: All namespaces MUST use the same hierarchy separator! It is allowed by IMAP standard, but Roundcube will not work with different separators.

Jools

Nice one, thanks for the reply.  I'll keep an eye on the bug report.


All the best,

Julian

Jools

And, already solved.

Brilliant works, thanks very much for your help,

All the best,

Julian