diff -r redmine\htdocs\app\models\mail_handler.rb redmine.current\htdocs\app\models\mail_handler.rb 17a18,19 > require 'mail' > 61a64 > logger.info "Receiving email #{sender_email}" 249a253,254 > logger.info "Adding attachements" > 275a281,299 > logger.info "Checking multipart" > if email.parts > email.parts.each do |part| > if part.content_disposition == "attachment" > logger.info "Found email attachment in parts section" > contents = part.decoded.gsub(0x0a.chr, 0x0d.chr+0x0a.chr) # this is to change newline type in attachment > logger.info "Trying to parse it as email" > attachment_email = Mail.new(contents) > obj.attachments << Attachment.create(:container => obj, > :file => contents, > :filename => attachment_email.subject + ".eml", > :author => user, > :content_type => part.content_type) > logger.info "Attachment added" > end > end > end > logger.info "Attachements added" >