nextcloud / nextcloud/mail

Repeated Undefined Array Key Error; Unread Message Count Correct, New/Unread Messages Not Displayed

Open
#10,581 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Steps to reproduce
  1. Manual config of NC Mail with AWS SES mail account
  2. Send and receive email
  3. Try to read emails in NC Mail
Expected behavior

Unread email count should be matched to actually displayed unread emails in NC Mail

Actual behavior

Unread email count on right sidebar next to Inbox folder is displayed correctly but no new emails received are actually displayed in the email Inbox. Force syncing and Repair Mailbox fail to remedy the situation. It seems that NC Mail knows there are new emails and can note which are unread but it is unable to actually display them in the inbox. Deleting the account and setting it up again fresh does allow the inbox to sync from scratch and display all emails correctly but after some time, displaying new emails fails again, making the inbox unuseable.

This is the specific logging error with repeated entries in the System Log whenever I attempt to use NC Mail:

[PHP] Error: Undefined array key "H" at /var/www/html/custom_apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Data/Sync.php#209
POST /apps/mail/api/mailboxes/8/sync
from 201.226.178.254 by rockyreidel at Jan 18, 2025, 4:33:31 PM

{"reqId":"8XNLw63GEUICMlJGjCmD","level":3,"time":"2025-01-18T21:33:31+00:00","remoteAddr":"201.226.178.254","user":"rockyreidel","app":"PHP","method":"POST","url":"/apps/mail/api/mailboxes/8/sync","message":"Undefined array key "H" at /var/www/html/custom_apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Data/Sync.php#209","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36","version":"30.0.4.1","data":{"app":"PHP"},"id":"678c1e4a2e019"}

Mail app version

4.1.1

Nextcloud version

30.0.4

Mailserver or service

AWS SES

Operating system

Linux 5.15.0-130-generic x86_64

PHP engine version

PHP 8.3

Nextcloud memory caching

No response

Web server

None

Database

None

Additional info

Using NC AIO/HUB 9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the AWS SES sync flow through POST /apps/mail/api/mailboxes/8/sync and inspect vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Data/Sync.php at line 209, where the undefined array key is logged. Done means the sync completes without repeated errors and newly received messages are displayed in the Inbox with an accurate unread count.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, php
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.