Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Fix message_to_chunks for the m.body == nil case.
@ 2009-09-17 20:05 Carl Worth
  2009-09-26 18:12 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Carl Worth @ 2009-09-17 20:05 UTC (permalink / raw)


The code was previously broken in calling EnclosedMessage.new with
only 2 instead of 5 arguments.
---

A friend of mine couldn't import his mail into sup due to the crash
fixed by this patch. It looks like the message he had that was causing
this infrequently-used (and obviously broken) code to be executed had
some mime pieces corrupted.

The message consisted of several mime-attached messages looking like:

	--==_Exmh_5062123120
	Content-Type: message/rfc822 ; name="5714"
	Content-Description: 5714
	Content-Disposition: attachment; filename="5714"
	
	Return-path: <omitted>
	...

but one part was missing the mime searpate and Content-Type and
instead just looked like:

	Content-Description: 5692
	Content-Disposition: attachment; filename="5692"

	Return-path: <omitted>
	...

I tried fixing this first by adding several more empty-string
arguments, that is:

	[Chunk::EnclosedMessage.new(nil, "", "", "", "")]

but that ended up causing this exception instead:

	./lib/sup/message-chunks.rb:212:in `initialize': undefined
	method `full_adress' for nil:NilClass (NoMethodError)

So I'm not 100% sure that this patch is correct, but it does allow
sup-sync to proceed and the message appears in sup as well as could be
expected, (the "extra" headers from the corrupted mime part appear in
the body as one might expect here).

-Carl

 lib/sup/message.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/message.rb b/lib/sup/message.rb
index afa8f00..579c1e5 100644
--- a/lib/sup/message.rb
+++ b/lib/sup/message.rb
@@ -453,7 +453,7 @@ private
         cc_people = cc ? Person.from_address_list(cc) : nil
         [Chunk::EnclosedMessage.new(from_person, to_people, cc_people, msgdate, subj)] + message_to_chunks(payload, encrypted)
       else
-        [Chunk::EnclosedMessage.new(nil, "")]
+        []
       end
     else
       filename =
-- 
1.6.4.3



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

end of thread, other threads:[~2009-09-26 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-17 20:05 [sup-talk] [PATCH] Fix message_to_chunks for the m.body == nil case Carl Worth
2009-09-26 18:12 ` William Morgan

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