Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: cworth@cworth.org (Carl Worth)
Subject: [sup-talk] [PATCH] Fix message_to_chunks for the m.body == nil case.
Date: Thu, 17 Sep 2009 13:05:45 -0700	[thread overview]
Message-ID: <1253217341-sup-8631@yoom.home.cworth.org> (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



             reply	other threads:[~2009-09-17 20:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17 20:05 Carl Worth [this message]
2009-09-26 18:12 ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1253217341-sup-8631@yoom.home.cworth.org \
    --to=cworth@cworth.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox