nextcloud / nextcloud/mail

OutboxWorkerJob does not work with contact groups

Open
#11,209 1 comment 2 reactions 1 assignee View on GitHub

@kesselb is already working on this.

Since May 30, 2025.

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

Description

Steps to reproduce
  1. Create a contact group with at least one contact with an email address.
  2. Create an email in the Mail app to this contact group (To, CC, or BCC), send it, and wait (at least 10 seconds).
  3. Create another email as before, send it, and log out immediately (and close the tab or browser).
Expected behavior

Both emails should have been delivered in both cases (without an error message).

Actual behavior

The first email is sent.
The second email is not sent. It remains in the outbox. Ten minutes later, the following entry will appear in the Nextcloud log: “Could not send outbox message 1603: aTest1 (Contacts) has no members with email addresses.”

Mail app version

5.1.1 and all older since at least about 6 month

Nextcloud version

31.0.5 and all older since at least about 6 month

Mailserver or service

no matter

Operating system

no matter

PHP engine version

PHP 8.3

Nextcloud memory caching

memcache.local

Web server

Nginx

Database

MariaDB

Additional info

I traced the problem with Xdebug until I found the cause:
When attempting to open the address books, the user is queried from the session. There is no session and no user in the cron job, so ContactsManager does not return any contacts.
A distinction must be made between whether the services are running within an active session with a user or within the cron job. In the second case, the user must be actively set so that their address books can be loaded.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.