ignore Mail::Field::IncompleteParseError errors when mail gem can't parse header

This commit is contained in:
Charlie Smurthwaite
2019-07-17 14:37:21 +01:00
parent 2c8a0e19ad
commit 34e5085c37
+2
View File
@@ -329,6 +329,8 @@ module Postal
mail.header.fields.each_with_object({}) do |field, hash| mail.header.fields.each_with_object({}) do |field, hash|
hash[field.name.downcase] ||= [] hash[field.name.downcase] ||= []
hash[field.name.downcase] << field.decoded hash[field.name.downcase] << field.decoded
rescue Mail::Field::IncompleteParseError
# Never mind, move on to the next header
end end
end end
end end