Say, i have a raw mail message in a file and i read it like
m = Mail.read '/path/to/file'
it has attachments, one of which is an inline pic.
pic = m.attachments[0]
=> #<Mail::Part:70130030888740, Multipart: false, Headers: <Content-Type: image/png; name="image001.png">, <Content-Transfer-Encoding: base64>, <Content-ID: <image001.png@01D21F1C.E063ADE0>>>
others are just some files.
What i need is to have a way of knowing whether the attachment is inline or not. There is an inline?
method, and for non-inline attachments it works like a charm
pdf = m.attachments[1]
=> #<Mail::Part:70130031002140, Multipart: false, Headers: <Content-Type: application/pdf; name="blah blah blah blah
pdf.inline?
=> false
But let's return to our pic
here:
pic.inline?
=> nil
Which is just not right. I also tried
pdf['Content-Disposition']
=> #<Mail::Field 0x7f90d729b598 @charset="UTF-8" @name="Content-Disposition" @raw_value="Content-Disposition: attachment;\r\n\tfilename
and
pic['Content-Disposition']
=> nil
which is not too good either.
Is there any way to have a true/false value here?