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

PHP message: PHP Notice: Undefined index: HIGHESTMODSEQ #149

Closed
m-i-k-e-y opened this issue Sep 25, 2021 · 1 comment
Closed

PHP message: PHP Notice: Undefined index: HIGHESTMODSEQ #149

m-i-k-e-y opened this issue Sep 25, 2021 · 1 comment

Comments

@m-i-k-e-y
Copy link

Describe the bug
I found the follwing error in the logfile of nginx:
2021/09/25 15:40:15 [error] 19392#19392: *45 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: HIGHESTMODSEQ in /var/www/snappymail/snappymail/v/2.7.1/app/libraries/MailSo/Mail/MailClient.php on line 584" while reading response header from upstream, client: [redacted], server: [redacted], request: "POST /?/Json/&q[]=/0/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: [redacted]

This does not appear with all mailservers that I sue snappymail with, just with GMX.

To Reproduce
Steps to reproduce the behavior:
I can reproduce this when I login with an account at gmx.net. Every time a switch the folder, the massage appears in the logs.

Expected behavior
Error should not appear in the logfile.

Desktop (please complete the following information):

  • Firefox 92.0.1 x64 on Windows 10 x64
  • SnappyMail Version 2.7.1

Additional context
I'm no expert for PHP, but in the method initFolderValues in MailClient.php this index is only conditionally assinged to aTypes array. However, after the aFolderStatus array is created based on the aTypes array, this index is always accessed in aFolderStatus.

@m-i-k-e-y
Copy link
Author

m-i-k-e-y commented Sep 25, 2021

I did some experimenting and changing this line in MailClient.php
$iHighestModSeq = (int) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::HIGHESTMODSEQ] ?? 0;
to this
if ($this->oImapClient->IsSupported('CONDSTORE'))
{
$iHighestModSeq = (int) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::HIGHESTMODSEQ] ?? 0;
}
else
{
$iHighestModSeq = 0;
}
resolves the issue. The error no longer appears in the logs. Tried with GMX, Gmail and Outlook.com accounts.

the-djmaze pushed a commit that referenced this issue Sep 27, 2021
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