Mail-app inflates and writes HUGE amount of html-text and email-contents into nextcloud.log

I run nextcloud mail 1.12.0 un Nextcloud 23.0.4 (stable).
When a user uses the mail app nextcloud.log gets seriously inflated; sometimes it gets rotated thrice in one day. I just checked with a new log and my own email-account:
after logging into nextcloud and looking at some files, pix contacts and appointments, the log had less than 30 lines (and almost no size), but after looking at one or two emails the log had almost 2000 (VERY LONG) lines and ~80 mb in size.
I noticed that lots of html-source from the emails (and most likely senstive email-content) are written into the logfile.
Debug or anything similar is not turned on in config.php.
What can i do to not write all this data and email-contetns into the nextcloud.log?
THX for your input!

Hi @pete.dawgg,
You are missing the required support template. Please fill this form out and edit into your post.

You can also check for this issue on the mail app repo. https://github.com/nextcloud/mail/issues

This will give us the technical info and logs needed to help you! Thanks.

Please open nextcloud.log and find a line with the html source. Then go backwards from the html source to the previous line and share the error / log message with us.

THX for your reply!

Nextcloud version Nextcloud Hub II (23.0.4) stable
Operating system and version Linux 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64
Apache or nginx version Server version: Apache/2.4.53 (Debian) Server built: 2022-03-14T16:28:35
PHP version: PHP 7.4.28 Zend Engine v3.4.0 with Zend OPcache v7.4.28

Issue& reproduceability stated in OP.

Nextcloud-log(s). too large to paste

config.php (all sensitive values deleted)

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '',
  ),
  'datadirectory' => '/home/nc/data',
  'overwrite.cli.url' => '',
  'dbtype' => 'mysql',
  'version' => '23.0.4.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'default_language' => 'de',
  'auth.bruteforce.protection.enable' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => '',
  'mail_smtphost' => '',
  'mail_smtpport' => '25',
  'maintenance' => false,
  'enable_previews' => true,
  'loglevel' => 2,
  'theme' => '',
  'app.mail.verify-tls-peer' => false,
  'mysql.utf8mb4' => true,
  'default_phone_region' => 'DE',
);

Admin-log; loglevel error:

[PHP] Fehler: Undefined property: DOMAttr::$value at /var/www/nc/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php#267

GET /index.php/apps/mail/api/messages/100152/html
from **.**.**.** by >USER> at 2022-05-11T11:23:46+00:00

THOUSANDS of these; only clicked on two different mails as user. nextcloud.log grew from 83 to 104MB doing this and has been rotated while i’m writing this.

Github-issues has nothing related to htmlpurifier in my case

@kesselb
there are no relevant previous lines, i fear:
this is from the just-rotated log:

wc -l  /home/nc/data/nextcloud.log.1 
1782 /home/nc/data/nextcloud.log.1

grep -iE "error|mail" /home/nc/data/nextcloud.log.1 | wc -l
1780
grep -viE "error|mail" /home/nc/data/nextcloud.log.1 | wc -l
2

One message ist about the log being rotated because it’s too big; the other is: "app":"core","method":"GET","url":"/index.php/core/preview?fileId=1475959&x=32&y=32","message":"OC_Image::fixOrientation(): No image loaded","

And the same thing repeats over and over with the freshly created new nextcloud.log.
And i can read the emails’ contents from the html written to nextcloud.log.

Hmm. I guess to debug it properly we need the message source of one those emails. Are you able to provide them?

