Open jcatrysse opened 2 years ago
I added some dirty code (I found on the internet) into Redmine to just add the rfc822 parts as attachments, but it would be nice to handle this correctly.
logger.info "Checking multipart"
if email.parts
email.parts.each do |part|
if (part.content_disposition =~ /attachment/i) && (part.content_type = "message/rfc822")
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"
looks similar to my 2 year old PR :) https://github.com/mikel/mail/pull/1389
Yes, indeed... it does! Any idea why this hasn't been merged / implemented?
And maybe more important... can this be implemented in for example a 2.7.2 version? I'm not that familiar with this :-)
Hello,
This issue concerns Redmine 4.2.3, who is using this mail gem to handle incoming mails.
We have an issue when using
forward mail as attachment
from Outlook and sending the message to Redmine (who is using this mail gem). Normally, on reception, we would expect to receive the mail message and the added .msg attachment as an attachment. This is not the case.We get the mail message, all the other attachments from the mail, but also from the added .msg attachment. But never the .msg attachment itself.
The .msg attachment is encoded like this:
And not like this:
What can we do, just to handle rfc822 parts as an attachment?
All help is very much appreciated.