Html emails are shown in a tiny preview iframe even if there is a lot more space that the iframe could use
Steps to reproduce
- Deploy a new Nextcloud instance from scratch and perform preliminary configuration
- Install Mail app, it will install "Mail 5.10.3" (latest version)
- Open the app and configure a client
- Open an html mail from the inbox or any folder
Expected behavior
Correctly show the mail in an iframe utilizing entire available space
Actual behavior
Only a small portion of vertical available space is used for the iframe
Mail app version
5.10.3
Nextcloud version
33.0.5
Mailserver or service
Mailcow
Operating system
Linux 6.18.29+rpt-rpi-2712 aarch64
PHP engine version
8.4.22
Nextcloud memory caching
No response
Web server
Apache
Database
MariaDB 11.8.8
Additional info
I found out that this happens only on new instances configured from scratch with Nextcloud version 33.0.5 and Mail 5.10.3. I have another instance that was running "Mail 5.9.2" and after updating it, the problem isn't showing up (same client, same mail used for testing).
So, I think this has something to do with preliminary config files created installing latest mail version, that fixed #13028 .
Moreover, I think that something like this probably already happened in the past, see #3696 .
Browsers utilized:
- Safari 26.5 (21624.2.5.11.4) MacOS 26.5.1
- Firefox 152.0.1 (aarch64) MacOS 26.5.1
- Firefox 152.0.1 x86 Fedora KDE 44 rpm version
@xX-MrN0b0dy-Xx Thank you for reporting the issue.
I wasn't able to reproduce it. Could you please do the following to help me reproduce it:
- Share a mail that is displayed wrongly as
.eml. Either here or via email to[email protected] - Share what you have set under "Mail settings > General > Appearance > Show all messages in thread"
I can confirm this behavior. I testet it on 33.0.6 with mail version 5.10.4 / 5.10.5
@odzhychko
- Share what you have set under "Mail settings > General > Appearance > Show all messages in thread"
"Mail settings > General > Appearance > Show all messages in thread" is not influent, I tried both every time completely clearing browser cache.
Also "Mail settings > General > Layout" is not influent.
- Share a mail that is displayed wrongly as
.eml. Either here or via email to[email protected]
See the attached .eml mail that is one of the impacted ones, but actually I see that all mails are affected.
Also, to help trying to recreate the problem, I'll try to share as much info as possible, in the hope to be more helpful that annoyingly verbose. On top of issue description above with host detail, this is my compose:
name: nextcloud
services:
app:
image: &image nextcloud:33.0.5-apache
container_name: nextcloud
restart: unless-stopped
ports:
- 8888:80
depends_on:
- db
- cache
environment: &environment
TZ: Europe/Rome
PHP_UPLOAD_LIMIT: 2G
PHP_MEMORY_LIMIT: 1G
APACHE_BODY_LIMIT: 0
NEXTCLOUD_TRUSTED_DOMAINS: "${TRUSTED_DOMAINS}"
NEXTCLOUD_UPDATE: 0
NEXTCLOUD_INIT_HTACCESS: true
# db
MYSQL_HOST: db
MYSQL_DATABASE: "${DB_NAME}"
MYSQL_USER: "${DB_USER}"
MYSQL_PASSWORD: "${DB_PASSWORD}"
# cache w/ redis
REDIS_HOST: cache
REDIS_HOST_PORT: 6379
# mail sender
SMTP_HOST: "${MAIL_HOST}"
SMTP_SECURE: starttls
SMTP_PORT: 587
MAIL_FROM_ADDRESS: "${MAIL_FROM_ADDRESS}"
MAIL_DOMAIN: "${MAIL_DOMAIN}"
SMTP_NAME: "${MAIL_USERNAME}"
SMTP_PASSWORD: "${MAIL_PASSWORD}"
volumes: &volumes
- ./config:/var/www/html/config
- ./data/app/main_folder:/var/www/html
- ./data/app/user_data:/var/www/html/data
- ./data/app/custom_apps:/var/www/html/custom_apps
cron:
image: *image
container_name: nextcloud_cron
entrypoint: /cron.sh
restart: unless-stopped
depends_on:
- db
- cache
- app
environment: *environment
volumes: *volumes
db:
image: mariadb:11.8
container_name: nextcloud_db
restart: unless-stopped
expose:
- 3306
environment:
MARIADB_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
MARIADB_DATABASE: "${DB_NAME}"
MARIADB_USER: "${DB_USER}"
MARIADB_PASSWORD: "${DB_PASSWORD}"
volumes:
- ./data/db:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro #for Debian based images
cache:
image: redis:latest
container_name: nextcloud_cache
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
start_period: 20s
interval: 30s
retries: 5
timeout: 3s
restart: unless-stopped
expose:
- 6379
volumes:
- cache_data:/data
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro #for Debian based images
volumes:
cache_data:
And these are all the bash commands I run:
mkdir config data/{app,db} -p
sudo chown -R www-data:www-data data config
sudo docker compose up -d
After preliminary config, where installation of suggested apps is skipped, from inside container I run:
./occ app:install calendar
./occ app:install contacts
./occ app:install mail
./occ app:install tasks
./occ config:system:set default_phone_region --value="IT"
./occ config:system:set maintenance_window_start --type=integer --value=2
./occ db:add-missing-indices
I can't test a new test environment deploy right now, I'll do it during lunch time (CEST).
Edit: I tried to update my instance to "Mail 5.10.5", but nothing seems to be changed.
Also, to help trying to recreate the problem, I'll try to share as much info as possible, in the hope to be more helpful that annoyingly verbose. On top of issue description above with host detail, this is my compose:
Better verbose then not enough. Thx especially for the full env config, I will try it out and come back to you.
I tried to deploy on a x86 (Fedora 44 KDE) machine a new test instance following exactly my instructions, connecting to same mail client and ofc the mail version that has been installed is the lastest one (5.10.5). Surprisingly, the problem is not present anymore. Just to be extra sure, I also tried to setup a new instance from a raspberry pi5 similar to the one I use as main unit, with same kernel. Also there, problem is not present anymore (I am aware that mail is a PHP app or anyway arch agnostic, but I had that extra couple of minutes to test it and I did it).
Up to know, the facts I was able to gather are:
- If you have an old nextcloud instance with mail app version prior to 5.10 and you update to 5.10.x, you're good
- If you configure a brand new instance of nextcloud and install mail app with version >= 5.10.5, you're good
So, I have a question for @KOEWADO : is your instance almost new or anyway, did you installed mail app from scratch with version 5.10.3 or anyway after 5.10 and before 5.10.5?
If the answer is yes, we can add to the list of facts the following:
- If you configured an instance in the past few weeks and first version of the app was 5.10 < x < 5.10.5, the bug shows up
Main problem is that, as of now, I tried to uninstall mail app, clean cache, compose down and back up but after reinstalling a brand new version of mail the bug is still there... (I did not touch the database).
I also tried to update nextclout to latest 33.0.6, but this didn't fix it.
So, I have a question for @KOEWADO : is your instance almost new or anyway, did you installed mail app from scratch with version 5.10.3 or anyway after 5.10 and before 5.10.5?
Yes, i had install a prev version of the mail app (think it was 5.10.3) -> got this problem Update today to 5.10.5 -> always got this problem
Maybe some older files not included in update stays on the server
@KOEWADO @xX-MrN0b0dy-Xx Could you check check your browser console logs for this message: https://github.com/nextcloud/mail/issues/8941#issuecomment-3343564327
With Nextcloud 33.0.6 and Mail 5.10.5: When I open this mail it sizes it correctly, but I do get the following warning. I do not get this warning for other HTML mails. This indicates, that some issue with how we use https://iframe-resizer.com for some mails.
MessageHTMLBody.vue:123 The max-width CSS property is set to 100% on the <body> element via an inline style attribute. This may cause issues with the correct operation of iframe-resizer.
If you wish to restrict the size of the iframe, then you should set this property on the iframe element itself, not the content inside it.
So for now, I will follow this warning.
In the long term, it would be interesting to know why updating and installing the Mail app from scratch might make a difference.
- I'm considering the code in
- https://github.com/nextcloud/mail/commit/d74cf2dd7938df3842ed5e85609a37550d55a60b
- https://github.com/nextcloud/mail/blob/main/src/html-response.js
- and how it might not work as expected after updates because of
- client browser caching
- HTTP caching by web proxies (e.g, reverse proxies or company proxies)
- server code caching with OPcache
Nextcloud 34.0.1
Mail 5.10.7
@odzhychko something "strange" just happened to me. I wanted to update mail before doing the test. I updated from the Apps section via WebUI as always, but evth crashed and i have to restart the containers. After that, nextcloud started in mainteinance mode and i had to do an occ upgrade where nextcloud did something to db related to Mail app:
etting log level to debug
Updating database schema
Updated database
Updating <mail> ...
Restore default tags that are missing
Done
1/1 [============================] 100%
Purify and migrate collected mail addresses
Done
0/0 [------->--------------------] 0%
Insert background jobs for all accounts
Done
1/1 [============================] 100%
Updated <mail> to 5.10.7
Starting code integrity check...
Finished code integrity check
Update successful
Maintenance mode is kept active
Resetting log level
After this, everything works fine.
Regarding what u asked, when i open a mail, this is what appears on my console log (Firefox rpm version on Fedora 44 KDE) that I think it can easily be neglected:
iframe-resizer v5.5.9 (GPLv3) [mail.8613.b03776cabac484fd658b.js:2:15357](https://next.nowhere.ovh/custom_apps/mail/js/mail.8613.b03776cabac484fd658b.js)
iframeResizer(Parent) GPLv3 License Version
This version of iframe-resizer is being used under the terms of the GPL V3 license. This license allows you to use iframe-resizer in Open Source projects, but it requires your project to be public, provide attribution and be licensed under version 3 or later of the GNU General Public License.
If you are using this library in a non-open source project or website, you will need to purchase a low cost one time commercial license.
For more information visit https://iframe-resizer.com/pricing. [mail.8613.b03776cabac484fd658b.js:2:3565](https://next.nowhere.ovh/custom_apps/mail/js/mail.8613.b03776cabac484fd658b.js)
Content-Security-Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.
Hi there! It looks like this issue hasn’t seen much activity for a while and might need a bit more information to move forward. If we don’t hear back soon, we may close it to keep things organized. Thanks again for your contributions – we really appreciate it!
Hi there! It looks like this issue hasn’t seen much activity for a while and might need a bit more information to move forward. If we don’t hear back soon, we may close it to keep things organized. Thanks again for your contributions – we really appreciate it!
My bad on not following up on this. Because I can't reproduce it and it goes away after restarting (and does not reappear), I'm not going to look into it further for now and close it.
@xX-MrN0b0dy-Xx @KOEWADO @vooteleaer Still, thank you for all the input. It was helpful and might become relevant in the future. If the issues persists or reappears please let us know, then we can reopen this issue.