OK. I opened the email that this forum-software sent with your reply (clicked on it once inside the mail-app); here is one of the lines it wrote into nextcloud.log 137 times:
{"reqId":"JhKF2fgdA9O6YGlV6zkz","level":3,"time":"2022-05-11T14:39:52+00:00","remoteAddr":"X.X.X.X","user":"XXX","app":"PHP","method":"GET","url":"/index.php/apps/mail/api/messages/100170/html","message":"Undefined property: DOMAttr::$value at /var/www/nc/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php#267","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0","version":"23.0.4.1","exception":{"Exception":"Error","Message":"Undefined property: DOMAttr::$value at /var/www/nc/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php#267","Code":0,"Trace":[{"file":"/var/www/nc/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php","line":267,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[8,"Undefined property: DOMAttr::$value","/var/www/nc/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php",267,{"node_map":{"__class__":"DOMNamedNodeMap"},"array":[],"attr":{"__class__":"DOMAttr"}}]},{"file":"/var/www/nc/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php","line":222,"function":"transformAttrToAssoc","class":"HTMLPurifier_Lexer_DOMLex","type":"->","args":[{"__class__":"DOMNamedNodeMap"}]},{"file":"/var/www/nc/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php","line":118,"function":"createStartNode","class":"HTMLPurifier_Lexer_DOMLex","type":"->","args":[{"__class__":"DOMElement"},[{"__class__":"HTMLPurifier_Token_Text","name":"#PCDATA","data":"\n \n\n \n \n ","is_whitespace":true,"line":null,"col":null,"armor":[],"skip":null,"rewind":null,"carryover":null},{"__class__":"HTMLPurifier_Token_Start","is_tag":true,"name":"div","attr":[],"line":null,"col":null,"armor":[],"skip":null,"rewind":null,"carryover":null},{"__class__":"HTMLPurifier_Token_Text","name":"#PCDATA","data":"\n\n ","is_whitespace":true,"line":null,"col":null,"armor":[],"skip":null,"rewind":null,"carryover":null},{"__class__":"HTMLPurifier_Token_Empty","is_tag":true,"name":"div","attr":[],"line":null,"col":null,"armor":[],"skip":null,"rewind":null,"carryover":null},{"__class__":"HTMLPurifier_Token_Text","name":"#PCDATA","data":"\n\n ","is_whitespace":true,"line":null,"col":null,"armor":[],"skip":null,"rewind":null,"carryover":null},"And 77 more entries, set log level to debug to see all entries"],true,{"__class__":"HTMLPurifier_Config","version":"4.14.0","autoFinalize":true,"def":{"__class__":"HTMLPurifier_ConfigSchema","defaults":{"Attr.AllowedClasses":null,"Attr.AllowedFrameTargets":[],"Attr.AllowedRel":[],"Attr.AllowedRev":[],"Attr.ClassUseCDATA":null,"0":"And 122 more entries, set log level to debug to see all entries"},"defaultPlist":{"__class__":"HTMLPurifier_PropertyList"},"info":{"Attr.AllowedClasses":-8,"Attr.AllowedFrameTargets":8,"Attr.AllowedRel":8,"Attr.AllowedRev":8,"Attr.ClassUseCDATA":-7,"0":"And 135 more entries, set log level to debug to see all entries"}},"chatty":true}]},{"file":"/var/www/nc/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php","line":90,"function":"tokenizeDOM","class":"HTMLPurifier_Lexer_DOMLex","type":"->","args":[{"__class__":"DOMElement"},[{"__class__":"HTMLPurifier_Token_Text","name":"#PCDATA","data":"\n \n\n \n \n ","is_whitespace":true,"line":null,"col":null,"armor":[],"skip":null,"rewind":null,"carryover":null},{"__class__":"HTMLPurifier_Token_Start","is_tag":true,"name":"div","attr":[],"line":null,"col":null,"armor":[],"skip":null,"rewind":null,"carryover":null},{"__class__":"HTMLPurifier_Token_Text","name":"#PCDATA","data":"\n\n ","is_whitespace":true,"line":null,"col":null,"armor":[],"skip":null,"rewind":null,"carryover":null},{"__class__":"HTMLPurifier_Token_Empty","is_tag":true,"name":"div","attr":[],"line":null,"col":null,"armor":[],"skip":null,"rewind":null,"carryover":null},{"__class__":"HTMLPurifier_Token_Text","name":"#PCDATA","data":"\n\n ","is_whitespace":true,"line":null,"col":null,"armor":[],"skip":null,"rewind":null,"carryover":null},"And 77 more entries, set log level to debug to see all entries"],{"__class__":"HTMLPurifier_Config","version":"4.14.0","autoFinalize":true,"def":{"__class__":"HTMLPurifier_ConfigSchema","defaults":{"Attr.AllowedClasses":null,"Attr.AllowedFrameTargets":[],"Attr.AllowedRel":[],"Attr.AllowedRev":[],"Attr.ClassUseCDATA":null,"0":"And 122 more entries, set log level to debug to see all entries"},"defaultPlist":{"__class__":"HTMLPurifier_PropertyList"},"info":{"Attr.AllowedClasses":-8,"Attr.AllowedFrameTargets":8,"Attr.AllowedRel":8,"Attr.AllowedRev":8,"Attr.ClassUseCDATA":-7,"0":"And 135 more entries, set log level to debug to see all entries"}},"chatty":true}]},{"file":"/var/www/nc/apps/mail/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php","line":213,"function":"tokenizeHTML","class":"HTMLPurifier_Lexer_DOMLex","type":"->","args":["<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" ><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head><body><div>\n \n\n \n \n <div>\n\n <div></div>\n\n <div style=\"margin-bottom:25px;\">\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n <tbody><tr>\n <td style=\"vertical-align:top;width:55px;\">\n <img src=\"https://help.nextcloud.com/user_avatar/help.nextcloud.com/kesselb/45/14708_2.png\" title=\"kesselb\" width=\"45\" height=\"45\">\n </td>\n <td>\n <a href=\"https://help.nextcloud.com/u/kesselb\" target=\"_blank\" style=\"color:#006699;; font-size:13px;font-family:'lucida grande',tahoma,verdana,arial,sans-serif;text-decoration:none;font-weight:bold; text-decoration: none; font-weight: bold; color: #006699;\">kesselb</a>\n <br>\n <span style=\"text-align:right;color:#999999;padding-right:5px;font-family:'lucida grande',tahoma,verdana,arial,sans-serif;font-size:11px\">May 11</span>\n </td>\n </tr>\n </tbody></table>\n <div style=\"padding-top:5px;\"><p style=\"margin-top:0; border: 0;\">Hmm. I guess to debug it properly we need the message source of one those emails. Are you able to provide them?</p></div>\n</div>\n\n\n\n\n\n\n <div style=\"color:#666;\"><hr style=\"background-color: #ddd; height: 1px; border: 1px;; background-color: #ddd; height: 1px; border: 1px;\">\n<p><a href=\"https://help.nextcloud.com/t/mail-app-inflates-and-writes-huge-amount-of-html-text-and-email-contents-into-nextcloud-log/138857/5\" style=\"font-weight: normal;; text-decoration: none; font-weight: bold; color: #006699;; background-color: #2F70AC; color: #FFFFFF; border-top: 4px solid #2F70AC; border-right: 6px solid #2F70AC; border-bottom: 4px solid #2F70AC; border-left: 6px solid #2F70AC; display: inline-block; font-weight: bold;\">Rufe das Thema auf</a> oder antworte auf diese E-Mail, um zu antworten.</p></div>\n <div style=\"color:#666;\"><p>Um diese E-Mails abzubestellen, <a href=\"https://help.nextcloud.com/email/unsubscribe/aec1bf1ffff4a45a7b96fe1012e8cbe15367b00253ab9986fc2cc49ae3c147db\" style=\"text-decoration: none; font-weight: bold; color: #006699;; color:#666;\">klicke hier</a>.</p></div>\n\n</div>\n\n<div itemscope=\"\" itemtype=\"http://schema.org/EmailMessage\" style=\"display:none\">\n <div itemprop=\"action\" itemscope=\"\" itemtype=\"http://schema.org/ViewAction\">\n <link itemprop=\"url\" href=\"https://help.nextcloud.com/t/mail-app-inflates-and-writes-huge-amount-of-html-text-and-email-contents-into-nextcloud-log/138857/5\">\n <meta itemprop=\"name\" content=\"Read full topic\">\n </div>\n</div>\n\n\n\n <!-- prevent Gmail on iOS font size manipulation -->\n <div style=\"\n display: none;\n white-space: nowrap;\n font: 15px courier;\n line-height: 0;\n \">\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n </div>\n \n \n\n</div></body></html>",{"__class__":"HTMLPurifier_Config","version":"4.14.0","autoFinalize":true,"def":{"__class__":"HTMLPurifier_ConfigSchema","defaults":{"Attr.AllowedClasses":null,"Attr.AllowedFrameTargets":[],"Attr.AllowedRel":[],"Attr.AllowedRev":[],"Attr.ClassUseCDATA":null,"0":"And 122 more entries, set log level to debug to see all entries"},"defaultPlist":{"__class__":"HTMLPurifier_PropertyList"},"info":{"Attr.AllowedClasses":-8,"Attr.AllowedFrameTargets":8,"Attr.AllowedRel":8,"Attr.AllowedRev":8,"Attr.ClassUseCDATA":-7,"0":"And 135 more entries, set log level to debug to see all entries"}},"chatty":true},{"__class__":"HTMLPurifier_Context"}]},{"file":"/var/www/nc/apps/mail/lib/Service/Html.php","line":159,"function":"purify","class":"HTMLPurifier","type":"->","args":["<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\"><head>\r\n <meta http-equiv=\"Content-type\" name=\"viewport\" content=\"initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width\">\r\n \r\n <!-- prevent ios zooming + autoscaling -->\r\n <meta name=\"x-apple-disable-message-reformatting\">\r\n <title></title>\r\n </head>\r\n\r\n <body style=\"line-height: 1.4; text-align:left;\" dir=\"ltr\">\r\n <!--[if mso]>\r\n \r\n <![endif]-->\r\n\r\n \r\n \r\n <div>\r\n\r\n <div></div>\r\n\r\n <div style=\"margin-bottom:25px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\r\n <tbody><tr>\r\n <td style=\"vertical-align:top;width:55px;\">\r\n <img src=\"https://help.nextcloud.com/user_avatar/help.nextcloud.com/kesselb/45/14708_2.png\" title=\"kesselb\" width=\"45\" height=\"45\">\r\n </td>\r\n <td>\r\n <a href=\"https://help.nextcloud.com/u/kesselb\" target=\"_blank\" style=\"color:#006699;; font-size:13px;font-family:'lucida grande',tahoma,verdana,arial,sans-serif;text-decoration:none;font-weight:bold; text-decoration: none; font-weight: bold; color: #006699;\">kesselb</a>\r\n <br>\r\n <span style=\"text-align:right;color:#999999;padding-right:5px;font-family:'lucida grande',tahoma,verdana,arial,sans-serif;font-size:11px\">May 11</span>\r\n </td>\r\n </tr>\r\n </tbody></table>\r\n <div style=\"padding-top:5px;\"><p style=\"margin-top:0; border: 0;\">Hmm. I guess to debug it properly we need the message source of one those emails. Are you able to provide them?</p></div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n <div style=\"color:#666;\"><hr style=\"background-color: #ddd; height: 1px; border: 1px;; background-color: #ddd; height: 1px; border: 1px;\">\r\n<p><a href=\"https://help.nextcloud.com/t/mail-app-inflates-and-writes-huge-amount-of-html-text-and-email-contents-into-nextcloud-log/138857/5\" style=\"font-weight: normal;; text-decoration: none; font-weight: bold; color: #006699;; background-color: #2F70AC; color: #FFFFFF; border-top: 4px solid #2F70AC; border-right: 6px solid #2F70AC; border-bottom: 4px solid #2F70AC; border-left: 6px solid #2F70AC; display: inline-block; font-weight: bold;\">Rufe das Thema auf</a> oder antworte auf diese E-Mail, um zu antworten.</p></div>\r\n <div style=\"color:#666;\"><p>Um diese E-Mails abzubestellen, <a href=\"https://help.nextcloud.com/email/unsubscribe/aec1bf1ffff4a45a7b96fe1012e8cbe15367b00253ab9986fc2cc49ae3c147db\" style=\"text-decoration: none; font-weight: bold; color: #006699;; color:#666;\">klicke hier</a>.</p></div>\r\n\r\n</div>\r\n\r\n<div itemscope=\"\" itemtype=\"http://schema.org/EmailMessage\" style=\"display:none\">\r\n <div itemprop=\"action\" itemscope=\"\" itemtype=\"http://schema.org/ViewAction\">\r\n <link itemprop=\"url\" href=\"https://help.nextcloud.com/t/mail-app-inflates-and-writes-huge-amount-of-html-text-and-email-contents-into-nextcloud-log/138857/5\">\r\n <meta itemprop=\"name\" content=\"Read full topic\">\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n <!-- prevent Gmail on iOS font size manipulation -->\r\n <div style=\"\r\n display: none;\r\n white-space: nowrap;\r\n font: 15px courier;\r\n line-height: 0;\r\n \">\r\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\r\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\r\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\r\n </div>\r\n \r\n \r\n\r\n</body></html><br><br>"]},{"file":"/var/www/nc/apps/mail/lib/Model/IMAPMessage.php","line":529,"function":"sanitizeHtmlMailBody","class":"OCA\\Mail\\Service\\Html","type":"->","args":["<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\"><head>\r\n <meta http-equiv=\"Content-type\" name=\"viewport\" content=\"initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width\">\r\n \r\n <!-- prevent ios zooming + autoscaling -->\r\n <meta name=\"x-apple-disable-message-reformatting\">\r\n <title></title>\r\n </head>\r\n\r\n <body style=\"line-height: 1.4; text-align:left;\" dir=\"ltr\">\r\n <!--[if mso]>\r\n <style type=\"text/css\">\r\n body,\r\n table,\r\n td,\r\n th,\r\n h1,\r\n h2,\r\n h3 {\r\n font-family: Arial, sans-serif !important;\r\n }\r\n </style>\r\n <![endif]-->\r\n\r\n \r\n \r\n <div>\r\n\r\n <div></div>\r\n\r\n <div style=\"margin-bottom:25px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\r\n <tbody><tr>\r\n <td style=\"vertical-align:top;width:55px;\">\r\n <img src=\"https://help.nextcloud.com/user_avatar/help.nextcloud.com/kesselb/45/14708_2.png\" title=\"kesselb\" width=\"45\" height=\"45\">\r\n </td>\r\n <td>\r\n <a href=\"https://help.nextcloud.com/u/kesselb\" target=\"_blank\" style=\"color:#006699;; font-size:13px;font-family:'lucida grande',tahoma,verdana,arial,sans-serif;text-decoration:none;font-weight:bold; text-decoration: none; font-weight: bold; color: #006699;\">kesselb</a>\r\n <br>\r\n <span style=\"text-align:right;color:#999999;padding-right:5px;font-family:'lucida grande',tahoma,verdana,arial,sans-serif;font-size:11px\">May 11</span>\r\n </td>\r\n </tr>\r\n </tbody></table>\r\n <div style=\"padding-top:5px;\"><p style=\"margin-top:0; border: 0;\">Hmm. I guess to debug it properly we need the message source of one those emails. Are you able to provide them?</p></div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n <div style=\"color:#666;\"><hr style=\"background-color: #ddd; height: 1px; border: 1px;; background-color: #ddd; height: 1px; border: 1px;\">\r\n<p><a href=\"https://help.nextcloud.com/t/mail-app-inflates-and-writes-huge-amount-of-html-text-and-email-contents-into-nextcloud-log/138857/5\" style=\"font-weight: normal;; text-decoration: none; font-weight: bold; color: #006699;; background-color: #2F70AC; color: #FFFFFF; border-top: 4px solid #2F70AC; border-right: 6px solid #2F70AC; border-bottom: 4px solid #2F70AC; border-left: 6px solid #2F70AC; display: inline-block; font-weight: bold;\">Rufe das Thema auf</a> oder antworte auf diese E-Mail, um zu antworten.</p></div>\r\n <div style=\"color:#666;\"><p>Um diese E-Mails abzubestellen, <a href=\"https://help.nextcloud.com/email/unsubscribe/aec1bf1ffff4a45a7b96fe1012e8cbe15367b00253ab9986fc2cc49ae3c147db\" style=\"text-decoration: none; font-weight: bold; color: #006699;; color:#666;\">klicke hier</a>.</p></div>\r\n\r\n</div>\r\n\r\n<div itemscope=\"\" itemtype=\"http://schema.org/EmailMessage\" style=\"display:none\">\r\n <div itemprop=\"action\" itemscope=\"\" itemtype=\"http://schema.org/ViewAction\">\r\n <link itemprop=\"url\" href=\"https://help.nextcloud.com/t/mail-app-inflates-and-writes-huge-amount-of-html-text-and-email-contents-into-nextcloud-log/138857/5\">\r\n <meta itemprop=\"name\" content=\"Read full topic\">\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n <!-- prevent Gmail on iOS font size manipulation -->\r\n <div style=\"\r\n display: none;\r\n white-space: nowrap;\r\n font: 15px courier;\r\n line-height: 0;\r\n \">\r\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\r\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\r\n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\r\n </div>\r\n \r\n \r\n\r\n</body></html><br><br>",{"id":100170},{"__class__":"Closure"}]},{"file":"/var/www/nc/apps/mail/lib/Controller/MessagesController.php","line":470,"function":"getHtmlBody","class":"OCA\\Mail\\Model\\IMAPMessage","type":"->","args":[100170]},{"file":"/var/www/nc/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getHtmlBody","class":"OCA\\Mail\\Controller\\MessagesController","type":"->","args":[100170,false]},{"file":"/var/www/nc/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Mail\\Controller\\MessagesController"},"getHtmlBody"]},{"file":"/var/www/nc/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Mail\\Controller\\MessagesController"},"getHtmlBody"]},{"file":"/var/www/nc/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Mail\\Controller\\MessagesController","getHtmlBody",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"id":"100170","_route":"mail.messages.getHtmlBody"}]},{"file":"/var/www/nc/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/mail/api/messages/100170/html"]},{"file":"/var/www/nc/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/nc/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}

I uploaded the slightly redacted version on this whole raw mail here (expires in seven days)
THX & happy debuggin’ :wink:

Thanks :+1:

I’m not able to reproduce it locally :frowning:

set log level to debug to see all entries

Is it possible that xdebug is enabled on your server?

Does each of those Mail log lines contain this error?

nextcloud.log has grown to 720MB since last night (and been rotated to nextcloud.log.1)

YES - i’d say, (almost: 3716 of 3720 lines)) every line contains this:

 wc -l /home/nc/data/nextcloud.log.1 
