Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] handle malformed multiplart messages
@ 2009-07-28 16:58 Kornilios Kourtis
  2009-09-04 15:53 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Kornilios Kourtis @ 2009-07-28 16:58 UTC (permalink / raw)


Hi,

I've tried to use sup-mail, but sup-sync blows up due to some malformed
messages I keep in my mailbox. Below is a quick patch that seems to fix the
above issue for me.

Thanks,

-- 
Kornilios Kourtis

diff --git a/lib/sup/message.rb b/lib/sup/message.rb
index ded577a..c6e6baf 100644
--- a/lib/sup/message.rb
+++ b/lib/sup/message.rb
@@ -385,11 +385,15 @@ private
 
       chunks
     elsif m.header.content_type == "message/rfc822"
-      payload = RMail::Parser.read(m.body)
-      from = payload.header.from.first
-      from_person = from ? Person.from_address(from.format) : nil
-      [Chunk::EnclosedMessage.new(from_person, payload.to_s)] +
-        message_to_chunks(payload, encrypted)
+      if m.body
+        payload = RMail::Parser.read(m.body)
+        from = payload.header.from.first
+        from_person = from ? Person.from_address(from.format) : nil
+        [Chunk::EnclosedMessage.new(from_person, payload.to_s)] +
+          message_to_chunks(payload, encrypted)
+       else
+        [Chunk::EnclosedMessage.new(nil, "")]
+       end
     else
       filename =
         ## first, paw through the headers looking for a filename



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [sup-talk] [PATCH] handle malformed multiplart messages
  2009-07-28 16:58 [sup-talk] [PATCH] handle malformed multiplart messages Kornilios Kourtis
@ 2009-09-04 15:53 ` William Morgan
  0 siblings, 0 replies; 2+ messages in thread
From: William Morgan @ 2009-09-04 15:53 UTC (permalink / raw)


Reformatted excerpts from Kornilios Kourtis's message of 2009-07-28:
> I've tried to use sup-mail, but sup-sync blows up due to some malformed
> messages I keep in my mailbox. Below is a quick patch that seems to fix the
> above issue for me.

Sorry for the delay. I think this is good. Applied. Thanks!
-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-04 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-28 16:58 [sup-talk] [PATCH] handle malformed multiplart messages Kornilios Kourtis
2009-09-04 15:53 ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox