Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0004290SOGoBackend Mailpublic2017-10-11 15:20
Reporterrongten Assigned Tofrancis  
PriorityurgentSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Platform[Server] LinuxOSRHEL/CentOSOS Version7
Product Versionnightly master 
Summary0004290: When Imap Folder contains a number, it is filtered out and there is an error in the webmail starting from sogo-3.2.10.20170915
Description

Hello,

very strange thing, when I updated from sogo.x86_64 3.2.9.20170604-1.el7.centos to sogo-3.2.10.20170915-1.el7.centos.x86_64 I started having trouble with folders that contain numbers in them.

Previously all was ok, now you cannot access a folder with a number and the sogo.log gives the following error when you try to access a folder called test1:

Sep 18 12:20:55 sogod [4066]: [ERROR] <0x0x7f069a3bb6b0[NGImap4Connection]> could not select URL: imap://USER@localhost/test/: {RawResponse = "{ResponseResult = {description = \"Mailbox doesn't exist: test\"; result = no; tagId = 6; }; }"; reason = "Mailbox doesn't exist: test"; result = 0; }

You can create a new folder from the webinterface, it is listed in the folders pane, but you cannot access it anymore.

The content is of course accessible via an Imap Client, like it was before accessible from the webmail.

Steps To Reproduce

Try to open a Mail folder with a number in the name.

TagsNo tags attached.

Relationships

related to 0004287 resolvedfrancis [NGImap4Connection] Can't no more access to folder after renaming it 

Activities

cedric.archambeau

cedric.archambeau

2017-09-18 12:53

reporter   ~0012302

I think this bug is in the neighborhood of 0004287.
Thanks for report, I'm feeling less alone.

rongten

rongten

2017-09-18 13:10

reporter   ~0012304

Hello Cedric,

I saw your bug, but I was not sure was the same issue, so I opened a new one.

To make sure is the same bug, we could try to have the same debug options and try the same steps to reproduce (I am on centos 7 with the nightly rpms).

I have in my /etc/sogo/sogo.conf the following debug enabled:

SOGoDebugRequests = YES;
SoDebugBaseURL = YES;
LDAPDebugEnabled = YES;
PGDebugEnabled = YES;
MySQL4DebugEnabled = YES;
WODontZipResponse = YES;

I open a terminal and I do a tail -f /var/log/sogo/sogo.log

On the web gui I create a new folder (i.e. test2017) and on the log I see a successful folder creation:

Sep 18 15:04:55 sogod [4874]: |SOGo| request took 0.765789 seconds to execute
Sep 18 15:04:55 sogod [4874]: 10.1.2.70 "POST /SOGo/so/USER/Mail/0/createFolder HTTP/1.1" 204 0/19 0.770 - - 0
Sep 18 15:04:55 sogod [4874]: |SOGo| starting method 'GET' on uri '/SOGo/so/USER/Mail/0/view'
Sep 18 15:04:55 sogod [4874]: |SOGo| request took 0.366927 seconds to execute
Sep 18 15:04:55 sogod [4874]: 10.1.2.70 "GET /SOGo/so/USER/Mail/0/view HTTP/1.1" 200 3249/0 0.368 - - 0

then when I try to get into the very same folder I just created, I get the error message "An error occurred.." on the web client and on the log I get

Sep 18 15:06:42 sogod [4874]: [ERROR] <0x0x7f069aacab80[NGImap4Connection]> could not select URL: imap://USER@localhost/test/: {RawResponse = "{ResponseResult = {description = \"Mailbox doesn't exist: test\"; result = no; tagId = 6; }; }"; reason = "Mailbox doesn't exist: test"; result = 0; }

If you rename to test2017test from thunderbird, the error message on the log becomes:
Sep 18 15:08:50 sogod [4874]: |SOGo| starting method 'POST' on uri '/SOGo/so/USER/Mail/0/foldertesttest/view'
Sep 18 15:08:50 sogod [4874]: [ERROR] <0x0x7f069ab4f730[NGImap4Connection]> could not select URL: imap://USER@localhost/testtest/: {RawResponse = "{ResponseResult = {description = \"Mailbox doesn't exist: testtest\"; result = no; tagId = 6; }; }"; reason = "Mailbox doesn't exist: testtest"; result = 0; }
Sep 18 15:08:50 sogod [4874]: 10.1.2.70 "POST /SOGo/so/USER/Mail/0/foldertesttest/view HTTP/1.1" 500 72/45 0.374 - - 0

