Improved error handling of spam emails (also for html parts).
This commit is contained in:
parent
f3b9e612b0
commit
9f035fb7af
1 changed files with 1 additions and 1 deletions
|
@ -142,7 +142,7 @@ class Channel::EmailParser
|
||||||
data[:body] = Encode.conv( mail.html_part.charset.to_s, data[:body] )
|
data[:body] = Encode.conv( mail.html_part.charset.to_s, data[:body] )
|
||||||
data[:body] = data[:body].html2text.to_s.force_encoding('utf-8')
|
data[:body] = data[:body].html2text.to_s.force_encoding('utf-8')
|
||||||
|
|
||||||
if !data[:body].valid_encoding?
|
if !data[:body].force_encoding("UTF-8").valid_encoding?
|
||||||
data[:body] = data[:body].encode('utf-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '?')
|
data[:body] = data[:body].encode('utf-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '?')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue