Does TMail support Nested Multipart Messages?


#1

Hi,

does anybody know if TMail supports nested multipart messages? I read
a
changelog that indicates this …
http://dev.rubyonrails.org/svn/rails/trunk/actionmailer/CHANGELOG, but I
haven’t been able to get it working so far.

Maybe I am doing something wrong here?

I attached the sample mail. Here is the code:

require File.dirname(FILE) + ‘/…/test_helper’

class TMailTest < Test::Unit::TestCase

def test_multiparts
assert raw = File.read(“sample”)
assert mail = TMail::Mail.parse (raw)
puts “body=!#{body_as_plain_text(mail)}!”
end

def body_as_plain_text(part)
body = ‘’
if part.multipart?
part.parts.each do |subpart|
if subpart.content_type == ‘text/plain’ and
subpart.content_disposition == ‘inline’
body << subpart.body
elsif subpart.content_type =~ /^multipart/
body << body_as_plain_text(subpart)
end
end
else
body = part.body
end
body
end
end

The output looks like this:

body=!Hi,

I have the following code:
@conversation_pages,
@conversations = paginate(:conversations,
:per_page => 20,
:joins => 'LEFT JOIN messages on
messages.conversation_id = conversations.id '+
‘LEFT JOIN email_addresses
on
email_addresses.id = messages.email_address_id’,
:conditions =>
['email_addresses.emai_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

!

So the message is broken off at some point that looks arbitrary to me.

Any idea?

Cheers,
Mariano