Rejected mails are unreadable

I got it. The part of a Mail has the correct charset information but somehow its body doesn’t get it and treat the bytes as ASCII-8BIT.

sed -i 's/part.body.decoded/part.body.decoded.force_encoding(part.charset || "utf-8")/' /var/www/discourse/lib/email/cleaner.rb
1 Like