3720 /home/nc/data/nextcloud.log.1
grep -i mail  /home/nc/data/nextcloud.log.1 | grep -i error | grep "HTMLPurifier" | wc -l
3716

should i do a more precise check? Searching for longer strings is possible but the log is really large and every line contains the whole html-body of one email.
I manually searched thru a fresh log and i’d say yes, this whole string is conained in every line in question.
anything else i can do/check?

THX for checking!

it’s not IMpossible but i’ve never used or enabled it consciously.

Well that is good because it indicates a single bug that happens a lot of times. We can look into that.

I have filed this as a bug: Undefined property: DOMAttr::$value · Issue #6426 · nextcloud/mail · GitHub

THX!
Small status update: i just upgraded to nextcloud-24.0.1 and Mail 1.12.0 (latest stable) but the problems persists unchanged.

The bug report is still open.

Could you tail -f your logs and see if it’s a specific email that generates those logs when you open the mail?

it’s definitely only html-emails, but all of them. when i click on a plaintext and an html-email alternately in a browser-window, nothing happens when the plaintext-email is selected.
i thought that maybe after i clicked on one html-email it might be “cached” or sth. so that it is not completelx written into the log again when i click on it again in the same session, but i rather think this is not the case. the amount of data witten into the log is so massive that there are also extreme delays when tailing the log(s). i was logged into the server via ssh and after i had finished the (web)session and closed the browser the log i was still tailing grew for one or two more minutes.
Please let me know if i can do anything else - the next two weeks i will mainly be offline and w/out any computers.
cheers, p

