Steps to reproduce
Steps to reproduce
Req.: richdocuments must be enabled (Nextcloud Office with collabora Code in my setup)
- Open a message with a PDF (or other Viewer-handled) attachment.
- Click the attachment to preview it; Viewer hands off to Nextcloud Office (richdocuments).
- Request fails with "Failed to generate token for file".
Server log shows
PROPFIND /remote.php/dav/files/https%3A//cloud.example.com/apps/mail/api/messages/188882/attachment/2/
The username and the attachment's absolute download URL are concatenated with no separator → first path segment parsed as principal <user>https: → "Principal not
found".
Probable Root cause ??
src/mixins/AttachementMixin.js lines 8–18 build a fileInfo for OCA.Viewer.open() where:
source and filename are set to attachment.downloadUrl, which is an absolute URL produced by IURLGenerator::linkToRouteAbsolute() in
lib/Service/Attachment/AttachmentService.php:318 and lib/Controller/MessagesController.php:1075.
fileid is set to the (non-DAV) attachment id.
Viewer + richdocuments then construct a DAV URL roughly as /remote.php/dav/files/${uid}${source}, producing the malformed path above. Mail attachments are not real
files under the user root, so handing them to richdocuments cannot succeed.
Expected behavior
PDF/image/video attachments preview inline via Viewer's built-in handlers (plain GET on source); richdocuments is not invoked for mail attachments.
Actual behavior
opens a Window which says "Loading 2 ...", but it never loads.
Mail app version
5.8.1
Nextcloud version
33.0.3
Mailserver or service
Dovecot
Operating system
Arch
PHP engine version
None
Nextcloud memory caching
Redis
Web server
Nginx
Database
MariaDB
Additional info
- Collabora Online: 25.04.9.4
- Browser: any (reproducible in Chromium and Firefox)
Steps to reproduce
Steps to reproduce
Req.: richdocuments must be enabled (Nextcloud Office with collabora Code in my setup)
Server log shows
PROPFIND /remote.php/dav/files/https%3A//cloud.example.com/apps/mail/api/messages/188882/attachment/2/
The username and the attachment's absolute download URL are concatenated with no separator → first path segment parsed as principal
<user>https:→ "Principal notfound".
Probable Root cause ??
src/mixins/AttachementMixin.jslines 8–18 build afileInfoforOCA.Viewer.open()where:sourceandfilenameare set toattachment.downloadUrl, which is an absolute URL produced byIURLGenerator::linkToRouteAbsolute()inlib/Service/Attachment/AttachmentService.php:318andlib/Controller/MessagesController.php:1075.fileidis set to the (non-DAV) attachment id.Viewer + richdocuments then construct a DAV URL roughly as
/remote.php/dav/files/${uid}${source}, producing the malformed path above. Mail attachments are not realfiles under the user root, so handing them to richdocuments cannot succeed.
Expected behavior
PDF/image/video attachments preview inline via Viewer's built-in handlers (plain GET on
source); richdocuments is not invoked for mail attachments.Actual behavior
opens a Window which says "Loading 2 ...", but it never loads.
Mail app version
5.8.1
Nextcloud version
33.0.3
Mailserver or service
Dovecot
Operating system
Arch
PHP engine version
None
Nextcloud memory caching
Redis
Web server
Nginx
Database
MariaDB
Additional info