mail.body.decoded returning binary?

175 views
Skip to first unread message

ari gold

unread,
Nov 9, 2012, 11:23:50 PM11/9/12
to mail...@googlegroups.com
Hi there,

I have a simple script which is looking at an email sent via Apple Mail.  No text in the body of the email, just a picture attached.  Basically mail.body or mail.body.decoded is returning binary. The email is all ASCII.

Here's some of the email headers:

Content-Type: image/jpeg; x-unix-mode=0644; name="apollo16_earth_northamerica.jpeg"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=apollo16_earth_northamerica.jpeg
X-Mailer: Apple Mail (2.1283)

and here's my lil' script:

#! /usr/local/bin/ruby

require 'mail'

mail = Mail.read('emailsForDebugging/applemail_imagenotext_base64inline.eml')

mail.body.decoded

Any ideas?  I'm going to look through the source code but I thought I'd post here first to see if I'm just missing something simple.

Thanks..

ari gold

unread,
Nov 10, 2012, 3:20:32 AM11/10/12
to mail...@googlegroups.com
To answer my own question, this worked:

mail.body.raw_source

It was printing the converted picture - as if you did a "less picture.jpeg".

kashyap k

unread,
Nov 10, 2012, 2:24:54 AM11/10/12
to mail...@googlegroups.com
What exactly do you want to do? It think you forgot to ask that unless I'm missing something :)


--
Kashyap KMBC
Reply all
Reply to author
Forward
0 new messages