The numbers are strangely removed from the folder name.

rongten

rongten

2017-09-18 13:18

reporter   ~0012305

Scratch that, this is exactly 0004287, very little doubt about it.

francis

francis

2017-09-18 16:23

administrator   ~0012307

Fixed.

See https://github.com/inverse-inc/sogo/commit/d02f0db0b48f0631ecbaaa6d5f015e5407b035a9

rongten

rongten

2017-09-19 12:24

reporter   ~0012311

Hello,

I have installed sogo-3.2.10.20170919-1.el7.centos.x86_64 that as far as I understand contains the commit proposed by Francis.

However the issue is still there.

Using the developer tools of chrome I see something very strange in the String.prototype.asCSSIdentifier.

I see that when I do an hard refresh and sogo rebuilds the folder list (I think), when it arrives to "test1" it does something very strange:

It does the loop at line 147, it does not find any special character to change (i.e. _ to U), and when it arrives at line 152, the newString value is updated to "test" from test1.

If I remove lines 152 and 154-156, when it arrives to the return statement, the newString value changes alone to "test".

It is very strange, I empty the cache each time (developer mode + "Empty Cache and Hard Reload") and I tried many times and still the digits are removed from the newString variable.

If I remove the handling of exceptions an the function becomes only
String.prototype.asCSSIdentifier = function() {
var characters = [ '_' , '\.', '#' , '@' , '\*', ':' , ',' , ' ', "'", '&', '\+' ];
var escapeds = [ 'U', 'D', 'H', 'A', 'S', 'C', 'CO', 'SP', 'SQ', 'AM', 'P' ];

var newString = this;

return newString;
};

I still have the error with the imap request for folder test instead of test1.

I am not really into javascript debugging, I do not know how to look further...

Am I doing something wrong?

francis

francis

2017-09-19 12:33

administrator   ~0012312

Looks like our bot failed to generated the static JavaScript files last night, so you're still running the broken version.

rongten

rongten

2017-09-19 13:00

reporter   ~0012313

Ah, ok. This is over my head, sorry.

Is there a way for me to compile these files myself or it is better to wait for next nightly?

francis

francis

2017-09-19 13:10

administrator   ~0012314

Wait for the next build.

cedric.archambeau

cedric.archambeau

2017-09-20 08:55

reporter   ~0012318

3.2.10.20170920-1 : first tests OK for me.

Thanks Francis

rongten

rongten

2017-09-20 11:08

reporter   ~0012319

Same here!

Issue History

Date Modified Username Field Change
2017-09-18 10:24 rongten New Issue
2017-09-18 12:53 cedric.archambeau Note Added: 0012302
2017-09-18 13:10 rongten Note Added: 0012304
2017-09-18 13:18 rongten Note Added: 0012305
2017-09-18 16:23 francis Note Added: 0012307
2017-09-18 16:23 francis Status new => resolved
2017-09-18 16:23 francis Resolution open => fixed
2017-09-18 16:23 francis Assigned To => francis
2017-09-18 16:23 francis Product Version 3.2.10 => nightly master
2017-09-18 16:24 francis Relationship added related to 0004287
2017-09-19 12:24 rongten Note Added: 0012311
2017-09-19 12:24 rongten Status resolved => feedback
2017-09-19 12:24 rongten Resolution fixed => reopened
2017-09-19 12:33 francis Note Added: 0012312
2017-09-19 13:00 rongten Note Added: 0012313
2017-09-19 13:00 rongten Status feedback => assigned
2017-09-19 13:10 francis Note Added: 0012314
2017-09-20 08:55 cedric.archambeau Note Added: 0012318
2017-09-20 11:08 rongten Note Added: 0012319
2017-10-11 15:20 ludovic Status assigned => resolved
2017-10-11 15:20 ludovic Resolution reopened => fixed