Skip to content

OutboxWorkerJob does not work with contact groups #11209

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

Open
AdminMgl opened this issue May 30, 2025 · 1 comment
Open

OutboxWorkerJob does not work with contact groups #11209

AdminMgl opened this issue May 30, 2025 · 1 comment
Assignees

Comments

@AdminMgl
Copy link

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.

@kesselb
Copy link
Contributor

kesselb commented May 30, 2025

Hi @AdminMgl,

Thank you very much 🙏

I can confirm that without a user session, just the system address book is available and the user's contact groups are unavailable.

Related code in server:

https://github.com/nextcloud/server/blob/35930a4331150d231be30fe05269ecfbd92d1f8d/apps/dav/lib/AppInfo/Application.php#L228-L235

Steps to reproduce:

  • Create a contacts group in contacts
  • Add Alice and Bob to the contacts group
  • Write an email and select the contacts group as recipient
  • Pick "Send later"
  • Trigger OutboxWorkerJob manually (e.g. by resetting the send_at column for the local message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants