Our server was under heavy load, and HTML processing failed for an hour. All tickets and answers during this time now shows on the web interface with message “This message cannot be displayed due to HTML processing issues. Download the raw message below and open it via an Email client if you still wish to view it.”
Is it possible to re-run the HTML processing on all those items ?
(btw the root cause of the heavy load had been adressed)
yes this is technically possible, however, please note that this is a potential ressource expensive operation which you may want to run within a maintenance window or out side of your usual business hours.
Dangerzone™
Run the rollowing within a rails console (zammad run rails c):
affected = Ticket::Article.where("body LIKE '%This message cannot be displayed due to HTML processing issues.%'")
affected.each {|article|
parsed = Channel::EmailParser.new.parse(article.as_raw.content)
# comment out if you don't want to see outputs
p parsed[:body]
# uncomment AFTER dry run
# article.update!(body: parsed[:body])
}
puts "#{affected.count} articles are affected."
Above script by default runs “dry” without updating. Comments hint on what to do.
It worked like a charm on incoming tickets from customers. Two agents replies were not processed correctly, but when I look as_raw.content, there is the same message with some HTML formatting.
I believe it was during the HTML generation of the reply that it generated an error and has been saved as such in raw content.