From: wmorgan Date: Wed, 7 Nov 2007 20:19:04 +0000 (+0000) Subject: fix normalize_whitespace error where rubymail is breaking X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=6f420efa81de57beadb6f0e858d36d32f2c98323;p=sup fix normalize_whitespace error where rubymail is breaking git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@677 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/message.rb b/lib/sup/message.rb index a899165..5decdee 100644 --- a/lib/sup/message.rb +++ b/lib/sup/message.rb @@ -361,11 +361,11 @@ private end def self.convert_from body, charset - return body unless charset - begin + raise MessageFormatError, "RubyMail decode returned a null body" unless body + return body unless charset Iconv.iconv($encoding, charset, body).join - rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence => e + rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence, MessageFormatError => e Redwood::log "warning: error (#{e.class.name}) decoding message body from #{charset}: #{e.message}" File.open("sup-unable-to-decode.txt", "w") { |f| f.write body } body