Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't show mailbox, throws PHP error: __construct() must be of the type string, array given #1

Closed
h3artbl33d opened this issue Aug 6, 2020 · 5 comments

Comments

@h3artbl33d
Copy link

RainLoop version, browser, OS:
1.14.0-djmaze

Expected behavior
User logs in, messages in inbox get loaded and shown to user.

Actual behavior:
User enters credentials, Rainloop drops back to login screen, error gets added to the error_log.

Steps to reproduce the problem:
I tried to reproduce it myself, it seems to happen sometimes and not bound to an individual user or mailbox - making this incredibly hard to reproduce. I've had this behaviour occur to once of my personal accounts yesterday; when I retried after X time it worked normally.

Logs or screenshots:
Argument 1 passed to MailSo\Imap\Folder::__construct() must be of the type string, array given, called in /var/www/webmail/rainloop/v/1.14.0-djmaze/app/libraries/MailSo/Imap/ResponseCollection.php on line 108

@h3artbl33d h3artbl33d changed the title PHP error: __construct() must be of the type string, array given Doesn't show mailbox, throws PHP error: __construct() must be of the type string, array given Aug 6, 2020
@the-djmaze
Copy link
Owner

This is indeed a strange bug which i couldn't reproduce.
To get more details, i've modified some code to log the issue.
Try it with this change 0d81b2c

Would also be nice to know which PHP version and which IMAP server is used.

2 similar comments
@the-djmaze
Copy link
Owner

This is indeed a strange bug which i couldn't reproduce.
To get more details, i've modified some code to log the issue.
Try it with this change 0d81b2c

Would also be nice to know which PHP version and which IMAP server is used.

@the-djmaze
Copy link
Owner

This is indeed a strange bug which i couldn't reproduce.
To get more details, i've modified some code to log the issue.
Try it with this change 0d81b2c

Would also be nice to know which PHP version and which IMAP server is used.

@h3artbl33d
Copy link
Author

Thank you for the reply! The server running Rainloop-djmaze is configured with PHP 7.4. Dovecot is being used for IMAP access. Before the switch (to this fork), the webmail server ran Rainloop (upstream) with PHP 7.2, which didn't throw this error. So, it might be either something in the fork or PHP 7.4 that causes this error.

I will throw in the commit tomorrow and get back with the resulting info :)

the-djmaze pushed a commit that referenced this issue Sep 9, 2020
@the-djmaze
Copy link
Owner

the-djmaze commented Sep 9, 2020

Problem was caused by square brackets because the IMAP response has no quotes around it.
The IMAP parser treats it like a list and makes it an array.

`sendRaw: TAG2 LSUB "" "*"
* LSUB (\Drafts) "." Drafts
* LSUB (\Sent) "." Sent
* LSUB (\Trash) "." Trash
* LSUB () "." INBOX
* LSUB () "." [gmail]
* LSUB () "." [brackets]
* LSUB () "." "{curly}"
* LSUB () "." "(round)"
* LSUB () "." "[mess](this){up}[cool]"
TAG2 OK Lsub completed (0.001 + 0.000 secs).

ResponseCollection::getFoldersResult: invalid string array (
0 => 'gmail',
)
ResponseCollection::getFoldersResult: invalid string array (
0 => 'brackets',
)`

the-djmaze pushed a commit that referenced this issue Nov 4, 2021
The RainLoop skipSquareBracketParse wasn't perfect either
the-djmaze pushed a commit that referenced this issue Mar 21, 2023
the-djmaze pushed a commit that referenced this issue Jun 18, 2023
add Nextcloud 27 compatibility
the-djmaze pushed a commit that referenced this issue Dec 26, 2023
the-djmaze pushed a commit that referenced this issue May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants