Feature #3413 » mail_handler_ignore_inline_attachments_patch.diff
| app/models/mail_handler.rb | ||
|---|---|---|
|
def add_attachments(obj)
|
||
|
if email.attachments && email.attachments.any?
|
||
|
email.attachments.each do |attachment|
|
||
|
obj.attachments << Attachment.create(:container => obj,
|
||
|
:file => attachment.decoded,
|
||
|
:filename => attachment.filename,
|
||
|
:author => user,
|
||
|
:content_type => attachment.mime_type)
|
||
|
end
|
||
|
email.attachments.each do |attachment|
|
||
|
if attachment.header.to_s.match(/Content-Disposition: attachment;/)
|
||
|
obj.attachments << Attachment.create(:container => obj,
|
||
|
:file => attachment.decoded,
|
||
|
:filename => attachment.filename,
|
||
|
:author => user,
|
||
|
:content_type => attachment.mime_type)
|
||
|
else
|
||
|
logger.info "MailHandler: ignoring signature attachment #{attachment.filename} " if logger && logger.info
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
- « Previous
- 1
- 2
- 3
- Next »