We now force the body encoding to UTF-8
With badly encoded message, an error was being thrown:
Encoding::CompatibilityError: incompatible character encodings: UTF-8
and ASCII-8BIT
The problem occurred when:
- The server returned a badly encoded email message,
- there were non-ASCII characters in the 'From' line
- there were non-ASCII characters in other parts of the message.
In this case, the 'mail' gem force encoded the 'From' line as UTF-8,
but the body was still be "ASCII-8BIT". Without non-ASCII characters,
the 'From' line got coerced to the same encoding as the body,
but when both parts had non-ASCII characters, the error was thrown.
Now, we force the body to UTF-8 before uniting it tieh the 'From' line.