Defect #24992
openMailHandler: an unexpected error occurred when receiving email: invalid byte sequence in UTF-8
0%
Description
Problem description¶
We have set RAILS_ENV
to development
for our email scraping, so we were fortunate enough to have this logged when we found that several emails had been rejected:
MailHandler: an unexpected error occurred when receiving email: invalid byte sequence in UTF-8 Message 190 can not be processed
The subject line of the email had this text:
Boletín de entomología venezolana.
Redmine installation info¶
# bin/about
# bundle list
I don't know what the fix actually is, but this Stackoverflow.com1 thread mentioned this:
The combination of using:
@file = IO.read(file).force_encoding("ISO-8859-1").encode("utf-8", replace: nil)
and#encoding: UTF-8
solved the issue.
I don't have Ruby knowledge, but I'll start digging through the code on my end to see if I can find where to make those changes. Please let me know if you need additional information.
1 http://stackoverflow.com/questions/9607554/ruby-invalid-byte-sequence-in-utf-8
Related issues