Feature #14945

Outlook inline image replace [cid:..] by redmine !inline image!

Added by Luc Vandenbroucke over 4 years ago. Updated over 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email receiving
Target version:-
Resolution:Invalid

Description

When receiving an outlook mail,

if
[cid:]
would be replaced by
!image001.png!

It would just be perfect!

History

#1 Updated by Etienne Massip over 4 years ago

What's the point??

#2 Updated by Luc Vandenbroucke over 4 years ago

I send a mail with screen shots to redmine.
Now, the screen shots become attachments like image001.png, this is ok, but the place where the image was becomes the text [cid:].

What I do now, every time is change all descriptions like
[cid:] to , and it looks like the original.

#3 Updated by Jan Niggemann (redmine.org team member) over 4 years ago

  • Status changed from New to Needs feedback

I don't think this should be in redmine core, every mail system does things differently...
We had the same idea and wrote a plugin that uses regex to achieve the replacement (plain_text_body from mail_handler.rb):

module MailHandlerPatch
  def self.included(base)
    base.send(:include, InstanceMethods)
    base.class_eval do
      alias_method_chain :plain_text_body, :notes_cleanup
    end
  end

  module InstanceMethods
    def plain_text_body_with_notes_cleanup
      body = plain_text_body_without_notes_cleanup

      body.gsub! /\(Embedded image moved to file: (.*)\)/, '!\1!'
      body.gsub! /^\|------------>\s*?\n\| ([^|]*)\|\s*?\n\|------------>\s*?\n  >-{80,}\|\s*?\n  \|([^|]*)\|\s*?\n  >-{80,}\|/m, '|\1|\2|'

      body
    end
  end
end

This converts the stuff our Lotus Notes uses to

#4 Updated by Luc Vandenbroucke over 4 years ago

You are completely right, and thanks for the code.
I will make this work for outlook.

#5 Updated by Jan Niggemann (redmine.org team member) over 4 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Invalid

#6 Updated by Heiko Robert over 2 years ago

has anybody written already a patch/plugin for the outlook use case?

#7 Updated by Toshi MARUYAMA over 2 years ago

  • Category set to Email receiving

#8 Updated by Michael Ziegler over 2 years ago

i would also need a patch/plugin receiving outlook emails :-)

Also available in: Atom PDF