Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Conversation

@MarcHagen
Copy link

CMD: * LIST (\HasNoChildren) "/" [label]/Trash failed because the parser sees the [ as opening for arguments or comments.
Google for example returns it quoted: * LIST (\HasNoChildren) "/" "[Gmail]/Trash" then this is no issue.

In the LIST context this failed with a MailSo-Base-Exceptions-InvalidArgumentException, the ResponseList[4] was parsed as a array instead of a string.
This problem exists with Dovecot 2.2

This exception is nicely handled so you won't notice. But it the folders menu it won't show the subfolders because it exits the loop with a exception.

My proposal is quite simple, just check it the current buffered line has LIST at the beginning and checking if current sChar === '[' and is not a LIST command.

Original error:

[23:31:07.321][99437e3c] IMAP[WARNING]: MailSo\Base\Exceptions\InvalidArgumentException: MailSo-Base-Exceptions-InvalidArgumentException (Folder.php ~ 77) in /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/MailSo/Imap/Folder.php:77
Stack trace:
#0 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/MailSo/Imap/Folder.php(117): MailSo\Imap\Folder->__construct(Array, '/', Array)
#1 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/MailSo/Imap/ImapClient.php(670): MailSo\Imap\Folder::NewInstance(Array, '/', Array)
#2 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/MailSo/Imap/ImapClient.php(800): MailSo\Imap\ImapClient->getFoldersFromResult(Array, 'LIST', false)
#3 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/MailSo/Imap/ImapClient.php(814): MailSo\Imap\ImapClient->specificFolderList(false, '', '*')
#4 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/MailSo/Mail/MailClient.php(2349): MailSo\Imap\ImapClient->FolderList('', '*')
#5 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/RainLoop/Actions.php(5347): MailSo\Mail\MailClient->Folders('', '*', true, 200)
#6 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/RainLoop/ServiceActions.php(172): RainLoop\Actions->DoFolders()
#7 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/RainLoop/Service.php(146): RainLoop\ServiceActions->ServiceAjax('')
#8 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/RainLoop/Service.php(56): RainLoop\Service->localHandle()
#9 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/libraries/RainLoop/Service.php(79): RainLoop\Service->__construct()
#10 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/app/handle.php(94): RainLoop\Service::Handle()
#11 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/rainloop/v/1.12.1/include.php(228): include('/home/dutchmast...')
#12 /home/dutchmasterserver/domains/mail.dutchmasterserver.nl/public_html/index.php(13): include('/home/dutchmast...')
#13 {main}

Output unmodified code:

[bc1a974b] IMAP[DATA]: < * LIST (\HasNoChildren) "/" [label]/Trash\r\n
[bc1a974b] INFO[WARNING]: Array
(
    [0] => *
    [1] => LIST
    [2] => Array
        (
            [0] => \HasNoChildren
        )

    [3] => /
    [4] => Array << Failes here.
        (
            [0] => label
        )

    [5] => /Trash
)

CMD: * LIST (\HasNoChildren) "/" [label]/Trash failed because the parser sees the [ as opening for arguments or comments.
In the LIST context this failed with a MailSo-Base-Exceptions-InvalidArgumentException the ResponseList[4] was parsed as a array
instead of a string.
This problem exists with Dovecot 2.2
@MarcHagen MarcHagen changed the title Fix non quited LIST command, not failing on brackets [label]/ [WIP] Fix non quoted LIST command, not failing on brackets [label]/ Jan 2, 2019
@MarcHagen MarcHagen changed the title [WIP] Fix non quoted LIST command, not failing on brackets [label]/ [WIP] Fix non quoted LIST command, failing on brackets [label]/ Jan 2, 2019
@MarcHagen MarcHagen closed this Jan 2, 2019
@MarcHagen MarcHagen deleted the bug/bracketFolderNames branch January 2, 2019 23:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant