Просмотр исходного кода

Fixes issue #3344 - Allow mailto links in knowledge base (KB) and email signatures.

Martin Edenhofer 4 лет назад
Родитель
Сommit
2a6036fb6e

+ 1 - 22
lib/html_sanitizer.rb

@@ -45,7 +45,7 @@ satinize html string based on whiltelist
         if node['href']
           href                = cleanup_target(node['href'], keep_spaces: true)
           href_without_spaces = href.gsub(/[[:space:]]/, '')
-          if external && href_without_spaces.present? && !href_without_spaces.downcase.start_with?('//') && href_without_spaces.downcase !~ %r{^.{1,6}://.+?}
+          if external && href_without_spaces.present? && !href_without_spaces.downcase.start_with?('mailto:') && !href_without_spaces.downcase.start_with?('//') && href_without_spaces.downcase !~ %r{^.{1,6}://.+?}
             node['href']        = "http://#{node['href']}"
             href                = node['href']
             href_without_spaces = href.gsub(/[[:space:]]/, '')
@@ -176,16 +176,6 @@ satinize html string based on whiltelist
           node.delete(attribute)
         end
 
-        # remove mailto links
-        if node['href']
-          href = cleanup_target(node['href'])
-          if href =~ /mailto:(.*)$/i
-            text = Nokogiri::XML::Text.new($1, node.document)
-            node.add_next_sibling(text)
-            node.remove
-            Loofah::Scrubber::STOP
-          end
-        end
       end
 
       done = true
@@ -320,17 +310,6 @@ cleanup html string:
 
     scrubber_cleanup = Loofah::Scrubber.new do |node|
 
-      # remove mailto links
-      if node['href']
-        href = cleanup_target(node['href'])
-        if href =~ /mailto:(.*)$/i
-          text = Nokogiri::XML::Text.new($1, node.document)
-          node.add_next_sibling(text)
-          node.remove
-          Loofah::Scrubber::STOP
-        end
-      end
-
       # remove not needed new lines
       if node.instance_of?(Nokogiri::XML::Text)
         if !node.parent || (node.parent.name != 'pre' && node.parent.name != 'code') # rubocop:disable Style/SoleNestedConditional

+ 10 - 8
spec/lib/core_ext/string_spec.rb

@@ -1199,7 +1199,7 @@ RSpec.describe String do
           expect(<<~HTML.chomp.html2html_strict).to eq(<<~TEXT.chomp)
             <a href="mailto:john.smith@example.com" style="color: blue; text-decoration: underline; ">john.smith@example.com</a>
           HTML
-            john.smith@example.com
+            <a href="mailto:john.smith@example.com">john.smith@example.com</a>
           TEXT
         end
 
@@ -1207,7 +1207,7 @@ RSpec.describe String do
           expect(<<~HTML.chomp.html2html_strict).to eq(<<~TEXT.chomp)
             <a href="MAILTO:john.smith@example.com" style="color: blue; text-decoration: underline; ">john.smith@example.com</a>
           HTML
-            john.smith@example.com
+            <a href="MAILTO:john.smith@example.com">john.smith@example.com</a>
           TEXT
         end
 
@@ -1215,7 +1215,7 @@ RSpec.describe String do
           expect(<<~HTML.chomp.html2html_strict).to eq(<<~TEXT.chomp)
             <a href="MAILTO:john.smith2@example.com" style="color: blue; text-decoration: underline; ">john.smith@example.com</a>
           HTML
-            john.smith2@example.com
+            <a href="MAILTO:john.smith2@example.com">john.smith@example.com</a>
           TEXT
         end
 
@@ -1289,7 +1289,9 @@ RSpec.describe String do
           <div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Arial, sans-serif; ">Mit freundlichem Gruß<span class="Apple-converted-space">&nbsp;</span><br><br>John Smith<br>Service und Support<br><br>Example Service AG &amp; Co.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Arial, sans-serif; ">Management OHG<br>Someware-Str. 4<br>xxxxx Someware<br><br></span><span style="font-size: 10pt; font-family: Arial, sans-serif; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Arial, sans-serif; ">Tel.: +49 001 7601 462<br>Fax: +49 001 7601 472</span><span style="font-size: 10pt; font-family: Arial, sans-serif; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Arial, sans-serif; "><a href="mailto:john.smith@example.com" style=color: blue; text-decoration: underline; ">john.smith@example.com</a></span><span style="font-size: 10pt; font-family: Arial, sans-serif; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: Arial, sans-serif; "><a href="http://www.example.com" style="color: blue; text-decoration: underline; ">www.example.com</a></span><span style="font-size: 10pt; font-family: Arial, sans-serif; "><o:p></o:p></span></div>
         HTML
           <div>Mit freundlichem Gruß<br><br>John Smith<br>Service und Support<br><br>Example Service AG &amp; Co. </div><div>Management OHG<br>Someware-Str. 4<br>xxxxx Someware<br><br>
-          </div><div>Tel.: +49 001 7601 462<br>Fax: +49 001 7601 472 </div><div>john.smith@example.com</div><div>
+          </div><div>Tel.: +49 001 7601 462<br>Fax: +49 001 7601 472 </div><div>
+          <a href="mailto:john.smith@example.com">john.smith@example.com</a>
+          </div><div>
           <a href="http://www.example.com" rel="nofollow noreferrer noopener" target="_blank">www.example.com</a>
           </div>
         TEXT
@@ -1321,7 +1323,7 @@ RSpec.describe String do
         HTML
           <div>
           <p><span style="color:#1f497d;">Guten Morgen, Frau ABC,</span></p><p><span style="color:#1f497d;"><p>&nbsp;</p></span></p><p><span style="color:#1f497d;">vielen Dank für die Reservierung. Dabei allerdings die Sprache (Niederländisch) nicht erwähnt. Können Sie bitte dieses in Ihrer Reservierung vormerken?</span></p><p><span style="color:#1f497d;"><p>&nbsp;</p></span></p><p><span style="color:#1f497d;">Nochmals vielen Dank und herzliche Grüße </span></p><div>
-          <p><b><span style="color:#1f497d;"><p>&nbsp;</p></span></b></p><p><b><span style="color:#1f497d;">Anna Smith</span></b></p><p><b><span style="color:#1f497d;">art abc SEV GmbH</span></b></p><p><b><span style="color:#1f497d;">art abc TRAV</span></b></p><p><span style="color:#1f497d;">Marktstätte 123</span></p><p><span style="color:#1f497d;">123456 Dorten</span></p><p><span style="color:#1f497d;">T: +49 (0) 12345/1234560-1</span></p><p><span style="color:#1f497d;">T: +49 (0) 12345/1234560-0</span></p><p><span style="color:#1f497d;">F: +49 (0) 12345/1234560-2</span></p><p>annad@example.com</p><p><a href="http://www.example.com/" rel="nofollow noreferrer noopener" target="_blank">www.example.com</a><span style="color:#1f497d;"> </span><a href="http://www.ABC.com/" rel="nofollow noreferrer noopener" target="_blank">www.ABC.com</a></p><p><span style="color:#1f497d;">Geschäftsführer Vor Nach, VorUndZu Nach - Amtsgericht Dort HRB 12345 - Ein Unternehmer der ABC Gruppe</span></p></div></div>
+          <p><b><span style="color:#1f497d;"><p>&nbsp;</p></span></b></p><p><b><span style="color:#1f497d;">Anna Smith</span></b></p><p><b><span style="color:#1f497d;">art abc SEV GmbH</span></b></p><p><b><span style="color:#1f497d;">art abc TRAV</span></b></p><p><span style="color:#1f497d;">Marktstätte 123</span></p><p><span style="color:#1f497d;">123456 Dorten</span></p><p><span style="color:#1f497d;">T: +49 (0) 12345/1234560-1</span></p><p><span style="color:#1f497d;">T: +49 (0) 12345/1234560-0</span></p><p><span style="color:#1f497d;">F: +49 (0) 12345/1234560-2</span></p><p><a href="mailto:annad@example.com">annad@example.com</a></p><p><a href="http://www.example.com/" rel="nofollow noreferrer noopener" target="_blank">www.example.com</a><span style="color:#1f497d;"> </span><a href="http://www.ABC.com/" rel="nofollow noreferrer noopener" target="_blank">www.ABC.com</a></p><p><span style="color:#1f497d;">Geschäftsführer Vor Nach, VorUndZu Nach - Amtsgericht Dort HRB 12345 - Ein Unternehmer der ABC Gruppe</span></p></div></div>
         TEXT
       end
 
@@ -1344,7 +1346,7 @@ RSpec.describe String do
         HTML
           <p><span style="color:#1f497d;"><p>&nbsp;</p></span></p><div>
           <div>
-          <span class="js-signatureMarker"></span><p><b>Von:</b> Besucherbüro, MKuk [besucherbuero@example.com] <br>
+          <span class="js-signatureMarker"></span><p><b>Von:</b> Besucherbüro, MKuk [<a href="mailto:besucherbuero@example.com">mailto:besucherbuero@example.com</a>] <br>
           <b>Gesendet:</b> Freitag, 16. Dezember 2016 08:05<br>
           <b>An:</b> 'Amaia Epalza'<br>
           <b>Betreff:</b> AW: Gruppe vtb Kultuur // 28.06.2017</p></div></div><p>&nbsp;</p><p><b><span style="color:#1f497d;">Reservierungsbestätigung Führung Skulptur-Projekte 2017 am </span></b></p><p></p><p><span style="color:#1f497d;"> </span></p><p></p><p>Guten Morgen Frau Epalza,</p>
@@ -1473,7 +1475,7 @@ RSpec.describe String do
         expect(<<~HTML.chomp.html2html_strict).to eq(<<~TEXT.chomp)
           <div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span lang="DE" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">Von:</span></b><span lang="DE" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> Martin Edenhofer via Zammad Helpdesk [mailto:<a href="mailto:support@example.com">support@zammad.com</a>] <br><b>Gesendet:</b>\u0020
         HTML
-          #{marker}<p><b>Von:</b> Martin Edenhofer via Zammad Helpdesk [mailto:support@example.com] <br><b>Gesendet:</b> </p>
+          #{marker}<p><b>Von:</b> Martin Edenhofer via Zammad Helpdesk [mailto:<a href="mailto:support@example.com">support@zammad.com</a>] <br><b>Gesendet:</b> </p>
         TEXT
       end
 
@@ -1510,7 +1512,7 @@ RSpec.describe String do
           <br class=""><div><blockquote type="cite" class=""><div class="">On 04 Mar 2017, at 14:47, Oliver Ruhm &lt;<a href="mailto:oliver@example.com" class="">oliver@example.com</a>&gt; wrote:</div><br class="Apple-interchange-newline">
         HTML
           <div>#{marker}<blockquote type="cite">
-          <div>On 04 Mar 2017, at 14:47, Oliver Ruhm &lt;oliver@example.com&gt; wrote:</div><br>
+          <div>On 04 Mar 2017, at 14:47, Oliver Ruhm &lt;<a href="mailto:oliver@example.com">oliver@example.com</a>&gt; wrote:</div><br>
           </blockquote></div>
         TEXT
       end

+ 96 - 2
test/data/mail/mail001.yml

@@ -2,12 +2,106 @@
 from: John.Smith@example.com
 from_email: John.Smith@example.com
 from_display_name: ''
+to: martin@example.com
 subject: 'CI Daten für PublicView '
-content_type: text/html
 body: |-
   <div>
   <div>Hallo Martin,</div><p>&nbsp;</p><div>wie besprochen hier noch die Daten für die Intranetseite:</div><p>&nbsp;</p><div>Schriftart/-größe: Verdana 11 Pt wenn von Browser nicht unterstützt oder nicht vorhanden wird Arial 11 Pt genommen</div><div>Schriftfarbe: Schwarz</div><div>Farbe für die Balken in der Grafik: D7DDE9 (Blau)</div><p>&nbsp;</p><div>Wenn noch was fehlt oder du was brauchst sag mir Bescheid.</div><p>&nbsp;</p><div>Mit freundlichem Gruß<br><br>John Smith<br>Service und Support<br><br>Example Service AG &amp; Co. </div><div>Management OHG<br>Someware-Str. 4<br>xxxxx Someware<br><br>
-  </div><div>Tel.: +49 001 7601 462<br>Fax: +49 001 7601 472 </div><div>john.smith@example.com</div><div>
+  </div><div>Tel.: +49 001 7601 462<br>Fax: +49 001 7601 472 </div><div>
+  <a href="mailto:john.smith@example.com">john.smith@example.com</a>
+  </div><div>
   <a href="http://www.example.com" rel="nofollow noreferrer noopener" target="_blank">www.example.com</a>
   </div><div>
   <br>OHG mit Sitz in Someware<br>AG: Someware - HRA 4158<br>Geschäftsführung: Tilman Test, Klaus Jürgen Test, </div><div>Bernhard Test, Ulrich Test<br>USt-IdNr. DE 1010101010<br><br>Persönlich haftende geschäftsführende Gesellschafterin: </div><div>Marie Test Example Stiftung, Someware<br>Vorstand: Rolf Test<br><br>Persönlich haftende Gesellschafterin: </div><div>Example Service AG, Someware<br>AG: Someware - HRB xxx<br>Vorstand: Marie Test </div><p>&nbsp;</p></div>
+content_type: text/html
+attachments:
+- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
+  data: '<html><head><base href="x-msg://2849/"></head><body style="word-wrap: break-word;
+    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span"
+    style="border-collapse: separate; font-family: Helvetica; font-style: normal;
+    font-variant: normal; font-weight: normal; letter-spacing: normal; line-height:
+    normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform:
+    none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing:
+    0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect:
+    none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size:
+    medium; "><div lang="DE" link="blue" vlink="purple"><div class="Section1" style="page:
+    Section1; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm;
+    margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span
+    style="font-size: 10pt; font-family: Arial, sans-serif; ">Hallo Martin,<o:p></o:p></span></div><div
+    style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt;
+    font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt;
+    font-family: Arial, sans-serif; "><o:p>&nbsp;</o:p></span></div><div style="margin-top:
+    0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size:
+    11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family:
+    Arial, sans-serif; ">wie besprochen hier noch die Daten für die Intranetseite:<o:p></o:p></span></div><div
+    style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt;
+    font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt;
+    font-family: Arial, sans-serif; "><o:p>&nbsp;</o:p></span></div><div style="margin-top:
+    0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size:
+    11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family:
+    Arial, sans-serif; ">Schriftart/-größe: Verdana 11 Pt wenn von Browser nicht unterstützt
+    oder nicht vorhanden wird Arial 11 Pt genommen<o:p></o:p></span></div><div style="margin-top:
+    0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size:
+    11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family:
+    Arial, sans-serif; ">Schriftfarbe: Schwarz<o:p></o:p></span></div><div style="margin-top:
+    0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size:
+    11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family:
+    Arial, sans-serif; ">Farbe für die Balken in der Grafik: D7DDE9 (Blau)<o:p></o:p></span></div><div
+    style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt;
+    font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt;
+    font-family: Arial, sans-serif; "><o:p>&nbsp;</o:p></span></div><div style="margin-top:
+    0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size:
+    11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family:
+    Arial, sans-serif; ">Wenn noch was fehlt oder du was brauchst sag mir Bescheid.<o:p></o:p></span></div><div
+    style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt;
+    font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt;
+    font-family: Arial, sans-serif; "><o:p>&nbsp;</o:p></span></div><div style="margin-top:
+    0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size:
+    11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family:
+    Arial, sans-serif; ">Mit freundlichem Gruß<span class="Apple-converted-space">&nbsp;</span><br><br>John
+    Smith<br>Service und Support<br><br>Example Service AG &amp; Co.<o:p></o:p></span></div><div
+    style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt;
+    font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt;
+    font-family: Arial, sans-serif; ">Management OHG<br>Someware-Str. 4<br>xxxxx Someware<br><br></span><span
+    style="font-size: 10pt; font-family: Arial, sans-serif; "><o:p></o:p></span></div><div
+    style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt;
+    font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt;
+    font-family: Arial, sans-serif; ">Tel.: +49 001 7601 462<br>Fax: +49 001 7601
+    472</span><span style="font-size: 10pt; font-family: Arial, sans-serif; "><o:p></o:p></span></div><div
+    style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt;
+    font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt;
+    font-family: Arial, sans-serif; "><a href="mailto:john.smith@example.com" style="color:
+    blue; text-decoration: underline; ">john.smith@example.com</a></span><span style="font-size:
+    10pt; font-family: Arial, sans-serif; "><o:p></o:p></span></div><div style="margin-top:
+    0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size:
+    11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family:
+    Arial, sans-serif; "><a href="http://www.example.com" style="color: blue; text-decoration:
+    underline; ">www.example.com</a></span><span style="font-size: 10pt; font-family:
+    Arial, sans-serif; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right:
+    0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family:
+    Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Arial, sans-serif;
+    "><br>OHG mit Sitz in Someware<br>AG: Someware - HRA 4158<br>Geschäftsführung:
+    Tilman Test, Klaus Jürgen Test,</span><span style="font-size: 8pt; font-family:
+    Arial, sans-serif; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right:
+    0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family:
+    Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Arial, sans-serif;
+    ">Bernhard Test, Ulrich Test<br>USt-IdNr. DE 1010101010<br><br>Persönlich haftende
+    geschäftsführende Gesellschafterin:</span><span style="font-size: 8pt; font-family:
+    Arial, sans-serif; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right:
+    0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family:
+    Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Arial, sans-serif;
+    ">Marie Test Example Stiftung, Someware<br>Vorstand: Rolf Test<br><br>Persönlich
+    haftende Gesellschafterin:</span><span style="font-size: 8pt; font-family: Arial,
+    sans-serif; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right:
+    0cm; margin-left: 0cm; margin-bottom: 0.0001pt; font-size: 11pt; font-family:
+    Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Arial, sans-serif;
+    ">Example Service AG, Someware<br>AG: Someware - HRB xxx<br>Vorstand: Marie Test</span><span
+    style="font-size: 8pt; font-family: Arial, sans-serif; "><o:p></o:p></span></div><div
+    style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt;
+    font-size: 11pt; font-family: Calibri, sans-serif; "><o:p>&nbsp;</o:p></div></div></div></span></body></html>'
+  filename: message.html
+  preferences: !ruby/hash:ActiveSupport::HashWithIndifferentAccess
+    content-alternative: true
+    original-format: true
+    Mime-Type: text/html
+    Charset: iso-8859-1

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
test/data/mail/mail003.yml


+ 50 - 4
test/data/mail/mail011.yml

@@ -1,11 +1,9 @@
 --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
-reply-to: serviceteam@cylex.de
 from: CYLEX Newsletter <carina.merkant@cylex.de>
 from_email: carina.merkant@cylex.de
 from_display_name: CYLEX Newsletter
-subject: Eine schöne Adventszeit für ZNUNY GMBH - ENTERPRISE SERVICES FÜR OTRS
 to: enjoy_us@znuny.com
-content_type: text/html
+subject: Eine schöne Adventszeit für ZNUNY GMBH - ENTERPRISE SERVICES FÜR OTRS
 body: |-
   <table border="0" cellpadding="0" style=" font-size: 14px;">
   <tbody>
@@ -31,10 +29,58 @@ body: |-
   <tbody>
   <tr>
   <td align="left" style="text-align:left;"> Impressum <br> S.C. CYLEX INTERNATIONAL S.N.C.<br> Sat. Palota 119/A RO 417516 Palota Romania <br> Tel.: +49 208/62957-0 | <br> Geschäftsführer: Francisc Osvald<br> Handelsregister: J05/1591/2009<br> USt.IdNr.: RO26332771 <br>
-  <br> serviceteam@cylex.de<br>
+  <br>
+  <a href="mailto:serviceteam@cylex.de">E-Mail Kontakt</a><br>
   <a href="http://newsletters.cylex.de/ref/www.cylex.de/sid-105/uid-4134001/lid-98/http%3a%2f%2fweb2.cylex.de%2fHomepage%2fHome.asp" rel="nofollow noreferrer noopener" target="_blank" title="http://newsletters.cylex.de/ref/www.cylex.de/sid-105/uid-4134001/lid-98/http%3a%2f%2fweb2.cylex.de%2fHomepage%2fHome.asp">Homepage</a><br>
   <a href="http://newsletters.cylex.de/ref/www.cylex.de/sid-105/uid-4134001/lid-99/http%3a%2f%2fnewsletters.cylex.de%2funsubscribe.aspx%3fuid%3d4134001%26d%3dwww.cylex.de%26e%3denjoy%40znuny.com%26sc%3d3009%26l%3dd" rel="nofollow noreferrer noopener" target="_blank" title="http://newsletters.cylex.de/ref/www.cylex.de/sid-105/uid-4134001/lid-99/http%3a%2f%2fnewsletters.cylex.de%2funsubscribe.aspx%3fuid%3d4134001%26d%3dwww.cylex.de%26e%3denjoy%40znuny.com%26sc%3d3009%26l%3dd">Newsletter abbestellen</a>
   </td>
   </tr>
   </tbody>
   </table>
+content_type: text/html
+reply-to: serviceteam@cylex.de
+attachments:
+- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
+  data: "<center>\n\t<table border=\"0\" cellpadding=\"0\" style=\"width: 600px; font-family:
+    Arial,sans-serif; font-size: 14px;\" width=\"600\">\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<a
+    href=\"http://newsletters.cylex.de/ref/www.cylex.de/sid-105/uid-4134001/lid-2/http%3a%2f%2fweb2.cylex.de%2fadvent2012%3fb2b\"><img
+    alt=\"CYLEX Adventskalender 2012\" border=\"0\" height=\"90\" src=\"http://newsletters.cylex.de/img/www.cylex.de/sid-105/uid-4134001/http%3a%2f%2fnewsletters.cylex.de%2fimages_upl%2fcylexadvent2012-newsletter-banner634895.jpg\"
+    style=\"width:600px; height:90px; color: rgb(153, 153, 153); font-size: 10px;\"
+    width=\"600\" /></a></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tLieber CYLEX Eintragsinhaber,</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tdas
+    Jahr neigt sich dem Ende und die besinnliche Zeit beginnt laut Kalender mit dem<br
+    />\n\t\t\t\t\t\t1. Advent. Und wie immer wird es in der vorweihnachtlichen Zeit
+    meist beruflich und privat<br />\n\t\t\t\t\t\tso richtig schön hektisch.</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tUm
+    Ihre Weihnachtsstimmung in Schwung zu bringen kommen wir nun mit unserem Adventskalender
+    ins Spiel. Denn 24 Tage werden Sie unsere netten Geschichten, Rezepte und Gewinnspiele
+    sowie ausgesuchte Geschenktipps und Einkaufsgutscheine online begleiten. Damit
+    lässt sich Ihre Freude auf das Fest garantiert mit jedem Tag steigern.</p>\n\t\t\t\t\t<table
+    style=\"font-family: Arial,sans-serif; font-size: 14px;\" width=\"100%\">\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td
+    align=\"left\" valign=\"middle\">\n\t\t\t\t\t\t\t\t\tEinen gemütlichen Start in
+    die Adventszeit wünscht Ihnen</td>\n\t\t\t\t\t\t\t\t<td align=\"right\" valign=\"middle\"
+    width=\"160\">\n\t\t\t\t\t\t\t\t\t<a href=\"http://newsletters.cylex.de/ref/www.cylex.de/sid-105/uid-4134001/lid-1/http%3a%2f%2fweb2.cylex.de%2fadvent2012%3fb2b\"
+    style=\"background:#c00; color:#fff; text-align:center;\"><img alt=\"Jetzt Türchen
+    öffnen\" src=\"http://newsletters.cylex.de/images_upl/cylexadvent2012-newsletter-btn634895.png\"
+    style=\"width:146px; height:30px; border:0; text-align:center; font-size:12px;
+    font-weight:700; background:#c00; color:#fff;\" title=\"Jetzt Türchen öffnen\"
+    /></a></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tIhr
+    CYLEX Team<br />\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<strong>P.S.</strong> Damit
+    Sie keinen Tag versäumen, empfehlen wir Ihnen den <a href=\"http://newsletters.cylex.de/ref/www.cylex.de/sid-105/uid-4134001/lid-3/http%3a%2f%2fweb2.cylex.de%2fadvent2012%3fb2b\">Link
+    des Adventkalenders</a> in<br />\n\t\t\t\t\t\t&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+    Ihrer Lesezeichen-Symbolleiste zu ergänzen.</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t </p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</center>\n<center><table
+    width=\"600\" cellspacing=\"0\" cellpadding=\"0\" style=\"color:#6578A0; font-family:Arial,Verdana,Helvetica,sans-serif;
+    font-size:10px;\">\n<tbody>\n<tr>\n<td width=\"600\" align=\"left\" style=\"text-align:left;\">\nImpressum
+    <br/>\nS.C. CYLEX INTERNATIONAL S.N.C.<br />\nSat. Palota 119/A RO 417516 Palota
+    Romania <br/>\nTel.: +49 208/62957-0 | <br/>\nGeschäftsführer: Francisc Osvald<br
+    />\nHandelsregister: J05/1591/2009<br />\nUSt.IdNr.: RO26332771\n<br/>\n<br/>\n<a
+    href=\"mailto:serviceteam@cylex.de\" style=\"color:#6578A0; font-family:Arial,Verdana,Helvetica,sans-serif;
+    font-size:10px;\">E-Mail Kontakt</a><br/>\n<a href=\"http://newsletters.cylex.de/ref/www.cylex.de/sid-105/uid-4134001/lid-98/http%3a%2f%2fweb2.cylex.de%2fHomepage%2fHome.asp\"
+    style=\"color:#6578A0; font-family:Arial,Verdana,Helvetica,sans-serif; font-size:10px;\">Homepage</a><br/>\n<a
+    href=\"http://newsletters.cylex.de/ref/www.cylex.de/sid-105/uid-4134001/lid-99/http%3a%2f%2fnewsletters.cylex.de%2funsubscribe.aspx%3fuid%3d4134001%26d%3dwww.cylex.de%26e%3denjoy%40znuny.com%26sc%3d3009%26l%3dd\"
+    style=\"color:#6578A0; font-family:Arial,Verdana,Helvetica,sans-serif; font-size:10px;\">Newsletter
+    abbestellen</a>\n</td>\n</tr>\n</tbody>\n</table>\n</center>"
+  filename: message.html
+  preferences: !ruby/hash:ActiveSupport::HashWithIndifferentAccess
+    content-alternative: true
+    original-format: true
+    Mime-Type: text/html
+    Charset: utf-8

+ 79 - 9
test/data/mail/mail030.yml

@@ -2,8 +2,9 @@
 from: Manfred Haert <Manfred.Haert@example.com>
 from_email: Manfred.Haert@example.com
 from_display_name: Manfred Haert
-subject: Antragswesen in TesT abbilden
 to: info@znuny.inc
+cc: '"Bert Jörg" <Joerg.Bert@example.com>, "Test, Karl-Heinz" <Karl-Heinz.Test@example.com>'
+subject: Antragswesen in TesT abbilden
 body: 'Sehr geehrte Damen und Herren,<br> <br> wir hatten bereits letztes Jahr einen
   TesT-Workshop mit Ihrem Herrn XXX durchgeführt und würden nun gerne erneut Ihre
   Dienste in Anspruch nehmen.<br> <br> Mittlerweile setzen wir TesT produktiv ein
@@ -13,16 +14,85 @@ body: 'Sehr geehrte Damen und Herren,<br> <br> wir hatten bereits letztes Jahr e
   stehe ich gerne zur Verfügung. Vielen Dank!<br> <br> <div>--<br> Freundliche Grüße<br>
   i.A. Manfred Härt<br> <br> <small>Test Somewhere GmbH<br> Ferdinand-Straße 99<br>
   99073 Korlben<br> <b>Bitte beachten Sie die neuen Rufnummern!</b><br> Telefon: 011261
-  00000-2460<br> Fax: 011261 0000-7460<br> manfred.haertel@example.com<br> <a href="http://www.example.com"
-  rel="nofollow noreferrer noopener" target="_blank">http://www.example.com</a><br>
+  00000-2460<br> Fax: 011261 0000-7460<br> <a href="mailto:manfred.haertel@example.com">mailto:manfred.haertel@example.com</a><br>
+  <a href="http://www.example.com" rel="nofollow noreferrer noopener" target="_blank">http://www.example.com</a><br>
   JETZT AUCH BEI FACEBOOK !<br> <a href="https://www.facebook.com/test" rel="nofollow
   noreferrer noopener" target="_blank">https://www.facebook.com/test</a><span class="js-signatureMarker"></span><br>
   ___________________________________<br> Test Somewhere GmbH<br> </small> <p><small>Diese
   e-Mail ist ausschließlich für den beabsichtigten Empfänger bestimmt. Sollten Sie
   irrtümlich diese e-Mail erhalten haben, unterrichten Sie uns bitte umgehend unter
-  kontakt@example.com und vernichten Sie diese Mitteilung einschließlich der ggf.
-  beigefügten Dateien.<br> Weil wir die Echtheit oder Vollständigkeit der in dieser
-  Nachricht enthaltenen Informationen nicht garantieren können, bitten wir um Verständnis,
-  dass wir zu Ihrem und unserem Schutz die rechtliche Verbindlichkeit der vorstehenden
-  Erklärungen ausschließen, soweit wir mit Ihnen keine anders lautenden Vereinbarungen
-  getroffen haben.</small> </p></div>'
+  <a href="mailto:kontakt@example.com">kontakt@example.com</a> und vernichten Sie
+  diese Mitteilung einschließlich der ggf. beigefügten Dateien.<br> Weil wir die Echtheit
+  oder Vollständigkeit der in dieser Nachricht enthaltenen Informationen nicht garantieren
+  können, bitten wir um Verständnis, dass wir zu Ihrem und unserem Schutz die rechtliche
+  Verbindlichkeit der vorstehenden Erklärungen ausschließen, soweit wir mit Ihnen
+  keine anders lautenden Vereinbarungen getroffen haben.</small> </p></div>'
+content_type: text/html
+attachments:
+- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
+  data: |+
+    <html>
+      <head>
+
+        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+      </head>
+      <body bgcolor="#FFFFFF" text="#000066">
+        <font face="Helvetica, Arial, sans-serif">Sehr geehrte Damen und
+          Herren,<br>
+          <br>
+          wir hatten bereits letztes Jahr einen TesT-Workshop mit Ihrem
+          Herrn XXX durchgeführt und würden nun gerne erneut
+          Ihre Dienste in Anspruch nehmen.<br>
+          <br>
+          Mittlerweile setzen wir TesT produktiv ein und würden nun gerne an
+          einem Anwendungsfall (Change-Management) die Machbarkeit des
+          Abbildens eines derzeit "per Papier" durchgeführten Antragswesens
+          in TesT prüfen wollen.<br>
+          <br>
+          Wir bitten gerne um ein entsprechendes Angebot.<br>
+          <br>
+          Für Rückfragen stehe ich gerne zur Verfügung. Vielen Dank!<br>
+          <br>
+        </font>
+        <div class="moz-signature">-- <br>
+          <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+          <title></title>
+          <font face="Helvetica, Arial, sans-serif"> Freundliche Grüße<br>
+            i.A. Manfred Härt<br>
+            <br>
+            <small><small>Test Somewhere GmbH<br>
+                Ferdinand-Straße 99<br>
+                99073 Korlben<br>
+                <b>Bitte beachten Sie die neuen Rufnummern!</b><br>
+                Telefon: 011261 00000-2460<br>
+                Fax: 011261 0000-7460<br>
+                <a class="moz-txt-link-freetext" href="mailto:manfred.haertel@example.com">mailto:manfred.haertel@example.com</a><br>
+                <a class="moz-txt-link-freetext" href="http://www.example.com">http://www.example.com</a><br>
+                JETZT AUCH BEI FACEBOOK !<br>
+                <a class="moz-txt-link-freetext" href="https://www.facebook.com/test">https://www.facebook.com/test</a><br>
+                ___________________________________<br>
+                Test Somewhere GmbH<br>
+                </small></small> </font>
+          <p><font face="Helvetica, Arial, sans-serif"><small><small>Diese
+                  e-Mail ist ausschließlich für den beabsichtigten Empfänger
+                  bestimmt. Sollten Sie irrtümlich diese e-Mail erhalten
+                  haben, unterrichten Sie uns bitte umgehend unter
+                  <a class="moz-txt-link-abbreviated" href="mailto:kontakt@example.com">kontakt@example.com</a> und vernichten Sie diese Mitteilung
+                  einschließlich der ggf. beigefügten Dateien.<br>
+                  Weil wir die Echtheit oder Vollständigkeit der in dieser
+                  Nachricht enthaltenen Informationen nicht garantieren
+                  können, bitten wir um Verständnis, dass wir zu Ihrem und
+                  unserem Schutz die rechtliche Verbindlichkeit der
+                  vorstehenden Erklärungen ausschließen, soweit wir mit
+                  Ihnen keine anders lautenden Vereinbarungen getroffen
+                  haben.</small></small> </font> </p>
+        </div>
+      </body>
+    </html>
+
+  filename: message.html
+  preferences: !ruby/hash:ActiveSupport::HashWithIndifferentAccess
+    content-alternative: true
+    original-format: true
+    Mime-Type: text/html
+    Charset: UTF-8

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
test/data/mail/mail043.yml


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
test/data/mail/mail047.yml


+ 1 - 1
test/data/mail/mail082.yml

@@ -10,7 +10,7 @@ body: |-
   <p><b><span style="color:#403152;">Chantel Wilken</span></b></p><p><b><span style="color:#403152;">John Smith</span></b></p><p><b><span style="color:#403152;">Tel: 053-8311646</span></b></p><p><b><span style="color:#403152;"> : 053-8311710</span></b></p><p><b><span style="color:#403152;">Fax to e-mail: 0865586973</span></b></p><p><b><span style="color:#403152;">Fax to e-mail: 0865665137</span></b><b><span style="color:#403152;"></span></b></p></div><p><span style="color:#1f497d;"><p>&nbsp;</p></span></p><div>
   <span class="js-signatureMarker"></span><p><b>From:</b> Profsen Lab [mailto:from@example.com] <br><b>Sent:</b> Wednesday, 06 March 2019 08:52<br><b>To:</b> to@example.com<br><b>Subject:</b> FW: Tax Invoice INX4183</p></div><p>&nbsp;</p><p><span style="color:#1f497d;"><p>&nbsp;</p></span></p><p><span style="color:#1f497d;"><p>&nbsp;</p></span></p><div>
   <p><b><span style="color:#403152;">Chantel Wilken</span></b></p><p><b><span style="color:#403152;">John Smith</span></b></p><p><b><span style="color:#403152;">Tel: 053-8311646</span></b></p><p><b><span style="color:#403152;"> : 053-8311710</span></b></p><p><b><span style="color:#403152;">Fax to e-mail: 0865586973</span></b></p><p><b><span style="color:#403152;">Fax to e-mail: 0865665137</span></b><b><span style="color:#403152;"></span></b></p></div><p><span style="color:#1f497d;"><p>&nbsp;</p></span></p><div>
-  <p><b>From:</b> Profsen Lab %5Bmailto:from@example.com%5D <br><b>Sent:</b> Monday, 04 March 2019 12:41<br><b>To:</b> from@example.com<br><b>Subject:</b> Tax Invoice INX4183</p></div><p>&nbsp;</p><p>Tax Invoice INX4183 from Shammah Dental BK t/a John Smith</p><p>&nbsp;</p></div>
+  <p><b>From:</b> Profsen Lab <a href="mailto:%5Bmailto:from@example.com%5D">[mailto:from@example.com]</a> <br><b>Sent:</b> Monday, 04 March 2019 12:41<br><b>To:</b> <a href="mailto:from@example.com">from@example.com</a><br><b>Subject:</b> Tax Invoice INX4183</p></div><p>&nbsp;</p><p>Tax Invoice INX4183 from Shammah Dental BK t/a John Smith</p><p>&nbsp;</p></div>
 content_type: text/html
 attachments:
 - !ruby/hash:ActiveSupport::HashWithIndifferentAccess

+ 1 - 1
test/unit/email_process_test.rb

@@ -3067,7 +3067,7 @@ Content-Type: text/html; charset=us-ascii; format=flowed
           },
           1 => {
             content_type: 'text/html',
-            body: 'test%C3%A4%C3%B6%C3%BC@example.com',
+            body: '<a href="mailto:test%C3%A4%C3%B6%C3%BC@example.com">test</a>',
             sender: 'Customer',
             type: 'email',
             internal: false,

Некоторые файлы не были показаны из-за большого количества измененных файлов