nextcloud / nextcloud/server

Wrong URL (non-Pretty) in digest mail

Open
#51,176 12 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 32-feedback bug
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Steps to reproduce
  1. Configure Nextcloud to not use index.php (mod rewrite)
  2. Configure cron to run using cron jobs (not web!)
  3. Trigger any activity containing an link (e.g. calendar event modified or form shared)
  4. Wait for digest mail
Expected behaviour

Absolute URL used in email is using correct server address without the index.php.

Actual behaviour

Message contains the index.php.

Other

I checked everything - the URL generate correctly generates the link when used from the webui (e.g. in the notifications app).
But not when sending the digest mail.

I guess the problem is that a background job is sending it, the background job is called by the cron.php which is not using a real request thus the environment for removing the index.php (front_controller_active) is not set.
So when calling the Activity Provider within that context the generated URL will always include the index.php which - depending on the server configuration can be invalid and lead to 404 error.

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 tracing digest-mail generation from cron.php into the Activity Provider, then compare URL generation in that background-job context with the web UI path. Reproduce the configured non-Pretty-URL scenario and trigger a digest mail. Done means links in the digest use the configured server address without index.php.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.