According to Undefined property: DOMAttr::$name · Issue #291 · ezyang/htmlpurifier · GitHub this could be an issue with your php dom/xml extension or libxml

Thx for your reply. I’ve been installing all updates and hoping but the problem persists.
The github link states:

Ensure ext-dom / ext-xml is correctly loaded, no configuration warnings, and a modern version of libxml2 is used.

The system is an up-to-date Debian Bullseye and the pkgs have been installed for a long time:

apt-get -sf install libxml2 php7.4-xml
(...)
libxml2 is already the newest version (2.9.10+dfsg-6.7+deb11u2).
libxml2 set to manually installed.
php7.4-xml is already the newest version (7.4.30-1+deb11u1).
php7.4-xml set to manually installed.

Should/could anything be changed in the php-module-config /etc/php/7.4/mods-available/xml.ini ?
The mail-app is basically unusable right now - even (accidentally) clicking on an html-email keeps writing into the log for at least five minutes after the user logs out.

is there maybe some lightweight, html-free mailing-app for nextcloud? (using html in email was a very bad idea fron the start anyway).

I there any chance of fixing this? It seems to have got worse - i’m on Nextcloud 25.0.4.1 with an up-to-date Debian Bullseye-system and just clicking on ONE (small) html-email inflated the log to 770 MB and kept writing to it for about six minutes after the user logged out of nc.

THIS problem was never solved but the issue can be closed since it “disappeared” in the latest Nextcloud/PHP-Upgrade (26/8)