3 = Attachment handling file
10 class Attachment
< StringIO
11 attr_accessor
:original_filename, :content_type
16 multipart
? && parts
.any
? { |part
| attachment
?(part
) }
20 part
.disposition_is_attachment
? || part
.content_type_is_text
?
25 parts
.collect
{ |part
|
28 elsif attachment
?(part
)
29 content
= part
.body
# unquoted automatically by TMail#body
30 file_name
= (part
['content-location'] &&
31 part
['content-location'].body
) ||
32 part
.sub_header("content-type", "name") ||
33 part
.sub_header("content-disposition", "filename")
35 next if file_name
.blank
? || content
.blank
?
37 attachment
= Attachment
.new(content
)
38 attachment
.original_filename
= file_name
.strip
39 attachment
.content_type
= part
.content_type