From 2233cded7f8c8b92a576a8a666d02417264b3439 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Wed, 6 Jun 2018 23:55:23 +0800 Subject: [PATCH 1/7] Add type coercion to fix #2054 --- config/initializers/db_preferences_mysql.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/db_preferences_mysql.rb b/config/initializers/db_preferences_mysql.rb index 31bb30117..2958bb6a4 100644 --- a/config/initializers/db_preferences_mysql.rb +++ b/config/initializers/db_preferences_mysql.rb @@ -61,7 +61,7 @@ end if connection.execute("SHOW tables LIKE 'settings';").any? && Setting.get('postmaster_max_size').present? && - Setting.get('postmaster_max_size') > max_allowed_packet_mb + Setting.get('postmaster_max_size').to_i > max_allowed_packet_mb printf "\e[33m" # ANSI yellow puts <<~MSG Warning: Database config value 'max_allowed_packet' less than Zammad setting 'Maximum Email Size' From 13ef5d42464ecb57f00fc24e721e7982b1ced3e5 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Fri, 1 Jun 2018 19:32:59 +0800 Subject: [PATCH 2/7] Rewrite Encode::conv as String#utf8_encode --- app/models/calendar.rb | 5 +- app/models/channel/email_parser.rb | 46 ++++--------- lib/core_ext/object.rb | 5 ++ lib/core_ext/string.rb | 61 +++++++++++++++++- lib/encode.rb | 37 ----------- lib/html_sanitizer.rb | 6 +- lib/import/helper.rb | 4 +- lib/import/helper/attributes_examples.rb | 2 +- lib/import/otrs/requester.rb | 4 +- lib/ldap/user.rb | 2 +- spec/lib/core_ext/string_spec.rb | 58 +++++++++++++++++ test/unit/email_parser_test.rb | 18 +++--- test/unit/email_process_test.rb | 82 ++++++++++++------------ 13 files changed, 195 insertions(+), 135 deletions(-) create mode 100644 lib/core_ext/object.rb delete mode 100644 lib/encode.rb create mode 100644 spec/lib/core_ext/string_spec.rb diff --git a/app/models/calendar.rb b/app/models/calendar.rb index 9cd2a670a..1fcf20bdb 100644 --- a/app/models/calendar.rb +++ b/app/models/calendar.rb @@ -251,10 +251,7 @@ returns def self.day_and_comment_by_event(event, start_time) day = "#{start_time.year}-#{format('%02d', start_time.month)}-#{format('%02d', start_time.day)}" comment = event.summary || event.description - comment = Encode.conv( 'utf8', comment.to_s.force_encoding('utf-8') ) - if !comment.valid_encoding? - comment = comment.encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?') - end + comment = comment.to_utf8(fallback: :read_as_sanitized_binary) # ignore daylight saving time entries return if comment.match?(/(daylight saving|sommerzeit|summertime)/i) diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index 05576f4f1..bb1cb367e 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.rb @@ -69,18 +69,14 @@ class Channel::EmailParser def parse(msg) data = {} - # Rectify invalid encodings - encoding = CharDet.detect(msg)['encoding'] - msg.force_encoding(encoding) if !msg.valid_encoding? - - mail = Mail.new(msg) + mail = Mail.new(msg.utf8_encode) # set all headers mail.header.fields.each do |field| # full line, encode, ready for storage begin - value = Encode.conv('utf8', field.to_s) + value = field.to_utf8 if value.blank? value = field.raw_value end @@ -150,24 +146,17 @@ class Channel::EmailParser # html attachment/body may exists and will be converted to strict html if mail.html_part&.body data[:body] = mail.html_part.body.to_s - data[:body] = Encode.conv(mail.html_part.charset.to_s, data[:body]) - data[:body] = data[:body].html2html_strict.to_s.force_encoding('utf-8') + data[:body] = data[:body].utf8_encode(from: mail.html_part.charset, fallback: :read_as_sanitized_binary) + data[:body] = data[:body].html2html_strict - if !data[:body].force_encoding('UTF-8').valid_encoding? - data[:body] = data[:body].encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?') - end data[:content_type] = 'text/html' end # text attachment/body exists if data[:body].blank? && mail.text_part data[:body] = mail.text_part.body.decoded - data[:body] = Encode.conv(mail.text_part.charset, data[:body]) - data[:body] = data[:body].to_s.force_encoding('utf-8') + data[:body] = data[:body].utf8_encode(from: mail.text_part.charset, fallback: :read_as_sanitized_binary) - if !data[:body].valid_encoding? - data[:body] = data[:body].encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?') - end data[:content_type] = 'text/plain' end @@ -217,12 +206,9 @@ class Channel::EmailParser elsif mail.mime_type && mail.mime_type.to_s.casecmp('text/html').zero? filename = 'message.html' data[:body] = mail.body.decoded - data[:body] = Encode.conv(mail.charset, data[:body]) - data[:body] = data[:body].html2html_strict.to_s.force_encoding('utf-8') + data[:body] = data[:body].utf8_encode(from: mail.charset, fallback: :read_as_sanitized_binary) + data[:body] = data[:body].html2html_strict - if !data[:body].valid_encoding? - data[:body] = data[:body].encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?') - end data[:content_type] = 'text/html' # add body as attachment @@ -246,11 +232,8 @@ class Channel::EmailParser # text part only elsif !mail.mime_type || mail.mime_type.to_s == '' || mail.mime_type.to_s.casecmp('text/plain').zero? data[:body] = mail.body.decoded - data[:body] = Encode.conv(mail.charset, data[:body]) + data[:body] = data[:body].utf8_encode(from: mail.charset, fallback: :read_as_sanitized_binary) - if !data[:body].force_encoding('UTF-8').valid_encoding? - data[:body] = data[:body].encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?') - end data[:content_type] = 'text/plain' else filename = '-no name-' @@ -319,7 +302,7 @@ class Channel::EmailParser # full line, encode, ready for storage begin - value = Encode.conv('utf8', field.to_s) + value = field.to_utf8 if value.blank? value = field.raw_value end @@ -330,10 +313,7 @@ class Channel::EmailParser end # cleanup content id, <> will be added automatically later - if headers_store['Content-ID'] - headers_store['Content-ID'].gsub!(/^$/, '') - end + headers_store['Content-ID']&.gsub!(/(^<|>$)/, '') # get filename from content-disposition filename = nil @@ -669,7 +649,7 @@ returns mail[:attachments]&.each do |attachment| filename = attachment[:filename].force_encoding('utf-8') if !filename.force_encoding('UTF-8').valid_encoding? - filename = filename.encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?') + filename = filename.utf8_encode(fallback: :read_as_sanitized_binary) end Store.add( object: 'Ticket::Article', @@ -762,7 +742,7 @@ returns end # do extra decoding because we needed to use field.value - data[:from_display_name] = Mail::Field.new('X-From', Encode.conv('utf8', data[:from_display_name])).to_s + data[:from_display_name] = Mail::Field.new('X-From', data[:from_display_name].to_utf8).to_s data[:from_display_name].delete!('"') data[:from_display_name].strip! data[:from_display_name].gsub!(/^'/, '') @@ -862,7 +842,7 @@ module Mail # workaround to get content of no parseable headers - in most cases with non 7 bit ascii signs class Field def raw_value - value = Encode.conv('utf8', @raw_value) + value = @raw_value.try(:utf8_encode) return value if value.blank? value.sub(/^.+?:(\s|)/, '') end diff --git a/lib/core_ext/object.rb b/lib/core_ext/object.rb new file mode 100644 index 000000000..a0f47d617 --- /dev/null +++ b/lib/core_ext/object.rb @@ -0,0 +1,5 @@ +class Object + def to_utf8(**options) + to_s.utf8_encode(**options) + end +end diff --git a/lib/core_ext/string.rb b/lib/core_ext/string.rb index 83c13626b..f1c2efacd 100644 --- a/lib/core_ext/string.rb +++ b/lib/core_ext/string.rb @@ -1,3 +1,5 @@ +require 'rchardet' + class String alias old_strip strip alias old_strip! strip! @@ -8,7 +10,7 @@ class String sub!(/[[[:space:]]\u{200B}\u{FEFF}]+\Z/, '') # if incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) (Encoding::CompatibilityError), use default - rescue + rescue Encoding::CompatibilityError old_strip! end self @@ -20,7 +22,7 @@ class String new_string.sub!(/[[[:space:]]\u{200B}\u{FEFF}]+\Z/, '') # if incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) (Encoding::CompatibilityError), use default - rescue + rescue Encoding::CompatibilityError new_string = old_strip end new_string @@ -451,4 +453,59 @@ class String string end + + # Returns a copied string whose encoding is UTF-8. + # If both the provided and current encodings are invalid, + # an auto-detected encoding is tried. + # + # Supports some fallback strategies if a valid encoding cannot be found. + # + # Options: + # + # * from: An encoding to try first. + # Takes precedence over the current and auto-detected encodings. + # + # * fallback: The strategy to follow if no valid encoding can be found. + # * `:output_to_binary` returns an ASCII-8BIT-encoded string. + # * `:read_as_sanitized_binary` returns a UTF-8-encoded string with all + # invalid byte sequences replaced with "?" characters. + def utf8_encode(**options) + dup.utf8_encode!(options) + end + + def utf8_encode!(**options) + return self if (encoding == Encoding::UTF_8) && valid_encoding? + + input_encoding = viable_encodings(try_first: options[:from]).first + return encode!('utf-8', input_encoding) if input_encoding.present? + + case options[:fallback] + when :output_to_binary + force_encoding('ascii-8bit') + when :read_as_sanitized_binary + encode!('utf-8', 'ascii-8bit', invalid: :replace, undef: :replace, replace: '?') + else + raise EncodingError, 'could not find a valid input encoding' + end + end + + private + + def viable_encodings(try_first: nil) + return dup.viable_encodings(try_first: try_first) if frozen? + + provided = Encoding.find(try_first) if try_first.present? + original = encoding + detected = CharDet.detect(self)['encoding'] + + [provided, original, detected] + .compact + .reject { |e| Encoding.find(e) == Encoding::ASCII_8BIT } + .select { |e| force_encoding(e).valid_encoding? } + .tap { force_encoding(original) } # clean up changes from previous line + + # if `try_first` is not a valid encoding, try_first again without it + rescue ArgumentError + try_first.present? ? viable_encodings : raise + end end diff --git a/lib/encode.rb b/lib/encode.rb deleted file mode 100644 index b844197ea..000000000 --- a/lib/encode.rb +++ /dev/null @@ -1,37 +0,0 @@ -module Encode - def self.conv (charset, string) - - # return if string is false - return string if !string - - # if no charset is given, use LATIN1 as default - if !charset || charset == 'US-ASCII' || charset == 'ASCII-8BIT' - charset = 'ISO-8859-15' - end - - # validate already existing utf8 strings - if charset.casecmp('utf8').zero? || charset.casecmp('utf-8').zero? - begin - # return if encoding is valid - utf8 = string.dup.force_encoding('UTF-8') - return utf8 if utf8.valid_encoding? - - # try to encode from Windows-1252 to utf8 - string.encode!('UTF-8', 'Windows-1252') - rescue EncodingError => e - Rails.logger.error "Bad encoding: #{string.inspect}" - string = string.encode!('UTF-8', invalid: :replace, undef: :replace, replace: '?') - end - return string - end - - # convert string - begin - string.encode!('UTF-8', charset) - rescue => e - Rails.logger.error 'ERROR: ' + e.inspect - string - end - #Iconv.conv( 'UTF8', charset, string) - end -end diff --git a/lib/html_sanitizer.rb b/lib/html_sanitizer.rb index f8b7a09ba..00fbfd896 100644 --- a/lib/html_sanitizer.rb +++ b/lib/html_sanitizer.rb @@ -374,7 +374,7 @@ cleanup html string: end def self.cleanup_target(string, keep_spaces: false) - string = CGI.unescape(string).encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?') + string = CGI.unescape(string).utf8_encode(fallback: :read_as_sanitized_binary) blank_regex = if keep_spaces /\t|\n|\r/ else @@ -405,8 +405,8 @@ cleanup html string: end def self.url_same?(url_new, url_old) - url_new = CGI.unescape(url_new.to_s).encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?').downcase.gsub(%r{/$}, '').gsub(/[[:space:]]|\t|\n|\r/, '').strip - url_old = CGI.unescape(url_old.to_s).encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?').downcase.gsub(%r{/$}, '').gsub(/[[:space:]]|\t|\n|\r/, '').strip + url_new = CGI.unescape(url_new.to_s).utf8_encode(fallback: :read_as_sanitized_binary).downcase.gsub(%r{/$}, '').gsub(/[[:space:]]|\t|\n|\r/, '').strip + url_old = CGI.unescape(url_old.to_s).utf8_encode(fallback: :read_as_sanitized_binary).downcase.gsub(%r{/$}, '').gsub(/[[:space:]]|\t|\n|\r/, '').strip url_new = html_decode(url_new).sub('/?', '?') url_old = html_decode(url_old).sub('/?', '?') return true if url_new == url_old diff --git a/lib/import/helper.rb b/lib/import/helper.rb index 3a2d5f7f2..e0b1d1a66 100644 --- a/lib/import/helper.rb +++ b/lib/import/helper.rb @@ -22,8 +22,8 @@ module Import def utf8_encode(data) data.each do |key, value| next if !value - next if value.class != String - data[key] = Encode.conv('utf8', value) + next if !value.respond_to?(:utf8_encode) + data[key] = value.utf8_encode end end diff --git a/lib/import/helper/attributes_examples.rb b/lib/import/helper/attributes_examples.rb index 1ae3c00a9..ef2e9ba4d 100644 --- a/lib/import/helper/attributes_examples.rb +++ b/lib/import/helper/attributes_examples.rb @@ -58,7 +58,7 @@ module Import next if value.nil? - example = value.to_s.force_encoding('UTF-8').encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?') + example = value.to_utf8(fallback: :read_as_sanitized_binary) example.gsub!(/^(.{20,}?).*$/m, '\1...') @examples[attribute] = "#{attribute} (e. g. #{example})" diff --git a/lib/import/otrs/requester.rb b/lib/import/otrs/requester.rb index adbcc4c27..2e27c6f7f 100644 --- a/lib/import/otrs/requester.rb +++ b/lib/import/otrs/requester.rb @@ -94,9 +94,9 @@ module Import end def handle_response(response) - encoded_body = Encode.conv('utf8', response.body.to_s) + encoded_body = response.body.to_utf8 # remove null bytes otherwise PostgreSQL will fail - encoded_body.gsub!('\u0000', '') + encoded_body.delete('\u0000') JSON.parse(encoded_body) end diff --git a/lib/ldap/user.rb b/lib/ldap/user.rb index 3dd2143f6..4b228fb27 100644 --- a/lib/ldap/user.rb +++ b/lib/ldap/user.rb @@ -144,7 +144,7 @@ class Ldap next if value.blank? next if value[0].blank? - example_value = value[0].force_encoding('UTF-8').encode('utf-8', 'binary', invalid: :replace, undef: :replace, replace: '?') + example_value = value[0].force_encoding('UTF-8').utf8_encode(fallback: :read_as_sanitized_binary) attributes[attribute] = "#{attribute} (e. g. #{example_value})" end diff --git a/spec/lib/core_ext/string_spec.rb b/spec/lib/core_ext/string_spec.rb new file mode 100644 index 000000000..52bd0ba8f --- /dev/null +++ b/spec/lib/core_ext/string_spec.rb @@ -0,0 +1,58 @@ +require 'rails_helper' + +RSpec.describe String do + describe '#utf8_encode' do + context 'for valid, UTF-8-encoded strings' do + let(:subject) { 'hello' } + + it 'returns an identical copy' do + expect(subject.utf8_encode).to eq(subject) + expect(subject.utf8_encode.encoding).to be(subject.encoding) + expect(subject.utf8_encode).not_to be(subject) + end + end + + context 'for strings in other encodings' do + let(:subject) { original_string.encode(input_encoding) } + + context 'with no from: option' do + let(:original_string) { 'Tschüss!' } + let(:input_encoding) { Encoding::ISO_8859_2 } + + it 'detects the input encoding' do + expect(subject.utf8_encode).to eq(original_string) + end + end + + context 'with a valid from: option' do + let(:original_string) { 'Tschüss!' } + let(:input_encoding) { Encoding::ISO_8859_2 } + + it 'uses the specified input encoding' do + expect(subject.utf8_encode(from: 'iso-8859-2')).to eq(original_string) + end + + it 'uses any valid input encoding, even if not correct' do + expect(subject.utf8_encode(from: 'gb18030')).to eq('Tsch黶s!') + end + end + + context 'with an invalid from: option' do + let(:original_string) { '―陈志' } + let(:input_encoding) { Encoding::GB18030 } + + it 'does not try it' do + expect { subject.encode('utf-8', 'gb2312') } + .to raise_error(Encoding::InvalidByteSequenceError) + + expect { subject.utf8_encode(from: 'gb2312') } + .not_to raise_error(Encoding::InvalidByteSequenceError) + end + + it 'uses the detected input encoding instead' do + expect(subject.utf8_encode(from: 'gb2312')).to eq(original_string) + end + end + end + end +end diff --git a/test/unit/email_parser_test.rb b/test/unit/email_parser_test.rb index 54ee3d61b..48168cfd4 100644 --- a/test/unit/email_parser_test.rb +++ b/test/unit/email_parser_test.rb @@ -464,7 +464,7 @@ Managing Director: Martin Edenhofer # mutt c1abb5fb77a9d2ab2017749a7987c074 { md5: '2ef81e47872d42efce7ef34bfa2de043', - filename: '¼¨Ð§¹ÜÀí,¾¿¾¹Ë­´íÁË.xls', + filename: '绩效管理,究竟谁错了.xls', }, ], params: { @@ -619,7 +619,7 @@ Managing Director: Martin Edenhofer { data: IO.read('test/fixtures/mail21.box'), source: 'test/fixtures/mail21.box', - body_md5: '7cb50fe6b37420fe9aea61eb5badc25a', + body_md5: 'dea7a8979172261f61fb799b6c83742e', params: { from: 'Viagra Super Force Online ', from_email: 'pharmacy_affordable1@ertelecom.ru', @@ -631,20 +631,20 @@ Managing Director: Martin Edenhofer { data: IO.read('test/fixtures/mail22.box'), source: 'test/fixtures/mail22.box', - body_md5: '56223b1ea04a63269020cb64be7a70b0', + body_md5: '1af1f68f66713b63ce8ec4cc20c7887e', params: { from: 'Gilbertina Suthar ', from_email: 'ireoniqla@lipetsk.ru', from_display_name: 'Gilbertina Suthar', subject: 'P..E..N-I..S__-E N L A R-G E-M..E..N T-___P..I-L-L..S...Info.', to: 'Info ', - body: 'Puzzled by judith bronte dave. Melvin will want her way through with.
Continued adam helped charlie cried. Soon joined the master bathroom. Grinned adam rubbed his arms she nodded.
Freemont and they talked with beppe.
Thinking of bed and whenever adam.
Mike was too tired man to hear.
I10PQSHEJl2Nwf&tilde;2113S173 &Icirc;1mEbb5N371L&piv;C7AlFnR1&diams;HG64B242&brvbar;M2242zk&Iota;N&rceil;7&rceil;TBN&ETH; T2xPI&ograve;gI2&Atilde;lL2&Otilde;ML&perp;22Sa&Psi;RBreathed adam gave the master bedroom door.
Better get charlie took the wall.
Charlotte clark smile he saw charlie.
Dave and leaned her tears adam.
Maybe we want any help me that.
Next morning charlie gazed at their father.
Well as though adam took out here. Melvin will be more money. Called him into this one last night.
Men joined the pickup truck pulled away. Chuck could make sure that.[1] &dagger;p1C?L&thinsp;I?C&ensp;K?88&ensp;5 E R?EEOD !Chuckled adam leaned forward and le? charlie.
Just then returned to believe it here.
Freemont and pulling out several minutes.

[1] &#104;&#116;&#116;&#112;&#58;&#47;&#47;&#1072;&#1086;&#1089;&#1082;&#46;&#1088;&#1092;?jmlfwnwe&ucwkiyyc' + body: 'Puzzled by judith bronte dave. Melvin will want her way through with.
Continued adam helped charlie cried. Soon joined the master bathroom. Grinned adam rubbed his arms she nodded.
Freemont and they talked with beppe.
Thinking of bed and whenever adam.
Mike was too tired man to hear.
I°0PQSHEJlÔNwf˜Ì1§3S¬73 Î1mEbb5N37¢LϖC7AlFnRº♦HG64BÉ4Ò¦Måâ4ÊzkΙN⌉7⌉TBNÐ T×xPIògIÎÃlLøÕML⊥ÞøSaΨRBreathed adam gave the master bedroom door.
Better get charlie took the wall.
Charlotte clark smile he saw charlie.
Dave and leaned her tears adam.
Maybe we want any help me that.
Next morning charlie gazed at their father.
Well as though adam took out here. Melvin will be more money. Called him into this one last night.
Men joined the pickup truck pulled away. Chuck could make sure that.†p­C L I C K Ȟ E R EEOD !Chuckled adam leaned forward and leî charlie.
Just then returned to believe it here.
Freemont and pulling out several minutes.' }, }, { data: IO.read('test/fixtures/mail23.box'), source: 'test/fixtures/mail23.box', - body_md5: '545a1b067fd10ac636c20b44f5df8868', + body_md5: '23967dfbbc2e167332b2ecb78fb9e397', params: { from: 'marketingmanager@nthcpghana.com', from_email: 'marketingmanager@nthcpghana.com', @@ -794,7 +794,7 @@ end { data: IO.read('test/fixtures/mail31.box'), source: 'test/fixtures/mail31.box', - body_md5: '10484f3b096e85e7001da387c18871d5', + body_md5: 'd5448d34bf7f5db0a525fc83735dc11b', params: { from: '"bertha mou" ', from_email: 'zhengkang@ha.chinamobile.com', @@ -806,7 +806,7 @@ end { data: IO.read('test/fixtures/mail32.box'), source: 'test/fixtures/mail32.box', - body_md5: '6bed82e0d079e521f506e4e5d3529107', + body_md5: '9ccf94a31ace1c27e71138c3803ff178', params: { from: '"Dana.Qin" ', from_email: 'Dana.Qin6e1@gmail.com', @@ -1036,7 +1036,7 @@ end { data: IO.read('test/fixtures/mail44.box'), source: 'test/fixtures/mail44.box', - body_md5: '2f0f5a21e4393c174d4670a188fc5548', + body_md5: 'ee930244edd3b7c19494e688aa9cc41c', params: { from: '"Clement.Si" ', from_email: 'Claudia.Shu@yahoo.com.', @@ -1373,7 +1373,7 @@ delete your own text from the attached returned message. ] count = 0 - files.each { |file| + files.each { |file, i| count += 1 #p "Count: #{count}" parser = Channel::EmailParser.new diff --git a/test/unit/email_process_test.rb b/test/unit/email_process_test.rb index a9922d390..d0d620c60 100644 --- a/test/unit/email_process_test.rb +++ b/test/unit/email_process_test.rb @@ -415,96 +415,96 @@ Some Text", }, 1 => { content_type: 'text/html', - body: "_________________________________________________________________________________Please beth saw his head
+ body: %{_________________________________________________________________________________Please beth saw his head
- +
- + - + - - - + + - - + + - - + + - - - + + - - + + - + - - + + - - + + - - + + - + - + - + - + - +
9õhH3ÿoIÚõ´GÿiH±6u-û◊NQ4ùäU¹awAq¹JLZμÒIicgT1ζ2Y7⊆t 63‘Mñ36EßÝ→DAå†I048CvJ9A↑3iTc4ÉIΥvXO50ñNÁFJSð­r 154F1HPOÀ£CRxZp tLîT9öXH1b3Es±W mNàBg3õEbPŒSúfτTóY4 sUÖPÒζΔRFkcIÕ1™CÓZ3EΛRq!Cass is good to ask what that9õhH3ÿoIÚõ´GÿiH±6u-û◊NQ4ùäU¹awAq¹JLZμÒIicgT1ζ2Y7⊆t 63‘Mñ36EßÝ→DAå†I048CvJ9A↑3iTc4ÉIΥvXO50ñNÁFJSð­r 154F1HPOÀ£CRxZp tLîT9öXH1b3Es±W mNàBg3õEbPŒSúfτTóY4 sUÖPÒζΔRFkcIÕ1™CÓZ3EΛRq!Cass is good to ask what that
86ËÏuÕC L I C K H E R E28MLuke had been thinking about that.
Shannon said nothing in fact they. Matt placed the sofa with amy smiled. Since the past him with more. Maybe he checked the phone. Neither did her name only. Ryan then went inside matt.
Maybe we can have anything you sure.
86ËÏuÕC L I C K H E R E28MLuke had been thinking about that.
Shannon said nothing in fact they. Matt placed the sofa with amy smiled. Since the past him with more. Maybe he checked the phone. Neither did her name only. Ryan then went inside matt.
Maybe we can have anything you sure.
á•XMYÍÅEE£ÓN°kP'dÄÅS4⌉d √p¨HΣ>jE4y4ACüûLì“vT∧4tHXÆX: +á•XMYÍÅEE£ÓN°kP'dÄÅS4⌉d √p¨HΣ>jE4y4ACüûLì“vT∧4tHXÆX:
x5VV\"¹tiçÂaaΦ3fg¦zèr«°haeJw n§Va879sÆ3j f¶ïlÞ9lo5F¾wν¶1 κψ›a9f4sLsL ùVo$v3x1¸nz.uȦ1H4s35Ô7yoQCÄFMiMzda¯ZεlÝHNi¬cÚsù–ϖ DYhaã7Ns4Ö· n3dl1XÆo¯µ¶wpN↑ YQ7aé39s1qÓ QyL$fcÕ1ΝS5.5Wy62­d5ĶHx5VV"¹tiçÂaaΦ3fg¦zèr«°haeJw n§Va879sÆ3j f¶ïlÞ9lo5F¾wν¶1 κψ›a9f4sLsL ùVo$v3x1¸nz.uȦ1H4s35Ô7yoQCÄFMiMzda¯ZεlÝHNi¬cÚsù–ϖ DYhaã7Ns4Ö· n3dl1XÆo¯µ¶wpN↑ YQ7aé39s1qÓ QyL$fcÕ1ΝS5.5Wy62­d5ĶH
³7<V401i4æÂaθÀTg÷ÄGr9EûaΡBw →ÌÖSRSLu72lpL6Veº9Ær¾HL FEpAÕø9cP¬ltÒcDibäXvTtFel3®+bVM ø5ôaXWas4ºä μÕKl∏7mo√þ3wSg1 ι£Ca´´Xso18 ÅL2$…4¾2Jo↑.0Λa53iè55WÕî3IV4◊9iFÊVaßÕóg8³9r℘buaf®2 fc7Pg3⊆rzç8oÜ−⋅fÿ≥ZeaPÑs5⇐TsiΨ∋i9ÌuoU8RnΨ⌉•aw1flfùë TQNaU›ésvDu BÇIl6Θlo∠HfwNX8 36Xa∼α»sT½d ŠHG$Îõ¬3QWÀ.‰›Y5Ôg80¦ao
³7<V401i4æÂaθÀTg÷ÄGr9EûaΡBw →ÌÖSRSLu72lpL6Veº9Ær¾HL FEpAÕø9cP¬ltÒcDibäXvTtFel3®+bVM ø5ôaXWas4ºä μÕKl∏7mo√þ3wSg1 ι£Ca´´Xso18 ÅL2$…4¾2Jo↑.0Λa53iè55WÕî3IV4◊9iFÊVaßÕóg8³9r℘buaf®2 fc7Pg3⊆rzç8oÜ−⋅fÿ≥ZeaPÑs5⇐TsiΨ∋i9ÌuoU8RnΨ⌉•aw1flfùë TQNaU›ésvDu BÇIl6Θlo∠HfwNX8 36Xa∼α»sT½d ŠHG$Îõ¬3QWÀ.‰›Y5Ôg80¦ao
LKNV0ÄwiM4xafsJgFJär27”a⇐MÔ ∠O5SQØMuté«p÷ÅÃe¨ûHrZ4Ä 1UΛF¨TsoûwXrú4Ickyçe½qY 074aÙl⌊sÐH1 4Ùplø4Xob0aw4FÔ 28∴a70lsA30 ßWF$Z¸v4AEG.Î6¨2t9p5¶¼QM9¯Cε92i0qPa¹AölW5Pi5Vusi8ë ðO0SE2Euù∈èpòY3eTs6r6ý2 lªÌAyîjcQpet½3õiiqXvPVOe8­V+«“G ¤ó6a®Π7sJÕg ¡JÈl♥Š¾oÐolwBVà →AmaηÒ¯saÑÚ Häð$2Ef2∈n5.Œ8H95¨19⊃ƒõLKNV0ÄwiM4xafsJgFJär27”a⇐MÔ ∠O5SQØMuté«p÷ÅÃe¨ûHrZ4Ä 1UΛF¨TsoûwXrú4Ickyçe½qY 074aÙl⌊sÐH1 4Ùplø4Xob0aw4FÔ 28∴a70lsA30 ßWF$Z¸v4AEG.Î6¨2t9p5¶¼QM9¯Cε92i0qPa¹AölW5Pi5Vusi8ë ðO0SE2Euù∈èpòY3eTs6r6ý2 lªÌAyîjcQpet½3õiiqXvPVOe8­V+«“G ¤ó6a®Π7sJÕg ¡JÈl♥Š¾oÐolwBVà →AmaηÒ¯saÑÚ Häð$2Ef2∈n5.Œ8H95¨19⊃ƒõ
Up dylan in love and found herself. Sorry for beth smiled at some time Whatever you on one who looked. Except for another man and ready.
ÚúeACíøN˵UT3L♠ICë9-BŒfAoÓCL5ΒÉLHοNE5∂7RScdGX­ªIpΣuCCw∨/D¤6A´vâS0d⊂TÇ'BHfóΔMåß7A63B: +ÚúeACíøN˵UT3L♠ICë9-BŒfAoÓCL5ΒÉLHοNE5∂7RScdGX­ªIpΣuCCw∨/D¤6A´vâS0d⊂TÇ'BHfóΔMåß7A63B:
2UýV5¦Ueý¿×nRm2tæÓOoγ1øly¼Wi6pxnÀZ« câSa8ï¤sGï⊂ ΜJll1£„onbéw⌉ö1 vY8aΘmgs0Ú4 å¥G$·592KkU1®b0.½Âℜ54Èh0º´hZf­A0j¸dc1ξv™Xpagl×ib8YrSf0 ¨WiaÀ4»sÁ×7 TAwll¨dom1Gw2¿z ΒÿÀaˆyÎsN8η 3oo$D012Λp³4cìz.PA∅9ϒ7354ú92UýV5¦Ueý¿×nRm2tæÓOoγ1øly¼Wi6pxnÀZ« câSa8ï¤sGï⊂ ΜJll1£„onbéw⌉ö1 vY8aΘmgs0Ú4 å¥G$·592KkU1®b0.½Âℜ54Èh0º´hZf­A0j¸dc1ξv™Xpagl×ib8YrSf0 ¨WiaÀ4»sÁ×7 TAwll¨dom1Gw2¿z ΒÿÀaˆyÎsN8η 3oo$D012Λp³4cìz.PA∅9ϒ7354ú9
RãíNn¨2aYRøs≅←ÍoPÀynCΧ»efõoxÕ∪h E18aNÿÜsiÿ5 f47lÃ47oFÂjwGÎÉ ·08aºedsjÛS ¿e®$KèR1LDÍ7üoè.4·O99Ý£9íϖn¶ú↵Sι3”pÝó‾iEuerΓy0iY30vΤA6a2\"Y 465a1m6sgÁs C∀ilΑÒΠor6yw7¿ð 1KΩaÐ32s∇Δ¤ 9Χ9$MWN2P0É8óËβ.Ö∩S93íñ0RQ’RãíNn¨2aYRøs≅←ÍoPÀynCΧ»efõoxÕ∪h E18aNÿÜsiÿ5 f47lÃ47oFÂjwGÎÉ ·08aºedsjÛS ¿e®$KèR1LDÍ7üoè.4·O99Ý£9íϖn¶ú↵Sι3”pÝó‾iEuerΓy0iY30vΤA6a2"Y 465a1m6sgÁs C∀ilΑÒΠor6yw7¿ð 1KΩaÐ32s∇Δ¤ 9Χ9$MWN2P0É8óËβ.Ö∩S93íñ0RQ’
Have anything but matty is taking care. Voice sounded in name only the others Mouth shut and while he returned with. Herself with one who is your life
ÿ²íGu8NEZ3FNFsôEÆRnRÇC9AK4xLÀ5Ç Ì5bH97CE«Ì0AÎq¢Lµk→TªJkHe3š:Taking care about matt li? ed ryan. Knowing he should be there.ÿ²íGu8NEZ3FNFsôEÆRnRÇC9AK4xLÀ5Ç Ì5bH97CE«Ì0AÎq¢Lµk→TªJkHe3š:Taking care about matt liî ed ryan. Knowing he should be there.
Ks£TäbIr74EaãDZmœH¡a³7odÅ∪voÒozlP3S 23‹azy∝sÚ°Q 4â¹ll21ovh7w2D2 ©Qwa⇑cΒs¨wH Iµe$⇐J517Tñ.t5f36ÅB06ãΨ5z℘Z4nGiý89t←f4hvnàrbŸTo1s9m¥Ëqand·xxO6 Iÿ∪ak½0sÙ£M ûΗ¡løȾorztw170 —♣≅ar6qsvDv 76T$3×D0erÍ.d¼07WoI5ÀKúKs£TäbIr74EaãDZmœH¡a³7odÅ∪voÒozlP3S 23‹azy∝sÚ°Q 4â¹ll21ovh7w2D2 ©Qwa⇑cΒs¨wH Iµe$⇐J517Tñ.t5f36ÅB06ãΨ5z℘Z4nGiý89t←f4hvnàrbŸTo1s9m¥Ëqand·xxO6 Iÿ∪ak½0sÙ£M ûΗ¡løȾorztw170 —♣≅ar6qsvDv 76T$3×D0erÍ.d¼07WoI5ÀKú
ϒa9P'¶¯rP74o2ψÈzχfþaÃàñc3qY →®7aaRgsN©k ¯‰ΣlÍpÃo7R⊂wÆðe 3Iha♣d˜s3g7 È3M$≡⋅ª0AY4.Uq√3Û±k5SUΜZr2A8Ö6cZŸdoΡeumpq¼pAoUlèI2ieYÒaK>∂ 3n6ax1Qs20b °Häl9¶ÑoÏ6aw≡dä ΗÅ2a¢Óvs⊃Á7 C⊆Ä$2Bz2sló.∫Pb5ØMx0oQdϒa9P'¶¯rP74o2ψÈzχfþaÃàñc3qY →®7aaRgsN©k ¯‰ΣlÍpÃo7R⊂wÆðe 3Iha♣d˜s3g7 È3M$≡⋅ª0AY4.Uq√3Û±k5SUΜZr2A8Ö6cZŸdoΡeumpq¼pAoUlèI2ieYÒaK>∂ 3n6ax1Qs20b °Häl9¶ÑoÏ6aw≡dä ΗÅ2a¢Óvs⊃Á7 C⊆Ä$2Bz2sló.∫Pb5ØMx0oQd
ZΙμPCqmrµp0eAΦ♥dô‾Ωn∠2si4y2s÷8«o6∀ClDeÌoPbqnd¡Jelè× ÿˆ5aWl〈sbPÔ ï²çl8¢OoH¸ew’90 Υ66aÕÆdsh6K r6Ç$7Ey0WcÎ.£—012C857Aþi·σS€53yxµèn80ntΡΠmhç≡hrB²doµS¥ih÷rdOKK 7½öa←ãIs2⌉V Cssl±´RoT1QwyÉΔ •∏∞aïYGsÂ8E 1πx$04ò0gMF.bTQ3Íx658ùςZΙμPCqmrµp0eAΦ♥dô‾Ωn∠2si4y2s÷8«o6∀ClDeÌoPbqnd¡Jelè× ÿˆ5aWl〈sbPÔ ï²çl8¢OoH¸ew’90 Υ66aÕÆdsh6K r6Ç$7Ey0WcÎ.£—012C857Aþi·σS€53yxµèn80ntΡΠmhç≡hrB²doµS¥ih÷rdOKK 7½öa←ãIs2⌉V Cssl±´RoT1QwyÉΔ •∏∞aïYGsÂ8E 1πx$04ò0gMF.bTQ3Íx658ùς
Maybe even though she followed. Does this mean you talking about. Whatever else to sit on them back
←4BC3éhAGAWNrÛjAGυ»D¬f4Iðm√AHM9N〉1è ‚¬HDÁ9ÜRâ3∨U90IG¾99S¶∪”T¥ì3OË°cR0E⇑E2°1 4ÖaA″XΝDµ4ℑVAK8Aµd9NrÅDT¦12A5khGA3mE98ÔS9KC!5TU←4BC3éhAGAWNrÛjAGυ»D¬f4Iðm√AHM9N〉1è ‚¬HDÁ9ÜRâ3∨U90IG¾99S¶∪”T¥ì3OË°cR0E⇑E2°1 4ÖaA″XΝDµ4ℑVAK8Aµd9NrÅDT¦12A5khGA3mE98ÔS9KC!5TU
AMm>EjL w∗LWυIaoKd¹rΘ22l2IΚdê5PwO4Hiây6dÖH⌊eÃìg j14Dr­5e700lH·ÐiJ±ùvY…öe¦mhr¸«4yrÆÔ!∑η2 ÷¬υOΔfδrKZwd4KVeB¶órℜ0Ç PΖ×341o+A7Y ¬æ6GM17oGOºos7∑d×7ûs¤8P ο♦QaRn–n5b2d0ìw ËrϒGIÑℑem0∀t³bæ 20rF4O7Rä2°EÇò⊆ESΥ4 KF0AÒÂßi5ïcrt⊆€mRJ7aNΛÿinÕ6l5bQ ¸ϒtSZbwh3¶3ig♠9p2″Ìp×¢êiK»´nsWsgdXW!tBOAMm>EjL w∗LWυIaoKd¹rΘ22l2IΚdê5PwO4Hiây6dÖH⌊eÃìg j14Dr­5e700lH·ÐiJ±ùvY…öe¦mhr¸«4yrÆÔ!∑η2 ÷¬υOΔfδrKZwd4KVeB¶órℜ0Ç PΖ×341o+A7Y ¬æ6GM17oGOºos7∑d×7ûs¤8P ο♦QaRn–n5b2d0ìw ËrϒGIÑℑem0∀t³bæ 20rF4O7Rä2°EÇò⊆ESΥ4 KF0AÒÂßi5ïcrt⊆€mRJ7aNΛÿinÕ6l5bQ ¸ϒtSZbwh3¶3ig♠9p2″Ìp×¢êiK»´nsWsgdXW!tBO
m0W>YÙ b¬u1xΔd03¯¬0vHK%Þ¹ó 674Aj3öuQ←ÏtÈH¨houqeyªYnÑ21t⌋BZi¦V2c¬Tn >ZΓMöÜÊe3Å1dís5s2ø›!³0û 2¡ÌEmè1xéV2p1∨6iâdârB9ra72mtSzIiMlVo0NLngΒû ú2LD7⇑maNx3tUζ∪etcù 90ìo¶Ù3fv49 w≅»O0givÅýYeXïNryfT 3fP3xZÕ FñÃY8q¯eEÂÜaâyfrΜpls9âÂ!qκÊm0W>YÙ b¬u1xΔd03¯¬0vHK%Þ¹ó 674Aj3öuQ←ÏtÈH¨houqeyªYnÑ21t⌋BZi¦V2c¬Tn >ZΓMöÜÊe3Å1dís5s2ø›!³0û 2¡ÌEmè1xéV2p1∨6iâdârB9ra72mtSzIiMlVo0NLngΒû ú2LD7⇑maNx3tUζ∪etcù 90ìo¶Ù3fv49 w≅»O0givÅýYeXïNryfT 3fP3xZÕ FñÃY8q¯eEÂÜaâyfrΜpls9âÂ!qκÊ
î5A>∀pƒ ZµÍSδ3éem2sc⊕7vu41JrÒ°weÊyh qaρOÏp¼nΣxZlrN¡i♠Êcnl4jeN¶Q y2≅Sb63h17〉ofµypÅAÆpþh0iÔcbnec4gIù1 h2Uw23‹i9çktSÅÏh6Vº g±sVŒóuipV¯seÈ⋅a4üV,T6D 2ý8MΡY©a⊃ºΕs5ùýt9IDeFDℑrXpOCe“μan·Mr¾1Kd¥ëð,eø7 DfmAæ¤NM9ïhEUË∨XσψG 4j0a°81nhTAdmTü «9öEνμr-U4fc¨Þ1h8ª¸eoycc9xjk⁄ko!ë9Kî5A>∀pƒ ZµÍSδ3éem2sc⊕7vu41JrÒ°weÊyh qaρOÏp¼nΣxZlrN¡i♠Êcnl4jeN¶Q y2≅Sb63h17〉ofµypÅAÆpþh0iÔcbnec4gIù1 h2Uw23‹i9çktSÅÏh6Vº g±sVŒóuipV¯seÈ⋅a4üV,T6D 2ý8MΡY©a⊃ºΕs5ùýt9IDeFDℑrXpOCe“μan·Mr¾1Kd¥ëð,eø7 DfmAæ¤NM9ïhEUË∨XσψG 4j0a°81nhTAdmTü «9öEνμr-U4fc¨Þ1h8ª¸eoycc9xjk⁄ko!ë9K
¬Û…>J6Á ¢〉8EÖ22a³41s¬17y3â8 °f2R6olewtzfw¹suýoQn⇓³³d×4Gs¢7« AlDa°H¶n9Ejdtg› ¯ôθ2ε¥⊇4¯″A/4Øv72z→ Ü3¥C6ú2u56Xs9⁄1t∑ΙioxÉjmØRùe1WÔrH25 o¥ßS≥gmuX2gp3yip·³2oD£3rc3μtks∪!sWK¬Û…>J6Á ¢〉8EÖ22a³41s¬17y3â8 °f2R6olewtzfw¹suýoQn⇓³³d×4Gs¢7« AlDa°H¶n9Ejdtg› ¯ôθ2ε¥⊇4¯″A/4Øv72z→ Ü3¥C6ú2u56Xs9⁄1t∑ΙioxÉjmØRùe1WÔrH25 o¥ßS≥gmuX2gp3yip·³2oD£3rc3μtks∪!sWK
-
When she were there you here. Lott to need for amy said.
Once more than ever since matt. Lott said turning o? ered. Tell you so matt kept going.
Homegrown dandelions by herself into her lips. Such an excuse to stop thinking about. Leave us and be right.

+When she were there you here. Lott to need for amy said.
Once more than ever since matt. Lott said turning oď ered. Tell you so matt kept going.
Homegrown dandelions by herself into her lips. Such an excuse to stop thinking about. Leave us and be right.


- +
- -
- + + -

?????? ?????????????????? ???????????????? ???? ?????????????? ?? ???????????????????????? ???? ?????????????????? avast! Antivirus ???????????? ??????????????.

+

Это сообщение свободно от вирусов и вредоносного ПО благодаря avast! Antivirus защита активна.

", +}, sender: 'Customer', type: 'email', internal: false, @@ -521,7 +521,7 @@ Some Text", }, 1 => { content_type: 'text/html', - body: 'Puzzled by judith bronte dave. Melvin will want her way through with.
Continued adam helped charlie cried. Soon joined the master bathroom. Grinned adam rubbed his arms she nodded.
Freemont and they talked with beppe.
Thinking of bed and whenever adam.
Mike was too tired man to hear.
I10PQSHEJl2Nwf&tilde;2113S173 &Icirc;1mEbb5N371L&piv;C7AlFnR1&diams;HG64B242&brvbar;M2242zk&Iota;N&rceil;7&rceil;TBN&ETH; T2xPI&ograve;gI2&Atilde;lL2&Otilde;ML&perp;22Sa&Psi;RBreathed adam gave the master bedroom door.
Better get charlie took the wall.
Charlotte clark smile he saw charlie.
Dave and leaned her tears adam.
Maybe we want any help me that.
Next morning charlie gazed at their father.
Well as though adam took out here. Melvin will be more money. Called him into this one last night.
Men joined the pickup truck pulled away. Chuck could make sure that.[1] &dagger;p1C?L&thinsp;I?C&ensp;K?88&ensp;5 E R?EEOD !Chuckled adam leaned forward and le? charlie.
Just then returned to believe it here.
Freemont and pulling out several minutes.

[1] &#104;&#116;&#116;&#112;&#58;&#47;&#47;&#1072;&#1086;&#1089;&#1082;&#46;&#1088;&#1092;?jmlfwnwe&ucwkiyyc', + body: 'Puzzled by judith bronte dave. Melvin will want her way through with.
Continued adam helped charlie cried. Soon joined the master bathroom. Grinned adam rubbed his arms she nodded.
Freemont and they talked with beppe.
Thinking of bed and whenever adam.
Mike was too tired man to hear.
I°0PQSHEJlÔNwf˜Ì1§3S¬73 Î1mEbb5N37¢LϖC7AlFnRº♦HG64BÉ4Ò¦Måâ4ÊzkΙN⌉7⌉TBNÐ T×xPIògIÎÃlLøÕML⊥ÞøSaΨRBreathed adam gave the master bedroom door.
Better get charlie took the wall.
Charlotte clark smile he saw charlie.
Dave and leaned her tears adam.
Maybe we want any help me that.
Next morning charlie gazed at their father.
Well as though adam took out here. Melvin will be more money. Called him into this one last night.
Men joined the pickup truck pulled away. Chuck could make sure that.†p­C L I C K Ȟ E R EEOD !Chuckled adam leaned forward and leî charlie.
Just then returned to believe it here.
Freemont and pulling out several minutes.', sender: 'Customer', type: 'email', internal: false, @@ -538,7 +538,7 @@ Some Text", }, 1 => { from: 'marketingmanager@nthcpghana.com', - body: '»ú·¿»·¾³·¨¹æ + body: '机房环境法规 Message-ID: <20140911055224675615@nthcpghana.com> From: =?utf-8?B?6IOh5qW35ZKM?= To: , @@ -2524,10 +2524,10 @@ Some Text', result: { 0 => { priority: '2 normal', - title: 'ת·¢£ºÕûÌåÌáÉýÆóÒµ·þÎñˮƽ', + title: '转发:整体提升企业服务水平', }, 1 => { - from: '"ÎäÀ¼³É" ', + from: '"武兰成" ', sender: 'Customer', type: 'email', }, @@ -2535,9 +2535,9 @@ Some Text', verify: { users: [ { - firstname: 'ÎäÀ¼³É', + firstname: '武兰成', lastname: '', - fullname: 'ÎäÀ¼³É', + fullname: '武兰成', email: 'glopelf7121@example.com', }, ], @@ -2655,7 +2655,7 @@ Some Text', from: 'Martin Edenhofer ', sender: 'Customer', type: 'email', - body: 'Here it goes - ?????? - ?????????Here it goes - ??? - hi ?', + body: "Here it goes - äÜß - 塎ĺ\u0087şäşşHere it goes - äöü - hi ­", }, }, verify: { From dfebe8d767b38575c21c1fca3df6b82bf63ca895 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Tue, 5 Jun 2018 11:28:12 +0800 Subject: [PATCH 3/7] Relocate test data files from test/fixtures to test/data --- app/models/channel/driver/mail_stdin.rb | 4 +- app/models/channel/email_parser.rb | 6 +- lib/core_ext/string.rb | 2 +- lib/enrichment/clearbit/user.rb | 4 +- test/browser/agent_ticket_attachment_test.rb | 8 +- test/browser_test_helper.rb | 2 +- .../organization_controller_test.rb | 9 +- .../text_module_controller_test.rb | 9 +- ...ket_article_attachments_controller_test.rb | 9 +- test/controllers/user_controller_test.rb | 9 +- .../{fixtures => data/calendar}/calendar1.ics | 0 .../{fixtures => data/calendar}/calendar2.ics | 0 .../{fixtures => data/calendar}/calendar3.ics | 0 .../clearbit/alex@alexmaccaw.com.json | 0 .../clearbit/me2@example.com.json | 0 .../clearbit/me@example.com.json | 0 .../clearbit/testing3@znuny.com.json | 0 .../clearbit/testing4@znuny.com.json | 0 .../clearbit/testing5@znuny.com.json | 0 .../clearbit/testing6@znuny.com.json | 0 .../csv/organization_simple.csv | 0 .../organization_simple_col_not_existing.csv | 0 .../csv/text_module_simple.csv | 0 .../text_module_simple_col_not_existing.csv | 0 test/{fixtures => data}/csv/user_simple.csv | 0 .../csv/user_simple_col_not_existing.csv | 0 .../elasticsearch}/es-box1.box | 0 .../elasticsearch}/es-normal.txt | 0 .../elasticsearch}/es-pdf1.pdf | Bin .../elasticsearch}/es-too-big.txt | 0 .../email_signature_detection/client_a_1.txt | 0 .../email_signature_detection/client_a_2.txt | 0 .../email_signature_detection/client_a_3.txt | 0 .../email_signature_detection/client_b_1.txt | 0 .../email_signature_detection/client_b_2.txt | 0 .../email_signature_detection/client_b_3.txt | 0 .../email_signature_detection/client_c_1.html | 0 .../email_signature_detection/client_c_2.html | 0 .../email_signature_detection/client_c_3.html | 0 .../email_signature_detection/example1.html | 0 .../idoit/object_types_filter_response.json | 0 .../idoit/object_types_response.json | 0 .../mail1.box => data/mail/mail001.box} | 0 .../mail2.box => data/mail/mail002.box} | 0 .../mail3.box => data/mail/mail003.box} | 0 .../mail4.box => data/mail/mail004.box} | 0 .../mail5.box => data/mail/mail005.box} | 0 .../mail6.box => data/mail/mail006.box} | 0 .../mail7.box => data/mail/mail007.box} | 0 .../mail8.box => data/mail/mail008.box} | 0 .../mail9.box => data/mail/mail009.box} | 0 .../mail10.box => data/mail/mail010.box} | 0 .../mail11.box => data/mail/mail011.box} | 0 .../mail12.box => data/mail/mail012.box} | 0 .../mail13.box => data/mail/mail013.box} | 0 .../mail14.box => data/mail/mail014.box} | 0 .../mail15.box => data/mail/mail015.box} | 0 .../mail16.box => data/mail/mail016.box} | 0 .../mail17.box => data/mail/mail017.box} | 0 .../mail18.box => data/mail/mail018.box} | 0 .../mail19.box => data/mail/mail019.box} | 0 .../mail20.box => data/mail/mail020.box} | 0 .../mail21.box => data/mail/mail021.box} | 0 .../mail22.box => data/mail/mail022.box} | 0 .../mail23.box => data/mail/mail023.box} | 0 .../mail24.box => data/mail/mail024.box} | 0 .../mail25.box => data/mail/mail025.box} | 0 .../mail26.box => data/mail/mail026.box} | 0 .../mail27.box => data/mail/mail027.box} | 0 .../mail28.box => data/mail/mail028.box} | 0 .../mail29.box => data/mail/mail029.box} | 0 .../mail30.box => data/mail/mail030.box} | 0 .../mail31.box => data/mail/mail031.box} | 0 .../mail32.box => data/mail/mail032.box} | 0 ...3-undelivered-mail-returned-to-sender.box} | 0 .../mail34.box => data/mail/mail034.box} | 0 .../mail35.box => data/mail/mail035.box} | 0 .../mail36.box => data/mail/mail036.box} | 0 .../mail37.box => data/mail/mail037.box} | 0 .../mail38.box => data/mail/mail038.box} | 0 .../mail39.box => data/mail/mail039.box} | 0 .../mail40.box => data/mail/mail040.box} | 0 .../mail41.box => data/mail/mail041.box} | 0 .../mail42.box => data/mail/mail042.box} | 0 .../mail43.box => data/mail/mail043.box} | 0 .../mail44.box => data/mail/mail044.box} | 0 .../mail45.box => data/mail/mail045.box} | 0 .../mail46.box => data/mail/mail046.box} | 0 .../mail47.box => data/mail/mail047.box} | 0 .../mail48.box => data/mail/mail048.box} | 0 .../mail49.box => data/mail/mail049.box} | 0 .../mail50.box => data/mail/mail050.box} | 0 .../mail51.box => data/mail/mail051.box} | 0 .../mail52.box => data/mail/mail052.box} | 0 .../mail53.box => data/mail/mail053.box} | 0 .../mail54.box => data/mail/mail054.box} | 0 .../mail55.box => data/mail/mail055.box} | 0 .../mail56.box => data/mail/mail056.box} | 0 .../mail57.box => data/mail/mail057.box} | 0 .../mail58.box => data/mail/mail058.box} | 0 .../mail59.box => data/mail/mail059.box} | 0 .../mail60.box => data/mail/mail060.box} | 0 .../mail62.box => data/mail/mail062.box} | 0 .../mail63.box => data/mail/mail063.box} | 0 .../mail64.box => data/mail/mail064.box} | 0 .../mail65.box => data/mail/mail065.box} | 0 .../mail66.box => data/mail/mail066.box} | 0 test/{fixtures => data/pdf}/test1.pdf | Bin .../telegram/channel1_message_content1.json | 0 .../telegram/channel1_message_content2.json | 0 .../telegram/channel1_message_content3.json | 0 .../telegram/channel1_message_content4.json | 0 .../telegram/channel1_message_content5.json | 0 .../telegram/channel2_message_content1.json | 0 .../telegram/personal1_message_content1.json | 0 .../telegram/personal1_message_content2.json | 0 .../telegram/personal1_message_end.json | 0 .../telegram/personal1_message_start.json | 0 .../telegram/personal2_message_content1.json | 0 .../telegram/personal2_message_content2.json | 0 .../telegram/personal2_message_start.json | 0 .../telegram/personal3_message_content1.json | 0 .../telegram/personal3_message_content2.json | 0 .../telegram/personal3_message_content3.json | 0 .../telegram/personal3_message_content4.json | 0 .../telegram/personal3_message_content5.json | 0 .../telegram/personal3_message_start.json | 0 .../telegram/personal4_message_content1.json | 0 .../telegram/personal5_message_content1.json | 0 .../telegram/personal5_message_content2.json | 0 .../ticket_trigger/mail1.box | 0 .../ticket_trigger/mail2.box | 0 .../ticket_trigger/mail3.box | 0 test/{fixtures => data/upload}/upload1.txt | 0 test/{fixtures => data/upload}/upload2.jpg | Bin test/integration/elasticsearch_test.rb | 10 +- test/integration/idoit_controller_test.rb | 2 +- test/integration/telegram_controller_test.rb | 2 +- test/unit/calendar_test.rb | 8 +- test/unit/email_parser_test.rb | 224 +++++++++--------- ...s_bounce_delivery_permanent_failed_test.rb | 4 +- test/unit/email_process_bounce_follow_test.rb | 9 +- test/unit/email_process_test.rb | 38 +-- test/unit/email_signatur_detection_test.rb | 132 ----------- test/unit/email_signature_detection_test.rb | 125 ++++++++++ test/unit/store_test.rb | 4 +- test/unit/ticket_article_store_empty.rb | 4 +- .../ticket_trigger_recursive_disabled_test.rb | 20 +- test/unit/ticket_trigger_test.rb | 20 +- 149 files changed, 337 insertions(+), 327 deletions(-) rename test/{fixtures => data/calendar}/calendar1.ics (100%) rename test/{fixtures => data/calendar}/calendar2.ics (100%) rename test/{fixtures => data/calendar}/calendar3.ics (100%) rename test/{fixtures => data}/clearbit/alex@alexmaccaw.com.json (100%) rename test/{fixtures => data}/clearbit/me2@example.com.json (100%) rename test/{fixtures => data}/clearbit/me@example.com.json (100%) rename test/{fixtures => data}/clearbit/testing3@znuny.com.json (100%) rename test/{fixtures => data}/clearbit/testing4@znuny.com.json (100%) rename test/{fixtures => data}/clearbit/testing5@znuny.com.json (100%) rename test/{fixtures => data}/clearbit/testing6@znuny.com.json (100%) rename test/{fixtures => data}/csv/organization_simple.csv (100%) rename test/{fixtures => data}/csv/organization_simple_col_not_existing.csv (100%) rename test/{fixtures => data}/csv/text_module_simple.csv (100%) rename test/{fixtures => data}/csv/text_module_simple_col_not_existing.csv (100%) rename test/{fixtures => data}/csv/user_simple.csv (100%) rename test/{fixtures => data}/csv/user_simple_col_not_existing.csv (100%) rename test/{fixtures => data/elasticsearch}/es-box1.box (100%) rename test/{fixtures => data/elasticsearch}/es-normal.txt (100%) rename test/{fixtures => data/elasticsearch}/es-pdf1.pdf (100%) rename test/{fixtures => data/elasticsearch}/es-too-big.txt (100%) rename test/{fixtures => data}/email_signature_detection/client_a_1.txt (100%) rename test/{fixtures => data}/email_signature_detection/client_a_2.txt (100%) rename test/{fixtures => data}/email_signature_detection/client_a_3.txt (100%) rename test/{fixtures => data}/email_signature_detection/client_b_1.txt (100%) rename test/{fixtures => data}/email_signature_detection/client_b_2.txt (100%) rename test/{fixtures => data}/email_signature_detection/client_b_3.txt (100%) rename test/{fixtures => data}/email_signature_detection/client_c_1.html (100%) rename test/{fixtures => data}/email_signature_detection/client_c_2.html (100%) rename test/{fixtures => data}/email_signature_detection/client_c_3.html (100%) rename test/{fixtures => data}/email_signature_detection/example1.html (100%) rename test/{fixtures => data}/idoit/object_types_filter_response.json (100%) rename test/{fixtures => data}/idoit/object_types_response.json (100%) rename test/{fixtures/mail1.box => data/mail/mail001.box} (100%) rename test/{fixtures/mail2.box => data/mail/mail002.box} (100%) rename test/{fixtures/mail3.box => data/mail/mail003.box} (100%) rename test/{fixtures/mail4.box => data/mail/mail004.box} (100%) rename test/{fixtures/mail5.box => data/mail/mail005.box} (100%) rename test/{fixtures/mail6.box => data/mail/mail006.box} (100%) rename test/{fixtures/mail7.box => data/mail/mail007.box} (100%) rename test/{fixtures/mail8.box => data/mail/mail008.box} (100%) rename test/{fixtures/mail9.box => data/mail/mail009.box} (100%) rename test/{fixtures/mail10.box => data/mail/mail010.box} (100%) rename test/{fixtures/mail11.box => data/mail/mail011.box} (100%) rename test/{fixtures/mail12.box => data/mail/mail012.box} (100%) rename test/{fixtures/mail13.box => data/mail/mail013.box} (100%) rename test/{fixtures/mail14.box => data/mail/mail014.box} (100%) rename test/{fixtures/mail15.box => data/mail/mail015.box} (100%) rename test/{fixtures/mail16.box => data/mail/mail016.box} (100%) rename test/{fixtures/mail17.box => data/mail/mail017.box} (100%) rename test/{fixtures/mail18.box => data/mail/mail018.box} (100%) rename test/{fixtures/mail19.box => data/mail/mail019.box} (100%) rename test/{fixtures/mail20.box => data/mail/mail020.box} (100%) rename test/{fixtures/mail21.box => data/mail/mail021.box} (100%) rename test/{fixtures/mail22.box => data/mail/mail022.box} (100%) rename test/{fixtures/mail23.box => data/mail/mail023.box} (100%) rename test/{fixtures/mail24.box => data/mail/mail024.box} (100%) rename test/{fixtures/mail25.box => data/mail/mail025.box} (100%) rename test/{fixtures/mail26.box => data/mail/mail026.box} (100%) rename test/{fixtures/mail27.box => data/mail/mail027.box} (100%) rename test/{fixtures/mail28.box => data/mail/mail028.box} (100%) rename test/{fixtures/mail29.box => data/mail/mail029.box} (100%) rename test/{fixtures/mail30.box => data/mail/mail030.box} (100%) rename test/{fixtures/mail31.box => data/mail/mail031.box} (100%) rename test/{fixtures/mail32.box => data/mail/mail032.box} (100%) rename test/{fixtures/mail33-undelivered-mail-returned-to-sender.box => data/mail/mail033-undelivered-mail-returned-to-sender.box} (100%) rename test/{fixtures/mail34.box => data/mail/mail034.box} (100%) rename test/{fixtures/mail35.box => data/mail/mail035.box} (100%) rename test/{fixtures/mail36.box => data/mail/mail036.box} (100%) rename test/{fixtures/mail37.box => data/mail/mail037.box} (100%) rename test/{fixtures/mail38.box => data/mail/mail038.box} (100%) rename test/{fixtures/mail39.box => data/mail/mail039.box} (100%) rename test/{fixtures/mail40.box => data/mail/mail040.box} (100%) rename test/{fixtures/mail41.box => data/mail/mail041.box} (100%) rename test/{fixtures/mail42.box => data/mail/mail042.box} (100%) rename test/{fixtures/mail43.box => data/mail/mail043.box} (100%) rename test/{fixtures/mail44.box => data/mail/mail044.box} (100%) rename test/{fixtures/mail45.box => data/mail/mail045.box} (100%) rename test/{fixtures/mail46.box => data/mail/mail046.box} (100%) rename test/{fixtures/mail47.box => data/mail/mail047.box} (100%) rename test/{fixtures/mail48.box => data/mail/mail048.box} (100%) rename test/{fixtures/mail49.box => data/mail/mail049.box} (100%) rename test/{fixtures/mail50.box => data/mail/mail050.box} (100%) rename test/{fixtures/mail51.box => data/mail/mail051.box} (100%) rename test/{fixtures/mail52.box => data/mail/mail052.box} (100%) rename test/{fixtures/mail53.box => data/mail/mail053.box} (100%) rename test/{fixtures/mail54.box => data/mail/mail054.box} (100%) rename test/{fixtures/mail55.box => data/mail/mail055.box} (100%) rename test/{fixtures/mail56.box => data/mail/mail056.box} (100%) rename test/{fixtures/mail57.box => data/mail/mail057.box} (100%) rename test/{fixtures/mail58.box => data/mail/mail058.box} (100%) rename test/{fixtures/mail59.box => data/mail/mail059.box} (100%) rename test/{fixtures/mail60.box => data/mail/mail060.box} (100%) rename test/{fixtures/mail62.box => data/mail/mail062.box} (100%) rename test/{fixtures/mail63.box => data/mail/mail063.box} (100%) rename test/{fixtures/mail64.box => data/mail/mail064.box} (100%) rename test/{fixtures/mail65.box => data/mail/mail065.box} (100%) rename test/{fixtures/mail66.box => data/mail/mail066.box} (100%) rename test/{fixtures => data/pdf}/test1.pdf (100%) rename test/{fixtures => data}/telegram/channel1_message_content1.json (100%) rename test/{fixtures => data}/telegram/channel1_message_content2.json (100%) rename test/{fixtures => data}/telegram/channel1_message_content3.json (100%) rename test/{fixtures => data}/telegram/channel1_message_content4.json (100%) rename test/{fixtures => data}/telegram/channel1_message_content5.json (100%) rename test/{fixtures => data}/telegram/channel2_message_content1.json (100%) rename test/{fixtures => data}/telegram/personal1_message_content1.json (100%) rename test/{fixtures => data}/telegram/personal1_message_content2.json (100%) rename test/{fixtures => data}/telegram/personal1_message_end.json (100%) rename test/{fixtures => data}/telegram/personal1_message_start.json (100%) rename test/{fixtures => data}/telegram/personal2_message_content1.json (100%) rename test/{fixtures => data}/telegram/personal2_message_content2.json (100%) rename test/{fixtures => data}/telegram/personal2_message_start.json (100%) rename test/{fixtures => data}/telegram/personal3_message_content1.json (100%) rename test/{fixtures => data}/telegram/personal3_message_content2.json (100%) rename test/{fixtures => data}/telegram/personal3_message_content3.json (100%) rename test/{fixtures => data}/telegram/personal3_message_content4.json (100%) rename test/{fixtures => data}/telegram/personal3_message_content5.json (100%) rename test/{fixtures => data}/telegram/personal3_message_start.json (100%) rename test/{fixtures => data}/telegram/personal4_message_content1.json (100%) rename test/{fixtures => data}/telegram/personal5_message_content1.json (100%) rename test/{fixtures => data}/telegram/personal5_message_content2.json (100%) rename test/{fixtures => data}/ticket_trigger/mail1.box (100%) rename test/{fixtures => data}/ticket_trigger/mail2.box (100%) rename test/{fixtures => data}/ticket_trigger/mail3.box (100%) rename test/{fixtures => data/upload}/upload1.txt (100%) rename test/{fixtures => data/upload}/upload2.jpg (100%) delete mode 100644 test/unit/email_signatur_detection_test.rb create mode 100644 test/unit/email_signature_detection_test.rb diff --git a/app/models/channel/driver/mail_stdin.rb b/app/models/channel/driver/mail_stdin.rb index b6257b84a..e5e3354e4 100644 --- a/app/models/channel/driver/mail_stdin.rb +++ b/app/models/channel/driver/mail_stdin.rb @@ -10,11 +10,11 @@ process emails from STDIN e. g. - cat test/fixtures/mail1.box | rails r 'Channel::Driver::MailStdin.new' + cat test/data/mail/mail001.box | rails r 'Channel::Driver::MailStdin.new' e. g. if you want to trust on mail headers - cat test/fixtures/mail1.box | rails r 'Channel::Driver::MailStdin.new(trusted: true)' + cat test/data/mail/mail001.box | rails r 'Channel::Driver::MailStdin.new(trusted: true)' =end diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index bb1cb367e..97fb331f8 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.rb @@ -190,7 +190,7 @@ class Channel::EmailParser # get attachments mail.parts&.each do |part| - # protect process to work fine with spam emails, see test/fixtures/mail15.box + # protect process to work fine with spam emails, see test/data/mail/mail015.box begin attachs = _get_attachment(part, data[:attachments], mail) data[:attachments].concat(attachs) @@ -848,7 +848,7 @@ module Mail end end - # workaround to parse subjects with 2 different encodings correctly (e. g. quoted-printable see test/fixtures/mail9.box) + # workaround to parse subjects with 2 different encodings correctly (e. g. quoted-printable see test/data/mail/mail009.box) module Encodings def self.value_decode(str) # Optimization: If there's no encoded-words in the string, just return it @@ -884,7 +884,7 @@ module Mail end end - # issue#348 - IMAP mail fetching stops because of broken spam email (e. g. broken Content-Transfer-Encoding value see test/fixtures/mail43.box) + # issue#348 - IMAP mail fetching stops because of broken spam email (e. g. broken Content-Transfer-Encoding value see test/data/mail/mail043.box) # https://github.com/zammad/zammad/issues/348 class Body def decoded diff --git a/lib/core_ext/string.rb b/lib/core_ext/string.rb index f1c2efacd..dd522da16 100644 --- a/lib/core_ext/string.rb +++ b/lib/core_ext/string.rb @@ -111,7 +111,7 @@ class String string = "#{self}" # rubocop:disable Style/UnneededInterpolation # in case of invalid encoding, strip invalid chars - # see also test/fixtures/mail21.box + # see also test/data/mail/mail021.box # note: string.encode!('UTF-8', 'UTF-8', :invalid => :replace, :replace => '?') was not detecting invalid chars if !string.valid_encoding? string = string.chars.select(&:valid_encoding?).join diff --git a/lib/enrichment/clearbit/user.rb b/lib/enrichment/clearbit/user.rb index 6dff9d66e..e885f62d4 100644 --- a/lib/enrichment/clearbit/user.rb +++ b/lib/enrichment/clearbit/user.rb @@ -119,9 +119,9 @@ module Enrichment def fetch if !Rails.env.production? - filename = Rails.root.join('test', 'fixtures', 'clearbit', "#{@local_user.email}.json") + filename = Rails.root.join('test', 'data', 'clearbit', "#{@local_user.email}.json") if File.exist?(filename) - data = IO.binread(filename) + data = File.binread(filename) return JSON.parse(data) if data end end diff --git a/test/browser/agent_ticket_attachment_test.rb b/test/browser/agent_ticket_attachment_test.rb index 87aec7d59..20318e49d 100644 --- a/test/browser/agent_ticket_attachment_test.rb +++ b/test/browser/agent_ticket_attachment_test.rb @@ -45,7 +45,8 @@ class AgentTicketAttachmentTest < TestCase # add attachment, attachment check should quiet file_upload( css: '.content.active .attachmentPlaceholder-inputHolder input', - files: ['test/fixtures/upload2.jpg', 'test/fixtures/upload1.txt'], + files: [Rails.root.join('test', 'data', 'upload', 'upload1.txt'), + Rails.root.join('test', 'data', 'upload', 'upload2.jpg')], ) # submit form @@ -91,7 +92,7 @@ class AgentTicketAttachmentTest < TestCase # add attachment, attachment check should quiet file_upload( css: '.content.active .attachmentPlaceholder-inputHolder input', - files: ['test/fixtures/upload1.txt'], + files: [Rails.root.join('test', 'data', 'upload', 'upload1.txt')], ) # submit form @@ -132,7 +133,8 @@ class AgentTicketAttachmentTest < TestCase # add attachment without body file_upload( css: '.content.active .attachmentPlaceholder-inputHolder input', - files: ['test/fixtures/upload2.jpg', 'test/fixtures/upload1.txt'], + files: [Rails.root.join('test', 'data', 'upload', 'upload1.txt'), + Rails.root.join('test', 'data', 'upload', 'upload2.jpg')], ) # submit form diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 50a77dff4..9b271e77b 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -1226,7 +1226,7 @@ set type of task (closeTab, closeNextInOverview, stayOnTab) file_upload( browser: browser1, css: '.content.active .attachmentPlaceholder-inputHolder input' - files: ['path/in/home/some_file.ext'], # 'test/fixtures/test1.pdf' + files: ['path/in/home/some_file.ext'], # 'test/data/pdf/test1.pdf' ) =end diff --git a/test/controllers/organization_controller_test.rb b/test/controllers/organization_controller_test.rb index 56d10490e..37c8ea27c 100644 --- a/test/controllers/organization_controller_test.rb +++ b/test/controllers/organization_controller_test.rb @@ -531,7 +531,8 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest credentials = ActionController::HttpAuthentication::Basic.encode_credentials('rest-admin@example.com', 'adminpw') # invalid file - csv_file = ::Rack::Test::UploadedFile.new(Rails.root.join('test', 'fixtures', 'csv', 'organization_simple_col_not_existing.csv'), 'text/csv') + csv_file_path = Rails.root.join('test', 'data', 'csv', 'organization_simple_col_not_existing.csv') + csv_file = ::Rack::Test::UploadedFile.new(csv_file_path, 'text/csv') post '/api/v1/organizations/import?try=true', params: { file: csv_file, col_sep: ';' }, headers: { 'Authorization' => credentials } assert_response(200) result = JSON.parse(@response.body) @@ -545,7 +546,8 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest assert_equal("Line 2: unknown attribute 'name2' for Organization.", result['errors'][1]) # valid file try - csv_file = ::Rack::Test::UploadedFile.new(Rails.root.join('test', 'fixtures', 'csv', 'organization_simple.csv'), 'text/csv') + csv_file_path = Rails.root.join('test', 'data', 'csv', 'organization_simple.csv') + csv_file = ::Rack::Test::UploadedFile.new(csv_file_path, 'text/csv') post '/api/v1/organizations/import?try=true', params: { file: csv_file, col_sep: ';' }, headers: { 'Authorization' => credentials } assert_response(200) result = JSON.parse(@response.body) @@ -559,7 +561,8 @@ class OrganizationControllerTest < ActionDispatch::IntegrationTest assert_nil(Organization.find_by(name: 'organization-member-import2')) # valid file - csv_file = ::Rack::Test::UploadedFile.new(Rails.root.join('test', 'fixtures', 'csv', 'organization_simple.csv'), 'text/csv') + csv_file_path = Rails.root.join('test', 'data', 'csv', 'organization_simple.csv') + csv_file = ::Rack::Test::UploadedFile.new(csv_file_path, 'text/csv') post '/api/v1/organizations/import', params: { file: csv_file, col_sep: ';' }, headers: { 'Authorization' => credentials } assert_response(200) result = JSON.parse(@response.body) diff --git a/test/controllers/text_module_controller_test.rb b/test/controllers/text_module_controller_test.rb index c028df4fa..d7d83f78c 100644 --- a/test/controllers/text_module_controller_test.rb +++ b/test/controllers/text_module_controller_test.rb @@ -101,7 +101,8 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest credentials = ActionController::HttpAuthentication::Basic.encode_credentials('rest-admin@example.com', 'adminpw') # invalid file - csv_file = ::Rack::Test::UploadedFile.new(Rails.root.join('test', 'fixtures', 'csv', 'text_module_simple_col_not_existing.csv'), 'text/csv') + csv_file_path = Rails.root.join('test', 'data', 'csv', 'text_module_simple_col_not_existing.csv') + csv_file = ::Rack::Test::UploadedFile.new(csv_file_path, 'text/csv') post '/api/v1/text_modules/import?try=true', params: { file: csv_file, col_sep: ';' }, headers: { 'Authorization' => credentials } assert_response(200) result = JSON.parse(@response.body) @@ -115,7 +116,8 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest assert_equal("Line 2: unknown attribute 'keywords2' for TextModule.", result['errors'][1]) # valid file try - csv_file = ::Rack::Test::UploadedFile.new(Rails.root.join('test', 'fixtures', 'csv', 'text_module_simple.csv'), 'text/csv') + csv_file_path = Rails.root.join('test', 'data', 'csv', 'text_module_simple.csv') + csv_file = ::Rack::Test::UploadedFile.new(csv_file_path, 'text/csv') post '/api/v1/text_modules/import?try=true', params: { file: csv_file, col_sep: ';' }, headers: { 'Authorization' => credentials } assert_response(200) result = JSON.parse(@response.body) @@ -129,7 +131,8 @@ class TextModuleControllerTest < ActionDispatch::IntegrationTest assert_nil(TextModule.find_by(name: 'some name2')) # valid file - csv_file = ::Rack::Test::UploadedFile.new(Rails.root.join('test', 'fixtures', 'csv', 'text_module_simple.csv'), 'text/csv') + csv_file_path = Rails.root.join('test', 'data', 'csv', 'text_module_simple.csv') + csv_file = ::Rack::Test::UploadedFile.new(csv_file_path, 'text/csv') post '/api/v1/text_modules/import', params: { file: csv_file, col_sep: ';' }, headers: { 'Authorization' => credentials } assert_response(200) result = JSON.parse(@response.body) diff --git a/test/controllers/ticket_article_attachments_controller_test.rb b/test/controllers/ticket_article_attachments_controller_test.rb index abee9e162..750728eb6 100644 --- a/test/controllers/ticket_article_attachments_controller_test.rb +++ b/test/controllers/ticket_article_attachments_controller_test.rb @@ -144,7 +144,8 @@ class TicketArticleAttachmentsControllerTest < ActionDispatch::IntegrationTest test '01.02 test attachments for split' do headers = { 'ACCEPT' => 'application/json', 'CONTENT_TYPE' => 'application/json' } - email_raw_string = IO.binread('test/fixtures/mail24.box') + email_file_path = Rails.root.join('test', 'data', 'mail', 'mail024.box') + email_raw_string = File.read(email_file_path) ticket_p, article_p, user_p = Channel::EmailParser.new.process({}, email_raw_string) credentials = ActionController::HttpAuthentication::Basic.encode_credentials('tickets-agent@example.com', 'agentpw') @@ -161,7 +162,8 @@ class TicketArticleAttachmentsControllerTest < ActionDispatch::IntegrationTest test '01.03 test attachments for forward' do headers = { 'ACCEPT' => 'application/json', 'CONTENT_TYPE' => 'application/json' } - email_raw_string = IO.binread('test/fixtures/mail8.box') + email_file_path = Rails.root.join('test', 'data', 'mail', 'mail008.box') + email_raw_string = File.read(email_file_path) ticket_p, article_p, user_p = Channel::EmailParser.new.process({}, email_raw_string) credentials = ActionController::HttpAuthentication::Basic.encode_credentials('tickets-agent@example.com', 'agentpw') @@ -177,7 +179,8 @@ class TicketArticleAttachmentsControllerTest < ActionDispatch::IntegrationTest assert_equal(result['attachments'].class, Array) assert(result['attachments'].blank?) - email_raw_string = IO.binread('test/fixtures/mail24.box') + email_file_path = Rails.root.join('test', 'data', 'mail', 'mail024.box') + email_raw_string = File.read(email_file_path) ticket_p, article_p, user_p = Channel::EmailParser.new.process({}, email_raw_string) post "/api/v1/ticket_attachment_upload_clone_by_article/#{article_p.id}", params: { form_id: '1234-2' }.to_json, headers: headers.merge('Authorization' => credentials) diff --git a/test/controllers/user_controller_test.rb b/test/controllers/user_controller_test.rb index eaed69625..fca67736c 100644 --- a/test/controllers/user_controller_test.rb +++ b/test/controllers/user_controller_test.rb @@ -978,7 +978,8 @@ class UserControllerTest < ActionDispatch::IntegrationTest credentials = ActionController::HttpAuthentication::Basic.encode_credentials('rest-admin@example.com', 'adminpw') # invalid file - csv_file = ::Rack::Test::UploadedFile.new(Rails.root.join('test', 'fixtures', 'csv', 'user_simple_col_not_existing.csv'), 'text/csv') + csv_file_path = Rails.root.join('test', 'data', 'csv', 'user_simple_col_not_existing.csv') + csv_file = ::Rack::Test::UploadedFile.new(csv_file_path, 'text/csv') post '/api/v1/users/import?try=true', params: { file: csv_file, col_sep: ';' }, headers: { 'Authorization' => credentials } assert_response(200) result = JSON.parse(@response.body) @@ -992,7 +993,8 @@ class UserControllerTest < ActionDispatch::IntegrationTest assert_equal("Line 2: unknown attribute 'firstname2' for User.", result['errors'][1]) # valid file try - csv_file = ::Rack::Test::UploadedFile.new(Rails.root.join('test', 'fixtures', 'csv', 'user_simple.csv'), 'text/csv') + csv_file_path = Rails.root.join('test', 'data', 'csv', 'user_simple.csv') + csv_file = ::Rack::Test::UploadedFile.new(csv_file_path, 'text/csv') post '/api/v1/users/import?try=true', params: { file: csv_file, col_sep: ';' }, headers: { 'Authorization' => credentials } assert_response(200) result = JSON.parse(@response.body) @@ -1006,7 +1008,8 @@ class UserControllerTest < ActionDispatch::IntegrationTest assert_nil(User.find_by(login: 'user-simple-import2')) # valid file - csv_file = ::Rack::Test::UploadedFile.new(Rails.root.join('test', 'fixtures', 'csv', 'user_simple.csv'), 'text/csv') + csv_file_path = Rails.root.join('test', 'data', 'csv', 'user_simple.csv') + csv_file = ::Rack::Test::UploadedFile.new(csv_file_path, 'text/csv') post '/api/v1/users/import', params: { file: csv_file, col_sep: ';' }, headers: { 'Authorization' => credentials } assert_response(200) result = JSON.parse(@response.body) diff --git a/test/fixtures/calendar1.ics b/test/data/calendar/calendar1.ics similarity index 100% rename from test/fixtures/calendar1.ics rename to test/data/calendar/calendar1.ics diff --git a/test/fixtures/calendar2.ics b/test/data/calendar/calendar2.ics similarity index 100% rename from test/fixtures/calendar2.ics rename to test/data/calendar/calendar2.ics diff --git a/test/fixtures/calendar3.ics b/test/data/calendar/calendar3.ics similarity index 100% rename from test/fixtures/calendar3.ics rename to test/data/calendar/calendar3.ics diff --git a/test/fixtures/clearbit/alex@alexmaccaw.com.json b/test/data/clearbit/alex@alexmaccaw.com.json similarity index 100% rename from test/fixtures/clearbit/alex@alexmaccaw.com.json rename to test/data/clearbit/alex@alexmaccaw.com.json diff --git a/test/fixtures/clearbit/me2@example.com.json b/test/data/clearbit/me2@example.com.json similarity index 100% rename from test/fixtures/clearbit/me2@example.com.json rename to test/data/clearbit/me2@example.com.json diff --git a/test/fixtures/clearbit/me@example.com.json b/test/data/clearbit/me@example.com.json similarity index 100% rename from test/fixtures/clearbit/me@example.com.json rename to test/data/clearbit/me@example.com.json diff --git a/test/fixtures/clearbit/testing3@znuny.com.json b/test/data/clearbit/testing3@znuny.com.json similarity index 100% rename from test/fixtures/clearbit/testing3@znuny.com.json rename to test/data/clearbit/testing3@znuny.com.json diff --git a/test/fixtures/clearbit/testing4@znuny.com.json b/test/data/clearbit/testing4@znuny.com.json similarity index 100% rename from test/fixtures/clearbit/testing4@znuny.com.json rename to test/data/clearbit/testing4@znuny.com.json diff --git a/test/fixtures/clearbit/testing5@znuny.com.json b/test/data/clearbit/testing5@znuny.com.json similarity index 100% rename from test/fixtures/clearbit/testing5@znuny.com.json rename to test/data/clearbit/testing5@znuny.com.json diff --git a/test/fixtures/clearbit/testing6@znuny.com.json b/test/data/clearbit/testing6@znuny.com.json similarity index 100% rename from test/fixtures/clearbit/testing6@znuny.com.json rename to test/data/clearbit/testing6@znuny.com.json diff --git a/test/fixtures/csv/organization_simple.csv b/test/data/csv/organization_simple.csv similarity index 100% rename from test/fixtures/csv/organization_simple.csv rename to test/data/csv/organization_simple.csv diff --git a/test/fixtures/csv/organization_simple_col_not_existing.csv b/test/data/csv/organization_simple_col_not_existing.csv similarity index 100% rename from test/fixtures/csv/organization_simple_col_not_existing.csv rename to test/data/csv/organization_simple_col_not_existing.csv diff --git a/test/fixtures/csv/text_module_simple.csv b/test/data/csv/text_module_simple.csv similarity index 100% rename from test/fixtures/csv/text_module_simple.csv rename to test/data/csv/text_module_simple.csv diff --git a/test/fixtures/csv/text_module_simple_col_not_existing.csv b/test/data/csv/text_module_simple_col_not_existing.csv similarity index 100% rename from test/fixtures/csv/text_module_simple_col_not_existing.csv rename to test/data/csv/text_module_simple_col_not_existing.csv diff --git a/test/fixtures/csv/user_simple.csv b/test/data/csv/user_simple.csv similarity index 100% rename from test/fixtures/csv/user_simple.csv rename to test/data/csv/user_simple.csv diff --git a/test/fixtures/csv/user_simple_col_not_existing.csv b/test/data/csv/user_simple_col_not_existing.csv similarity index 100% rename from test/fixtures/csv/user_simple_col_not_existing.csv rename to test/data/csv/user_simple_col_not_existing.csv diff --git a/test/fixtures/es-box1.box b/test/data/elasticsearch/es-box1.box similarity index 100% rename from test/fixtures/es-box1.box rename to test/data/elasticsearch/es-box1.box diff --git a/test/fixtures/es-normal.txt b/test/data/elasticsearch/es-normal.txt similarity index 100% rename from test/fixtures/es-normal.txt rename to test/data/elasticsearch/es-normal.txt diff --git a/test/fixtures/es-pdf1.pdf b/test/data/elasticsearch/es-pdf1.pdf similarity index 100% rename from test/fixtures/es-pdf1.pdf rename to test/data/elasticsearch/es-pdf1.pdf diff --git a/test/fixtures/es-too-big.txt b/test/data/elasticsearch/es-too-big.txt similarity index 100% rename from test/fixtures/es-too-big.txt rename to test/data/elasticsearch/es-too-big.txt diff --git a/test/fixtures/email_signature_detection/client_a_1.txt b/test/data/email_signature_detection/client_a_1.txt similarity index 100% rename from test/fixtures/email_signature_detection/client_a_1.txt rename to test/data/email_signature_detection/client_a_1.txt diff --git a/test/fixtures/email_signature_detection/client_a_2.txt b/test/data/email_signature_detection/client_a_2.txt similarity index 100% rename from test/fixtures/email_signature_detection/client_a_2.txt rename to test/data/email_signature_detection/client_a_2.txt diff --git a/test/fixtures/email_signature_detection/client_a_3.txt b/test/data/email_signature_detection/client_a_3.txt similarity index 100% rename from test/fixtures/email_signature_detection/client_a_3.txt rename to test/data/email_signature_detection/client_a_3.txt diff --git a/test/fixtures/email_signature_detection/client_b_1.txt b/test/data/email_signature_detection/client_b_1.txt similarity index 100% rename from test/fixtures/email_signature_detection/client_b_1.txt rename to test/data/email_signature_detection/client_b_1.txt diff --git a/test/fixtures/email_signature_detection/client_b_2.txt b/test/data/email_signature_detection/client_b_2.txt similarity index 100% rename from test/fixtures/email_signature_detection/client_b_2.txt rename to test/data/email_signature_detection/client_b_2.txt diff --git a/test/fixtures/email_signature_detection/client_b_3.txt b/test/data/email_signature_detection/client_b_3.txt similarity index 100% rename from test/fixtures/email_signature_detection/client_b_3.txt rename to test/data/email_signature_detection/client_b_3.txt diff --git a/test/fixtures/email_signature_detection/client_c_1.html b/test/data/email_signature_detection/client_c_1.html similarity index 100% rename from test/fixtures/email_signature_detection/client_c_1.html rename to test/data/email_signature_detection/client_c_1.html diff --git a/test/fixtures/email_signature_detection/client_c_2.html b/test/data/email_signature_detection/client_c_2.html similarity index 100% rename from test/fixtures/email_signature_detection/client_c_2.html rename to test/data/email_signature_detection/client_c_2.html diff --git a/test/fixtures/email_signature_detection/client_c_3.html b/test/data/email_signature_detection/client_c_3.html similarity index 100% rename from test/fixtures/email_signature_detection/client_c_3.html rename to test/data/email_signature_detection/client_c_3.html diff --git a/test/fixtures/email_signature_detection/example1.html b/test/data/email_signature_detection/example1.html similarity index 100% rename from test/fixtures/email_signature_detection/example1.html rename to test/data/email_signature_detection/example1.html diff --git a/test/fixtures/idoit/object_types_filter_response.json b/test/data/idoit/object_types_filter_response.json similarity index 100% rename from test/fixtures/idoit/object_types_filter_response.json rename to test/data/idoit/object_types_filter_response.json diff --git a/test/fixtures/idoit/object_types_response.json b/test/data/idoit/object_types_response.json similarity index 100% rename from test/fixtures/idoit/object_types_response.json rename to test/data/idoit/object_types_response.json diff --git a/test/fixtures/mail1.box b/test/data/mail/mail001.box similarity index 100% rename from test/fixtures/mail1.box rename to test/data/mail/mail001.box diff --git a/test/fixtures/mail2.box b/test/data/mail/mail002.box similarity index 100% rename from test/fixtures/mail2.box rename to test/data/mail/mail002.box diff --git a/test/fixtures/mail3.box b/test/data/mail/mail003.box similarity index 100% rename from test/fixtures/mail3.box rename to test/data/mail/mail003.box diff --git a/test/fixtures/mail4.box b/test/data/mail/mail004.box similarity index 100% rename from test/fixtures/mail4.box rename to test/data/mail/mail004.box diff --git a/test/fixtures/mail5.box b/test/data/mail/mail005.box similarity index 100% rename from test/fixtures/mail5.box rename to test/data/mail/mail005.box diff --git a/test/fixtures/mail6.box b/test/data/mail/mail006.box similarity index 100% rename from test/fixtures/mail6.box rename to test/data/mail/mail006.box diff --git a/test/fixtures/mail7.box b/test/data/mail/mail007.box similarity index 100% rename from test/fixtures/mail7.box rename to test/data/mail/mail007.box diff --git a/test/fixtures/mail8.box b/test/data/mail/mail008.box similarity index 100% rename from test/fixtures/mail8.box rename to test/data/mail/mail008.box diff --git a/test/fixtures/mail9.box b/test/data/mail/mail009.box similarity index 100% rename from test/fixtures/mail9.box rename to test/data/mail/mail009.box diff --git a/test/fixtures/mail10.box b/test/data/mail/mail010.box similarity index 100% rename from test/fixtures/mail10.box rename to test/data/mail/mail010.box diff --git a/test/fixtures/mail11.box b/test/data/mail/mail011.box similarity index 100% rename from test/fixtures/mail11.box rename to test/data/mail/mail011.box diff --git a/test/fixtures/mail12.box b/test/data/mail/mail012.box similarity index 100% rename from test/fixtures/mail12.box rename to test/data/mail/mail012.box diff --git a/test/fixtures/mail13.box b/test/data/mail/mail013.box similarity index 100% rename from test/fixtures/mail13.box rename to test/data/mail/mail013.box diff --git a/test/fixtures/mail14.box b/test/data/mail/mail014.box similarity index 100% rename from test/fixtures/mail14.box rename to test/data/mail/mail014.box diff --git a/test/fixtures/mail15.box b/test/data/mail/mail015.box similarity index 100% rename from test/fixtures/mail15.box rename to test/data/mail/mail015.box diff --git a/test/fixtures/mail16.box b/test/data/mail/mail016.box similarity index 100% rename from test/fixtures/mail16.box rename to test/data/mail/mail016.box diff --git a/test/fixtures/mail17.box b/test/data/mail/mail017.box similarity index 100% rename from test/fixtures/mail17.box rename to test/data/mail/mail017.box diff --git a/test/fixtures/mail18.box b/test/data/mail/mail018.box similarity index 100% rename from test/fixtures/mail18.box rename to test/data/mail/mail018.box diff --git a/test/fixtures/mail19.box b/test/data/mail/mail019.box similarity index 100% rename from test/fixtures/mail19.box rename to test/data/mail/mail019.box diff --git a/test/fixtures/mail20.box b/test/data/mail/mail020.box similarity index 100% rename from test/fixtures/mail20.box rename to test/data/mail/mail020.box diff --git a/test/fixtures/mail21.box b/test/data/mail/mail021.box similarity index 100% rename from test/fixtures/mail21.box rename to test/data/mail/mail021.box diff --git a/test/fixtures/mail22.box b/test/data/mail/mail022.box similarity index 100% rename from test/fixtures/mail22.box rename to test/data/mail/mail022.box diff --git a/test/fixtures/mail23.box b/test/data/mail/mail023.box similarity index 100% rename from test/fixtures/mail23.box rename to test/data/mail/mail023.box diff --git a/test/fixtures/mail24.box b/test/data/mail/mail024.box similarity index 100% rename from test/fixtures/mail24.box rename to test/data/mail/mail024.box diff --git a/test/fixtures/mail25.box b/test/data/mail/mail025.box similarity index 100% rename from test/fixtures/mail25.box rename to test/data/mail/mail025.box diff --git a/test/fixtures/mail26.box b/test/data/mail/mail026.box similarity index 100% rename from test/fixtures/mail26.box rename to test/data/mail/mail026.box diff --git a/test/fixtures/mail27.box b/test/data/mail/mail027.box similarity index 100% rename from test/fixtures/mail27.box rename to test/data/mail/mail027.box diff --git a/test/fixtures/mail28.box b/test/data/mail/mail028.box similarity index 100% rename from test/fixtures/mail28.box rename to test/data/mail/mail028.box diff --git a/test/fixtures/mail29.box b/test/data/mail/mail029.box similarity index 100% rename from test/fixtures/mail29.box rename to test/data/mail/mail029.box diff --git a/test/fixtures/mail30.box b/test/data/mail/mail030.box similarity index 100% rename from test/fixtures/mail30.box rename to test/data/mail/mail030.box diff --git a/test/fixtures/mail31.box b/test/data/mail/mail031.box similarity index 100% rename from test/fixtures/mail31.box rename to test/data/mail/mail031.box diff --git a/test/fixtures/mail32.box b/test/data/mail/mail032.box similarity index 100% rename from test/fixtures/mail32.box rename to test/data/mail/mail032.box diff --git a/test/fixtures/mail33-undelivered-mail-returned-to-sender.box b/test/data/mail/mail033-undelivered-mail-returned-to-sender.box similarity index 100% rename from test/fixtures/mail33-undelivered-mail-returned-to-sender.box rename to test/data/mail/mail033-undelivered-mail-returned-to-sender.box diff --git a/test/fixtures/mail34.box b/test/data/mail/mail034.box similarity index 100% rename from test/fixtures/mail34.box rename to test/data/mail/mail034.box diff --git a/test/fixtures/mail35.box b/test/data/mail/mail035.box similarity index 100% rename from test/fixtures/mail35.box rename to test/data/mail/mail035.box diff --git a/test/fixtures/mail36.box b/test/data/mail/mail036.box similarity index 100% rename from test/fixtures/mail36.box rename to test/data/mail/mail036.box diff --git a/test/fixtures/mail37.box b/test/data/mail/mail037.box similarity index 100% rename from test/fixtures/mail37.box rename to test/data/mail/mail037.box diff --git a/test/fixtures/mail38.box b/test/data/mail/mail038.box similarity index 100% rename from test/fixtures/mail38.box rename to test/data/mail/mail038.box diff --git a/test/fixtures/mail39.box b/test/data/mail/mail039.box similarity index 100% rename from test/fixtures/mail39.box rename to test/data/mail/mail039.box diff --git a/test/fixtures/mail40.box b/test/data/mail/mail040.box similarity index 100% rename from test/fixtures/mail40.box rename to test/data/mail/mail040.box diff --git a/test/fixtures/mail41.box b/test/data/mail/mail041.box similarity index 100% rename from test/fixtures/mail41.box rename to test/data/mail/mail041.box diff --git a/test/fixtures/mail42.box b/test/data/mail/mail042.box similarity index 100% rename from test/fixtures/mail42.box rename to test/data/mail/mail042.box diff --git a/test/fixtures/mail43.box b/test/data/mail/mail043.box similarity index 100% rename from test/fixtures/mail43.box rename to test/data/mail/mail043.box diff --git a/test/fixtures/mail44.box b/test/data/mail/mail044.box similarity index 100% rename from test/fixtures/mail44.box rename to test/data/mail/mail044.box diff --git a/test/fixtures/mail45.box b/test/data/mail/mail045.box similarity index 100% rename from test/fixtures/mail45.box rename to test/data/mail/mail045.box diff --git a/test/fixtures/mail46.box b/test/data/mail/mail046.box similarity index 100% rename from test/fixtures/mail46.box rename to test/data/mail/mail046.box diff --git a/test/fixtures/mail47.box b/test/data/mail/mail047.box similarity index 100% rename from test/fixtures/mail47.box rename to test/data/mail/mail047.box diff --git a/test/fixtures/mail48.box b/test/data/mail/mail048.box similarity index 100% rename from test/fixtures/mail48.box rename to test/data/mail/mail048.box diff --git a/test/fixtures/mail49.box b/test/data/mail/mail049.box similarity index 100% rename from test/fixtures/mail49.box rename to test/data/mail/mail049.box diff --git a/test/fixtures/mail50.box b/test/data/mail/mail050.box similarity index 100% rename from test/fixtures/mail50.box rename to test/data/mail/mail050.box diff --git a/test/fixtures/mail51.box b/test/data/mail/mail051.box similarity index 100% rename from test/fixtures/mail51.box rename to test/data/mail/mail051.box diff --git a/test/fixtures/mail52.box b/test/data/mail/mail052.box similarity index 100% rename from test/fixtures/mail52.box rename to test/data/mail/mail052.box diff --git a/test/fixtures/mail53.box b/test/data/mail/mail053.box similarity index 100% rename from test/fixtures/mail53.box rename to test/data/mail/mail053.box diff --git a/test/fixtures/mail54.box b/test/data/mail/mail054.box similarity index 100% rename from test/fixtures/mail54.box rename to test/data/mail/mail054.box diff --git a/test/fixtures/mail55.box b/test/data/mail/mail055.box similarity index 100% rename from test/fixtures/mail55.box rename to test/data/mail/mail055.box diff --git a/test/fixtures/mail56.box b/test/data/mail/mail056.box similarity index 100% rename from test/fixtures/mail56.box rename to test/data/mail/mail056.box diff --git a/test/fixtures/mail57.box b/test/data/mail/mail057.box similarity index 100% rename from test/fixtures/mail57.box rename to test/data/mail/mail057.box diff --git a/test/fixtures/mail58.box b/test/data/mail/mail058.box similarity index 100% rename from test/fixtures/mail58.box rename to test/data/mail/mail058.box diff --git a/test/fixtures/mail59.box b/test/data/mail/mail059.box similarity index 100% rename from test/fixtures/mail59.box rename to test/data/mail/mail059.box diff --git a/test/fixtures/mail60.box b/test/data/mail/mail060.box similarity index 100% rename from test/fixtures/mail60.box rename to test/data/mail/mail060.box diff --git a/test/fixtures/mail62.box b/test/data/mail/mail062.box similarity index 100% rename from test/fixtures/mail62.box rename to test/data/mail/mail062.box diff --git a/test/fixtures/mail63.box b/test/data/mail/mail063.box similarity index 100% rename from test/fixtures/mail63.box rename to test/data/mail/mail063.box diff --git a/test/fixtures/mail64.box b/test/data/mail/mail064.box similarity index 100% rename from test/fixtures/mail64.box rename to test/data/mail/mail064.box diff --git a/test/fixtures/mail65.box b/test/data/mail/mail065.box similarity index 100% rename from test/fixtures/mail65.box rename to test/data/mail/mail065.box diff --git a/test/fixtures/mail66.box b/test/data/mail/mail066.box similarity index 100% rename from test/fixtures/mail66.box rename to test/data/mail/mail066.box diff --git a/test/fixtures/test1.pdf b/test/data/pdf/test1.pdf similarity index 100% rename from test/fixtures/test1.pdf rename to test/data/pdf/test1.pdf diff --git a/test/fixtures/telegram/channel1_message_content1.json b/test/data/telegram/channel1_message_content1.json similarity index 100% rename from test/fixtures/telegram/channel1_message_content1.json rename to test/data/telegram/channel1_message_content1.json diff --git a/test/fixtures/telegram/channel1_message_content2.json b/test/data/telegram/channel1_message_content2.json similarity index 100% rename from test/fixtures/telegram/channel1_message_content2.json rename to test/data/telegram/channel1_message_content2.json diff --git a/test/fixtures/telegram/channel1_message_content3.json b/test/data/telegram/channel1_message_content3.json similarity index 100% rename from test/fixtures/telegram/channel1_message_content3.json rename to test/data/telegram/channel1_message_content3.json diff --git a/test/fixtures/telegram/channel1_message_content4.json b/test/data/telegram/channel1_message_content4.json similarity index 100% rename from test/fixtures/telegram/channel1_message_content4.json rename to test/data/telegram/channel1_message_content4.json diff --git a/test/fixtures/telegram/channel1_message_content5.json b/test/data/telegram/channel1_message_content5.json similarity index 100% rename from test/fixtures/telegram/channel1_message_content5.json rename to test/data/telegram/channel1_message_content5.json diff --git a/test/fixtures/telegram/channel2_message_content1.json b/test/data/telegram/channel2_message_content1.json similarity index 100% rename from test/fixtures/telegram/channel2_message_content1.json rename to test/data/telegram/channel2_message_content1.json diff --git a/test/fixtures/telegram/personal1_message_content1.json b/test/data/telegram/personal1_message_content1.json similarity index 100% rename from test/fixtures/telegram/personal1_message_content1.json rename to test/data/telegram/personal1_message_content1.json diff --git a/test/fixtures/telegram/personal1_message_content2.json b/test/data/telegram/personal1_message_content2.json similarity index 100% rename from test/fixtures/telegram/personal1_message_content2.json rename to test/data/telegram/personal1_message_content2.json diff --git a/test/fixtures/telegram/personal1_message_end.json b/test/data/telegram/personal1_message_end.json similarity index 100% rename from test/fixtures/telegram/personal1_message_end.json rename to test/data/telegram/personal1_message_end.json diff --git a/test/fixtures/telegram/personal1_message_start.json b/test/data/telegram/personal1_message_start.json similarity index 100% rename from test/fixtures/telegram/personal1_message_start.json rename to test/data/telegram/personal1_message_start.json diff --git a/test/fixtures/telegram/personal2_message_content1.json b/test/data/telegram/personal2_message_content1.json similarity index 100% rename from test/fixtures/telegram/personal2_message_content1.json rename to test/data/telegram/personal2_message_content1.json diff --git a/test/fixtures/telegram/personal2_message_content2.json b/test/data/telegram/personal2_message_content2.json similarity index 100% rename from test/fixtures/telegram/personal2_message_content2.json rename to test/data/telegram/personal2_message_content2.json diff --git a/test/fixtures/telegram/personal2_message_start.json b/test/data/telegram/personal2_message_start.json similarity index 100% rename from test/fixtures/telegram/personal2_message_start.json rename to test/data/telegram/personal2_message_start.json diff --git a/test/fixtures/telegram/personal3_message_content1.json b/test/data/telegram/personal3_message_content1.json similarity index 100% rename from test/fixtures/telegram/personal3_message_content1.json rename to test/data/telegram/personal3_message_content1.json diff --git a/test/fixtures/telegram/personal3_message_content2.json b/test/data/telegram/personal3_message_content2.json similarity index 100% rename from test/fixtures/telegram/personal3_message_content2.json rename to test/data/telegram/personal3_message_content2.json diff --git a/test/fixtures/telegram/personal3_message_content3.json b/test/data/telegram/personal3_message_content3.json similarity index 100% rename from test/fixtures/telegram/personal3_message_content3.json rename to test/data/telegram/personal3_message_content3.json diff --git a/test/fixtures/telegram/personal3_message_content4.json b/test/data/telegram/personal3_message_content4.json similarity index 100% rename from test/fixtures/telegram/personal3_message_content4.json rename to test/data/telegram/personal3_message_content4.json diff --git a/test/fixtures/telegram/personal3_message_content5.json b/test/data/telegram/personal3_message_content5.json similarity index 100% rename from test/fixtures/telegram/personal3_message_content5.json rename to test/data/telegram/personal3_message_content5.json diff --git a/test/fixtures/telegram/personal3_message_start.json b/test/data/telegram/personal3_message_start.json similarity index 100% rename from test/fixtures/telegram/personal3_message_start.json rename to test/data/telegram/personal3_message_start.json diff --git a/test/fixtures/telegram/personal4_message_content1.json b/test/data/telegram/personal4_message_content1.json similarity index 100% rename from test/fixtures/telegram/personal4_message_content1.json rename to test/data/telegram/personal4_message_content1.json diff --git a/test/fixtures/telegram/personal5_message_content1.json b/test/data/telegram/personal5_message_content1.json similarity index 100% rename from test/fixtures/telegram/personal5_message_content1.json rename to test/data/telegram/personal5_message_content1.json diff --git a/test/fixtures/telegram/personal5_message_content2.json b/test/data/telegram/personal5_message_content2.json similarity index 100% rename from test/fixtures/telegram/personal5_message_content2.json rename to test/data/telegram/personal5_message_content2.json diff --git a/test/fixtures/ticket_trigger/mail1.box b/test/data/ticket_trigger/mail1.box similarity index 100% rename from test/fixtures/ticket_trigger/mail1.box rename to test/data/ticket_trigger/mail1.box diff --git a/test/fixtures/ticket_trigger/mail2.box b/test/data/ticket_trigger/mail2.box similarity index 100% rename from test/fixtures/ticket_trigger/mail2.box rename to test/data/ticket_trigger/mail2.box diff --git a/test/fixtures/ticket_trigger/mail3.box b/test/data/ticket_trigger/mail3.box similarity index 100% rename from test/fixtures/ticket_trigger/mail3.box rename to test/data/ticket_trigger/mail3.box diff --git a/test/fixtures/upload1.txt b/test/data/upload/upload1.txt similarity index 100% rename from test/fixtures/upload1.txt rename to test/data/upload/upload1.txt diff --git a/test/fixtures/upload2.jpg b/test/data/upload/upload2.jpg similarity index 100% rename from test/fixtures/upload2.jpg rename to test/data/upload/upload2.jpg diff --git a/test/integration/elasticsearch_test.rb b/test/integration/elasticsearch_test.rb index ebd8eefe4..5411ddab4 100644 --- a/test/integration/elasticsearch_test.rb +++ b/test/integration/elasticsearch_test.rb @@ -140,7 +140,7 @@ class ElasticsearchTest < ActiveSupport::TestCase Store.add( object: 'Ticket::Article', o_id: article1.id, - data: IO.binread(Rails.root.join('test', 'fixtures', 'es-normal.txt')), + data: File.binread(Rails.root.join('test', 'data', 'elasticsearch', 'es-normal.txt')), filename: 'es-normal.txt', preferences: {}, created_by_id: 1, @@ -201,7 +201,7 @@ class ElasticsearchTest < ActiveSupport::TestCase Store.add( object: 'Ticket::Article', o_id: article1.id, - data: IO.binread(Rails.root.join('test', 'fixtures', 'es-normal.txt')), + data: File.binread(Rails.root.join('test', 'data', 'elasticsearch', 'es-normal.txt')), filename: 'es-normal.txt', preferences: {}, created_by_id: 1, @@ -212,7 +212,7 @@ class ElasticsearchTest < ActiveSupport::TestCase Store.add( object: 'Ticket::Article', o_id: article1.id, - data: IO.binread(Rails.root.join('test', 'fixtures', 'es-pdf1.pdf')), + data: File.binread(Rails.root.join('test', 'data', 'elasticsearch', 'es-pdf1.pdf')), filename: 'es-pdf1.pdf', preferences: {}, created_by_id: 1, @@ -223,7 +223,7 @@ class ElasticsearchTest < ActiveSupport::TestCase Store.add( object: 'Ticket::Article', o_id: article1.id, - data: IO.binread(Rails.root.join('test', 'fixtures', 'es-box1.box')), + data: File.binread(Rails.root.join('test', 'data', 'elasticsearch', 'es-box1.box')), filename: 'mail1.box', preferences: {}, created_by_id: 1, @@ -234,7 +234,7 @@ class ElasticsearchTest < ActiveSupport::TestCase Store.add( object: 'Ticket::Article', o_id: article1.id, - data: IO.binread(Rails.root.join('test', 'fixtures', 'es-too-big.txt')), + data: File.binread(Rails.root.join('test', 'data', 'elasticsearch', 'es-too-big.txt')), filename: 'es-too-big.txt', preferences: {}, created_by_id: 1, diff --git a/test/integration/idoit_controller_test.rb b/test/integration/idoit_controller_test.rb index a970abf31..abc208c1f 100644 --- a/test/integration/idoit_controller_test.rb +++ b/test/integration/idoit_controller_test.rb @@ -185,7 +185,7 @@ class IdoitControllerTest < ActionDispatch::IntegrationTest end def read_messaage(file) - File.read("test/fixtures/idoit/#{file}.json") + File.read(Rails.root.join('test', 'data', 'idoit', "#{file}.json")) end end diff --git a/test/integration/telegram_controller_test.rb b/test/integration/telegram_controller_test.rb index 1ab2c9370..e9a86cf5e 100644 --- a/test/integration/telegram_controller_test.rb +++ b/test/integration/telegram_controller_test.rb @@ -369,6 +369,6 @@ class TelegramControllerTest < ActionDispatch::IntegrationTest end def read_messaage(file) - File.read("test/fixtures/telegram/#{file}.json") + File.read(Rails.root.join('test', 'data', 'telegram', "#{file}.json")) end end diff --git a/test/unit/calendar_test.rb b/test/unit/calendar_test.rb index ac57ce9cf..8405f9435 100644 --- a/test/unit/calendar_test.rb +++ b/test/unit/calendar_test.rb @@ -111,7 +111,7 @@ class CalendarTest < ActiveSupport::TestCase fri: { '09:00' => '17:00' } }, default: true, - ical_url: 'test/fixtures/calendar1.ics', + ical_url: Rails.root.join('test', 'data', 'calendar', 'calendar1.ics'), updated_by_id: 1, created_by_id: 1, ) @@ -149,10 +149,10 @@ class CalendarTest < ActiveSupport::TestCase cache_key = "CalendarIcal::#{calendar1.id}" cache = Cache.get(cache_key) - calendar1.update_columns(ical_url: 'test/fixtures/calendar2.ics') + calendar1.update_columns(ical_url: Rails.root.join('test', 'data', 'calendar', 'calendar2.ics').to_s) cache_key = "CalendarIcal::#{calendar1.id}" cache = Cache.get(cache_key) - cache[:ical_url] = 'test/fixtures/calendar2.ics' + cache[:ical_url] = calendar1.ical_url Cache.write( cache_key, cache, @@ -213,7 +213,7 @@ class CalendarTest < ActiveSupport::TestCase fri: { '09:00' => '17:00' } }, default: true, - ical_url: 'test/fixtures/calendar3.ics', + ical_url: Rails.root.join('test', 'data', 'calendar', 'calendar3.ics'), updated_by_id: 1, created_by_id: 1, ) diff --git a/test/unit/email_parser_test.rb b/test/unit/email_parser_test.rb index 48168cfd4..86d899478 100644 --- a/test/unit/email_parser_test.rb +++ b/test/unit/email_parser_test.rb @@ -5,8 +5,8 @@ class EmailParserTest < ActiveSupport::TestCase test 'parse' do files = [ { - data: IO.read('test/fixtures/mail1.box'), - source: 'test/fixtures/mail1.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail001.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail001.box'), body_md5: 'e5cf748bf60cbbf324ee20314750fdf7', params: { from: 'John.Smith@example.com', @@ -23,8 +23,8 @@ class EmailParserTest < ActiveSupport::TestCase }, }, { - data: IO.read('test/fixtures/mail2.box'), - source: 'test/fixtures/mail2.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail002.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail002.box'), body_md5: '154c7d3ae7b94f99589df62882841b08', params: { from: 'Martin Edenhofer ', @@ -43,8 +43,8 @@ Old programmers never die. They just branch to a new address. }, }, { - data: IO.read('test/fixtures/mail3.box'), - source: 'test/fixtures/mail3.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail003.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail003.box'), body_md5: '0b6eb998e8903ba69a3528dedb5a5476', params: { from: '"Günther John | Example GmbH" ', @@ -74,8 +74,8 @@ Old programmers never die. They just branch to a new address. }, }, { - data: IO.read('test/fixtures/mail4.box'), - source: 'test/fixtures/mail4.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail004.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail004.box'), body_md5: '9fab9a0e8523011fde0f3ecd80f8d72c', params: { from: '"Günther Katja | Example GmbH" ', @@ -107,8 +107,8 @@ Liebe Grüße! }, }, { - data: IO.read('test/fixtures/mail5.box'), - source: 'test/fixtures/mail5.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail005.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail005.box'), body_md5: 'f34033e9a34bb5367062dd5df21115df', params: { from: 'marc.smith@example.com (Marc Smith)', @@ -119,8 +119,8 @@ Liebe Grüße! }, }, { - data: IO.read('test/fixtures/mail6.box'), - source: 'test/fixtures/mail6.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail006.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail006.box'), body_md5: '849105bdee623b4314b4c3daa2495471', params: { from: '"Hans BÄKOSchönland" ', @@ -134,8 +134,8 @@ Liebe Grüße! #

{ - data: IO.read('test/fixtures/mail7.box'), - source: 'test/fixtures/mail7.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail007.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail007.box'), body_md5: 'b779b65c7d90aa5e350d37998a6c5fc6', params: { from: 'Eike.Ehringer@example.com', @@ -195,8 +195,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail8.box'), - source: 'test/fixtures/mail8.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail008.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail008.box'), body_md5: 'd540b6f1a7b25468c1bc854ebc4c43fe', attachments: [ { @@ -278,8 +278,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail9.box'), - source: 'test/fixtures/mail9.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail009.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail009.box'), body_md5: '64675a479f80a674eb7c08e385c3622a', attachments: [ { @@ -304,8 +304,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail10.box'), - source: 'test/fixtures/mail10.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail010.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail010.box'), body_md5: '47d41fa38028d5fb02c7d041da60ba1f', attachments: [ { @@ -329,8 +329,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail11.box'), - source: 'test/fixtures/mail11.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail011.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail011.box'), body_md5: '260a815b0a7897e4219d210010008202', attachments: [ { @@ -380,8 +380,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail12.box'), - source: 'test/fixtures/mail12.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail012.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail012.box'), body_md5: 'dd7e002b6bb709effb56bdb6f2cc2e32', attachments: [ { @@ -411,8 +411,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail13.box'), - source: 'test/fixtures/mail13.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail013.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail013.box'), body_md5: 'c3b62f742eb702910d0074e438b34c72', attachments: [ { @@ -431,8 +431,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail14.box'), - source: 'test/fixtures/mail14.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail014.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail014.box'), body_md5: '154c7d3ae7b94f99589df62882841b08', attachments: [ { @@ -456,8 +456,8 @@ Managing Director: Martin Edenhofer }, # spam email { - data: IO.read('test/fixtures/mail15.box'), - source: 'test/fixtures/mail15.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail015.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail015.box'), body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', attachments: [ # :preferences=>{"Message-ID"=>"", "Content-Type"=>"application/octet-stream; name=\"\xBC\xA8\xD0\xA7\xB9\xDC\xC0\xED,\xBE\xBF\xBE\xB9\xCB\xAD\xB4\xED\xC1\xCB.xls\"", "Mime-Type"=>"application/octet-stream", "Charset"=>"UTF-8"}} @@ -478,8 +478,8 @@ Managing Director: Martin Edenhofer }, # spam email { - data: IO.read('test/fixtures/mail16.box'), - source: 'test/fixtures/mail16.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail016.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail016.box'), body_md5: 'c3ea8fde251062d56b7fc72b6d73d702', params: { from: nil, @@ -491,8 +491,8 @@ Managing Director: Martin Edenhofer }, # spam email { - data: IO.read('test/fixtures/mail17.box'), - source: 'test/fixtures/mail17.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail017.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail017.box'), body_md5: 'd78731371e3ec120896c51be3d0d3f8e', params: { from: '"都琹" ', @@ -503,8 +503,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail18.box'), - source: 'test/fixtures/mail18.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail018.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail018.box'), body_md5: '66f20e8557095762ccad9a6cb6f59c3a', params: { from: 'postmaster@example.com', @@ -515,8 +515,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail19.box'), - source: 'test/fixtures/mail19.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail019.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail019.box'), body_md5: '6021dd92d8e7844e6bb9b5bb7a4adfb8', params: { from: '"我" <>', @@ -527,8 +527,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail20.box'), - source: 'test/fixtures/mail20.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail020.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail020.box'), body_md5: '56ad8d02f4c7641fd2bb8ebf484d36d7', params: { from: 'Health and Care-Mall ', @@ -617,8 +617,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail21.box'), - source: 'test/fixtures/mail21.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail021.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail021.box'), body_md5: 'dea7a8979172261f61fb799b6c83742e', params: { from: 'Viagra Super Force Online ', @@ -629,8 +629,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail22.box'), - source: 'test/fixtures/mail22.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail022.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail022.box'), body_md5: '1af1f68f66713b63ce8ec4cc20c7887e', params: { from: 'Gilbertina Suthar ', @@ -642,8 +642,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail23.box'), - source: 'test/fixtures/mail23.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail023.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail023.box'), body_md5: '23967dfbbc2e167332b2ecb78fb9e397', params: { from: 'marketingmanager@nthcpghana.com', @@ -654,8 +654,8 @@ Managing Director: Martin Edenhofer }, }, { - data: IO.read('test/fixtures/mail24.box'), - source: 'test/fixtures/mail24.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail024.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail024.box'), body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', params: { from: 'oracle@IG0-1-DB01.example.com', @@ -676,8 +676,8 @@ Managing Director: Martin Edenhofer ], }, { - data: IO.read('test/fixtures/mail25.box'), - source: 'test/fixtures/mail25.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail025.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail025.box'), body_md5: '436f71d8d8a4ffbd3f18fc9de7d7f767', params: { from: 'oracle@IG0-1-DB01.example.com', @@ -695,8 +695,8 @@ end }, }, { - data: IO.read('test/fixtures/mail26.box'), - source: 'test/fixtures/mail26.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail026.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail026.box'), body_md5: '48c2843d219a7430bc84533d67719e95', params: { from: 'gate ', @@ -722,8 +722,8 @@ end ], }, { - data: IO.read('test/fixtures/mail27.box'), - source: 'test/fixtures/mail27.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail027.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail027.box'), body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', params: { from: 'caoyaoewfzfw@21cn.com', @@ -741,8 +741,8 @@ end ], }, { - data: IO.read('test/fixtures/mail28.box'), - source: 'test/fixtures/mail28.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail028.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail028.box'), body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', params: { from: 'kontakt@example.de', @@ -764,8 +764,8 @@ end ], }, { - data: IO.read('test/fixtures/mail29.box'), - source: 'test/fixtures/mail29.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail029.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail029.box'), body_md5: '0637f48a0979e479efec07120a2bb700', params: { from: 'Example Sales ', @@ -779,8 +779,8 @@ end }, }, { - data: IO.read('test/fixtures/mail30.box'), - source: 'test/fixtures/mail30.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail030.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail030.box'), body_md5: '9ce35920f5702a871f227cfe7ddd3d65', params: { from: 'Manfred Haert ', @@ -792,8 +792,8 @@ end }, }, { - data: IO.read('test/fixtures/mail31.box'), - source: 'test/fixtures/mail31.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail031.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail031.box'), body_md5: 'd5448d34bf7f5db0a525fc83735dc11b', params: { from: '"bertha mou" ', @@ -804,8 +804,8 @@ end }, }, { - data: IO.read('test/fixtures/mail32.box'), - source: 'test/fixtures/mail32.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail032.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail032.box'), body_md5: '9ccf94a31ace1c27e71138c3803ff178', params: { from: '"Dana.Qin" ', @@ -816,8 +816,8 @@ end }, }, { - data: IO.read('test/fixtures/mail34.box'), - source: 'test/fixtures/mail34.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail034.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail034.box'), body_md5: 'b855b615a2c9568ea7708f9dee6b6230', params: { from: 'Bay ', @@ -829,8 +829,8 @@ end }, }, { - data: IO.read('test/fixtures/mail36.box'), - source: 'test/fixtures/mail36.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail036.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail036.box'), body_md5: '3c58aeb003a55cafb0893d69676b4316', params: { from: 'Martin Smith ', @@ -855,8 +855,8 @@ end }, }, { - data: IO.read('test/fixtures/mail37.box'), - source: 'test/fixtures/mail37.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail037.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail037.box'), body_md5: 'dd67e5037a740c053c2bf91f67be072f', params: { from: 'Example ', @@ -869,8 +869,8 @@ end }, }, { - data: IO.read('test/fixtures/mail38.box'), - source: 'test/fixtures/mail38.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail038.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail038.box'), body_md5: 'dcd25707eed638ea568644b206a8596e', params: { from: 'Martin Edenhofer ', @@ -889,8 +889,8 @@ end ], }, { - data: IO.read('test/fixtures/mail39.box'), - source: 'test/fixtures/mail39.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail039.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail039.box'), body_md5: '92553234f01a918314f40973dfc2a303', params: { from: 'Martin Edenhofer ', @@ -919,8 +919,8 @@ end ], }, { - data: IO.read('test/fixtures/mail40.box'), - source: 'test/fixtures/mail40.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail040.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail040.box'), body_md5: '5db91cb79f889f80bbf8b47ad98efac9', params: { from: 'Martin Edenhofer ', @@ -939,8 +939,8 @@ end ], }, { - data: IO.read('test/fixtures/mail41.box'), - source: 'test/fixtures/mail41.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail041.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail041.box'), body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', params: { from: 'Martin Edenhofer ', @@ -959,8 +959,8 @@ end ], }, { - data: IO.read('test/fixtures/mail42.box'), - source: 'test/fixtures/mail42.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail042.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail042.box'), body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', params: { from: 'Martin Edenhofer ', @@ -979,8 +979,8 @@ end ], }, { - data: IO.read('test/fixtures/mail43.box'), - source: 'test/fixtures/mail43.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail043.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail043.box'), body_md5: 'a3b91a8969b54a67dd2154e70f74cc30', params: { from: 'Paula ', @@ -1034,8 +1034,8 @@ end }, }, { - data: IO.read('test/fixtures/mail44.box'), - source: 'test/fixtures/mail44.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail044.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail044.box'), body_md5: 'ee930244edd3b7c19494e688aa9cc41c', params: { from: '"Clement.Si" ', @@ -1047,8 +1047,8 @@ end }, }, { - data: IO.read('test/fixtures/mail45.box'), - source: 'test/fixtures/mail45.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail045.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail045.box'), body_md5: '1d847e3626145a9e886914ecf0d89368', params: { from: '"Ups Rémi" ', @@ -1060,8 +1060,8 @@ end }, }, { - data: IO.read('test/fixtures/mail48.box'), - source: 'test/fixtures/mail48.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail048.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail048.box'), body_md5: '64675a479f80a674eb7c08e385c3622a', attachments: [ { @@ -1086,8 +1086,8 @@ end }, }, { - data: IO.read('test/fixtures/mail50.box'), - source: 'test/fixtures/mail50.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail050.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail050.box'), body_md5: '154c7d3ae7b94f99589df62882841b08', attachments: [], params: { @@ -1095,8 +1095,8 @@ end }, }, { - data: IO.read('test/fixtures/mail51.box'), - source: 'test/fixtures/mail51.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail051.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail051.box'), body_md5: '64675a479f80a674eb7c08e385c3622a', attachments: [ { @@ -1117,8 +1117,8 @@ end }, }, { - data: IO.read('test/fixtures/mail52.box'), - source: 'test/fixtures/mail52.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail052.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail052.box'), body_md5: 'ad0c0727cd7d023ec9065daea03335f7', params: { from: 'MAILER-DAEMON@example.com (Mail Delivery System)', @@ -1128,8 +1128,8 @@ end }, }, { - data: IO.read('test/fixtures/mail53.box'), - source: 'test/fixtures/mail53.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail053.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail053.box'), body_md5: '104da300f70d5683f007951c9780c83d', params: { from: 'MAILER-DAEMON (Mail Delivery System)', @@ -1139,8 +1139,8 @@ end }, }, { - data: IO.read('test/fixtures/mail54.box'), - source: 'test/fixtures/mail54.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail054.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail054.box'), body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', params: { from: '"Smith, Karoline, Example DE" ', @@ -1151,8 +1151,8 @@ end }, }, { - data: IO.read('test/fixtures/mail56.box'), - source: 'test/fixtures/mail56.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail056.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail056.box'), body_md5: 'ee40e852b9fa18652ea66e2eda1ecbd3', attachments: [ { @@ -1174,8 +1174,8 @@ end }, }, { - data: IO.read('test/fixtures/mail57.box'), - source: 'test/fixtures/mail57.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail057.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail057.box'), body_md5: '3c5e4cf2d2a9bc572f10cd6222556027', attachments: [ { @@ -1211,8 +1211,8 @@ Bob Smith }, }, { - data: IO.read('test/fixtures/mail58.box'), - source: 'test/fixtures/mail58.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail058.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail058.box'), body_md5: '548917e0bff0806f9b27c09bbf23bb38', params: { from: 'Yangzhou ABC Lighting Equipment , LTD ', @@ -1229,8 +1229,8 @@ Old programmers never die. They just branch to a new address." }, }, { - data: IO.read('test/fixtures/mail59.box'), - source: 'test/fixtures/mail59.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail059.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail059.box'), body_md5: '548917e0bff0806f9b27c09bbf23bb38', params: { from: '"Yangzhou ABC Lighting Equipment " <>, "LTD" ', @@ -1247,8 +1247,8 @@ Old programmers never die. They just branch to a new address." }, }, { - data: IO.read('test/fixtures/mail62.box'), - source: 'test/fixtures/mail62.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail062.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail062.box'), body_md5: '10e7158e65a12b5850163d4d4b8ca2f8', attachments: [ { @@ -1305,8 +1305,8 @@ Old programmers never die. They just branch to a new address." }, }, { - data: IO.read('test/fixtures/mail63.box'), - source: 'test/fixtures/mail63.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail063.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail063.box'), body_md5: 'dbed0b09656d17bf4e832b2c18381c24', attachments: [ { @@ -1341,8 +1341,8 @@ delete your own text from the attached returned message. }, }, { - data: IO.read('test/fixtures/mail66.box'), - source: 'test/fixtures/mail66.box', + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail066.box')), + source: Rails.root.join('test', 'data', 'mail', 'mail066.box'), body_md5: '346effdbc86ef1f5ea263102fba2e542', attachments: [ { diff --git a/test/unit/email_process_bounce_delivery_permanent_failed_test.rb b/test/unit/email_process_bounce_delivery_permanent_failed_test.rb index 98701ab08..3bf543dff 100644 --- a/test/unit/email_process_bounce_delivery_permanent_failed_test.rb +++ b/test/unit/email_process_bounce_delivery_permanent_failed_test.rb @@ -100,7 +100,7 @@ class EmailProcessBounceDeliveryPermanentFailedTest < ActiveSupport::TestCase assert_equal(4, ticket.articles.count) travel 1.second - email_raw_string = IO.binread('test/fixtures/mail33-undelivered-mail-returned-to-sender.box') + email_raw_string = File.read(Rails.root.join('test', 'data', 'mail', 'mail033-undelivered-mail-returned-to-sender.box')) ticket_p, article_p, user_p = Channel::EmailParser.new.process({}, email_raw_string) assert_equal(ticket.id, ticket_p.id) assert_equal('open', ticket_p.state.name) @@ -207,7 +207,7 @@ class EmailProcessBounceDeliveryPermanentFailedTest < ActiveSupport::TestCase assert_equal(4, ticket.articles.count) travel 1.second - email_raw_string = IO.binread('test/fixtures/mail55.box') + email_raw_string = File.read(Rails.root.join('test', 'data', 'mail', 'mail055.box')) ticket_p, article_p, user_p = Channel::EmailParser.new.process({}, email_raw_string) assert_equal(ticket.id, ticket_p.id) assert_equal('open', ticket_p.state.name) diff --git a/test/unit/email_process_bounce_follow_test.rb b/test/unit/email_process_bounce_follow_test.rb index 967e1cf03..9e6045ec2 100644 --- a/test/unit/email_process_bounce_follow_test.rb +++ b/test/unit/email_process_bounce_follow_test.rb @@ -27,7 +27,8 @@ class EmailProcessBounceFollowUpTest < ActiveSupport::TestCase created_by_id: 1, ) travel 1.second - email_raw_string = IO.binread('test/fixtures/mail33-undelivered-mail-returned-to-sender.box') + email_file_path = Rails.root.join('test', 'data', 'mail', 'mail033-undelivered-mail-returned-to-sender.box') + email_raw_string = File.read(email_file_path) ticket_p, article_p, user_p = Channel::EmailParser.new.process({}, email_raw_string) assert_equal(ticket.id, ticket_p.id) assert_equal('new', ticket_p.state.name) @@ -134,7 +135,8 @@ class EmailProcessBounceFollowUpTest < ActiveSupport::TestCase assert_equal(4, ticket.articles.count) travel 1.second - email_raw_string = IO.binread('test/fixtures/mail33-undelivered-mail-returned-to-sender.box') + email_file_path = Rails.root.join('test', 'data', 'mail', 'mail033-undelivered-mail-returned-to-sender.box') + email_raw_string = File.read(email_file_path) ticket_p, article_p, user_p = Channel::EmailParser.new.process({}, email_raw_string) assert_equal(ticket.id, ticket_p.id) assert_equal('open', ticket_p.state.name) @@ -241,7 +243,8 @@ class EmailProcessBounceFollowUpTest < ActiveSupport::TestCase assert_equal(4, ticket.articles.count) travel 1.second - email_raw_string = IO.binread('test/fixtures/mail55.box') + email_file_path = Rails.root.join('test', 'data', 'mail', 'mail055.box') + email_raw_string = File.read(email_file_path) ticket_p, article_p, user_p = Channel::EmailParser.new.process({}, email_raw_string) assert_equal(ticket.id, ticket_p.id) assert_equal('open', ticket_p.state.name) diff --git a/test/unit/email_process_test.rb b/test/unit/email_process_test.rb index d0d620c60..f1f29b676 100644 --- a/test/unit/email_process_test.rb +++ b/test/unit/email_process_test.rb @@ -406,7 +406,7 @@ Some Text", }, }, { - data: IO.binread('test/fixtures/mail21.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail021.box')), success: true, result: { 0 => { @@ -512,7 +512,7 @@ Some Text", }, }, { - data: IO.binread('test/fixtures/mail22.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail022.box')), success: true, result: { 0 => { @@ -529,7 +529,7 @@ Some Text", }, }, { - data: IO.binread('test/fixtures/mail23.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail023.box')), success: true, result: { 0 => { @@ -2303,7 +2303,7 @@ Some Text', } }, { - data: IO.binread('test/fixtures/mail30.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail030.box')), success: true, result: { 0 => { @@ -2339,7 +2339,7 @@ Some Text', } }, { - data: IO.binread('test/fixtures/mail31.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail031.box')), success: true, result: { 0 => { @@ -2363,7 +2363,7 @@ Some Text', } }, { - data: IO.binread('test/fixtures/mail32.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail032.box')), success: true, result: { 0 => { @@ -2387,7 +2387,7 @@ Some Text', } }, { - data: IO.binread('test/fixtures/mail35.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail035.box')), success: true, result: { 0 => { @@ -2411,7 +2411,7 @@ Some Text', } }, { - data: IO.binread('test/fixtures/mail37.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail037.box')), success: true, result: { 0 => { @@ -2447,7 +2447,7 @@ Some Text', } }, { - data: IO.binread('test/fixtures/mail41.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail041.box')), success: true, result: { 0 => { @@ -2461,7 +2461,7 @@ Some Text', }, }, { - data: IO.binread('test/fixtures/mail42.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail042.box')), success: true, result: { 0 => { @@ -2475,7 +2475,7 @@ Some Text', }, }, { - data: IO.binread('test/fixtures/mail43.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail043.box')), success: true, result: { 0 => { @@ -2489,7 +2489,7 @@ Some Text', }, }, { - data: IO.binread('test/fixtures/mail44.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail044.box')), success: true, result: { 0 => { @@ -2519,7 +2519,7 @@ Some Text', }, }, { - data: IO.binread('test/fixtures/mail46.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail046.box')), success: true, result: { 0 => { @@ -2544,7 +2544,7 @@ Some Text', }, }, { - data: IO.binread('test/fixtures/mail47.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail047.box')), success: true, result: { 0 => { @@ -2569,7 +2569,7 @@ Some Text', }, }, { - data: IO.binread('test/fixtures/mail49.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail049.box')), success: true, result: { 0 => { @@ -2594,7 +2594,7 @@ Some Text', }, }, { - data: IO.binread('test/fixtures/mail52.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail052.box')), success: true, result: { 0 => { @@ -2619,7 +2619,7 @@ Some Text', }, }, { - data: IO.binread('test/fixtures/mail53.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail053.box')), success: true, result: { 0 => { @@ -2644,7 +2644,7 @@ Some Text', }, }, { - data: IO.binread('test/fixtures/mail60.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail060.box')), success: true, result: { 0 => { @@ -2670,7 +2670,7 @@ Some Text', }, }, { - data: IO.binread('test/fixtures/mail64.box'), + data: File.read(Rails.root.join('test', 'data', 'mail', 'mail064.box')), success: true, result: { 0 => { diff --git a/test/unit/email_signatur_detection_test.rb b/test/unit/email_signatur_detection_test.rb deleted file mode 100644 index 37510921a..000000000 --- a/test/unit/email_signatur_detection_test.rb +++ /dev/null @@ -1,132 +0,0 @@ - -require 'test_helper' - -class EmailSignaturDetectionTest < ActiveSupport::TestCase - - test 'test case 1 - sender a' do - - # fixtures of sender a - fixture_files = { - 'email_signature_detection/client_a_1.txt' => { line: 10, content_type: 'text/plain' }, - 'email_signature_detection/client_a_2.txt' => { line: 20, content_type: 'text/plain' }, - 'email_signature_detection/client_a_3.txt' => { line: 6, content_type: 'text/plain' }, - } - - fixture_messages = [] - fixture_files.each do |filepath, value| - value[:content] = File.new( Rails.root.join('test', 'fixtures', filepath), 'r').read - fixture_messages.push value - end - - signature = SignatureDetection.find_signature(fixture_messages) - expected_signature = "\nMit freundlichen Grüßen\n\nBob Smith\nBerechtigungen und dez. Department\n________________________________\n\nMusik AG\nBerechtigungen und dez. Department (ITPBM)\nKastanien 2" - assert_equal(expected_signature, signature) - - fixture_files.each_value do |value| - assert_equal(value[:line], SignatureDetection.find_signature_line(signature, value[:content], value[:content_type])) - end - end - - test 'test case 2 - sender b' do - - fixture_files = { - 'email_signature_detection/client_b_1.txt' => { line: 26, content_type: 'text/plain' }, - 'email_signature_detection/client_b_2.txt' => { line: 4, content_type: 'text/plain' }, - 'email_signature_detection/client_b_3.txt' => { line: 6, content_type: 'text/plain' }, - } - - fixture_messages = [] - fixture_files.each do |filepath, value| - value[:content] = File.new( Rails.root.join('test', 'fixtures', filepath), 'r').read - fixture_messages.push value - end - - signature = SignatureDetection.find_signature(fixture_messages) - expected_signature = "\nFreundliche Grüße\n\nGünter Lässig\nLokale Daten\n\nMusic GmbH\nBaustraße 123, 12345 Max City\nTelefon 0123 5432114\nTelefax 0123 5432139" - assert_equal(expected_signature, signature) - - fixture_files.each_value do |value| - assert_equal(value[:line], SignatureDetection.find_signature_line(signature, value[:content], value[:content_type])) - end - end - - test 'test case 3 - just tests' do - signature = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nBob Smith\nABC Organisation\n\nEXAMPLE IT-Service GmbH\nDorten 5 F&E\n12345 Da / Germany\nPhone: +49 (0) 1234 567 890 / +49 (0) 1234 567 891\nFax:     +49 (0) 1234 567 892" - message = File.new(Rails.root.join('test', 'fixtures', 'email_signature_detection', 'example1.html'), 'r').read - signature_line = SignatureDetection.find_signature_line(signature, message, 'text/html') - assert_equal(11, signature_line) - end - - test 'test case 4 - sender c' do - - fixture_files = { - 'email_signature_detection/client_c_1.html' => { line: 8, content_type: 'text/html' }, - 'email_signature_detection/client_c_2.html' => { line: 29, content_type: 'text/html' }, - 'email_signature_detection/client_c_3.html' => { line: 6, content_type: 'text/html' }, - } - - fixture_messages = [] - fixture_files.each do |filepath, value| - value[:content] = File.new( Rails.root.join('test', 'fixtures', filepath), 'r').read - fixture_messages.push value - end - - signature = SignatureDetection.find_signature(fixture_messages) - expected_signature = "\nChristianSmith\nTechnik\n\nTel: +49 12 34 56 78 441\nFax: +49 12 34 56 78 499\nEmail: Christian.Smith@example.com\nWeb: www.example.com\nABC KFZ- und Flugzeug B.V. & Co. KG\nHauptverwaltung" - assert_equal(expected_signature, signature) - - fixture_files.each do |filepath, value| - assert_equal(value[:line], SignatureDetection.find_signature_line(signature, value[:content], value[:content_type]), filepath) - end - end - - test 'test case III - sender a - full cycle' do - raw_email_header = "From: Bob.Smith@music.com\nTo: test@zammad.org\nSubject: test\n\n" - - # process email I - file = File.open(Rails.root.join('test', 'fixtures', 'email_signature_detection', 'client_a_1.txt'), 'rb') - raw_email = raw_email_header + file.read - ticket1, article1, user1, mail = Channel::EmailParser.new.process({}, raw_email) - assert(ticket1) - assert(article1) - Scheduler.worker(true) - - # process email II - file = File.open(Rails.root.join('test', 'fixtures', 'email_signature_detection', 'client_a_2.txt'), 'rb') - raw_email = raw_email_header + file.read - ticket2, article2, user2, mail = Channel::EmailParser.new.process({}, raw_email) - assert(ticket2) - assert(article2) - Scheduler.worker(true) - - # check if user2 has a signature_detection value - user2 = User.find(user2.id) - assert(user2.preferences[:signature_detection]) - - # process email III - file = File.open(Rails.root.join('test', 'fixtures', 'email_signature_detection', 'client_a_3.txt'), 'rb') - raw_email = raw_email_header + file.read - ticket3, article3, user3, mail = Channel::EmailParser.new.process({}, raw_email) - assert(ticket3) - assert(article3) - Scheduler.worker(true) - - # check if article3 has a signature_detection value - article3 = Ticket::Article.find(article3.id) - assert_equal(article3.preferences[:signature_detection], 6) - - # relbuild all - SignatureDetection.rebuild_all_articles - - article1 = Ticket::Article.find(article1.id) - assert_equal(article1.preferences[:signature_detection], 10) - - article2 = Ticket::Article.find(article2.id) - assert_equal(article2.preferences[:signature_detection], 20) - - article3 = Ticket::Article.find(article3.id) - assert_equal(article3.preferences[:signature_detection], 6) - - end - -end diff --git a/test/unit/email_signature_detection_test.rb b/test/unit/email_signature_detection_test.rb new file mode 100644 index 000000000..022fc404b --- /dev/null +++ b/test/unit/email_signature_detection_test.rb @@ -0,0 +1,125 @@ + +require 'test_helper' + +class EmailSignatureDetectionTest < ActiveSupport::TestCase + + test 'test case 1 - sender a' do + message_files = [Rails.root.join('test', 'data', 'email_signature_detection', 'client_a_1.txt'), + Rails.root.join('test', 'data', 'email_signature_detection', 'client_a_2.txt'), + Rails.root.join('test', 'data', 'email_signature_detection', 'client_a_3.txt')] + signature_lines = [10, 20, 6] + + messages = message_files.zip(signature_lines).map do |f, l| + { content: File.read(Rails.root.join('test', 'data', f)), + content_type: 'text/plain', + line: l } + end + + signature = SignatureDetection.find_signature(messages) + expected_signature = "\nMit freundlichen Grüßen\n\nBob Smith\nBerechtigungen und dez. Department\n________________________________\n\nMusik AG\nBerechtigungen und dez. Department (ITPBM)\nKastanien 2" + assert_equal(expected_signature, signature) + + messages.each do |m| + assert_equal(m[:line], SignatureDetection.find_signature_line(signature, m[:content], m[:content_type])) + end + end + + test 'test case 2 - sender b' do + message_files = [Rails.root.join('test', 'data', 'email_signature_detection', 'client_b_1.txt'), + Rails.root.join('test', 'data', 'email_signature_detection', 'client_b_2.txt'), + Rails.root.join('test', 'data', 'email_signature_detection', 'client_b_3.txt')] + signature_lines = [26, 4, 6] + + messages = message_files.zip(signature_lines).map do |f, l| + { content: File.read(Rails.root.join('test', 'data', f)), + content_type: 'text/plain', + line: l } + end + + signature = SignatureDetection.find_signature(messages) + expected_signature = "\nFreundliche Grüße\n\nGünter Lässig\nLokale Daten\n\nMusic GmbH\nBaustraße 123, 12345 Max City\nTelefon 0123 5432114\nTelefax 0123 5432139" + assert_equal(expected_signature, signature) + + messages.each do |m| + assert_equal(m[:line], SignatureDetection.find_signature_line(signature, m[:content], m[:content_type])) + end + end + + test 'test case 3 - just tests' do + signature = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nBob Smith\nABC Organisation\n\nEXAMPLE IT-Service GmbH\nDorten 5 F&E\n12345 Da / Germany\nPhone: +49 (0) 1234 567 890 / +49 (0) 1234 567 891\nFax:     +49 (0) 1234 567 892" + message = File.read(Rails.root.join('test', 'data', 'email_signature_detection', 'example1.html')) + signature_line = SignatureDetection.find_signature_line(signature, message, 'text/html') + assert_equal(11, signature_line) + end + + test 'test case 4 - sender c' do + message_files = [Rails.root.join('test', 'data', 'email_signature_detection', 'client_c_1.html'), + Rails.root.join('test', 'data', 'email_signature_detection', 'client_c_2.html'), + Rails.root.join('test', 'data', 'email_signature_detection', 'client_c_3.html')] + signature_lines = [8, 29, 6] + + messages = message_files.zip(signature_lines).map do |f, l| + { content: File.read(Rails.root.join('test', 'data', f)), + content_type: 'text/html', + line: l } + end + + signature = SignatureDetection.find_signature(messages) + expected_signature = "\nChristianSmith\nTechnik\n\nTel: +49 12 34 56 78 441\nFax: +49 12 34 56 78 499\nEmail: Christian.Smith@example.com\nWeb: www.example.com\nABC KFZ- und Flugzeug B.V. & Co. KG\nHauptverwaltung" + assert_equal(expected_signature, signature) + + messages.each do |m| + assert_equal(m[:line], SignatureDetection.find_signature_line(signature, m[:content], m[:content_type])) + end + end + + test 'test case III - sender a - full cycle' do + header = "From: Bob.Smith@music.com\nTo: test@zammad.org\nSubject: test\n\n" + + # process email I + body = File.binread(Rails.root.join('test', 'data', 'email_signature_detection', 'client_a_1.txt')) + raw_email = header + body + ticket1, article1, user1, mail = Channel::EmailParser.new.process({}, raw_email) + assert(ticket1) + assert(article1) + Scheduler.worker(true) + + # process email II + body = File.binread(Rails.root.join('test', 'data', 'email_signature_detection', 'client_a_2.txt')) + raw_email = header + body + ticket2, article2, user2, mail = Channel::EmailParser.new.process({}, raw_email) + assert(ticket2) + assert(article2) + Scheduler.worker(true) + + # check if user2 has a signature_detection value + user2 = User.find(user2.id) + assert(user2.preferences[:signature_detection]) + + # process email III + body = File.binread(Rails.root.join('test', 'data', 'email_signature_detection', 'client_a_3.txt')) + raw_email = header + body + ticket3, article3, user3, mail = Channel::EmailParser.new.process({}, raw_email) + assert(ticket3) + assert(article3) + Scheduler.worker(true) + + # check if article3 has a signature_detection value + article3 = Ticket::Article.find(article3.id) + assert_equal(article3.preferences[:signature_detection], 6) + + # relbuild all + SignatureDetection.rebuild_all_articles + + article1 = Ticket::Article.find(article1.id) + assert_equal(article1.preferences[:signature_detection], 10) + + article2 = Ticket::Article.find(article2.id) + assert_equal(article2.preferences[:signature_detection], 20) + + article3 = Ticket::Article.find(article3.id) + assert_equal(article3.preferences[:signature_detection], 6) + + end + +end diff --git a/test/unit/store_test.rb b/test/unit/store_test.rb index bd1732fce..c0853df73 100644 --- a/test/unit/store_test.rb +++ b/test/unit/store_test.rb @@ -42,12 +42,12 @@ class StoreTest < ActiveSupport::TestCase o_id: 2, }, { - data: IO.binread('test/fixtures/test1.pdf'), + data: File.binread(Rails.root.join('test', 'data', 'pdf', 'test1.pdf')), filename: 'test.pdf', o_id: 3, }, { - data: IO.binread('test/fixtures/test1.pdf'), + data: File.binread(Rails.root.join('test', 'data', 'pdf', 'test1.pdf')), filename: 'test-again.pdf', o_id: 4, }, diff --git a/test/unit/ticket_article_store_empty.rb b/test/unit/ticket_article_store_empty.rb index 913ef2798..99909058f 100644 --- a/test/unit/ticket_article_store_empty.rb +++ b/test/unit/ticket_article_store_empty.rb @@ -9,7 +9,7 @@ class TicketArticleStoreEmpty < ActiveSupport::TestCase current_file_count = Store::File.count current_backend_count = Store::Provider::DB.count - email_raw_string = IO.binread('test/fixtures/mail1.box') + email_raw_string = File.read(Rails.root.join('test', 'data', 'mail', 'mail001.box')) ticket, article, user, mail = Channel::EmailParser.new.process({}, email_raw_string) next_count = Store.count @@ -38,7 +38,7 @@ class TicketArticleStoreEmpty < ActiveSupport::TestCase current_file_count = Store::File.count current_backend_count = Store::Provider::DB.count - email_raw_string = IO.binread('test/fixtures/mail1.box') + email_raw_string = File.read(Rails.root.join('test', 'data', 'mail', 'mail001.box')) ticket1, article1, user1, mail1 = Channel::EmailParser.new.process({}, email_raw_string) ticket2, article2, user2, mail2 = Channel::EmailParser.new.process({}, email_raw_string) diff --git a/test/unit/ticket_trigger_recursive_disabled_test.rb b/test/unit/ticket_trigger_recursive_disabled_test.rb index 658a04d65..a2ddc95ed 100644 --- a/test/unit/ticket_trigger_recursive_disabled_test.rb +++ b/test/unit/ticket_trigger_recursive_disabled_test.rb @@ -707,7 +707,7 @@ class TicketTriggerRecursiveDisabledTest < ActiveSupport::TestCase ) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('aaäöüßad asd', ticket_p.title) @@ -833,21 +833,21 @@ class TicketTriggerRecursiveDisabledTest < ActiveSupport::TestCase assert_equal('text/html', article_p.content_type) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('new', ticket_p.state.name) assert_equal(2, ticket_p.articles.count) # process mail with Precedence header (no auto response) - content = IO.binread('test/fixtures/ticket_trigger/mail2.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail2.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('new', ticket_p.state.name) assert_equal(1, ticket_p.articles.count) # process mail with abuse@ (no auto response) - content = IO.binread('test/fixtures/ticket_trigger/mail3.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail3.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('new', ticket_p.state.name) @@ -926,7 +926,7 @@ class TicketTriggerRecursiveDisabledTest < ActiveSupport::TestCase ) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('aaäöüßad asd', ticket_p.title) @@ -991,7 +991,7 @@ class TicketTriggerRecursiveDisabledTest < ActiveSupport::TestCase ) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('aaäöüßad asd', ticket_p.title) @@ -1076,7 +1076,7 @@ class TicketTriggerRecursiveDisabledTest < ActiveSupport::TestCase ) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('aaäöüßad asd', ticket_p.title) @@ -1156,7 +1156,7 @@ class TicketTriggerRecursiveDisabledTest < ActiveSupport::TestCase ) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal(1, ticket_p.articles.count) @@ -4234,7 +4234,7 @@ class TicketTriggerRecursiveDisabledTest < ActiveSupport::TestCase updated_by_id: 1, ) - ticket1, article1, user, mail = Channel::EmailParser.new.process({}, IO.binread('test/fixtures/mail65.box')) + ticket1, article1, user, mail = Channel::EmailParser.new.process({}, File.read(Rails.root.join('test', 'data', 'mail', 'mail065.box'))) assert_equal('aaäöüßad asd', ticket1.title, 'ticket1.title verify') assert_equal('Users', ticket1.group.name, 'ticket1.group verify') @@ -4275,7 +4275,7 @@ class TicketTriggerRecursiveDisabledTest < ActiveSupport::TestCase updated_by_id: 1, ) - ticket1, article1, user, mail = Channel::EmailParser.new.process({}, IO.binread('test/fixtures/mail65.box')) + ticket1, article1, user, mail = Channel::EmailParser.new.process({}, File.read(Rails.root.join('test', 'data', 'mail', 'mail065.box'))) assert_equal('aaäöüßad asd', ticket1.title, 'ticket1.title verify') assert_equal('Users', ticket1.group.name, 'ticket1.group verify') diff --git a/test/unit/ticket_trigger_test.rb b/test/unit/ticket_trigger_test.rb index c9088db92..af5487cb7 100644 --- a/test/unit/ticket_trigger_test.rb +++ b/test/unit/ticket_trigger_test.rb @@ -721,7 +721,7 @@ class TicketTriggerTest < ActiveSupport::TestCase ) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('aaäöüßad asd', ticket_p.title) @@ -847,7 +847,7 @@ class TicketTriggerTest < ActiveSupport::TestCase assert_equal('text/html', article_p.content_type) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p1, article_p1, user_p1, mail = Channel::EmailParser.new.process({}, content) assert_not_equal(ticket_p.id, ticket_p1.id) @@ -855,7 +855,7 @@ class TicketTriggerTest < ActiveSupport::TestCase assert_equal(2, ticket_p1.articles.count) # process mail with Precedence header (no auto response) - content = IO.binread('test/fixtures/ticket_trigger/mail2.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail2.box')) ticket_p2, article_p2, user_p2, mail = Channel::EmailParser.new.process({}, content) assert_not_equal(ticket_p.id, ticket_p1.id) @@ -865,7 +865,7 @@ class TicketTriggerTest < ActiveSupport::TestCase assert_equal(1, ticket_p2.articles.count) # process mail with abuse@ (no auto response) - content = IO.binread('test/fixtures/ticket_trigger/mail3.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail3.box')) ticket_p3, article_p3, user_p3, mail = Channel::EmailParser.new.process({}, content) assert_not_equal(ticket_p.id, ticket_p1.id) @@ -951,7 +951,7 @@ class TicketTriggerTest < ActiveSupport::TestCase ) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('aaäöüßad asd', ticket_p.title) @@ -1016,7 +1016,7 @@ class TicketTriggerTest < ActiveSupport::TestCase ) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('aaäöüßad asd', ticket_p.title) @@ -1101,7 +1101,7 @@ class TicketTriggerTest < ActiveSupport::TestCase ) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal('aaäöüßad asd', ticket_p.title) @@ -1181,7 +1181,7 @@ class TicketTriggerTest < ActiveSupport::TestCase ) # process mail without Precedence header - content = IO.binread('test/fixtures/ticket_trigger/mail1.box') + content = File.read(Rails.root.join('test', 'data', 'ticket_trigger', 'mail1.box')) ticket_p, article_p, user_p, mail = Channel::EmailParser.new.process({}, content) assert_equal(1, ticket_p.articles.count) @@ -4259,7 +4259,7 @@ class TicketTriggerTest < ActiveSupport::TestCase updated_by_id: 1, ) - ticket1, article1, user, mail = Channel::EmailParser.new.process({}, IO.binread('test/fixtures/mail65.box')) + ticket1, article1, user, mail = Channel::EmailParser.new.process({}, File.read(Rails.root.join('test', 'data', 'mail', 'mail065.box'))) assert_equal('aaäöüßad asd', ticket1.title, 'ticket1.title verify') assert_equal('Users', ticket1.group.name, 'ticket1.group verify') @@ -4300,7 +4300,7 @@ class TicketTriggerTest < ActiveSupport::TestCase updated_by_id: 1, ) - ticket1, article1, user, mail = Channel::EmailParser.new.process({}, IO.binread('test/fixtures/mail65.box')) + ticket1, article1, user, mail = Channel::EmailParser.new.process({}, File.read(Rails.root.join('test', 'data', 'mail', 'mail065.box'))) assert_equal('aaäöüßad asd', ticket1.title, 'ticket1.title verify') assert_equal('Users', ticket1.group.name, 'ticket1.group verify') From 8951d3f1bde03da972143b11df05765f3ff963b5 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Tue, 5 Jun 2018 14:40:40 +0800 Subject: [PATCH 4/7] Refactor email parser test &c. --- app/models/channel/email_parser.rb | 2 +- test/data/mail/mail001.yml | 13 + test/data/mail/mail002.yml | 13 + test/data/mail/mail003.yml | 26 + test/data/mail/mail004.yml | 27 + test/data/mail/mail005.yml | 6 + test/data/mail/mail006.yml | 10 + test/data/mail/mail007.yml | 22 + test/data/mail/mail008.yml | 72 + test/data/mail/mail009.yml | 10 + test/data/mail/mail010.yml | 9 + test/data/mail/mail011.yml | 40 + test/data/mail/mail012.yml | 16 + test/data/mail/mail013.yml | 8 + test/data/mail/mail014.yml | 14 + test/data/mail/mail015.yml | 7 + test/data/mail/mail016.yml | 5 + test/data/mail/mail017.yml | 8 + test/data/mail/mail018.yml | 6 + test/data/mail/mail019.yml | 6 + test/data/mail/mail020.yml | 85 + test/data/mail/mail021.yml | 6 + test/data/mail/mail022.yml | 7 + test/data/mail/mail023.yml | 5 + test/data/mail/mail024.yml | 7 + test/data/mail/mail025.yml | 13 + test/data/mail/mail026.yml | 12 + test/data/mail/mail027.yml | 7 + test/data/mail/mail028.yml | 7 + test/data/mail/mail029.yml | 10 + test/data/mail/mail030.yml | 28 + test/data/mail/mail031.yml | 6 + test/data/mail/mail032.yml | 6 + test/data/mail/mail034.yml | 7 + test/data/mail/mail036.yml | 21 + test/data/mail/mail037.yml | 10 + test/data/mail/mail038.yml | 7 + test/data/mail/mail039.yml | 8 + test/data/mail/mail040.yml | 7 + test/data/mail/mail041.yml | 7 + test/data/mail/mail042.yml | 7 + test/data/mail/mail043.yml | 49 + test/data/mail/mail044.yml | 6 + test/data/mail/mail045.yml | 6 + test/data/mail/mail048.yml | 10 + test/data/mail/mail050.yml | 2 + test/data/mail/mail051.yml | 5 + test/data/mail/mail052.yml | 5 + test/data/mail/mail053.yml | 5 + test/data/mail/mail054.yml | 6 + test/data/mail/mail056.yml | 7 + test/data/mail/mail057.yml | 10 + test/data/mail/mail058.yml | 13 + test/data/mail/mail059.yml | 13 + test/data/mail/mail062.yml | 9 + test/data/mail/mail063.yml | 20 + test/data/mail/mail066.yml | 27 + test/unit/email_build_test.rb | 95 +- test/unit/email_parser_test.rb | 1451 +---------------- .../email_process_identify_sender_max_test.rb | 16 +- 60 files changed, 872 insertions(+), 1476 deletions(-) create mode 100644 test/data/mail/mail001.yml create mode 100644 test/data/mail/mail002.yml create mode 100644 test/data/mail/mail003.yml create mode 100644 test/data/mail/mail004.yml create mode 100644 test/data/mail/mail005.yml create mode 100644 test/data/mail/mail006.yml create mode 100644 test/data/mail/mail007.yml create mode 100644 test/data/mail/mail008.yml create mode 100644 test/data/mail/mail009.yml create mode 100644 test/data/mail/mail010.yml create mode 100644 test/data/mail/mail011.yml create mode 100644 test/data/mail/mail012.yml create mode 100644 test/data/mail/mail013.yml create mode 100644 test/data/mail/mail014.yml create mode 100644 test/data/mail/mail015.yml create mode 100644 test/data/mail/mail016.yml create mode 100644 test/data/mail/mail017.yml create mode 100644 test/data/mail/mail018.yml create mode 100644 test/data/mail/mail019.yml create mode 100644 test/data/mail/mail020.yml create mode 100644 test/data/mail/mail021.yml create mode 100644 test/data/mail/mail022.yml create mode 100644 test/data/mail/mail023.yml create mode 100644 test/data/mail/mail024.yml create mode 100644 test/data/mail/mail025.yml create mode 100644 test/data/mail/mail026.yml create mode 100644 test/data/mail/mail027.yml create mode 100644 test/data/mail/mail028.yml create mode 100644 test/data/mail/mail029.yml create mode 100644 test/data/mail/mail030.yml create mode 100644 test/data/mail/mail031.yml create mode 100644 test/data/mail/mail032.yml create mode 100644 test/data/mail/mail034.yml create mode 100644 test/data/mail/mail036.yml create mode 100644 test/data/mail/mail037.yml create mode 100644 test/data/mail/mail038.yml create mode 100644 test/data/mail/mail039.yml create mode 100644 test/data/mail/mail040.yml create mode 100644 test/data/mail/mail041.yml create mode 100644 test/data/mail/mail042.yml create mode 100644 test/data/mail/mail043.yml create mode 100644 test/data/mail/mail044.yml create mode 100644 test/data/mail/mail045.yml create mode 100644 test/data/mail/mail048.yml create mode 100644 test/data/mail/mail050.yml create mode 100644 test/data/mail/mail051.yml create mode 100644 test/data/mail/mail052.yml create mode 100644 test/data/mail/mail053.yml create mode 100644 test/data/mail/mail054.yml create mode 100644 test/data/mail/mail056.yml create mode 100644 test/data/mail/mail057.yml create mode 100644 test/data/mail/mail058.yml create mode 100644 test/data/mail/mail059.yml create mode 100644 test/data/mail/mail062.yml create mode 100644 test/data/mail/mail063.yml create mode 100644 test/data/mail/mail066.yml diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index 97fb331f8..53c016e8b 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.rb @@ -67,7 +67,7 @@ class Channel::EmailParser =end def parse(msg) - data = {} + data = {}.with_indifferent_access mail = Mail.new(msg.utf8_encode) diff --git a/test/data/mail/mail001.yml b/test/data/mail/mail001.yml new file mode 100644 index 000000000..55be5c1f6 --- /dev/null +++ b/test/data/mail/mail001.yml @@ -0,0 +1,13 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: John.Smith@example.com +from_email: John.Smith@example.com +from_display_name: '' +subject: 'CI Daten für PublicView ' +content_type: text/html +body: |- +
+
Hallo Martin,

 

wie besprochen hier noch die Daten für die Intranetseite:

 

Schriftart/-größe: Verdana 11 Pt wenn von Browser nicht unterstützt oder nicht vorhanden wird Arial 11 Pt genommen
Schriftfarbe: Schwarz
Farbe für die Balken in der Grafik: D7DDE9 (Blau)

 

Wenn noch was fehlt oder du was brauchst sag mir Bescheid.

 

Mit freundlichem Gruß

John Smith
Service und Support

Example Service AG & Co.
Management OHG
Someware-Str. 4
xxxxx Someware

+
Tel.: +49 001 7601 462
Fax: +49 001 7601 472
john.smith@example.com
+
OHG mit Sitz in Someware
AG: Someware - HRA 4158
Geschäftsführung: Tilman Test, Klaus Jürgen Test,
Bernhard Test, Ulrich Test
USt-IdNr. DE 1010101010

Persönlich haftende geschäftsführende Gesellschafterin:
Marie Test Example Stiftung, Someware
Vorstand: Rolf Test

Persönlich haftende Gesellschafterin:
Example Service AG, Someware
AG: Someware - HRB xxx
Vorstand: Marie Test

 

diff --git a/test/data/mail/mail002.yml b/test/data/mail/mail002.yml new file mode 100644 index 000000000..7d6df9da2 --- /dev/null +++ b/test/data/mail/mail002.yml @@ -0,0 +1,13 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Edenhofer +from_email: martin@example.com +from_display_name: Martin Edenhofer +subject: aaäöüßad asd +content_type: text/plain +body: | + äöüß ad asd + + -Martin + + -- + Old programmers never die. They just branch to a new address. diff --git a/test/data/mail/mail003.yml b/test/data/mail/mail003.yml new file mode 100644 index 000000000..90b7de8db --- /dev/null +++ b/test/data/mail/mail003.yml @@ -0,0 +1,26 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"Günther John | Example GmbH" ' +from_email: k.guenther@example.com +from_display_name: Günther John | Example GmbH +subject: Ticket Templates +content_type: text/html +body: |- +
+

Hallo Martin,

 

ich möchte mich gern für den Beta-Test für die Ticket Templates unter XXXX 2.4 anmelden.

 

 

Mit freundlichen Grüßen

John Günther

 

example.com – profitieren Sie vom umfangreichen Daten-Netzwerk

 

_ __ ___ ____________________________ ___ __ _

 

Example GmbH

Some What

 

Sitz: Someware-Straße 9, XXXXX Someware

 

M: +49 (0) XXX XX XX 70

T: +49 (0) XXX XX XX 22

F: +49 (0) XXX XX XX 11

W: http://www.example.de

 

Geschäftsführer: John Smith

HRB XXXXXX AG Someware

St.-Nr.: 112/107/05858

 

ISO 9001:2008 Zertifiziert -Qualitätsstandard mit Zukunft

_ __ ___ ____________________________ ___ __ _

 

Diese Information ist ausschließlich für den Adressaten bestimmt und kann vertrauliche oder gesetzlich geschützte Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße Adressat sind, unterrichten Sie bitte den Absender und vernichten Sie diese Mail. Anderen als dem bestimmungsgemäßen Adressaten ist es untersagt, diese E-Mail zu lesen, zu speichern, weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu verwenden.

 

+

Von: Fritz Bauer [mailto:me@example.com]
Gesendet: Donnerstag, 3. Mai 2012 11:51
An: John Smith
Cc: Smith, John Marian; johnel.fratczak@example.com; ole.brei@example.com; Günther John | Example GmbH; bkopon@example.com; john.heisterhagen@team.example.com; sven.rocked@example.com; michael.house@example.com; tgutzeit@example.com
Betreff: Re: OTRS::XXX Erweiterung - Anhänge an CI's

 

Hallo,

 

+

ich versuche an den Punkten anzuknüpfen.

 

+

a) LDAP Muster Konfigdatei

 

 

+

PS: Es gibt noch eine Reihe weiterer Möglichkeiten, vor allem im Bezug auf Agenten-Rechte/LDAP Gruppen Synchronisation. Wenn Ihr hier weitere Informationen benötigt, einfach im Wiki die Aufgabenbeschreibung rein machen und ich kann eine Beispiel-Config dazu legen.

+

 

 

+

b) Ticket Templates

+

Wir haben das Paket vom alten Maintainer übernommen, es läuft nun auf XXXX 2.4, XXXX 3.0 und XXXX 3.1. Wir haben das Paket um weitere Funktionen ergänzt und würden es gerne hier in diesen Kreis zum Beta-Test bereit stellen.

 

+

Vorgehen:

+

Wer Interesse hat, bitte eine Email an mich und ich versende Zugänge zu den Beta-Test-Systemen. Nach ca. 2 Wochen werden wir die Erweiterungen in der Version 1.0 veröffentlichen.

 

 

+

c) XXXX Entwickler Schulung

+

Weil es immer wieder Thema war, falls jemand Interesse hat, das XXXX bietet nun auch OTRS Entwickler Schulungen an (http://www.example.com/kurs/xxxx_entwickler/).

 

 

+

d) Genelle Fragen?

+

Haben sich beim ein oder anderen generell noch Fragen aufgetan?

 

 

+

Viele Grüße!

 

+
+

-Fritz

On May 2, 2012, at 14:25 , John Smith wrote:

Moin Moin,

die Antwort ist zwar etwas spät, aber nach der Schulung war ich krank und danach
hatte ich viel zu tun auf der Arbeit, sodass ich keine Zeit für XXXX hatte.
Ich denke das ist allgemein das Problem, wenn sowas nebenbei gemacht werden muss.

Wie auch immer, danke für die mail mit dem ITSM Zusatz auch wenn das zur Zeit bei der Example nicht relevant ist.

Ich habe im XXXX Wiki den Punkt um die Vorlagen angefügt.
Ticket Template von John Bäcker
Bei uns habe ich das Ticket Template von John Bäcker in der Version 0.1.96 unter XXXX 3.0.10 implementiert.

Fritz wollte sich auch um das andere Ticket Template Modul kümmern und uns zur Verfügung stellen, welches unter XXXX 3.0 nicht lauffähig sein sollte.

Im Wiki kann ich die LDAP Muster Konfigdatei nicht finden.
Hat die jemand von euch zufälligerweise ?

Danke und Gruß
John Smith

Am 4. April 2012 08:24 schrieb Smith, John Marian <john.smith@example.com>:
Hallo zusammen,

ich hoffe Ihr seid noch gut nach Hause gekommen am Mittwoch. Der XXX Kurs Donnerstag und Freitag war noch ganz gut, wobei ich mir den letzten halben Tag eigentlich hätte schenken können.

Soweit ich weiß arbeitet Ihr nicht mit XXX? Falls doch habe ich hier eine tolle (eigentlich) kostenpflichtige Erweiterung für Euch.

Es handelt sich um eine programmiertes Paket von der XXXX AG. Die Weitergabe ist legal.

Mit dem Paket kann man Anhänge an CI’s (Configuration Items) verknüpfen. Das ist sehr praktisch wenn man zum Beispiel Rechnungen an Server, Computern und und und anhängen möchte.

Der Dank geht an Frank Linden, der uns das Paket kostenlos zur Verfügung gestellt hat.

Viele Grüße aus Someware

John

_________________________
SysAdmin
John Marian Smith
IT-Management

Example GmbH & Co. KG
Der Provider für
Mehrwertdienste & YYY

Someware 23
XXXXX Someware

Tel. (01802) XX XX XX - 42
Fax (01802) XX XX XX - 99
nur 6 Cent je Anruf aus dem dt. Festnetz,
max. 42 Cent pro Min. aus dem Mobilfunknetz

E-Mail john.smith@Example.de
Web www.Example.de
Amtsgericht Hannover HRA xxxxxxxx
Komplementärin: Example Verwaltungs- GmbH
Vertreten durch: Somebody, Somebody
Amtsgericht Someware HRB XXX XXX

_________________________
Highlights der Example Contact Center-Suite:
Virtual XXX&Power-XXX, Self-Services&XXX-Portale,
XXX-/Web-Kundenbefragungen, CRM, PEP, YYY

diff --git a/test/data/mail/mail004.yml b/test/data/mail/mail004.yml new file mode 100644 index 000000000..02cfb4b12 --- /dev/null +++ b/test/data/mail/mail004.yml @@ -0,0 +1,27 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"Günther Katja | Example GmbH" ' +from_email: k.guenther@example.com +from_display_name: Günther Katja | Example GmbH +subject: 'AW: Ticket Templates [Ticket#11168]' +content_type: text/plain +body: |+ + Hallo Katja, + + super! Ich freu mich! + + Wir würden gerne die Präsentation/Einführung in die Ticket Templates per Screensharing oder zumindest per Telefon machen. + + Mögliche Termine: + o Do, 10.05.2012 15:00-16:00 + o Fr, 11.05.2012 13:00-14:00 + o Di, 15.05.2012 17:00-18:00 + + Über Feedback würde ich mich freuen! + + PS: Zur besseren Übersicht habe ich ein Ticket erstellt. :) Im Footer sind unsere geschäftlichen Kontaktdaten (falls diese irgendwann einmal benötigt werden sollten), mehr dazu in ein paar Tagen. + + Liebe Grüße! + + -Martin + + diff --git a/test/data/mail/mail005.yml b/test/data/mail/mail005.yml new file mode 100644 index 000000000..2b0055d23 --- /dev/null +++ b/test/data/mail/mail005.yml @@ -0,0 +1,6 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: marc.smith@example.com (Marc Smith) +from_email: marc.smith@example.com +from_display_name: Marc Smith +subject: 'Re: XXXX Betatest Ticket Templates [Ticket#11162]' +content_type: text/plain diff --git a/test/data/mail/mail006.yml b/test/data/mail/mail006.yml new file mode 100644 index 000000000..8d26868ae --- /dev/null +++ b/test/data/mail/mail006.yml @@ -0,0 +1,10 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"Hans BÄKOSchönland" ' +from_email: me@bogen.net +from_display_name: Hans BÄKOSchönland +subject: 'utf8: 使って / ISO-8859-1: Priorität" / cp-1251: Сергей Углицких' +content_type: text/html +body: '

this is a test



Compare + Cable, DSL or Satellite plans: As low as $2.95.

Test1:–
Test2:& +
Test3:∋
Test4:&
Test5:=' diff --git a/test/data/mail/mail007.yml b/test/data/mail/mail007.yml new file mode 100644 index 000000000..5e4530903 --- /dev/null +++ b/test/data/mail/mail007.yml @@ -0,0 +1,22 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Eike.Ehringer@example.com +from_email: Eike.Ehringer@example.com +from_display_name: '' +subject: AW:Installation [Ticket#11392] +content_type: text/html +body: "Hallo.
Jetzt muss ich dir noch kurzfristig absagen für morgen.
Lass uns + evtl morgen Tel.

Mfg eike

\n
Martin Edenhofer via Znuny + Team --- Installation [Ticket#11392] ---
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Von:\"Martin Edenhofer via Znuny Team\" + <support@example.com>
Aneike.xx@xx-corpxx.com
Datum:Mi., + 13.06.2012 14:30
BetreffInstallation [Ticket#11392]
\n
\n
Hi
+  Eike,\n\nanbei wie gestern telefonisch besprochen Informationen zur Vorbereitung.\n\na)
+  Installation von http://ftp.gwdg.de/pub/misc/zammad/RPMS/fedora/4/zammad-3.0.13-01.noarch.rpm
+  (dieses RPM ist RHEL kompatible) und dessen Abhängigkeiten.\n\nb) Installation von
+  \"mysqld\" und \"perl-DBD-MySQL\".\n\nDas wäre es zur Vorbereitung!\n\nBei Fragen
+  nur zu!\n\n -Martin\n\n--\nMartin Edenhofer\n\nZnuny GmbH // Marienstraße 11 //
+  10117 Berlin // Germany\n\nP: +49 (0) 30 60 98 54 18-0\nF: +49 (0) 30 60 98 54 18-8\nW:
+  http://example.com
+  \n\nLocation: Berlin - HRB 139852 B Amtsgericht Berlin-Charlottenburg\nManaging
+  Director: Martin Edenhofer\n\n
\n
" diff --git a/test/data/mail/mail008.yml b/test/data/mail/mail008.yml new file mode 100644 index 000000000..1668d614e --- /dev/null +++ b/test/data/mail/mail008.yml @@ -0,0 +1,72 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Franz.Schaefer@example.com +from_email: Franz.Schaefer@example.com +from_display_name: '' +subject: 'could not rename: ZZZAAuto' +content_type: text/html +body: |- + +
+
Gravierend?
+ + + +
Mit freundlichen Grüßen
+
+ + + + + + + +
+ Franz Schäfer +
Manager Information Systems
+
+ + + + + + + + +
Telefon +49 000 000 8565
christian.schaefer@example.com
+
+ + + + + + + + + + + + + + + + +
+ Example Stoff GmbH +
Fakultaet
Düsseldorfer Landstraße 395
D-00000 Hof
www.example.com
+
+ + + + + + + + + + + + + +
+
+
Geschäftsführung/Management Board: Jan Bauer (Vorsitzender/Chairman), Oliver Bauer, Heiko Bauer, Boudewijn Bauer
Sitz der Gesellschaft / Registered Office: Hof
Registergericht / Commercial Register of the Local Court: HRB 0000 AG Hof
diff --git a/test/data/mail/mail009.yml b/test/data/mail/mail009.yml new file mode 100644 index 000000000..55ff02450 --- /dev/null +++ b/test/data/mail/mail009.yml @@ -0,0 +1,10 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Edenhofer +from_email: martin@example.de +from_display_name: Martin Edenhofer +subject: 'AW: OTRS / Anfrage OTRS Einführung/Präsentation [Ticket#11545]' +content_type: text/html +body: |- + Enjoy!
+
-Martin

--
Old programmers never die. They just branch to a new address.
+

diff --git a/test/data/mail/mail010.yml b/test/data/mail/mail010.yml new file mode 100644 index 000000000..5e043d266 --- /dev/null +++ b/test/data/mail/mail010.yml @@ -0,0 +1,9 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Smith Sepp +from_email: smith@example.com +from_display_name: Smith Sepp +subject: Gruß aus Oberalteich +content_type: text/html +body: |- +
+

Herzliche Grüße aus Oberalteich sendet Herrn Smith

 

Sepp Smith - Dipl.Ing. agr. (FH)

Geschäftsführer der example Straubing-Bogen

Klosterhof 1 | 94327 Bogen-Oberalteich

Tel: 09422-505601 | Fax: 09422-505620

Internet: http://example-straubing-bogen.de

Facebook: http://facebook.de/examplesrbog

Beschreibung: Beschreibung: efqmLogo - European Foundation für Quality Management

 

diff --git a/test/data/mail/mail011.yml b/test/data/mail/mail011.yml new file mode 100644 index 000000000..867ff71c1 --- /dev/null +++ b/test/data/mail/mail011.yml @@ -0,0 +1,40 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +reply-to: serviceteam@cylex.de +from: CYLEX Newsletter +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 +body: |- + + + + + + +
+

+

Lieber CYLEX Eintragsinhaber,

das Jahr neigt sich dem Ende und die besinnliche Zeit beginnt laut Kalender mit dem
1. Advent. Und wie immer wird es in der vorweihnachtlichen Zeit meist beruflich und privat
so richtig schön hektisch.

Um 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.

+ + + + + + +
Einen gemütlichen Start in die Adventszeit wünscht Ihnen + +
+

Ihr CYLEX Team
+
+ P.S. Damit Sie keinen Tag versäumen, empfehlen wir Ihnen den Link des Adventkalenders in
Ihrer Lesezeichen-Symbolleiste zu ergänzen.

 

+ + + + + +
Impressum
S.C. CYLEX INTERNATIONAL S.N.C.
Sat. Palota 119/A RO 417516 Palota Romania
Tel.: +49 208/62957-0 |
Geschäftsführer: Francisc Osvald
Handelsregister: J05/1591/2009
USt.IdNr.: RO26332771
+
serviceteam@cylex.de
+ Homepage
+ Newsletter abbestellen +
diff --git a/test/data/mail/mail012.yml b/test/data/mail/mail012.yml new file mode 100644 index 000000000..f05b9faf9 --- /dev/null +++ b/test/data/mail/mail012.yml @@ -0,0 +1,16 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Alex.Smith@example.com +from_email: Alex.Smith@example.com +from_display_name: '' +subject: 'AW: Agenda [Ticket#11995]' +to: example@znuny.com +content_type: text/html +body: |- +
+

Hallo Herr Edenhofer,

 

möglicherweise haben wir für unsere morgige Veranstaltung ein Problem mit unserer Develop-Umgebung.
Der Kollege Smith wollte uns noch die Möglichkeit geben, direkt auf die Datenbank zugreifen zu können, hierzu hat er Freitag noch einige Einstellungen vorgenommen und uns die Zugangsdaten mitgeteilt. Eine der Änderungen hatte aber offenbar zur Folge, dass ein Starten der Develop-Anwendung nicht mehr möglich ist (s. Fehlermeldung)
+

 

Herr Smith ist im Urlaub, er wurde von seinen Datenbank-Kollegen kontaktiert aber offenbar lässt sich nicht mehr 100%ig rekonstruieren, was am Freitag noch verändert wurde.
Meinen Sie, dass Sie uns bei der Behebung der o. a. Störung morgen helfen können? Die Datenbank-Kollegen werden uns nach besten Möglichkeiten unterstützen, Zugriff erhalten wir auch.

 

Mit freundlichen Grüßen

 

Alex Smith
+
Abteilung IT-Strategie, Steuerung & Support
im Bereich Informationstechnologie
+
Example – Example GmbH
(Deutsche Example)
Longstreet 5
11111 Frankfurt am Main
+
Telefon: (069) 11 1111 – 11 30

Telefon ServiceDesk: (069) 11 1111 – 12 22
Telefax: (069) 11 1111 – 14 85
Internet: www.example.com

 

-----Ursprüngliche Nachricht-----
Von: Martin Edenhofer via Znuny Sales [mailto:example@znuny.com]
Gesendet: Freitag, 30. November 2012 13:50
An: Smith, Alex
Betreff: Agenda [Ticket#11995]

 

Sehr geehrte Frau Smith,

 

ich habe (wie telefonisch avisiert) versucht eine Agenda für nächste Woche zusammen zu stellen.

 

Leider ist es mir dies Inhaltlich nur unzureichend gelungen (es gibt zu wenig konkrete Anforderungen im Vorfeld :) ).

 

Dadurch würde ich gerne am Dienstag als erste Amtshandlung (mit Herrn Molitor im Boot) die Anforderungen und Ziele der zwei Tage, Mittelfristig und Langfristig definieren. Aufgrund dessen können wir die Agenda der zwei Tage fixieren. Inhaltlich können wir (ich) alles abdecken, von daher gibt es hier keine Probleme. ;)

 

Ist dies für Sie so in Ordnung?

 

Für Fragen stehe ich gerne zur Verfügung!

 

Ich freue mich auf Dienstag,

 

Martin Edenhofer

 

--

Enterprise Services for OTRS

 

Znuny GmbH // Marienstraße 11 // 10117 Berlin // Germany

 

P: +49 (0) 30 60 98 54 18-0

F: +49 (0) 30 60 98 54 18-8

W: http://znuny.com +

 

Location: Berlin - HRB 139852 B Amtsgericht Berlin-Charlottenburg Managing Director: Martin Edenhofer

+

-------------------------------------------------------------------------------------------------

Rechtsform: GmbH

Geschaeftsfuehrer: Dr. Carl Heinz Smith, Dr. Carsten Smith

Sitz der Gesellschaft und Registergericht: Frankfurt/Main, HRB 11111

Alleiniger Gesellschafter: Bundesrepublik Deutschland,

vertreten durch das XXX der Finanzen.

diff --git a/test/data/mail/mail013.yml b/test/data/mail/mail013.yml new file mode 100644 index 000000000..4815807b5 --- /dev/null +++ b/test/data/mail/mail013.yml @@ -0,0 +1,8 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: thomas.smith@example.com +from_email: thomas.smith@example.com +from_display_name: '' +subject: 'Antwort: Probleme ADB / Anlegen von Tickets [Ticket#111079]' +to: q1@znuny.com +content_type: text/html +body: "

JA

" diff --git a/test/data/mail/mail014.yml b/test/data/mail/mail014.yml new file mode 100644 index 000000000..7d3606867 --- /dev/null +++ b/test/data/mail/mail014.yml @@ -0,0 +1,14 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"Müller, Bernd" ' +from_email: Bernd.Mueller@example.com +from_display_name: Müller, Bernd +subject: 'AW: OTRS [Ticket#118192]' +to: "'Martin Edenhofer via Znuny Sales' " +content_type: text/plain +body: | + äöüß ad asd + + -Martin + + -- + Old programmers never die. They just branch to a new address. diff --git a/test/data/mail/mail015.yml b/test/data/mail/mail015.yml new file mode 100644 index 000000000..e4b03284b --- /dev/null +++ b/test/data/mail/mail015.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"Sara.Gang" ' +from_email: ynbe.ctrhk@gmail.com +from_display_name: Sara.Gang +subject: 绩效管理,究竟谁错了 +to: info42@znuny.com +content_type: text/plain diff --git a/test/data/mail/mail016.yml b/test/data/mail/mail016.yml new file mode 100644 index 000000000..147afd58c --- /dev/null +++ b/test/data/mail/mail016.yml @@ -0,0 +1,5 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from_email: vipyimin@126.com +from_display_name: '' +subject: "【 直通美国排名第49大学 成功后付费 】" +to: '"enterprisemobility.apacservice" ' diff --git a/test/data/mail/mail017.yml b/test/data/mail/mail017.yml new file mode 100644 index 000000000..1ea5df711 --- /dev/null +++ b/test/data/mail/mail017.yml @@ -0,0 +1,8 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"都琹" ' +from_email: ghgbwum@185.com.cn +from_display_name: 都琹 +subject: "【专业为您注册香港及海外公司(好处多多)】                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               人物 + \ 互联网事百度新闻独家出品传媒换一批捷克戴维斯杯决赛前任命临时领队 前领队因病住院最新:盖世汽车讯 11月6日,通用汽车宣布今年10月份在华销量...减持三特索道 + 孟凯将全力发展湘鄂情江青摄影作品科技日报讯 (记者过国忠 通讯员陈飞燕)江苏省无线电科学研究所有限公司院士工作站日前正式建...[详细]" +to: info@znuny.com diff --git a/test/data/mail/mail018.yml b/test/data/mail/mail018.yml new file mode 100644 index 000000000..d7e4cc114 --- /dev/null +++ b/test/data/mail/mail018.yml @@ -0,0 +1,6 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: postmaster@example.com +from_email: postmaster@example.com +from_display_name: '' +subject: "Benachrichtung \tzum \t=?unicode-1-1-utf-7?Q?+ANw-bermittlungsstatus \t(Fehlgeschlagen)?=" +to: sales@znuny.org diff --git a/test/data/mail/mail019.yml b/test/data/mail/mail019.yml new file mode 100644 index 000000000..273a55c6d --- /dev/null +++ b/test/data/mail/mail019.yml @@ -0,0 +1,6 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"我" <>' +from_email: vipyiming@126.com +from_display_name: '' +subject: "《欧美简讯》" +to: 377861373 <377861373@qq.com> diff --git a/test/data/mail/mail020.yml b/test/data/mail/mail020.yml new file mode 100644 index 000000000..5cbf24d47 --- /dev/null +++ b/test/data/mail/mail020.yml @@ -0,0 +1,85 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Health and Care-Mall +from_email: drugs-cheapest8@sicor.com +from_display_name: Health and Care-Mall +subject: The Highest Grade Drugs And EXTRA LOW Price . +to: info2@znuny.com +body: |- + ________________________________________________________________________Yeah but even when they. Beth liî ed her neck as well
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
óû5aHw5³½IΨµÁxG⌊o8KHCmς9-Ö½23QgñV6UAD¿ùAX←t¨Lf7⊕®Ir²r½TLA5pYJhjV gPnãM36V®E89RUDΤÅ©ÈI9æsàCΘYEϒAfg∗bT¡1∫rIoiš¦O5oUIN±IsæSعPp Ÿÿq1FΧ⇑eGOz⌈F³R98y§ 74”lTr8r§HÐæuØEÛPËq VmkfB∫SKNElst4S∃Á8üTðG°í lY9åPu×8>RÒ¬⊕ΜIÙzÙCC4³ÌQEΡºSè!XgŒs.
çγ⇓BcwspC L I C K H E R Eëe3¸ !Calm dylan for school today.
Closing the nursery with you down. Here and made the mess. Maybe the oï from under his mother. Song of course beth touched his pants.
When someone who gave up from here. Feel of god knows what.
TBϖ∃M5T5ΕEf2û–N¶ÁvΖ'®⇓∝5SÐçË5 Χ0jΔHbAgþE—2i6A2lD⇑LGjÓnTOy»¦Hëτ9’:Their mother and tugged it seemed like
d3RsV¶HÓΘi¯B∂gax1bîgdHä3rýJÿ1aIKDz n1jfaTk³Vs395ß C˜lBl‘mxGo0√úXwT8Ya õ8ksa∫f·ℵs”6ÑQ ÍAd7$p32d1e∏æe.0”×61aîΚ63αSMûNf5ÉCdL∪1i↔xcaa5êR3l6Lc3iãz16só9èU zDE²aEȨgs25ËÞ hE§cl⊃¢¢ÂoÒµBw²zF© qÏkõaXUius1r0⊆ d•∈ø$¢Z2F12­8l.07d56PÚl25JAO6
45loVóiv1i2ãΥ⌊að⊃d2gÃΥ3™rÎÍu¸aWjO8 n40–Soyè2u¡∅Î3p¢JΜNeÌé×jráÒrΚ 1ÌÓ9AúrAkc8nuEtl22ai‡OB8vSbéσeιõq1+65cw Òs8Uaò4PrsE1y8 〈fMElhϒ⋅Jo8pmzwjˆN¥ wv39aW¡WtsvuU3 1aœ³$éΝnR2OÏ⌉B.∀þc→5Ê9χw5pÃ⁄NfHGFVfE³ãiσjGpa5¶kgg¡ìcWrUq5æakx2h 0Fè4P¸ÕLñrn22ÏoþÝÐHfoRb2eUαw6sñN‾ws¶§3ΒiòX¶¸ofgtHnR⊥3âase9álF¿H5 à6BÁa⊃2iϒsô¡ói ÅkMylÚJ¾ÄoQ–0ℑwvmùþ ˈμ"aQ7jVse6Ðf «hÜp$Lâr£3i1tÚ.323h5qP8g0♥÷R÷
·iƒPV1Β∋øiF¤RÃa4v3âgL9¢wr¨7ø×aÏû0η þ1àßStuÞ³u7á¡lpÑocEe·SLlrVàXj ⊥Uµ¢F¬48ðov7¨Arm×4ÍcùVwÞe1§⊇N ÂÛ4äaLþZ2ski×5 c€pBlûù6∂olÃfÚwKß3Ñ 4iíla4C³êsREÕ1 ãeIó$âz8t442fG.¸1≤¸2F’Ã152in⊄Tl©ëC2v7Ci7·X8a×ú5NlþU〉ιicO∑«s·iKN UuϒjSÃj5Ýu÷Jü§pn5°§e¥Û3℘rÆW‡ò J‹S7A1j0sc&ºpkt·qqøiZ56½vn8¨∗eîØQ3+7Î3Š ∑RkLaKXËasÐsÌ2 ïÇ­¶lDäz8oã78wwU–ÀC T6Uûaϒ938sÌ0Gÿ Oxó∈$98‘R2ÂHï5.ÒL6b9θrδÜ92f9j
Please matt on his neck. Okay matt huï ed into your mindSince her head to check dylan. Where dylan matt got up there
1ȱΑAYQªdN¬ÚϒXT00ÀvI∨ío8-½b®8AΕºV4LgÕ↑7LKtgcEiw­yR5YýæGRA1°I¿0CïCàTiü/þwc0Ax211SÜÂùŒTÁ2êòHpNâùM6Ⱦ0A5Tb»:Simmons and now you really is what. Matt picked up this moment later that.
25¯yV9ÙßYeg·↑DnJ3l4tÝæb1os∏jll÷iSÐiwBÎ4n0ú1Ö ªf÷Ña§1løsuÚ8ê 2LCblgvN½o¼oP3wn♠90 FZora&M™xsΚbb ç5Ãξ$Âô·×2iGæ∇1⊇Ξ¬3.0P0κ53VÁö03ÝYzøX¢BAZ4KwdduÜvvuB↑ΒaÄ’THi0—93rZεj0 §rΜÅa2­·§s7¸Ιf 8⇓þolW„6Ýo6yH¥wKZ∧6 21hÒaKJ“ℜs48IÌ ÔÀ¬­$ZΣ¹ü2ñÙ6B42YMZ.Ô¹V¼9f·0å54⌈R8
÷w"9N2gBÀaðSê¢s≅gGÔo0Dn4n↵γ7⊗eS7eýxf3Jd q÷CMaÍä³isNMZp zz0˜lΚLw8oë29ww¤§Qu ¥D⌈íaýË¢ésJ8Á¬ 3oùÙ$¦1Nℜ1>Rét7WPM¨.¶8¹D92k5D9∗8≈Rl©3ªSj·Ψ8pΣïKùi6rrÔrbÛu¬i2V∗∏v5ª10a27BÁ Ú♦Ξsa9j3χsa¯iΟ Oi℘ml6óféowbz∀wA6ù→ ñ×bàai´wbs♦βGs Ù81i$iÀˆ12⊃2wC82n8o.µ3NJ9S1©Θ0P1Sd
What made no one in each time.Mommy was thinking of course beth. Everything you need the same thing
PïEVGÿ9srEx⇐9oN3U®yEÎi2OR5kÇÿAΤηνULP¿∧q R5¿FHt7J6E»¯C∅Aå∃aVLu∗¢tT〈2ÚHq9Né: +
⊥ÞÞ¨T¦ªBrrC7³2adš6lmzb¨6ai07tdBo×KopíΡÄlj4Hy ÝaÓ1aÖí∉Ós1aá’ 4D­kleowËo3–1ÍwjR≤Π £RhÈafà7≅sù6u2 8NLV$∪⇓»↓1Y¶2µ.vßÈ23ÖS7û0Ün¬Äm5VKZy3KÎiñë¹DtÚ2HrhGaMvr5ïR«oÂ1namΜwÐãanFu8x7⌈sU E4cva£Âε™s7ΑGO dA35ldñÌèoAξI1wXKïn f¼x¾a∏7ffs†ìÖð 5msC$7Ët¦0z„n÷.it¡T7O8vt5¼8å·
Jï1ÏPkáO¶rnùrAo8s5∅z—4Rha1®t˜cq5YΧ ΤQÍraÑ⌋4¹sÜ5²§ ûVBιluwóioL3ëBw£±1¶ 5∈àáa1IÊ2sšÛÛ G´7ρ$kJM80∼∠ℵl.J1Km32µÚ⊃5ã鼧p°ÿ­A¹NU0c¥xçfo〈Øácm14QGpHEj7lnDPVieV2¶aΠ2H7 ²j26azBSesë1c9 ´2Ù¬l0nò¤oõâRVw¦X´Ï αVõ­a≅σ¼Zs§jJå 3pFN$¾Kf821YΟ7.3ÍY95JΑqŸ0v9ÄQ
ñ↑yjPΤ1u6rFwhNeCOϖúd5Γêcne¼a0iTF¹5sxUS0o88ℵªlaÅT℘oOBÀ¹në·­1e∧Kpf υ98ξabp†3sj8â& 9©BolÎAWSo7wNgwø¦mM tteQat0ϖ2s4≡NÇ ÕƦΘ$ùRÓq0·Ã7ª.mt¾³1—uwF57H♣fæ∪HYSjψ3Byš²g¤ndXÀ5tµ¯ò6hZ⇒yÿr8ÿmdowyðdiψ8YΗd0ršŠ N0Ý9aÃ3I¦sQaýê Õ0Y7lZ¯18o∫50Çwµ"©Ζ n6Ü≥a∇lßnsF›J9 ºDΟK$Á4ÉL0S7zÖ.Ta2X3²R995391¡
Turning to mess up with. Well that to give her faceAnother for what she found it then. Since the best to hear
GX°♦Ca2isA¾8¡bNÉî8ÂAöÜzΘD∇tNXIfWi–Ap2WYNYF®b ≠7yφDpj6©R04EÂU´ñn7GÆoÌjS³Á∋TC⊥πËO1∗÷©RtS2wE66è­ νÑêéASi21DP“8λV∧W⋅OAÖg6qNtNp1T269XA7¥À²GGI6SEwU2íS3Χ1â!Okay let matt climbed in front door. Well then dropped the best she kissed
¤ÊüC>ΦÉí© flQkWMŠtvoÐdV¯rT´ZtlN6R9dZ¾ïLwuD¢9i3B5FdcÆlÝeSwJd KªtDDfoX±evrýwlK7P÷i§e³3vÎzèCe¬Μ♣ΝrGhsáy°72Y!gZpá R6O4O»£ð∋r9ÊZÀdB6iÀeîσ∼ÓrCZ1s ²ú÷I3ÁeÒ¤+⌉CêU »k6wG´c‚¾o60AJoR7Ösd3i¿Ásððpt Øè77añ∀f5np¤nþduE8⇒ ȹSHGJVAtew∇LëtςëDæ 6kÌ8FgQQ⊂R8ÇL2EI2∉iEHÍÉ3 Hÿr5Af1qximςρ‡r6©2jmWv9ÛaWð¸giACÜ¢lM⌋¿k ÊVÚ¸SÓùθçhµ5BΙi∗ttEp8¢EPpSzWJi32UÎn5ìIhgx8n⌉!j∏e5
x¯qJ>mC7f 5ºñy1GA4Ý0lCQe09s9u%uksã ψìX5A4g3nu←Τyst7ÍpMhšgÀÖe〉pÚ£n¼YƒŠtÉÚLGizqQ↓c3tÙI œïbXMKÛRSertj×d"OtÊss58®!oo2i FÂWáEWøDDx7hIÕpΦSôBiÒdrUr⇔J<Õa1Αzwt0°p×ià8RÌoHÛ1Än¥7ÿr ¯¥õàDYvO7aká»htì04Πe∂λÇ1 1ÈdUoο°X3fc63¶ e&∪GOxT3CvXcO·e3KËνr3¸y2 26Ëz3Ã∞I± Pì∃zYt6F4e6è⇓va5÷þ9rkΘ3äsKP5R!ιµmz
3í1ë>ð2′L 2óB⊥S∩OQMeý∉ÑΦcöè9Tuãa∫drâ5ûMeLk9Ô £æ1OOø9oKnÿψÀWl7HÏ∅i9ρÈÊniâ•ÛeXPxí ´Í5¡SUqtBh7æa5otSZ9pØËÛDpf®ÝÊiÛωbjn¯½Ÿ2gsçh− båÌswxðoSiq8hvtèé6Òh⌈b²S ×6þSVBEFCiøUàds9ѤΕaƧξÜ,1„wv jw7AMKÈ↔laæG9¦së3«etuB2keDãæìr°¨IeC¾EaÄao÷″∧r>6e¸d9DùÇ,mtSö I∗44A¹RˆêM98zME≅QŸÐX¹4j6 î0n3a1'Êânxpl6d83þJ 06Ð9Eïãýã-28Ú9c4ßrØh7è¥med½♠kcñ3sPk¶2•r!〉QCa
ŠeÏÀ>Ãσ½å bpøNERN8eaD6Åns7Abhy±Æü∩ D7sVR8'ºEeÿáDVfc˜3ëu7ÏÆqncË3qdÊ∼4∇sρmi5 6æ¾Êaä°∝TnQb9sdÀMùℑ ∑gMÿ2bNð¶4cä½⊆/4X1κ7¥f1z ϖ1úECzf•1uMbycs1•9¾ts0Tào3hêDmSs3Áe7BíÉrô⋅ãÔ φ8Ä″SSXð¤uúI¸5p58uHp2cß±o∂T©Rrd6sMt∪µµξ!é4Xb
+
Both hands through the fear in front.
Wade to give it seemed like this. Yeah but one for any longer. Everything you going inside the kids. diff --git a/test/data/mail/mail021.yml b/test/data/mail/mail021.yml new file mode 100644 index 000000000..44075656d --- /dev/null +++ b/test/data/mail/mail021.yml @@ -0,0 +1,6 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Viagra Super Force Online +from_email: pharmacy_affordable1@ertelecom.ru +from_display_name: Viagra Super Force Online +subject: World Best DRUGS Mall For a Reasonable Price. +to: info@znuny.nix diff --git a/test/data/mail/mail022.yml b/test/data/mail/mail022.yml new file mode 100644 index 000000000..4ae6f5efe --- /dev/null +++ b/test/data/mail/mail022.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Gilbertina Suthar +from_email: ireoniqla@lipetsk.ru +from_display_name: Gilbertina Suthar +subject: P..E..N-I..S__-E N L A R-G E-M..E..N T-___P..I-L-L..S...Info. +to: Info +body: Puzzled by judith bronte dave. Melvin will want her way through with.
Continued adam helped charlie cried. Soon joined the master bathroom. Grinned adam rubbed his arms she nodded.
Freemont and they talked with beppe.
Thinking of bed and whenever adam.
Mike was too tired man to hear.
I°0PQSHEJlÔNwf˜Ì1§3S¬73 Î1mEbb5N37¢LϖC7AlFnRº♦HG64BÉ4Ò¦Måâ4ÊzkΙN⌉7⌉TBNÐ T×xPIògIÎÃlLøÕML⊥ÞøSaΨRBreathed adam gave the master bedroom door.
Better get charlie took the wall.
Charlotte clark smile he saw charlie.
Dave and leaned her tears adam.
Maybe we want any help me that.
Next morning charlie gazed at their father.
Well as though adam took out here. Melvin will be more money. Called him into this one last night.
Men joined the pickup truck pulled away. Chuck could make sure that.†p­C L I C K Ȟ E R EEOD !Chuckled adam leaned forward and leî charlie.
Just then returned to believe it here.
Freemont and pulling out several minutes. diff --git a/test/data/mail/mail023.yml b/test/data/mail/mail023.yml new file mode 100644 index 000000000..5f2fb92ba --- /dev/null +++ b/test/data/mail/mail023.yml @@ -0,0 +1,5 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: marketingmanager@nthcpghana.com +from_email: marketingmanager@nthcpghana.com +from_display_name: '' +to: diff --git a/test/data/mail/mail024.yml b/test/data/mail/mail024.yml new file mode 100644 index 000000000..a44a3b3b0 --- /dev/null +++ b/test/data/mail/mail024.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: oracle@IG0-1-DB01.example.com +from_email: oracle@IG0-1-DB01.example.com +from_display_name: '' +subject: 'Regelsets im Test-Status gefunden: 1' +to: support@example.com +body: no visible content diff --git a/test/data/mail/mail025.yml b/test/data/mail/mail025.yml new file mode 100644 index 000000000..2cbfb4d12 --- /dev/null +++ b/test/data/mail/mail025.yml @@ -0,0 +1,13 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: oracle@IG0-1-DB01.example.com +from_email: oracle@IG0-1-DB01.example.com +from_display_name: '' +subject: 'Regelsets im Test-Status gefunden: 1' +to: support@example.com +body: | + begin 644 rulesets-report.csv + M4E5,15-%5%])1#M.04U%.T%#5$E6.U)53E]-3T1%.T%51$E47TU/1$E&65]$ + M051%"C,X-SM$4"!$2$P@2D])3B`M($5.(#H@16EN;&%D=6YG(&5!0SM4.U-- + *.S$W+C`Y+C$T"@`` + ` + end diff --git a/test/data/mail/mail026.yml b/test/data/mail/mail026.yml new file mode 100644 index 000000000..c19f0a574 --- /dev/null +++ b/test/data/mail/mail026.yml @@ -0,0 +1,12 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: gate +from_email: team@support.gate.de +from_display_name: gate +subject: Ihre Rechnung als PDF-Dokument +to: Martin Edenhofer +body: |- + Ihre Rechnung als PDF-Dokument + + + +


diff --git a/test/data/mail/mail027.yml b/test/data/mail/mail027.yml new file mode 100644 index 000000000..9e4b82fe4 --- /dev/null +++ b/test/data/mail/mail027.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: caoyaoewfzfw@21cn.com +from_email: caoyaoewfzfw@21cn.com +from_display_name: '' +subject: "\r\n蠭龕中層管理者如何避免角色行为誤区" +to: duan@seat.com.cn, info@znuny.com, jinzh@kingdream.com +body: no visible content diff --git a/test/data/mail/mail028.yml b/test/data/mail/mail028.yml new file mode 100644 index 000000000..39503a0fb --- /dev/null +++ b/test/data/mail/mail028.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: kontakt@example.de +from_email: kontakt@example.de +from_display_name: '' +subject: Bewerbung auf Ihr Stellenangebot +to: info@znuny.inc +body: no visible content diff --git a/test/data/mail/mail029.yml b/test/data/mail/mail029.yml new file mode 100644 index 000000000..2f33d73b1 --- /dev/null +++ b/test/data/mail/mail029.yml @@ -0,0 +1,10 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Example Sales +from_email: sales@example.com +from_display_name: Example Sales +subject: 'Example licensing information: No channel available' +to: info@znuny.inc +body: |- + Dear Mr. Edenhofer,

We want to keep you updated on TeamViewer licensing shortages on a regular basis.

We would like to inform you that since the last message on 25-Nov-2014 there have been temporary session channel exceedances which make it impossible to establish more sessions. Since the last e-mail this has occurred in a total of 1 cases.

Additional session channels can be added at any time. Please visit our TeamViewer Online Shop for pricing information.

Thank you - and again all the best with TeamViewer!

Best regards,

Your TeamViewer Team

P.S.: You receive this e-mail because you are listed in our database as person who ordered a TeamViewer license. Please click here to unsubscribe from further e-mails.

-----------------------------
+ www.teamviewer.com
+
TeamViewer GmbH * Jahnstr. 30 * 73037 Göppingen * Germany
Tel. 07161 60692 50 * Fax 07161 60692 79

Registration AG Ulm HRB 534075 * General Manager Holger Felgner diff --git a/test/data/mail/mail030.yml b/test/data/mail/mail030.yml new file mode 100644 index 000000000..d911b4b00 --- /dev/null +++ b/test/data/mail/mail030.yml @@ -0,0 +1,28 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Manfred Haert +from_email: Manfred.Haert@example.com +from_display_name: Manfred Haert +subject: Antragswesen in TesT abbilden +to: info@znuny.inc +body: 'Sehr geehrte Damen und Herren,

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.

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.

Wir bitten gerne um ein entsprechendes Angebot.

Für Rückfragen + stehe ich gerne zur Verfügung. Vielen Dank!

--
Freundliche Grüße
+ i.A. Manfred Härt

Test Somewhere GmbH
Ferdinand-Straße 99
+ 99073 Korlben
Bitte beachten Sie die neuen Rufnummern!
Telefon: 011261 + 00000-2460
Fax: 011261 0000-7460
manfred.haertel@example.com
http://www.example.com
+ JETZT AUCH BEI FACEBOOK !
https://www.facebook.com/test
+ ___________________________________
Test Somewhere GmbH

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.
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.

' diff --git a/test/data/mail/mail031.yml b/test/data/mail/mail031.yml new file mode 100644 index 000000000..607c33fc6 --- /dev/null +++ b/test/data/mail/mail031.yml @@ -0,0 +1,6 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"bertha mou" ' +from_email: zhengkang@ha.chinamobile.com +from_display_name: bertha mou +subject: 內應力產生与注塑工艺条件之间的关系; +to: info@znuny.inc diff --git a/test/data/mail/mail032.yml b/test/data/mail/mail032.yml new file mode 100644 index 000000000..20e2bb9d3 --- /dev/null +++ b/test/data/mail/mail032.yml @@ -0,0 +1,6 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"Dana.Qin" ' +from_email: Dana.Qin6e1@gmail.com +from_display_name: Dana.Qin +subject: 发现最美车间主任 +to: info@znuny.inc diff --git a/test/data/mail/mail034.yml b/test/data/mail/mail034.yml new file mode 100644 index 000000000..81dfc1fc6 --- /dev/null +++ b/test/data/mail/mail034.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Bay +from_email: memberbay+12345@members.somewhat +from_display_name: Bay +subject: strange email with empty text/plain +to: bay@example.com +body: "some html text" diff --git a/test/data/mail/mail036.yml b/test/data/mail/mail036.yml new file mode 100644 index 000000000..6ea2c71c0 --- /dev/null +++ b/test/data/mail/mail036.yml @@ -0,0 +1,21 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Smith +from_email: m.Smith@example.com +from_display_name: Martin Smith +subject: 'Fw: Zugangsdaten' +to: Martin Edenhofer +body: |- +
+
 
--
don't cry - work! (Rainald Goetz)
+
+ Gesendet: Mittwoch, 03. Februar 2016 um 12:43 Uhr
+ Von: "Martin Smith" <m.Smith@example.com>
+ An: linuxhotel@example.com
+ Betreff: Fw: Zugangsdaten
+
+
 
--
don't cry - work! (Rainald Goetz)
+
+ Gesendet: Freitag, 22. Januar 2016 um 11:52 Uhr
+ Von: "Martin Edenhofer" <me@example.com>
+ An: m.Smith@example.com
+ Betreff: Zugangsdaten
Um noch vertrauter zu werden, kannst Du mit einen externen E-Mail Account (z. B. web.de) mal ein wenig selber “spielen”. :)
diff --git a/test/data/mail/mail037.yml b/test/data/mail/mail037.yml new file mode 100644 index 000000000..f25faea6d --- /dev/null +++ b/test/data/mail/mail037.yml @@ -0,0 +1,10 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Example +from_email: info@example.com +from_display_name: Example +subject: 'Example: Java 8 Neuerungen' +to: Max Kohl | [example.com] +cc: Ingo Best +body: 'Tag Max / Ingo! + +' diff --git a/test/data/mail/mail038.yml b/test/data/mail/mail038.yml new file mode 100644 index 000000000..73d03d43f --- /dev/null +++ b/test/data/mail/mail038.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Edenhofer +from_email: me@example.com +from_display_name: Martin Edenhofer +subject: 'test 1234 äöü sig test without attachment ' +to: Martin Edenhofer +body: "test 1234 äöü sig test without attachment\n\n" diff --git a/test/data/mail/mail039.yml b/test/data/mail/mail039.yml new file mode 100644 index 000000000..28cb9bba0 --- /dev/null +++ b/test/data/mail/mail039.yml @@ -0,0 +1,8 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Edenhofer +from_email: me@example.com +from_display_name: Martin Edenhofer +subject: 'test 1234 äöü sig test with attachment ' +to: Martin Edenhofer +body: test 1234 äöü sig test with attachment
diff --git a/test/data/mail/mail040.yml b/test/data/mail/mail040.yml new file mode 100644 index 000000000..2816ba208 --- /dev/null +++ b/test/data/mail/mail040.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Edenhofer +from_email: me@example.com +from_display_name: Martin Edenhofer +subject: smime signed 123 öäüß +to: Martin Edenhofer +body: smime signed 123 öäüß diff --git a/test/data/mail/mail041.yml b/test/data/mail/mail041.yml new file mode 100644 index 000000000..fb2097b54 --- /dev/null +++ b/test/data/mail/mail041.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Edenhofer +from_email: me@example.com +from_display_name: Martin Edenhofer +subject: smime sign & crypt +to: Martin Edenhofer +body: no visible content diff --git a/test/data/mail/mail042.yml b/test/data/mail/mail042.yml new file mode 100644 index 000000000..fe35e1001 --- /dev/null +++ b/test/data/mail/mail042.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Edenhofer +from_email: me@example.com +from_display_name: Martin Edenhofer +subject: pgp sign & crypt +to: Martin Edenhofer +body: no visible content diff --git a/test/data/mail/mail043.yml b/test/data/mail/mail043.yml new file mode 100644 index 000000000..b4ae2a042 --- /dev/null +++ b/test/data/mail/mail043.yml @@ -0,0 +1,49 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Paula +from_email: databases.en@example.com +from_display_name: Paula +subject: Kontakte +to: info@example.ch +body: |- +
+ +
Geben Sie diese Information an den Direktor oder den für Marketing und Umsatzsteigerung verantwortlichen Mitarbeiter Ihrer Firma weiter! +

Hallo,

  • Sie suchen nach Möglichkeiten, den Umsatz Ihre Firma zu steigern?
  • +
  • Sie brauchen neue Geschäftskontakte?
  • +
  • Sie sind es leid, Kontaktdaten manuell zu erfassen?
  • +
  • Ihr Kontaktdatenanbieter ist zu teuer oder Sie sind mit seinen Dienstleistungen unzufrieden?
  • +
  • Sie möchten Ihre Kontaktinformationen gern effizienter auf dem neuesten Stand halten?


Bei uns können Sie mit nur wenigen Clicks Geschäftskontakte verschiedener Länder erwerben.

Dies ist eine schnelle und bequeme Methode, um Daten zu einem vernünftigen Preis zu erhalten.

Alle Daten werden ständig aktualisiertm so dass Sie sich keine Sorgen machen müssen.

 

XLS-Muster herunterladen

Datenbank bestellen

Die Anmeldung ist absolut kostenlos und unverbindlich. Sie können die Kataloge gemäß Ihren eigenen Kriterien filtern und ein kostenloses Datenmuster bestellen, sobald Sie sich angemeldet haben.

Wir haben Datenbanken der folgenden Länder: +

Anwendungsmöglichkeiten für Geschäftskontakte

  • + Newsletter senden - Senden von Werbung per E-Mail (besonders effizient).
  • +
  • + Telemarketing - Telefonwerbung.
  • +
  • + SMS-Marketing - Senden von Kurznachrichten.
  • +
  • + Gezielte Werbung - Briefpostwerbung.
  • +
  • + Marktforschung - Telefonumfragen zur Erforschung Ihrer Produkte oder Dienstleistungen.

 

Sie können Abschnitte wählen (filtern) Empfänger gemäß Tätigkeitsbereichen und Standort der Firmen, um die Effizienz Ihrer Werbemaßnahmen zu erhöhen.

 

Für jeden Kauf von 2016-11-05 23:59:59 + wir gewähren 30% Rabatt + RABATTCODE: WZ2124DD +

Bestellen Sie online bei:

company-catalogs.com

Für weitere Informationen:

E-Mail: databases.en@example.com
Telefon: +370-52-071554 (languages: EN, PL, RU, LT)


+
+
Unsubscribe from newsletter: Click here diff --git a/test/data/mail/mail044.yml b/test/data/mail/mail044.yml new file mode 100644 index 000000000..72dfcf9fd --- /dev/null +++ b/test/data/mail/mail044.yml @@ -0,0 +1,6 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"Clement.Si" ' +from_email: Claudia.Shu@yahoo.com. +from_display_name: Clement.Si +subject: 精益生产闪婚,是谁的责任 +to: abuse@domain.com diff --git a/test/data/mail/mail045.yml b/test/data/mail/mail045.yml new file mode 100644 index 000000000..039cde557 --- /dev/null +++ b/test/data/mail/mail045.yml @@ -0,0 +1,6 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"Ups Rémi" ' +from_email: r.ordonaud@example.com +from_display_name: Ups Rémi +subject: Nouveau message contact élégibilité Zammad +to: James-Max ROGER , Support diff --git a/test/data/mail/mail048.yml b/test/data/mail/mail048.yml new file mode 100644 index 000000000..55ff02450 --- /dev/null +++ b/test/data/mail/mail048.yml @@ -0,0 +1,10 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Edenhofer +from_email: martin@example.de +from_display_name: Martin Edenhofer +subject: 'AW: OTRS / Anfrage OTRS Einführung/Präsentation [Ticket#11545]' +content_type: text/html +body: |- + Enjoy!
+
-Martin

--
Old programmers never die. They just branch to a new address.
+

diff --git a/test/data/mail/mail050.yml b/test/data/mail/mail050.yml new file mode 100644 index 000000000..0444df288 --- /dev/null +++ b/test/data/mail/mail050.yml @@ -0,0 +1,2 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +subject: ABC / 123 / Wetterau West / ABC diff --git a/test/data/mail/mail051.yml b/test/data/mail/mail051.yml new file mode 100644 index 000000000..71c9d5a15 --- /dev/null +++ b/test/data/mail/mail051.yml @@ -0,0 +1,5 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Edenhofer +from_email: martin@example.de +from_display_name: Martin Edenhofer +subject: 'AW: OTRS / Anfrage OTRS Einführung/Präsentation [Ticket#11545]' diff --git a/test/data/mail/mail052.yml b/test/data/mail/mail052.yml new file mode 100644 index 000000000..2645fa939 --- /dev/null +++ b/test/data/mail/mail052.yml @@ -0,0 +1,5 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: MAILER-DAEMON@example.com (Mail Delivery System) +from_email: MAILER-DAEMON@example.com +from_display_name: Mail Delivery System +subject: Undelivered Mail Returned to Sender diff --git a/test/data/mail/mail053.yml b/test/data/mail/mail053.yml new file mode 100644 index 000000000..0732747a1 --- /dev/null +++ b/test/data/mail/mail053.yml @@ -0,0 +1,5 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: MAILER-DAEMON (Mail Delivery System) +from_email: MAILER-DAEMON +from_display_name: Mail Delivery System +subject: Undelivered Mail Returned to Sender diff --git a/test/data/mail/mail054.yml b/test/data/mail/mail054.yml new file mode 100644 index 000000000..8b70c400e --- /dev/null +++ b/test/data/mail/mail054.yml @@ -0,0 +1,6 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"Smith, Karoline, Example DE" ' +from_email: Karoline.Smith@example.com +from_display_name: Smith, Karoline, Example DE +subject: 'AW: One Net Business' +body: no visible content diff --git a/test/data/mail/mail056.yml b/test/data/mail/mail056.yml new file mode 100644 index 000000000..eba9c4359 --- /dev/null +++ b/test/data/mail/mail056.yml @@ -0,0 +1,7 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Martin Edenhofer +from_email: martin@example.de +from_display_name: Martin Edenhofer +subject: 'AW: OTRS / Anfrage OTRS Einführung/Präsentation [Ticket#11545]' +content_type: text/html +body: Enjoy! diff --git a/test/data/mail/mail057.yml b/test/data/mail/mail057.yml new file mode 100644 index 000000000..d1821ce1d --- /dev/null +++ b/test/data/mail/mail057.yml @@ -0,0 +1,10 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: example@example.com +from_email: example@example.com +from_display_name: '' +subject: 'W.: Invoice' +content_type: text/plain +body: " \n\n\n----- Original Nachricht ----\nVon: example@example.com\nAn: bob@example.com\nDatum: + \ 30.05.2017 16:17\nBetreff: Invoice\n\nDear Mrs.Weber\n\nanbei mal wieder ein + paar Invoice.\n\nWünsche Ihnen noch einen schönen Arbeitstag.\n\nMit freundlichen + Grüßen\n\nBob Smith\n" diff --git a/test/data/mail/mail058.yml b/test/data/mail/mail058.yml new file mode 100644 index 000000000..987c3f3ce --- /dev/null +++ b/test/data/mail/mail058.yml @@ -0,0 +1,13 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Yangzhou ABC Lighting Equipment , LTD +from_email: bob@example.com +from_display_name: Yangzhou ABC Lighting Equipment +subject: new design solar street lights +content_type: text/plain +body: |- + äöüß ad asd + + -Martin + + -- + Old programmers never die. They just branch to a new address. diff --git a/test/data/mail/mail059.yml b/test/data/mail/mail059.yml new file mode 100644 index 000000000..aebf8e8d0 --- /dev/null +++ b/test/data/mail/mail059.yml @@ -0,0 +1,13 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: '"Yangzhou ABC Lighting Equipment " <>, "LTD" ' +from_email: ly@example.com +from_display_name: LTD +subject: new design solar street lights +content_type: text/plain +body: |- + äöüß ad asd + + -Martin + + -- + Old programmers never die. They just branch to a new address. diff --git a/test/data/mail/mail062.yml b/test/data/mail/mail062.yml new file mode 100644 index 000000000..2e9c0d1b2 --- /dev/null +++ b/test/data/mail/mail062.yml @@ -0,0 +1,9 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: Smith Sepp +from_email: smith@example.com +from_display_name: Smith Sepp +subject: Gruß aus Oberalteich +content_type: text/html +body: |- +
+

Herzliche Grüße aus Oberalteich sendet Herrn Smith

 

Sepp Smith - Dipl.Ing. agr. (FH)

Geschäftsführer der example Straubing-Bogen

Klosterhof 1 | 94327 Bogen-Oberalteich

Tel: 09422-505601 | Fax: 09422-505620

Internet: http://example-straubing-bogen.de

Facebook: http://facebook.de/examplesrbog

Beschreibung: Beschreibung: efqmLogoBeschreibung: Beschreibung: efqmLogo - European Foundation für Quality Management

 

diff --git a/test/data/mail/mail063.yml b/test/data/mail/mail063.yml new file mode 100644 index 000000000..28bba9b42 --- /dev/null +++ b/test/data/mail/mail063.yml @@ -0,0 +1,20 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: MAILER-DAEMON@mx1.example.com (Mail Delivery System) +from_email: MAILER-DAEMON@mx1.example.com +from_display_name: Mail Delivery System +subject: Undelivered Mail Returned to Sender +content_type: text/plain +body: | + This is the mail system at host mx1.example.com. + + I'm sorry to have to inform you that your message could not + be delivered to one or more recipients. It's attached below. + + For further assistance, please send mail to postmaster. + + If you do so, please include this problem report. You can + delete your own text from the attached returned message. + + The mail system + + : user unknown diff --git a/test/data/mail/mail066.yml b/test/data/mail/mail066.yml new file mode 100644 index 000000000..b21cab24f --- /dev/null +++ b/test/data/mail/mail066.yml @@ -0,0 +1,27 @@ +--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess +from: ABC GmbH +from_email: info@example.com +from_display_name: ABC GmbH +subject: ABC gratuliert! +content_type: text/html +body: "Glückwunschkarte

Wenn diese Mail nicht richtig dargestellt wird, dann klicken + Sie bitte hier.

+ \n
\"Herzlichen

Sehr geehrte Damen und Herren,

zu Ihrem + Geburtstag schicken wir Ihnen ein großes Paket mit guten Wünschen:
Viel Erfolg, + Energie und ein gutes Gespür für die richtigen Entscheidungen!

Ihr Ehrentag + ist ein guter Anlass zurückzublicken und sich an Erreichtem zu erfreuen. Doch er + ist auch Anlass, den Blick nach vorne zu richten. Sich kurz zu orientieren und neue + Ziele zu stecken. Unsere besten Wünsche begleiten Sie auf Ihrem zukünftigen Weg + und wir freuen uns darauf, Ihnen auch dabei zur Seite zu stehen!

Heute wünschen + wir Ihnen einen schönen Tag im Kreise Ihrer Freunde und Familie.

Herzliche + Grüße

Ihre ABC


\n
ABC GmbH
Einestraße 23
99999 München
\n
+ Telefon.: +49 (0)11 11 11 11-1
Fax: +49 (0)11 11 11 11-1

www.example.com

 

Geschäftszeiten: + Mo-Do 08:00-18:00 Uhr Fr 08:00-17:00 Uhr
Sitz der Gesellschaft: München
+ Registergericht: Amtsgericht München, HRB AAAA
Geschäftsführer: AAAA, BBBB

" diff --git a/test/unit/email_build_test.rb b/test/unit/email_build_test.rb index 834ae8544..410043036 100644 --- a/test/unit/email_build_test.rb +++ b/test/unit/email_build_test.rb @@ -31,15 +31,17 @@ class EmailBuildTest < ActiveSupport::TestCase end test 'html email + attachment check' do - html = ' - - - - - -
> Welcome!
>
> Thank you for installing Zammad. äöüß
>
- -' + html = <<~MSG_HTML.chomp + + + + + + +
> Welcome!
>
> Thank you for installing Zammad. äöüß
>
+ + + MSG_HTML mail = Channel::EmailBuild.build( from: 'sender@example.com', to: 'recipient@example.com', @@ -54,12 +56,15 @@ class EmailBuildTest < ActiveSupport::TestCase ], ) - should = '> Welcome! -> -> Thank you for installing Zammad. äöüß ->' - assert_equal(mail.text_part.body.to_s, Mail::Utilities.to_crlf(should)) - assert_equal(mail.html_part.body.to_s, Mail::Utilities.to_crlf(html)) + text_should = Mail::Utilities.to_crlf(<<~MSG_TEXT.chomp) + > Welcome! + > + > Thank you for installing Zammad. äöüß + > + MSG_TEXT + html_should = Mail::Utilities.to_crlf(html) + assert_equal(text_should, mail.text_part.body.to_s) + assert_equal(html_should, mail.html_part.body.to_s) parser = Channel::EmailParser.new data = parser.parse(mail.to_s) @@ -91,10 +96,12 @@ class EmailBuildTest < ActiveSupport::TestCase end test 'plain email + attachment check' do - text = '> Welcome! -> -> Thank you for installing Zammad. äöüß ->' + text = <<~MSG_TEXT.chomp + > Welcome! + > + > Thank you for installing Zammad. äöüß + > + MSG_TEXT mail = Channel::EmailBuild.build( from: 'sender@example.com', to: 'recipient@example.com', @@ -108,11 +115,9 @@ class EmailBuildTest < ActiveSupport::TestCase ], ) - should = '> Welcome! -> -> Thank you for installing Zammad. äöüß ->' - assert_equal(mail.text_part.body.to_s, Mail::Utilities.to_crlf(should)) + mail_gem_should = Mail::Utilities.to_crlf(text) + email_parser_should = text + assert_equal(mail_gem_should, mail.text_part.body.to_s) assert_nil(mail.html_part) assert_equal('image/png; filename=somename.png', mail.attachments[0].content_type) @@ -120,7 +125,7 @@ class EmailBuildTest < ActiveSupport::TestCase data = parser.parse(mail.to_s) # check body - assert_equal(should, data[:body]) + assert_equal(email_parser_should, data[:body]) # check count of attachments, 2 assert_equal(1, data[:attachments].length) @@ -177,10 +182,12 @@ class EmailBuildTest < ActiveSupport::TestCase created_by_id: 1, ) - text = '> Welcome! -> -> Thank you for installing Zammad. äöüß ->' + text = <<~MSG_TEXT.chomp + > Welcome! + > + > Thank you for installing Zammad. äöüß + > + MSG_TEXT mail = Channel::EmailBuild.build( from: 'sender@example.com', to: 'recipient@example.com', @@ -190,11 +197,9 @@ class EmailBuildTest < ActiveSupport::TestCase ], ) - should = '> Welcome! -> -> Thank you for installing Zammad. äöüß ->' - assert_equal(mail.text_part.body.to_s, Mail::Utilities.to_crlf(should)) + mail_gem_should = Mail::Utilities.to_crlf(text) + email_parser_should = text + assert_equal(mail_gem_should, mail.text_part.body.to_s) assert_nil(mail.html_part) assert_equal('text/calendar; filename=schedule.ics', mail.attachments[0].content_type) @@ -202,7 +207,7 @@ class EmailBuildTest < ActiveSupport::TestCase data = parser.parse(mail.to_s) # check body - assert_equal(should, data[:body]) + assert_equal(email_parser_should, data[:body]) # check count of attachments, 2 assert_equal(1, data[:attachments].length) @@ -221,28 +226,28 @@ class EmailBuildTest < ActiveSupport::TestCase end test 'plain email + without attachment check' do - text = '> Welcome! -> -> Thank you for installing Zammad. äöüß ->' + text = <<~MSG_TEXT.chomp + > Welcome! + > + > Thank you for installing Zammad. äöüß + > + MSG_TEXT mail = Channel::EmailBuild.build( from: 'sender@example.com', to: 'recipient@example.com', body: text, ) - should = '> Welcome! -> -> Thank you for installing Zammad. äöüß ->' - assert_equal(mail.body.to_s, Mail::Utilities.to_crlf(should)) + mail_gem_should = Mail::Utilities.to_crlf(text) + email_parser_should = text + assert_equal(mail_gem_should, mail.body.to_s) assert_nil(mail.html_part) parser = Channel::EmailParser.new data = parser.parse(mail.to_s) # check body - assert_equal(should, data[:body]) + assert_equal(email_parser_should, data[:body]) # check count of attachments, 0 assert_equal(0, data[:attachments].length) diff --git a/test/unit/email_parser_test.rb b/test/unit/email_parser_test.rb index 86d899478..e61c2e5e0 100644 --- a/test/unit/email_parser_test.rb +++ b/test/unit/email_parser_test.rb @@ -1,1431 +1,46 @@ # rubocop:disable all + require 'test_helper' class EmailParserTest < ActiveSupport::TestCase test 'parse' do - files = [ - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail001.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail001.box'), - body_md5: 'e5cf748bf60cbbf324ee20314750fdf7', - params: { - from: 'John.Smith@example.com', - from_email: 'John.Smith@example.com', - from_display_name: '', - subject: 'CI Daten für PublicView ', - content_type: 'text/html', - body: "
-
Hallo Martin,

 

wie besprochen hier noch die Daten für die Intranetseite:

 

Schriftart/-größe: Verdana 11 Pt wenn von Browser nicht unterstützt oder nicht vorhanden wird Arial 11 Pt genommen
Schriftfarbe: Schwarz
Farbe für die Balken in der Grafik: D7DDE9 (Blau)

 

Wenn noch was fehlt oder du was brauchst sag mir Bescheid.

 

Mit freundlichem Gruß

John Smith
Service und Support

Example Service AG & Co.
Management OHG
Someware-Str. 4
xxxxx Someware

-
Tel.: +49 001 7601 462
Fax: +49 001 7601 472
john.smith@example.com
-
OHG mit Sitz in Someware
AG: Someware - HRA 4158
Geschäftsführung: Tilman Test, Klaus Jürgen Test,
Bernhard Test, Ulrich Test
USt-IdNr. DE 1010101010

Persönlich haftende geschäftsführende Gesellschafterin:
Marie Test Example Stiftung, Someware
Vorstand: Rolf Test

Persönlich haftende Gesellschafterin:
Example Service AG, Someware
AG: Someware - HRB xxx
Vorstand: Marie Test

 

", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail002.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail002.box'), - body_md5: '154c7d3ae7b94f99589df62882841b08', - params: { - from: 'Martin Edenhofer ', - from_email: 'martin@example.com', - from_display_name: 'Martin Edenhofer', - subject: 'aaäöüßad asd', - body_md5: "äöüß ad asd\n\n-Martin\n\n--\nOld programmers never die. They just branch to a new address.\n", - content_type: 'text/plain', - body: "äöüß ad asd + msg_files = Dir.glob(Rails.root.join('test', 'data', 'mail', 'mail*.box')).sort --Martin + messages = msg_files.select { |f| File.exists?(f.ext('yml')) } + .map do |f| + { + source: File.basename(f), + content: YAML.load(File.read(f.ext('yml'))), + parsed: Channel::EmailParser.new.parse(File.read(f)), + } + end --- -Old programmers never die. They just branch to a new address. -" - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail003.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail003.box'), - body_md5: '0b6eb998e8903ba69a3528dedb5a5476', - params: { - from: '"Günther John | Example GmbH" ', - from_email: 'k.guenther@example.com', - from_display_name: 'Günther John | Example GmbH', - subject: 'Ticket Templates', - content_type: 'text/html', - body: "
-

Hallo Martin,

 

ich möchte mich gern für den Beta-Test für die Ticket Templates unter XXXX 2.4 anmelden.

 

 

Mit freundlichen Grüßen

John Günther

 

example.com – profitieren Sie vom umfangreichen Daten-Netzwerk

 

_ __ ___ ____________________________ ___ __ _

 

Example GmbH

Some What

 

Sitz: Someware-Straße 9, XXXXX Someware

 

M: +49 (0) XXX XX XX 70

T: +49 (0) XXX XX XX 22

F: +49 (0) XXX XX XX 11

W: http://www.example.de

 

Geschäftsführer: John Smith

HRB XXXXXX AG Someware

St.-Nr.: 112/107/05858

 

ISO 9001:2008 Zertifiziert -Qualitätsstandard mit Zukunft

_ __ ___ ____________________________ ___ __ _

 

Diese Information ist ausschließlich für den Adressaten bestimmt und kann vertrauliche oder gesetzlich geschützte Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße Adressat sind, unterrichten Sie bitte den Absender und vernichten Sie diese Mail. Anderen als dem bestimmungsgemäßen Adressaten ist es untersagt, diese E-Mail zu lesen, zu speichern, weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu verwenden.

 

-

Von: Fritz Bauer [mailto:me@example.com]
Gesendet: Donnerstag, 3. Mai 2012 11:51
An: John Smith
Cc: Smith, John Marian; johnel.fratczak@example.com; ole.brei@example.com; Günther John | Example GmbH; bkopon@example.com; john.heisterhagen@team.example.com; sven.rocked@example.com; michael.house@example.com; tgutzeit@example.com
Betreff: Re: OTRS::XXX Erweiterung - Anhänge an CI's

 

Hallo,

 

-

ich versuche an den Punkten anzuknüpfen.

 

-

a) LDAP Muster Konfigdatei

 

 

-

PS: Es gibt noch eine Reihe weiterer Möglichkeiten, vor allem im Bezug auf Agenten-Rechte/LDAP Gruppen Synchronisation. Wenn Ihr hier weitere Informationen benötigt, einfach im Wiki die Aufgabenbeschreibung rein machen und ich kann eine Beispiel-Config dazu legen.

-

 

 

-

b) Ticket Templates

-

Wir haben das Paket vom alten Maintainer übernommen, es läuft nun auf XXXX 2.4, XXXX 3.0 und XXXX 3.1. Wir haben das Paket um weitere Funktionen ergänzt und würden es gerne hier in diesen Kreis zum Beta-Test bereit stellen.

 

-

Vorgehen:

-

Wer Interesse hat, bitte eine Email an mich und ich versende Zugänge zu den Beta-Test-Systemen. Nach ca. 2 Wochen werden wir die Erweiterungen in der Version 1.0 veröffentlichen.

 

 

-

c) XXXX Entwickler Schulung

-

Weil es immer wieder Thema war, falls jemand Interesse hat, das XXXX bietet nun auch OTRS Entwickler Schulungen an (http://www.example.com/kurs/xxxx_entwickler/).

 

 

-

d) Genelle Fragen?

-

Haben sich beim ein oder anderen generell noch Fragen aufgetan?

 

 

-

Viele Grüße!

 

-
-

-Fritz

On May 2, 2012, at 14:25 , John Smith wrote:

Moin Moin,

die Antwort ist zwar etwas spät, aber nach der Schulung war ich krank und danach
hatte ich viel zu tun auf der Arbeit, sodass ich keine Zeit für XXXX hatte.
Ich denke das ist allgemein das Problem, wenn sowas nebenbei gemacht werden muss.

Wie auch immer, danke für die mail mit dem ITSM Zusatz auch wenn das zur Zeit bei der Example nicht relevant ist.

Ich habe im XXXX Wiki den Punkt um die Vorlagen angefügt.
Ticket Template von John Bäcker
Bei uns habe ich das Ticket Template von John Bäcker in der Version 0.1.96 unter XXXX 3.0.10 implementiert.

Fritz wollte sich auch um das andere Ticket Template Modul kümmern und uns zur Verfügung stellen, welches unter XXXX 3.0 nicht lauffähig sein sollte.

Im Wiki kann ich die LDAP Muster Konfigdatei nicht finden.
Hat die jemand von euch zufälligerweise ?

Danke und Gruß
John Smith

Am 4. April 2012 08:24 schrieb Smith, John Marian <john.smith@example.com>:
Hallo zusammen,

ich hoffe Ihr seid noch gut nach Hause gekommen am Mittwoch. Der XXX Kurs Donnerstag und Freitag war noch ganz gut, wobei ich mir den letzten halben Tag eigentlich hätte schenken können.

Soweit ich weiß arbeitet Ihr nicht mit XXX? Falls doch habe ich hier eine tolle (eigentlich) kostenpflichtige Erweiterung für Euch.

Es handelt sich um eine programmiertes Paket von der XXXX AG. Die Weitergabe ist legal.

Mit dem Paket kann man Anhänge an CI’s (Configuration Items) verknüpfen. Das ist sehr praktisch wenn man zum Beispiel Rechnungen an Server, Computern und und und anhängen möchte.

Der Dank geht an Frank Linden, der uns das Paket kostenlos zur Verfügung gestellt hat.

Viele Grüße aus Someware

John

_________________________
SysAdmin
John Marian Smith
IT-Management

Example GmbH & Co. KG
Der Provider für
Mehrwertdienste & YYY

Someware 23
XXXXX Someware

Tel. (01802) XX XX XX - 42
Fax (01802) XX XX XX - 99
nur 6 Cent je Anruf aus dem dt. Festnetz,
max. 42 Cent pro Min. aus dem Mobilfunknetz

E-Mail john.smith@Example.de
Web www.Example.de
Amtsgericht Hannover HRA xxxxxxxx
Komplementärin: Example Verwaltungs- GmbH
Vertreten durch: Somebody, Somebody
Amtsgericht Someware HRB XXX XXX

_________________________
Highlights der Example Contact Center-Suite:
Virtual XXX&Power-XXX, Self-Services&XXX-Portale,
XXX-/Web-Kundenbefragungen, CRM, PEP, YYY

", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail004.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail004.box'), - body_md5: '9fab9a0e8523011fde0f3ecd80f8d72c', - params: { - from: '"Günther Katja | Example GmbH" ', - from_email: 'k.guenther@example.com', - from_display_name: 'Günther Katja | Example GmbH', - subject: 'AW: Ticket Templates [Ticket#11168]', - content_type: 'text/plain', - body: "Hallo Katja, + messages.each do |m| + # assert: raw content hash is a subset of parsed message hash + assert_operator(m[:content].except(:attachments), :<=, m[:parsed], + "parsed message data from #{m[:source]} does not match " \ + "message content from #{m[:source].ext('yml')}") -super! Ich freu mich! + # assert: attachments in parsed message hash match metadata in raw hash + next if m[:content][:attachments].blank? -Wir würden gerne die Präsentation/Einführung in die Ticket Templates per Screensharing oder zumindest per Telefon machen. + # the formats of m[:content][:attachments] and m[:parsed][:attachments] don't match, + # so we have to convert one to the other + parsed_attachment_metadata = m[:parsed][:attachments].map do |a| + { + md5: Digest::MD5.hexdigest(a[:data]), + cid: a[:preferences]['Content-ID'], + filename: a[:filename], + }.with_indifferent_access + end -Mögliche Termine: -o Do, 10.05.2012 15:00-16:00 -o Fr, 11.05.2012 13:00-14:00 -o Di, 15.05.2012 17:00-18:00 - -Über Feedback würde ich mich freuen! - -PS: Zur besseren Übersicht habe ich ein Ticket erstellt. :) Im Footer sind unsere geschäftlichen Kontaktdaten (falls diese irgendwann einmal benötigt werden sollten), mehr dazu in ein paar Tagen. - -Liebe Grüße! - - -Martin - - -", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail005.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail005.box'), - body_md5: 'f34033e9a34bb5367062dd5df21115df', - params: { - from: 'marc.smith@example.com (Marc Smith)', - from_email: 'marc.smith@example.com', - from_display_name: 'Marc Smith', - subject: 'Re: XXXX Betatest Ticket Templates [Ticket#11162]', - content_type: 'text/plain', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail006.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail006.box'), - body_md5: '849105bdee623b4314b4c3daa2495471', - params: { - from: '"Hans BÄKOSchönland" ', - from_email: 'me@bogen.net', - from_display_name: 'Hans BÄKOSchönland', - subject: 'utf8: 使って / ISO-8859-1: Priorität" / cp-1251: Сергей Углицких', - content_type: 'text/html', - body: "

this is a test



Compare Cable, DSL or Satellite plans: As low as $2.95.

Test1:–
Test2:&
Test3:∋
Test4:&
Test5:=", - }, - }, -#

- - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail007.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail007.box'), - body_md5: 'b779b65c7d90aa5e350d37998a6c5fc6', - params: { - from: 'Eike.Ehringer@example.com', - from_email: 'Eike.Ehringer@example.com', - from_display_name: '', - subject: 'AW:Installation [Ticket#11392]', - content_type: 'text/html', - body:"Hallo.
Jetzt muss ich dir noch kurzfristig absagen für morgen.
Lass uns evtl morgen Tel.

Mfg eike

-
Martin Edenhofer via Znuny Team --- Installation [Ticket#11392] ---
-
- - - - - - - - - - - - - - - - -
Von:\"Martin Edenhofer via Znuny Team\" <support@example.com>
Aneike.xx@xx-corpxx.com
Datum:Mi., 13.06.2012 14:30
BetreffInstallation [Ticket#11392]
-
-
Hi Eike,
-
-anbei wie gestern telefonisch besprochen Informationen zur Vorbereitung.
-
-a) Installation von http://ftp.gwdg.de/pub/misc/zammad/RPMS/fedora/4/zammad-3.0.13-01.noarch.rpm (dieses RPM ist RHEL kompatible) und dessen Abhängigkeiten.
-
-b) Installation von \"mysqld\" und \"perl-DBD-MySQL\".
-
-Das wäre es zur Vorbereitung!
-
-Bei Fragen nur zu!
-
- -Martin
-
---
-Martin Edenhofer
-
-Znuny GmbH // Marienstraße 11 // 10117 Berlin // Germany
-
-P: +49 (0) 30 60 98 54 18-0
-F: +49 (0) 30 60 98 54 18-8
-W: http://example.com 
-
-Location: Berlin - HRB 139852 B Amtsgericht Berlin-Charlottenburg
-Managing Director: Martin Edenhofer
-
-
-
", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail008.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail008.box'), - body_md5: 'd540b6f1a7b25468c1bc854ebc4c43fe', - attachments: [ - { - md5: '635e03d2ddde520b925262c8ffd03234', - filename: 'message.html', - }, - ], - params: { - from: 'Franz.Schaefer@example.com', - from_email: 'Franz.Schaefer@example.com', - from_display_name: '', - subject: 'could not rename: ZZZAAuto', - content_type: 'text/html', - body: " -
-
Gravierend?
- - - -
Mit freundlichen Grüßen
-
- - - - - - - -
-Franz Schäfer -
Manager Information Systems
-
- - - - - - - - -
Telefon +49 000 000 8565
christian.schaefer@example.com
-
- - - - - - - - - - - - - - - - -
-Example Stoff GmbH -
Fakultaet
Düsseldorfer Landstraße 395
D-00000 Hof
www.example.com
-
- - - - - - - - - - - - - -
-
-
Geschäftsführung/Management Board: Jan Bauer (Vorsitzender/Chairman), Oliver Bauer, Heiko Bauer, Boudewijn Bauer
Sitz der Gesellschaft / Registered Office: Hof
Registergericht / Commercial Register of the Local Court: HRB 0000 AG Hof
", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail009.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail009.box'), - body_md5: '64675a479f80a674eb7c08e385c3622a', - attachments: [ - { - md5: '9964263c167ab47f8ec59c48e57cb905', - filename: 'message.html', - }, - { - md5: 'ddbdf67aa2f5c60c294008a54d57082b', - filename: 'super-seven.jpg', - cid: '485376C9-2486-4351-B932-E2010998F579@home', - }, - ], - params: { - from: 'Martin Edenhofer ', - from_email: 'martin@example.de', - from_display_name: 'Martin Edenhofer', - subject: 'AW: OTRS / Anfrage OTRS Einführung/Präsentation [Ticket#11545]', - content_type: 'text/html', - body: "Enjoy!
-
-Martin

--
Old programmers never die. They just branch to a new address.
-

", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail010.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail010.box'), - body_md5: '47d41fa38028d5fb02c7d041da60ba1f', - attachments: [ - { - md5: '08b0c83fd155db23f22bed845715225d', - filename: 'message.html', - }, - { - md5: 'a618d671348735744d4c9a4005b56799', - filename: 'image001.jpg', - cid: 'image001.jpg@01CDB132.D8A510F0', - }, - ], - params: { - from: 'Smith Sepp ', - from_email: 'smith@example.com', - from_display_name: 'Smith Sepp', - subject: 'Gruß aus Oberalteich', - content_type: 'text/html', - body: "
-

Herzliche Grüße aus Oberalteich sendet Herrn Smith

 

Sepp Smith - Dipl.Ing. agr. (FH)

Geschäftsführer der example Straubing-Bogen

Klosterhof 1 | 94327 Bogen-Oberalteich

Tel: 09422-505601 | Fax: 09422-505620

Internet: http://example-straubing-bogen.de

Facebook: http://facebook.de/examplesrbog

\"Beschreibung: - European Foundation für Quality Management

 

", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail011.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail011.box'), - body_md5: '260a815b0a7897e4219d210010008202', - attachments: [ - { - md5: '08660cd33ce8c64b95bcf0207ff6c4d6', - filename: 'message.html', - }, - ], - params: { - "reply-to": 'serviceteam@cylex.de', - from: 'CYLEX Newsletter ', - 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', - body: " - - - - - -
-

-

Lieber CYLEX Eintragsinhaber,

das Jahr neigt sich dem Ende und die besinnliche Zeit beginnt laut Kalender mit dem
1. Advent. Und wie immer wird es in der vorweihnachtlichen Zeit meist beruflich und privat
so richtig schön hektisch.

Um 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.

- - - - - - -
Einen gemütlichen Start in die Adventszeit wünscht Ihnen - -
-

Ihr CYLEX Team
-
-P.S. Damit Sie keinen Tag versäumen, empfehlen wir Ihnen den Link des Adventkalenders in
Ihrer Lesezeichen-Symbolleiste zu ergänzen.

 

- - - - - -
Impressum
S.C. CYLEX INTERNATIONAL S.N.C.
Sat. Palota 119/A RO 417516 Palota Romania
Tel.: +49 208/62957-0 |
Geschäftsführer: Francisc Osvald
Handelsregister: J05/1591/2009
USt.IdNr.: RO26332771
-
serviceteam@cylex.de
-Homepage
-Newsletter abbestellen -
", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail012.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail012.box'), - body_md5: 'dd7e002b6bb709effb56bdb6f2cc2e32', - attachments: [ - { - md5: '25e4f512f8b660bac82e68285755b809', - filename: 'message.html', - }, - { - md5: 'b6e70f587c4b1810facbb20bb5ec69ef', - filename: 'image002.png', - }, - ], - params: { - from: 'Alex.Smith@example.com', - from_email: 'Alex.Smith@example.com', - from_display_name: '', - subject: 'AW: Agenda [Ticket#11995]', - to: 'example@znuny.com', - content_type: 'text/html', - body: "
-

Hallo Herr Edenhofer,

 

möglicherweise haben wir für unsere morgige Veranstaltung ein Problem mit unserer Develop-Umgebung.
Der Kollege Smith wollte uns noch die Möglichkeit geben, direkt auf die Datenbank zugreifen zu können, hierzu hat er Freitag noch einige Einstellungen vorgenommen und uns die Zugangsdaten mitgeteilt. Eine der Änderungen hatte aber offenbar zur Folge, dass ein Starten der Develop-Anwendung nicht mehr möglich ist (s. Fehlermeldung)
-

 

Herr Smith ist im Urlaub, er wurde von seinen Datenbank-Kollegen kontaktiert aber offenbar lässt sich nicht mehr 100%ig rekonstruieren, was am Freitag noch verändert wurde.
Meinen Sie, dass Sie uns bei der Behebung der o. a. Störung morgen helfen können? Die Datenbank-Kollegen werden uns nach besten Möglichkeiten unterstützen, Zugriff erhalten wir auch.

 

Mit freundlichen Grüßen

 

Alex Smith
-
Abteilung IT-Strategie, Steuerung & Support
im Bereich Informationstechnologie
-
Example – Example GmbH
(Deutsche Example)
Longstreet 5
11111 Frankfurt am Main
-
Telefon: (069) 11 1111 – 11 30

Telefon ServiceDesk: (069) 11 1111 – 12 22
Telefax: (069) 11 1111 – 14 85
Internet: www.example.com

 

-----Ursprüngliche Nachricht-----
Von: Martin Edenhofer via Znuny Sales [mailto:example@znuny.com]
Gesendet: Freitag, 30. November 2012 13:50
An: Smith, Alex
Betreff: Agenda [Ticket#11995]

 

Sehr geehrte Frau Smith,

 

ich habe (wie telefonisch avisiert) versucht eine Agenda für nächste Woche zusammen zu stellen.

 

Leider ist es mir dies Inhaltlich nur unzureichend gelungen (es gibt zu wenig konkrete Anforderungen im Vorfeld :) ).

 

Dadurch würde ich gerne am Dienstag als erste Amtshandlung (mit Herrn Molitor im Boot) die Anforderungen und Ziele der zwei Tage, Mittelfristig und Langfristig definieren. Aufgrund dessen können wir die Agenda der zwei Tage fixieren. Inhaltlich können wir (ich) alles abdecken, von daher gibt es hier keine Probleme. ;)

 

Ist dies für Sie so in Ordnung?

 

Für Fragen stehe ich gerne zur Verfügung!

 

Ich freue mich auf Dienstag,

 

Martin Edenhofer

 

--

Enterprise Services for OTRS

 

Znuny GmbH // Marienstraße 11 // 10117 Berlin // Germany

 

P: +49 (0) 30 60 98 54 18-0

F: +49 (0) 30 60 98 54 18-8

W: http://znuny.com -

 

Location: Berlin - HRB 139852 B Amtsgericht Berlin-Charlottenburg Managing Director: Martin Edenhofer

-

-------------------------------------------------------------------------------------------------

Rechtsform: GmbH

Geschaeftsfuehrer: Dr. Carl Heinz Smith, Dr. Carsten Smith

Sitz der Gesellschaft und Registergericht: Frankfurt/Main, HRB 11111

Alleiniger Gesellschafter: Bundesrepublik Deutschland,

vertreten durch das XXX der Finanzen.

", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail013.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail013.box'), - body_md5: 'c3b62f742eb702910d0074e438b34c72', - attachments: [ - { - md5: '29cc1679f8a44c72be6be7c1da4278ac', - filename: 'message.html', - }, - ], - params: { - from: 'thomas.smith@example.com', - from_email: 'thomas.smith@example.com', - from_display_name: '', - subject: 'Antwort: Probleme ADB / Anlegen von Tickets [Ticket#111079]', - to: 'q1@znuny.com', - content_type: 'text/html', - body: '

JA

', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail014.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail014.box'), - body_md5: '154c7d3ae7b94f99589df62882841b08', - attachments: [ - { - md5: '5536be23f647953dc39c1673205d6f5b', - filename: 'Neue Anfrage erstellt - 33284.eml', - }, - { - md5: '4eeeae078b920f9d0708353ba0f6aa63', - filename: 'Call: HW-Anforderung; Best-nr.47524152.eml', - }, - ], - params: { - from: '"Müller, Bernd" ', - from_email: 'Bernd.Mueller@example.com', - from_display_name: 'Müller, Bernd', - subject: 'AW: OTRS [Ticket#118192]', - to: '\'Martin Edenhofer via Znuny Sales\' ', - content_type: 'text/plain', - body: "äöüß ad asd\n\n-Martin\n\n--\nOld programmers never die. They just branch to a new address.\n" - }, - }, - # spam email - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail015.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail015.box'), - body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', - attachments: [ - # :preferences=>{"Message-ID"=>"", "Content-Type"=>"application/octet-stream; name=\"\xBC\xA8\xD0\xA7\xB9\xDC\xC0\xED,\xBE\xBF\xBE\xB9\xCB\xAD\xB4\xED\xC1\xCB.xls\"", "Mime-Type"=>"application/octet-stream", "Charset"=>"UTF-8"}} - # mutt c1abb5fb77a9d2ab2017749a7987c074 - { - md5: '2ef81e47872d42efce7ef34bfa2de043', - filename: '绩效管理,究竟谁错了.xls', - }, - ], - params: { - from: '"Sara.Gang" ', - from_email: 'ynbe.ctrhk@gmail.com', - from_display_name: 'Sara.Gang', - subject: '绩效管理,究竟谁错了', - to: 'info42@znuny.com', - content_type: 'text/plain', - }, - }, - # spam email - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail016.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail016.box'), - body_md5: 'c3ea8fde251062d56b7fc72b6d73d702', - params: { - from: nil, - from_email: 'vipyimin@126.com', - from_display_name: '', - subject: '【 直通美国排名第49大学 成功后付费 】', - to: '"enterprisemobility.apacservice" ', - }, - }, - # spam email - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail017.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail017.box'), - body_md5: 'd78731371e3ec120896c51be3d0d3f8e', - params: { - from: '"都琹" ', - from_email: 'ghgbwum@185.com.cn', - from_display_name: '都琹', - subject: '【专业为您注册香港及海外公司(好处多多)】                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               人物 互联网事百度新闻独家出品传媒换一批捷克戴维斯杯决赛前任命临时领队 前领队因病住院最新:盖世汽车讯 11月6日,通用汽车宣布今年10月份在华销量...减持三特索道 孟凯将全力发展湘鄂情江青摄影作品科技日报讯 (记者过国忠 通讯员陈飞燕)江苏省无线电科学研究所有限公司院士工作站日前正式建...[详细]', - to: 'info@znuny.com', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail018.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail018.box'), - body_md5: '66f20e8557095762ccad9a6cb6f59c3a', - params: { - from: 'postmaster@example.com', - from_email: 'postmaster@example.com', - from_display_name: '', - subject: "Benachrichtung \tzum \t=?unicode-1-1-utf-7?Q?+ANw-bermittlungsstatus \t(Fehlgeschlagen)?=", - to: 'sales@znuny.org', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail019.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail019.box'), - body_md5: '6021dd92d8e7844e6bb9b5bb7a4adfb8', - params: { - from: '"我" <>', - from_email: 'vipyiming@126.com', - from_display_name: '', - subject: '《欧美简讯》', - to: '377861373 <377861373@qq.com>', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail020.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail020.box'), - body_md5: '56ad8d02f4c7641fd2bb8ebf484d36d7', - params: { - from: 'Health and Care-Mall ', - from_email: 'drugs-cheapest8@sicor.com', - from_display_name: 'Health and Care-Mall', - subject: 'The Highest Grade Drugs And EXTRA LOW Price .', - to: 'info2@znuny.com', - body: "________________________________________________________________________Yeah but even when they. Beth liî ed her neck as well
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
óû5aHw5³½IΨµÁxG⌊o8KHCmς9-Ö½23QgñV6UAD¿ùAX←t¨Lf7⊕®Ir²r½TLA5pYJhjV gPnãM36V®E89RUDΤÅ©ÈI9æsàCΘYEϒAfg∗bT¡1∫rIoiš¦O5oUIN±IsæSعPp Ÿÿq1FΧ⇑eGOz⌈F³R98y§ 74”lTr8r§HÐæuØEÛPËq VmkfB∫SKNElst4S∃Á8üTðG°í lY9åPu×8>RÒ¬⊕ΜIÙzÙCC4³ÌQEΡºSè!XgŒs.
çγ⇓BcwspC L I C K H E R Eëe3¸ !Calm dylan for school today.
Closing the nursery with you down. Here and made the mess. Maybe the oï from under his mother. Song of course beth touched his pants.
When someone who gave up from here. Feel of god knows what.
TBϖ∃M5T5ΕEf2û–N¶ÁvΖ'®⇓∝5SÐçË5 Χ0jΔHbAgþE—2i6A2lD⇑LGjÓnTOy»¦Hëτ9’:Their mother and tugged it seemed like
d3RsV¶HÓΘi¯B∂gax1bîgdHä3rýJÿ1aIKDz n1jfaTk³Vs395ß C˜lBl‘mxGo0√úXwT8Ya õ8ksa∫f·ℵs”6ÑQ ÍAd7$p32d1e∏æe.0”×61aîΚ63αSMûNf5ÉCdL∪1i↔xcaa5êR3l6Lc3iãz16só9èU zDE²aEȨgs25ËÞ hE§cl⊃¢¢ÂoÒµBw²zF© qÏkõaXUius1r0⊆ d•∈ø$¢Z2F12­8l.07d56PÚl25JAO6
45loVóiv1i2ãΥ⌊að⊃d2gÃΥ3™rÎÍu¸aWjO8 n40–Soyè2u¡∅Î3p¢JΜNeÌé×jráÒrΚ 1ÌÓ9AúrAkc8nuEtl22ai‡OB8vSbéσeιõq1+65cw Òs8Uaò4PrsE1y8 〈fMElhϒ⋅Jo8pmzwjˆN¥ wv39aW¡WtsvuU3 1aœ³$éΝnR2OÏ⌉B.∀þc→5Ê9χw5pÃ⁄NfHGFVfE³ãiσjGpa5¶kgg¡ìcWrUq5æakx2h 0Fè4P¸ÕLñrn22ÏoþÝÐHfoRb2eUαw6sñN‾ws¶§3ΒiòX¶¸ofgtHnR⊥3âase9álF¿H5 à6BÁa⊃2iϒsô¡ói ÅkMylÚJ¾ÄoQ–0ℑwvmùþ ˈμ\"aQ7jVse6Ðf «hÜp$Lâr£3i1tÚ.323h5qP8g0♥÷R÷
·iƒPV1Β∋øiF¤RÃa4v3âgL9¢wr¨7ø×aÏû0η þ1àßStuÞ³u7á¡lpÑocEe·SLlrVàXj ⊥Uµ¢F¬48ðov7¨Arm×4ÍcùVwÞe1§⊇N ÂÛ4äaLþZ2ski×5 c€pBlûù6∂olÃfÚwKß3Ñ 4iíla4C³êsREÕ1 ãeIó$âz8t442fG.¸1≤¸2F’Ã152in⊄Tl©ëC2v7Ci7·X8a×ú5NlþU〉ιicO∑«s·iKN UuϒjSÃj5Ýu÷Jü§pn5°§e¥Û3℘rÆW‡ò J‹S7A1j0sc&ºpkt·qqøiZ56½vn8¨∗eîØQ3+7Î3Š ∑RkLaKXËasÐsÌ2 ïÇ­¶lDäz8oã78wwU–ÀC T6Uûaϒ938sÌ0Gÿ Oxó∈$98‘R2ÂHï5.ÒL6b9θrδÜ92f9j
Please matt on his neck. Okay matt huï ed into your mindSince her head to check dylan. Where dylan matt got up there
1ȱΑAYQªdN¬ÚϒXT00ÀvI∨ío8-½b®8AΕºV4LgÕ↑7LKtgcEiw­yR5YýæGRA1°I¿0CïCàTiü/þwc0Ax211SÜÂùŒTÁ2êòHpNâùM6Ⱦ0A5Tb»:Simmons and now you really is what. Matt picked up this moment later that.
25¯yV9ÙßYeg·↑DnJ3l4tÝæb1os∏jll÷iSÐiwBÎ4n0ú1Ö ªf÷Ña§1løsuÚ8ê 2LCblgvN½o¼oP3wn♠90 FZora&M™xsΚbb ç5Ãξ$Âô·×2iGæ∇1⊇Ξ¬3.0P0κ53VÁö03ÝYzøX¢BAZ4KwdduÜvvuB↑ΒaÄ’THi0—93rZεj0 §rΜÅa2­·§s7¸Ιf 8⇓þolW„6Ýo6yH¥wKZ∧6 21hÒaKJ“ℜs48IÌ ÔÀ¬­$ZΣ¹ü2ñÙ6B42YMZ.Ô¹V¼9f·0å54⌈R8
÷w\"9N2gBÀaðSê¢s≅gGÔo0Dn4n↵γ7⊗eS7eýxf3Jd q÷CMaÍä³isNMZp zz0˜lΚLw8oë29ww¤§Qu ¥D⌈íaýË¢ésJ8Á¬ 3oùÙ$¦1Nℜ1>Rét7WPM¨.¶8¹D92k5D9∗8≈Rl©3ªSj·Ψ8pΣïKùi6rrÔrbÛu¬i2V∗∏v5ª10a27BÁ Ú♦Ξsa9j3χsa¯iΟ Oi℘ml6óféowbz∀wA6ù→ ñ×bàai´wbs♦βGs Ù81i$iÀˆ12⊃2wC82n8o.µ3NJ9S1©Θ0P1Sd
What made no one in each time.Mommy was thinking of course beth. Everything you need the same thing
PïEVGÿ9srEx⇐9oN3U®yEÎi2OR5kÇÿAΤηνULP¿∧q R5¿FHt7J6E»¯C∅Aå∃aVLu∗¢tT〈2ÚHq9Né: -
⊥ÞÞ¨T¦ªBrrC7³2adš6lmzb¨6ai07tdBo×KopíΡÄlj4Hy ÝaÓ1aÖí∉Ós1aá’ 4D­kleowËo3–1ÍwjR≤Π £RhÈafà7≅sù6u2 8NLV$∪⇓»↓1Y¶2µ.vßÈ23ÖS7û0Ün¬Äm5VKZy3KÎiñë¹DtÚ2HrhGaMvr5ïR«oÂ1namΜwÐãanFu8x7⌈sU E4cva£Âε™s7ΑGO dA35ldñÌèoAξI1wXKïn f¼x¾a∏7ffs†ìÖð 5msC$7Ët¦0z„n÷.it¡T7O8vt5¼8å·
Jï1ÏPkáO¶rnùrAo8s5∅z—4Rha1®t˜cq5YΧ ΤQÍraÑ⌋4¹sÜ5²§ ûVBιluwóioL3ëBw£±1¶ 5∈àáa1IÊ2sšÛÛ G´7ρ$kJM80∼∠ℵl.J1Km32µÚ⊃5ã鼧p°ÿ­A¹NU0c¥xçfo〈Øácm14QGpHEj7lnDPVieV2¶aΠ2H7 ²j26azBSesë1c9 ´2Ù¬l0nò¤oõâRVw¦X´Ï αVõ­a≅σ¼Zs§jJå 3pFN$¾Kf821YΟ7.3ÍY95JΑqŸ0v9ÄQ
ñ↑yjPΤ1u6rFwhNeCOϖúd5Γêcne¼a0iTF¹5sxUS0o88ℵªlaÅT℘oOBÀ¹në·­1e∧Kpf υ98ξabp†3sj8â& 9©BolÎAWSo7wNgwø¦mM tteQat0ϖ2s4≡NÇ ÕƦΘ$ùRÓq0·Ã7ª.mt¾³1—uwF57H♣fæ∪HYSjψ3Byš²g¤ndXÀ5tµ¯ò6hZ⇒yÿr8ÿmdowyðdiψ8YΗd0ršŠ N0Ý9aÃ3I¦sQaýê Õ0Y7lZ¯18o∫50Çwµ\"©Ζ n6Ü≥a∇lßnsF›J9 ºDΟK$Á4ÉL0S7zÖ.Ta2X3²R995391¡
Turning to mess up with. Well that to give her faceAnother for what she found it then. Since the best to hear
GX°♦Ca2isA¾8¡bNÉî8ÂAöÜzΘD∇tNXIfWi–Ap2WYNYF®b ≠7yφDpj6©R04EÂU´ñn7GÆoÌjS³Á∋TC⊥πËO1∗÷©RtS2wE66è­ νÑêéASi21DP“8λV∧W⋅OAÖg6qNtNp1T269XA7¥À²GGI6SEwU2íS3Χ1â!Okay let matt climbed in front door. Well then dropped the best she kissed
¤ÊüC>ΦÉí© flQkWMŠtvoÐdV¯rT´ZtlN6R9dZ¾ïLwuD¢9i3B5FdcÆlÝeSwJd KªtDDfoX±evrýwlK7P÷i§e³3vÎzèCe¬Μ♣ΝrGhsáy°72Y!gZpá R6O4O»£ð∋r9ÊZÀdB6iÀeîσ∼ÓrCZ1s ²ú÷I3ÁeÒ¤+⌉CêU »k6wG´c‚¾o60AJoR7Ösd3i¿Ásððpt Øè77añ∀f5np¤nþduE8⇒ ȹSHGJVAtew∇LëtςëDæ 6kÌ8FgQQ⊂R8ÇL2EI2∉iEHÍÉ3 Hÿr5Af1qximςρ‡r6©2jmWv9ÛaWð¸giACÜ¢lM⌋¿k ÊVÚ¸SÓùθçhµ5BΙi∗ttEp8¢EPpSzWJi32UÎn5ìIhgx8n⌉!j∏e5
x¯qJ>mC7f 5ºñy1GA4Ý0lCQe09s9u%uksã ψìX5A4g3nu←Τyst7ÍpMhšgÀÖe〉pÚ£n¼YƒŠtÉÚLGizqQ↓c3tÙI œïbXMKÛRSertj×d\"OtÊss58®!oo2i FÂWáEWøDDx7hIÕpΦSôBiÒdrUr⇔J<Õa1Αzwt0°p×ià8RÌoHÛ1Än¥7ÿr ¯¥õàDYvO7aká»htì04Πe∂λÇ1 1ÈdUoο°X3fc63¶ e&∪GOxT3CvXcO·e3KËνr3¸y2 26Ëz3Ã∞I± Pì∃zYt6F4e6è⇓va5÷þ9rkΘ3äsKP5R!ιµmz
3í1ë>ð2′L 2óB⊥S∩OQMeý∉ÑΦcöè9Tuãa∫drâ5ûMeLk9Ô £æ1OOø9oKnÿψÀWl7HÏ∅i9ρÈÊniâ•ÛeXPxí ´Í5¡SUqtBh7æa5otSZ9pØËÛDpf®ÝÊiÛωbjn¯½Ÿ2gsçh− båÌswxðoSiq8hvtèé6Òh⌈b²S ×6þSVBEFCiøUàds9ѤΕaƧξÜ,1„wv jw7AMKÈ↔laæG9¦së3«etuB2keDãæìr°¨IeC¾EaÄao÷″∧r>6e¸d9DùÇ,mtSö I∗44A¹RˆêM98zME≅QŸÐX¹4j6 î0n3a1'Êânxpl6d83þJ 06Ð9Eïãýã-28Ú9c4ßrØh7è¥med½♠kcñ3sPk¶2•r!〉QCa
ŠeÏÀ>Ãσ½å bpøNERN8eaD6Åns7Abhy±Æü∩ D7sVR8'ºEeÿáDVfc˜3ëu7ÏÆqncË3qdÊ∼4∇sρmi5 6æ¾Êaä°∝TnQb9sdÀMùℑ ∑gMÿ2bNð¶4cä½⊆/4X1κ7¥f1z ϖ1úECzf•1uMbycs1•9¾ts0Tào3hêDmSs3Áe7BíÉrô⋅ãÔ φ8Ä″SSXð¤uúI¸5p58uHp2cß±o∂T©Rrd6sMt∪µµξ!é4Xb
-
Both hands through the fear in front.
Wade to give it seemed like this. Yeah but one for any longer. Everything you going inside the kids." - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail021.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail021.box'), - body_md5: 'dea7a8979172261f61fb799b6c83742e', - params: { - from: 'Viagra Super Force Online ', - from_email: 'pharmacy_affordable1@ertelecom.ru', - from_display_name: 'Viagra Super Force Online', - subject: 'World Best DRUGS Mall For a Reasonable Price.', - to: 'info@znuny.nix', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail022.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail022.box'), - body_md5: '1af1f68f66713b63ce8ec4cc20c7887e', - params: { - from: 'Gilbertina Suthar ', - from_email: 'ireoniqla@lipetsk.ru', - from_display_name: 'Gilbertina Suthar', - subject: 'P..E..N-I..S__-E N L A R-G E-M..E..N T-___P..I-L-L..S...Info.', - to: 'Info ', - body: 'Puzzled by judith bronte dave. Melvin will want her way through with.
Continued adam helped charlie cried. Soon joined the master bathroom. Grinned adam rubbed his arms she nodded.
Freemont and they talked with beppe.
Thinking of bed and whenever adam.
Mike was too tired man to hear.
I°0PQSHEJlÔNwf˜Ì1§3S¬73 Î1mEbb5N37¢LϖC7AlFnRº♦HG64BÉ4Ò¦Måâ4ÊzkΙN⌉7⌉TBNÐ T×xPIògIÎÃlLøÕML⊥ÞøSaΨRBreathed adam gave the master bedroom door.
Better get charlie took the wall.
Charlotte clark smile he saw charlie.
Dave and leaned her tears adam.
Maybe we want any help me that.
Next morning charlie gazed at their father.
Well as though adam took out here. Melvin will be more money. Called him into this one last night.
Men joined the pickup truck pulled away. Chuck could make sure that.†p­C L I C K Ȟ E R EEOD !Chuckled adam leaned forward and leî charlie.
Just then returned to believe it here.
Freemont and pulling out several minutes.' - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail023.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail023.box'), - body_md5: '23967dfbbc2e167332b2ecb78fb9e397', - params: { - from: 'marketingmanager@nthcpghana.com', - from_email: 'marketingmanager@nthcpghana.com', - from_display_name: '', - subject: nil, - to: nil, - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail024.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail024.box'), - body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', - params: { - from: 'oracle@IG0-1-DB01.example.com', - from_email: 'oracle@IG0-1-DB01.example.com', - from_display_name: '', - subject: 'Regelsets im Test-Status gefunden: 1', - to: 'support@example.com', - body: 'no visible content', - }, - attachments: [ - { - data: 'RULESET_ID;NAME;ACTIV;RUN_MODE;AUDIT_MODIFY_DATE -387;DP DHL JOIN - EN : Einladung eAC;T;SM;1.09.14 -', - md5: 'a61c76479fdc2f107fe2697ac5ad60ae', - filename: 'rulesets-report.csv', - }, - ], - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail025.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail025.box'), - body_md5: '436f71d8d8a4ffbd3f18fc9de7d7f767', - params: { - from: 'oracle@IG0-1-DB01.example.com', - from_email: 'oracle@IG0-1-DB01.example.com', - from_display_name: '', - subject: 'Regelsets im Test-Status gefunden: 1', - to: 'support@example.com', - body: "begin 644 rulesets-report.csv -M4E5,15-%5%])1#M.04U%.T%#5$E6.U)53E]-3T1%.T%51$E47TU/1$E&65]$ -M051%\"C,X-SM$4\"!$2$P@2D])3B`M($5.(#H@16EN;&%D=6YG(&5!0SM4.U-- -*.S$W+C`Y+C$T\"@`` -` -end -", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail026.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail026.box'), - body_md5: '48c2843d219a7430bc84533d67719e95', - params: { - from: 'gate ', - from_email: 'team@support.gate.de', - from_display_name: 'gate', - subject: 'Ihre Rechnung als PDF-Dokument', - to: 'Martin Edenhofer ', - body: "Ihre Rechnung als PDF-Dokument - - - -


", - }, - attachments: [ - { - md5: '5d6a49a266987af128bb7254abcb2896', - filename: 'message.html', - }, - { - md5: '552e21cd4cd9918678e3c1a0df491bc3', - filename: 'invoice_gatede_B181347.txt', - }, - ], - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail027.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail027.box'), - body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', - params: { - from: 'caoyaoewfzfw@21cn.com', - from_email: 'caoyaoewfzfw@21cn.com', - from_display_name: '', - subject: "\r\n蠭龕中層管理者如何避免角色行为誤区", - to: 'duan@seat.com.cn, info@znuny.com, jinzh@kingdream.com', - body: 'no visible content', - }, - attachments: [ - { - md5: '498b8ae7b26033af1a08f85644d6695c', - filename: 'message.html', - }, - ], - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail028.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail028.box'), - body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', - params: { - from: 'kontakt@example.de', - from_email: 'kontakt@example.de', - from_display_name: '', - subject: 'Bewerbung auf Ihr Stellenangebot', - to: 'info@znuny.inc', - body: 'no visible content', - }, - attachments: [ - { - md5: '6605d016bda980cdc65fb72d232e4df9', - filename: 'Znuny GmbH .pdf', - }, - { - md5: '6729bc7cbe44fc967a9d953c4af114b7', - filename: 'Lebenslauf.pdf', - }, - ], - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail029.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail029.box'), - body_md5: '0637f48a0979e479efec07120a2bb700', - params: { - from: 'Example Sales ', - from_email: 'sales@example.com', - from_display_name: 'Example Sales', - subject: 'Example licensing information: No channel available', - to: 'info@znuny.inc', - body: 'Dear Mr. Edenhofer,

We want to keep you updated on TeamViewer licensing shortages on a regular basis.

We would like to inform you that since the last message on 25-Nov-2014 there have been temporary session channel exceedances which make it impossible to establish more sessions. Since the last e-mail this has occurred in a total of 1 cases.

Additional session channels can be added at any time. Please visit our TeamViewer Online Shop for pricing information.

Thank you - and again all the best with TeamViewer!

Best regards,

Your TeamViewer Team

P.S.: You receive this e-mail because you are listed in our database as person who ordered a TeamViewer license. Please click here to unsubscribe from further e-mails.

-----------------------------
-www.teamviewer.com
-
TeamViewer GmbH * Jahnstr. 30 * 73037 Göppingen * Germany
Tel. 07161 60692 50 * Fax 07161 60692 79

Registration AG Ulm HRB 534075 * General Manager Holger Felgner' - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail030.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail030.box'), - body_md5: '9ce35920f5702a871f227cfe7ddd3d65', - params: { - from: 'Manfred Haert ', - from_email: 'Manfred.Haert@example.com', - from_display_name: 'Manfred Haert', - subject: 'Antragswesen in TesT abbilden', - to: 'info@znuny.inc', - body: "Sehr geehrte Damen und Herren,

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.

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.

Wir bitten gerne um ein entsprechendes Angebot.

Für Rückfragen stehe ich gerne zur Verfügung. Vielen Dank!

--
Freundliche Grüße
i.A. Manfred Härt

Test Somewhere GmbH
Ferdinand-Straße 99
99073 Korlben
Bitte beachten Sie die neuen Rufnummern!
Telefon: 011261 00000-2460
Fax: 011261 0000-7460
manfred.haertel@example.com
http://www.example.com
JETZT AUCH BEI FACEBOOK !
https://www.facebook.com/test
___________________________________
Test Somewhere GmbH

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.
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.

", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail031.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail031.box'), - body_md5: 'd5448d34bf7f5db0a525fc83735dc11b', - params: { - from: '"bertha mou" ', - from_email: 'zhengkang@ha.chinamobile.com', - from_display_name: 'bertha mou', - subject: '內應力產生与注塑工艺条件之间的关系;', - to: 'info@znuny.inc', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail032.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail032.box'), - body_md5: '9ccf94a31ace1c27e71138c3803ff178', - params: { - from: '"Dana.Qin" ', - from_email: 'Dana.Qin6e1@gmail.com', - from_display_name: 'Dana.Qin', - subject: '发现最美车间主任', - to: 'info@znuny.inc', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail034.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail034.box'), - body_md5: 'b855b615a2c9568ea7708f9dee6b6230', - params: { - from: 'Bay ', - from_email: 'memberbay+12345@members.somewhat', - from_display_name: 'Bay', - subject: 'strange email with empty text/plain', - to: 'bay@example.com', - body: 'some html text', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail036.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail036.box'), - body_md5: '3c58aeb003a55cafb0893d69676b4316', - params: { - from: 'Martin Smith ', - from_email: 'm.Smith@example.com', - from_display_name: 'Martin Smith', - subject: 'Fw: Zugangsdaten', - to: 'Martin Edenhofer ', - body: "
-
 
--
don't cry - work! (Rainald Goetz)
-
-Gesendet: Mittwoch, 03. Februar 2016 um 12:43 Uhr
-Von: \"Martin Smith\" <m.Smith@example.com>
-An: linuxhotel@example.com
-Betreff: Fw: Zugangsdaten
-
-
 
--
don't cry - work! (Rainald Goetz)
-
-Gesendet: Freitag, 22. Januar 2016 um 11:52 Uhr
-Von: \"Martin Edenhofer\" <me@example.com>
-An: m.Smith@example.com
-Betreff: Zugangsdaten
Um noch vertrauter zu werden, kannst Du mit einen externen E-Mail Account (z. B. web.de) mal ein wenig selber “spielen”. :)
", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail037.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail037.box'), - body_md5: 'dd67e5037a740c053c2bf91f67be072f', - params: { - from: 'Example ', - from_email: 'info@example.com', - from_display_name: 'Example', - subject: 'Example: Java 8 Neuerungen', - to: 'Max Kohl | [example.com] ', - cc: 'Ingo Best ', - body: "Tag Max / Ingo!\n", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail038.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail038.box'), - body_md5: 'dcd25707eed638ea568644b206a8596e', - params: { - from: 'Martin Edenhofer ', - from_email: 'me@example.com', - from_display_name: 'Martin Edenhofer', - subject: 'test 1234 äöü sig test without attachment ', - to: 'Martin Edenhofer ', - cc: nil, - body: "test 1234 äöü sig test without attachment\n\n", - }, - attachments: [ - { - md5: '85223228046c010ce4298947018fa33f', - filename: 'signature.asc', - }, - ], - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail039.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail039.box'), - body_md5: '92553234f01a918314f40973dfc2a303', - params: { - from: 'Martin Edenhofer ', - from_email: 'me@example.com', - from_display_name: 'Martin Edenhofer', - subject: 'test 1234 äöü sig test with attachment ', - to: 'Martin Edenhofer ', - cc: nil, - body: "test 1234 äöü sig test with attachment
", - - }, - attachments: [ - { - md5: 'c0b9a38d7c02516db9f016dc8063d1e8', - filename: 'signature.asc', - }, - { - md5: 'de909e05b3dd8b8ea50e8db422d0971e', - filename: 'HKT_Super_Seven_GTS.jpeg', - cid: '2ECB31C9-0E1D-4EBF-BD02-8D8B24208A3E@openvpn', - }, - { - md5: '72c2f9aecd24606b6490ff06ea9361ec', - filename: 'message.html', - }, - ], - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail040.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail040.box'), - body_md5: '5db91cb79f889f80bbf8b47ad98efac9', - params: { - from: 'Martin Edenhofer ', - from_email: 'me@example.com', - from_display_name: 'Martin Edenhofer', - subject: 'smime signed 123 öäüß', - to: 'Martin Edenhofer ', - cc: nil, - body: 'smime signed 123 öäüß', - }, - attachments: [ - { - md5: '6a0434efa5a2eebf4efe46b04f7b3a9c', - filename: 'smime.p7s', - }, - ], - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail041.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail041.box'), - body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', - params: { - from: 'Martin Edenhofer ', - from_email: 'me@example.com', - from_display_name: 'Martin Edenhofer', - subject: 'smime sign & crypt', - to: 'Martin Edenhofer ', - cc: nil, - body: 'no visible content', - }, - attachments: [ - { - md5: 'fc68cdcbf343c72e456fbf9477501a72', - filename: 'smime.p7m', - }, - ], - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail042.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail042.box'), - body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', - params: { - from: 'Martin Edenhofer ', - from_email: 'me@example.com', - from_display_name: 'Martin Edenhofer', - subject: 'pgp sign & crypt', - to: 'Martin Edenhofer ', - cc: nil, - body: 'no visible content', - }, - attachments: [ - { - md5: '8d23752cf0211ab3eba43bc3a530e8ab', - filename: 'encrypted.asc', - }, - ], - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail043.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail043.box'), - body_md5: 'a3b91a8969b54a67dd2154e70f74cc30', - params: { - from: 'Paula ', - from_email: 'databases.en@example.com', - from_display_name: 'Paula', - subject: 'Kontakte', - to: 'info@example.ch', - cc: nil, - body: "
- -
Geben Sie diese Information an den Direktor oder den für Marketing und Umsatzsteigerung verantwortlichen Mitarbeiter Ihrer Firma weiter! -

Hallo,

  • Sie suchen nach Möglichkeiten, den Umsatz Ihre Firma zu steigern?
  • -
  • Sie brauchen neue Geschäftskontakte?
  • -
  • Sie sind es leid, Kontaktdaten manuell zu erfassen?
  • -
  • Ihr Kontaktdatenanbieter ist zu teuer oder Sie sind mit seinen Dienstleistungen unzufrieden?
  • -
  • Sie möchten Ihre Kontaktinformationen gern effizienter auf dem neuesten Stand halten?


Bei uns können Sie mit nur wenigen Clicks Geschäftskontakte verschiedener Länder erwerben.

Dies ist eine schnelle und bequeme Methode, um Daten zu einem vernünftigen Preis zu erhalten.

Alle Daten werden ständig aktualisiertm so dass Sie sich keine Sorgen machen müssen.

 

XLS-Muster herunterladen

Datenbank bestellen

Die Anmeldung ist absolut kostenlos und unverbindlich. Sie können die Kataloge gemäß Ihren eigenen Kriterien filtern und ein kostenloses Datenmuster bestellen, sobald Sie sich angemeldet haben.

Wir haben Datenbanken der folgenden Länder: -

Anwendungsmöglichkeiten für Geschäftskontakte

  • -Newsletter senden - Senden von Werbung per E-Mail (besonders effizient).
  • -
  • -Telemarketing - Telefonwerbung.
  • -
  • -SMS-Marketing - Senden von Kurznachrichten.
  • -
  • -Gezielte Werbung - Briefpostwerbung.
  • -
  • -Marktforschung - Telefonumfragen zur Erforschung Ihrer Produkte oder Dienstleistungen.

 

Sie können Abschnitte wählen (filtern) Empfänger gemäß Tätigkeitsbereichen und Standort der Firmen, um die Effizienz Ihrer Werbemaßnahmen zu erhöhen.

 

Für jeden Kauf von 2016-11-05 23:59:59 -wir gewähren 30% Rabatt -RABATTCODE: WZ2124DD -

Bestellen Sie online bei:

company-catalogs.com

Für weitere Informationen:

E-Mail: databases.en@example.com
Telefon: +370-52-071554 (languages: EN, PL, RU, LT)


-
-
Unsubscribe from newsletter: Click here", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail044.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail044.box'), - body_md5: 'ee930244edd3b7c19494e688aa9cc41c', - params: { - from: '"Clement.Si" ', - from_email: 'Claudia.Shu@yahoo.com.', - from_display_name: 'Clement.Si', - subject: '精益生产闪婚,是谁的责任', - to: 'abuse@domain.com', - cc: nil, - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail045.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail045.box'), - body_md5: '1d847e3626145a9e886914ecf0d89368', - params: { - from: '"Ups Rémi" ', - from_email: 'r.ordonaud@example.com', - from_display_name: 'Ups Rémi', - subject: 'Nouveau message contact élégibilité Zammad', - to: 'James-Max ROGER , Support ', - cc: nil, - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail048.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail048.box'), - body_md5: '64675a479f80a674eb7c08e385c3622a', - attachments: [ - { - md5: '9964263c167ab47f8ec59c48e57cb905', - filename: 'message.html', - }, - { - md5: 'ddbdf67aa2f5c60c294008a54d57082b', - filename: 'CPG-Reklamationsmitteilung bezügl.01234567895 an Voda-28.03.2017.jpg', - cid: '485376C9-2486-4351-B932-E2010998F579@home', - }, - ], - params: { - from: 'Martin Edenhofer ', - from_email: 'martin@example.de', - from_display_name: 'Martin Edenhofer', - subject: 'AW: OTRS / Anfrage OTRS Einführung/Präsentation [Ticket#11545]', - content_type: 'text/html', - body: "Enjoy!
-
-Martin

--
Old programmers never die. They just branch to a new address.
-

", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail050.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail050.box'), - body_md5: '154c7d3ae7b94f99589df62882841b08', - attachments: [], - params: { - subject: 'ABC / 123 / Wetterau West / ABC', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail051.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail051.box'), - body_md5: '64675a479f80a674eb7c08e385c3622a', - attachments: [ - { - md5: '9964263c167ab47f8ec59c48e57cb905', - filename: 'message.html', - }, - { - md5: 'ddbdf67aa2f5c60c294008a54d57082b', - filename: 'super-seven.jpg', - cid: '485376C9-2486-4351-B932-E2010998F579@home', - }, - ], - params: { - from: 'Martin Edenhofer ', - from_email: 'martin@example.de', - from_display_name: 'Martin Edenhofer', - subject: 'AW: OTRS / Anfrage OTRS Einführung/Präsentation [Ticket#11545]', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail052.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail052.box'), - body_md5: 'ad0c0727cd7d023ec9065daea03335f7', - params: { - from: 'MAILER-DAEMON@example.com (Mail Delivery System)', - from_email: 'MAILER-DAEMON@example.com', - from_display_name: 'Mail Delivery System', - subject: 'Undelivered Mail Returned to Sender', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail053.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail053.box'), - body_md5: '104da300f70d5683f007951c9780c83d', - params: { - from: 'MAILER-DAEMON (Mail Delivery System)', - from_email: 'MAILER-DAEMON', - from_display_name: 'Mail Delivery System', - subject: 'Undelivered Mail Returned to Sender', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail054.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail054.box'), - body_md5: '5872ddcdfdf6bfe40f36cd0408fca667', - params: { - from: '"Smith, Karoline, Example DE" ', - from_email: 'Karoline.Smith@example.com', - from_display_name: 'Smith, Karoline, Example DE', - subject: 'AW: One Net Business', - body: 'no visible content' - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail056.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail056.box'), - body_md5: 'ee40e852b9fa18652ea66e2eda1ecbd3', - attachments: [ - { - md5: 'cd82962457892d2e2f2d6914da3a88ed', - filename: 'message.html', - }, - { - md5: 'ddbdf67aa2f5c60c294008a54d57082b', - filename: 'Hofjägeralle Wasserschaden.jpg', - }, - ], - params: { - from: 'Martin Edenhofer ', - from_email: 'martin@example.de', - from_display_name: 'Martin Edenhofer', - subject: 'AW: OTRS / Anfrage OTRS Einführung/Präsentation [Ticket#11545]', - content_type: 'text/html', - body: 'Enjoy!', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail057.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail057.box'), - body_md5: '3c5e4cf2d2a9bc572f10cd6222556027', - attachments: [ - { - md5: 'ddbdf67aa2f5c60c294008a54d57082b', - filename: 'Hofjägeralle Wasserschaden.jpg', - }, - ], - params: { - from: 'example@example.com', - from_email: 'example@example.com', - from_display_name: '', - subject: 'W.: Invoice', - content_type: 'text/plain', - body: ' - - ------ Original Nachricht ---- -Von: example@example.com -An: bob@example.com -Datum: 30.05.2017 16:17 -Betreff: Invoice - -Dear Mrs.Weber - -anbei mal wieder ein paar Invoice. - -Wünsche Ihnen noch einen schönen Arbeitstag. - -Mit freundlichen Grüßen - -Bob Smith -', - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail058.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail058.box'), - body_md5: '548917e0bff0806f9b27c09bbf23bb38', - params: { - from: 'Yangzhou ABC Lighting Equipment , LTD ', - from_email: 'bob@example.com', - from_display_name: 'Yangzhou ABC Lighting Equipment', - subject: 'new design solar street lights', - content_type: 'text/plain', - body: "äöüß ad asd - --Martin - --- -Old programmers never die. They just branch to a new address." - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail059.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail059.box'), - body_md5: '548917e0bff0806f9b27c09bbf23bb38', - params: { - from: '"Yangzhou ABC Lighting Equipment " <>, "LTD" ', - from_email: 'ly@example.com', - from_display_name: 'LTD', - subject: 'new design solar street lights', - content_type: 'text/plain', - body: "äöüß ad asd - --Martin - --- -Old programmers never die. They just branch to a new address." - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail062.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail062.box'), - body_md5: '10e7158e65a12b5850163d4d4b8ca2f8', - attachments: [ - { - md5: '51f073973e0265776b2200c785268f75', - filename: 'message.html', - }, - { - md5: 'a618d671348735744d4c9a4005b56799', - filename: 'image001.jpg', - cid: 'image001.jpg@01CDB132.D8A510F0', - }, - { - md5: '2cca28177acb4190cbf79cf3624cddae', - filename: 'image000.jpg', - cid: 'image000.jpg@01CDB132.D8A510F0', - }, - { - md5: '6db2535038171c72f97b060a24c8fe06', - filename: 'document.html', - }, - { - md5: '489ca24a0a54ca9189ea8a5256242fdd', - filename: 'document1.html', - }, - { - md5: 'b7e1651b0f31312a4e882d289c529ce8', - filename: 'Video1.MOV', - }, - { - md5: 'dcf4626b3dae9c47a8fd8f001c5d927f', - filename: 'Video2.MOV', - }, - { - md5: 'a93f87f52ef7cb56cf0576b804364e1e', - filename: 'Video3.MOV', - }, - { - md5: '370e0cb399d28515ab0692fa76c13b85', - filename: 'video.mov', - }, - { - md5: '9052bb9367a0bf45e4d3d10635bce8be', - filename: 'video1.mov', - }, - ], - params: { - from: 'Smith Sepp ', - from_email: 'smith@example.com', - from_display_name: 'Smith Sepp', - subject: 'Gruß aus Oberalteich', - content_type: 'text/html', - body: "
-

Herzliche Grüße aus Oberalteich sendet Herrn Smith

 

Sepp Smith - Dipl.Ing. agr. (FH)

Geschäftsführer der example Straubing-Bogen

Klosterhof 1 | 94327 Bogen-Oberalteich

Tel: 09422-505601 | Fax: 09422-505620

Internet: http://example-straubing-bogen.de

Facebook: http://facebook.de/examplesrbog

\"Beschreibung:\"Beschreibung: - European Foundation für Quality Management

 

", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail063.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail063.box'), - body_md5: 'dbed0b09656d17bf4e832b2c18381c24', - attachments: [ - { - md5: 'b8be1b421733bf2fab2eb24e11d53139', - filename: 'Delivery report.txt', - }, - { - md5: '47744d00358baaeff355ca91ede93859', - filename: 'hello 123 äöüß.eml', - }, - ], - params: { - from: 'MAILER-DAEMON@mx1.example.com (Mail Delivery System)', - from_email: 'MAILER-DAEMON@mx1.example.com', - from_display_name: 'Mail Delivery System', - subject: 'Undelivered Mail Returned to Sender', - content_type: 'text/plain', - body: "This is the mail system at host mx1.example.com. - -I'm sorry to have to inform you that your message could not -be delivered to one or more recipients. It's attached below. - -For further assistance, please send mail to postmaster. - -If you do so, please include this problem report. You can -delete your own text from the attached returned message. - - The mail system - -: user unknown -", - }, - }, - { - data: File.read(Rails.root.join('test', 'data', 'mail', 'mail066.box')), - source: Rails.root.join('test', 'data', 'mail', 'mail066.box'), - body_md5: '346effdbc86ef1f5ea263102fba2e542', - attachments: [ - { - md5: '9d048520675551c64f7d8152adf0fd21', - filename: 'message.html', - }, - { - md5: 'ddbdf67aa2f5c60c294008a54d57082b', - filename: 'FF_Geburtstagsmail.jpg', - }, - { - md5: 'a618d671348735744d4c9a4005b56799', - filename: 'team.jpg', - }, - ], - params: { - from: 'ABC GmbH ', - from_email: 'info@example.com', - from_display_name: 'ABC GmbH', - subject: 'ABC gratuliert!', - content_type: 'text/html', - body: 'Glückwunschkarte

Wenn diese Mail nicht richtig dargestellt wird, dann klicken Sie bitte hier.

-
Herzlichen Glückwunsch !

Sehr geehrte Damen und Herren,

zu Ihrem Geburtstag schicken wir Ihnen ein großes Paket mit guten Wünschen:
Viel Erfolg, Energie und ein gutes Gespür für die richtigen Entscheidungen!

Ihr Ehrentag ist ein guter Anlass zurückzublicken und sich an Erreichtem zu erfreuen. Doch er ist auch Anlass, den Blick nach vorne zu richten. Sich kurz zu orientieren und neue Ziele zu stecken. Unsere besten Wünsche begleiten Sie auf Ihrem zukünftigen Weg und wir freuen uns darauf, Ihnen auch dabei zur Seite zu stehen!

Heute wünschen wir Ihnen einen schönen Tag im Kreise Ihrer Freunde und Familie.

Herzliche Grüße

Ihre ABC


-
ABC GmbH
Einestraße 23
99999 München
-
Telefon.: +49 (0)11 11 11 11-1
Fax: +49 (0)11 11 11 11-1

www.example.com

 

Geschäftszeiten: Mo-Do 08:00-18:00 Uhr Fr 08:00-17:00 Uhr
Sitz der Gesellschaft: München
Registergericht: Amtsgericht München, HRB AAAA
Geschäftsführer: AAAA, BBBB

', - }, - }, - ] - - count = 0 - files.each { |file, i| - count += 1 - #p "Count: #{count}" - parser = Channel::EmailParser.new - data = parser.parse(file[:data]) - - #puts '++' + data[:body].to_s + '++' - # check body - md5 = Digest::MD5.hexdigest(data[:body]) - #puts "IS #{md5} / should #{file[:body_md5]}" - assert_equal(file[:body_md5], md5) - - # check params - file[:params].each { |key, value| - if key.to_s == 'body_md5' - #puts 'md5' - #puts '++' + data[:body].to_s + '++' - #puts '++' + file[:params][key.to_sym].to_s + '++' - assert_equal(Digest::MD5.hexdigest(file[:params][key.to_sym].to_s), Digest::MD5.hexdigest(data[:body].to_s)) - else - if file[:params][key.to_sym] == nil - assert_nil(data[key.to_sym], "check #{key}") - else - assert_equal(file[:params][key.to_sym], data[key.to_sym], "check #{key}") - end - end - } - - # check attachments - if file[:attachments] - attachment_count_config = file[:attachments].length - attachment_count_email = 0 - file[:attachments].each { |attachment| - attachment_count_email += 1 - found = false - data[:attachments].each { |attachment_parser| - next if found - file_md5 = Digest::MD5.hexdigest(attachment_parser[:data]) - #puts 'Attachment:' + attachment_parser.inspect + '-' + file_md5 - if attachment[:md5] == file_md5 - found = true - assert_equal(attachment[:filename], attachment_parser[:filename]) - if attachment[:cid] - assert_equal(attachment[:cid], attachment_parser[:preferences]['Content-ID']) - end - end - } - if !found - assert(false, "Attachment not found! MD5: #{attachment[:md5]} - #{attachment[:filename]}") - end - } - assert_equal( attachment_count_config, attachment_count_email ) + m[:content][:attachments].sort_by { |a| a[:md5] } + .zip(parsed_attachment_metadata.sort_by { |a| a[:md5] }) + .each do |content, parsed| + assert_operator(content, :<=, parsed, + "parsed attachment data from #{m[:source]} does not match " \ + "attachment metadata from #{m[:source].ext('yml')}") end - } + end end end diff --git a/test/unit/email_process_identify_sender_max_test.rb b/test/unit/email_process_identify_sender_max_test.rb index 0a0efecc3..895623cde 100644 --- a/test/unit/email_process_identify_sender_max_test.rb +++ b/test/unit/email_process_identify_sender_max_test.rb @@ -5,7 +5,7 @@ class EmailProcessIdentifySenderMax < ActiveSupport::TestCase test 'text max created recipients per email' do current_users = User.count - email_raw_string = "From: #{generate_recipient(1)} + email_raw_string = "From: #{generate_recipient} To: #{generate_recipient(22)} Cc: #{generate_recipient(22)} Subject: test max sender identify @@ -18,17 +18,9 @@ Some Text" assert_equal(current_users + 41, User.count) end - def generate_recipient(count) - recipients = '' - count.times.each do - if recipients.present? - recipients += ', ' - end - domain = "#{Time.zone.now.to_i}-#{rand(999_999_999_999_999)}.example.com" - email = "#{Time.zone.now.to_i}-#{rand(999_999_999_999_999)}@#{domain}" - recipients += email - end - recipients + def generate_recipient(count = 1) + uid = -> { rand(999_999_999_999_999) } + Array.new(count) { "#{uid.call}@#{uid.call}.example.com" }.join(', ') end end From c17a29cd0fccf81d2ea7dc0d9c117840578abae2 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Tue, 5 Jun 2018 19:08:52 +0800 Subject: [PATCH 5/7] Refactor Channel::EmailParser#parse method --- app/models/channel/email_parser.rb | 754 ++++++++---------- .../channel/filter/reply_to_based_sender.rb | 2 +- test/data/mail/mail023.yml | 2 +- 3 files changed, 317 insertions(+), 441 deletions(-) diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index 53c016e8b..73590e1a9 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.rb @@ -3,6 +3,9 @@ # encoding: utf-8 class Channel::EmailParser + EMAIL_REGEX = /.+@.+/ + RECIPIENT_FIELDS = %w[to cc delivered-to x-original-to envelope-to].freeze + SENDER_FIELDS = %w[from reply-to return-path].freeze =begin @@ -67,398 +70,16 @@ class Channel::EmailParser =end def parse(msg) - data = {}.with_indifferent_access - mail = Mail.new(msg.utf8_encode) - # set all headers - mail.header.fields.each do |field| + message_attributes = [ + { mail_instance: mail }, + message_header_hash(mail), + message_body_hash(mail), + self.class.sender_attributes(mail), + ] - # full line, encode, ready for storage - begin - value = field.to_utf8 - if value.blank? - value = field.raw_value - end - data[field.name.to_s.downcase.to_sym] = value - rescue => e - data[field.name.to_s.downcase.to_sym] = field.raw_value - end - - # if we need to access the lines by objects later again - data["raw-#{field.name.downcase}".to_sym] = field - end - - # verify content, ignore recipients with non email address - ['to', 'cc', 'delivered-to', 'x-original-to', 'envelope-to'].each do |field| - next if data[field.to_sym].blank? - next if data[field.to_sym].match?(/@/) - data[field.to_sym] = '' - end - - # get sender with @ / email address - from = nil - ['from', 'reply-to', 'return-path'].each do |item| - next if data[item.to_sym].blank? - next if data[item.to_sym] !~ /@/ - from = data[item.to_sym] - break if from - end - - # in case of no sender with email address - get sender - if !from - ['from', 'reply-to', 'return-path'].each do |item| - next if data[item.to_sym].blank? - from = data[item.to_sym] - break if from - end - end - - # set x-any-recipient - data['x-any-recipient'.to_sym] = '' - ['to', 'cc', 'delivered-to', 'x-original-to', 'envelope-to'].each do |item| - next if data[item.to_sym].blank? - if data['x-any-recipient'.to_sym] != '' - data['x-any-recipient'.to_sym] += ', ' - end - data['x-any-recipient'.to_sym] += mail[item.to_sym].to_s - end - - # set extra headers - data = data.merge(Channel::EmailParser.sender_properties(from)) - - # do extra encoding (see issue#1045) - if data[:subject].present? - data[:subject].sub!(/^=\?us-ascii\?Q\?(.+)\?=$/, '\1') - end - - # compat headers - data[:message_id] = data['message-id'.to_sym] - - # body - # plain_part = mail.multipart? ? (mail.text_part ? mail.text_part.body.decoded : nil) : mail.body.decoded - # html_part = message.html_part ? message.html_part.body.decoded : nil - data[:attachments] = [] - - # multi part email - if mail.multipart? - - # html attachment/body may exists and will be converted to strict html - if mail.html_part&.body - data[:body] = mail.html_part.body.to_s - data[:body] = data[:body].utf8_encode(from: mail.html_part.charset, fallback: :read_as_sanitized_binary) - data[:body] = data[:body].html2html_strict - - data[:content_type] = 'text/html' - end - - # text attachment/body exists - if data[:body].blank? && mail.text_part - data[:body] = mail.text_part.body.decoded - data[:body] = data[:body].utf8_encode(from: mail.text_part.charset, fallback: :read_as_sanitized_binary) - - data[:content_type] = 'text/plain' - end - - # any other attachments - if data[:body].blank? - data[:body] = 'no visible content' - data[:content_type] = 'text/plain' - end - - # add html attachment/body as real attachment - if mail.html_part - filename = 'message.html' - headers_store = { - 'content-alternative' => true, - 'original-format' => true, - } - if mail.mime_type - headers_store['Mime-Type'] = mail.html_part.mime_type - end - if mail.charset - headers_store['Charset'] = mail.html_part.charset - end - attachment = { - data: mail.html_part.body.to_s, - filename: mail.html_part.filename || filename, - preferences: headers_store - } - data[:attachments].push attachment - end - - # get attachments - mail.parts&.each do |part| - - # protect process to work fine with spam emails, see test/data/mail/mail015.box - begin - attachs = _get_attachment(part, data[:attachments], mail) - data[:attachments].concat(attachs) - rescue - attachs = _get_attachment(part, data[:attachments], mail) - data[:attachments].concat(attachs) - end - end - - # not multipart email - - # html part only, convert to text and add it as attachment - elsif mail.mime_type && mail.mime_type.to_s.casecmp('text/html').zero? - filename = 'message.html' - data[:body] = mail.body.decoded - data[:body] = data[:body].utf8_encode(from: mail.charset, fallback: :read_as_sanitized_binary) - data[:body] = data[:body].html2html_strict - - data[:content_type] = 'text/html' - - # add body as attachment - headers_store = { - 'content-alternative' => true, - 'original-format' => true, - } - if mail.mime_type - headers_store['Mime-Type'] = mail.mime_type - end - if mail.charset - headers_store['Charset'] = mail.charset - end - attachment = { - data: mail.body.decoded, - filename: mail.filename || filename, - preferences: headers_store - } - data[:attachments].push attachment - - # text part only - elsif !mail.mime_type || mail.mime_type.to_s == '' || mail.mime_type.to_s.casecmp('text/plain').zero? - data[:body] = mail.body.decoded - data[:body] = data[:body].utf8_encode(from: mail.charset, fallback: :read_as_sanitized_binary) - - data[:content_type] = 'text/plain' - else - filename = '-no name-' - data[:body] = 'no visible content' - data[:content_type] = 'text/plain' - - # add body as attachment - headers_store = { - 'content-alternative' => true, - } - if mail.mime_type - headers_store['Mime-Type'] = mail.mime_type - end - if mail.charset - headers_store['Charset'] = mail.charset - end - attachment = { - data: mail.body.decoded, - filename: mail.filename || filename, - preferences: headers_store - } - data[:attachments].push attachment - end - - # strip not wanted chars - data[:body].gsub!(/\n\r/, "\n") - data[:body].gsub!(/\r\n/, "\n") - data[:body].tr!("\r", "\n") - - # get mail date - begin - if mail.date - data[:date] = Time.zone.parse(mail.date.to_s) - end - rescue - data[:date] = nil - end - - # remember original mail instance - data[:mail_instance] = mail - - data - end - - def _get_attachment(file, attachments, mail) - - # check if sub parts are available - if file.parts.present? - list = [] - file.parts.each do |p| - attachment = _get_attachment(p, attachments, mail) - list.concat(attachment) - end - return list - end - - # ignore text/plain attachments - already shown in view - return [] if mail.text_part&.body.to_s == file.body.to_s - - # ignore text/html - html part, already shown in view - return [] if mail.html_part&.body.to_s == file.body.to_s - - # get file preferences - headers_store = {} - file.header.fields.each do |field| - - # full line, encode, ready for storage - begin - value = field.to_utf8 - if value.blank? - value = field.raw_value - end - headers_store[field.name.to_s] = value - rescue => e - headers_store[field.name.to_s] = field.raw_value - end - end - - # cleanup content id, <> will be added automatically later - headers_store['Content-ID']&.gsub!(/(^<|>$)/, '') - - # get filename from content-disposition - filename = nil - - # workaround for: NoMethodError: undefined method `filename' for # - begin - filename = file.header[:content_disposition].filename - rescue - begin - if file.header[:content_disposition].to_s =~ /filename="(.+?)"/i - filename = $1 - elsif file.header[:content_disposition].to_s =~ /filename='(.+?)'/i - filename = $1 - elsif file.header[:content_disposition].to_s =~ /filename=(.+?);/i - filename = $1 - end - rescue - Rails.logger.debug { 'Unable to get filename' } - end - end - - # as fallback, use raw values - if filename.blank? - if headers_store['Content-Disposition'].to_s =~ /filename="(.+?)"/i - filename = $1 - elsif headers_store['Content-Disposition'].to_s =~ /filename='(.+?)'/i - filename = $1 - elsif headers_store['Content-Disposition'].to_s =~ /filename=(.+?);/i - filename = $1 - end - end - - # for some broken sm mail clients (X-MimeOLE: Produced By Microsoft Exchange V6.5) - filename ||= file.header[:content_location].to_s - - # generate file name based on content-id - if filename.blank? && headers_store['Content-ID'].present? - if headers_store['Content-ID'] =~ /(.+?)@.+?/i - filename = $1 - end - end - - # generate file name based on content type - if filename.blank? && headers_store['Content-Type'].present? - if headers_store['Content-Type'].match?(%r{^message/rfc822}i) - begin - parser = Channel::EmailParser.new - mail_local = parser.parse(file.body.to_s) - filename = if mail_local[:subject].present? - "#{mail_local[:subject]}.eml" - elsif headers_store['Content-Description'].present? - "#{headers_store['Content-Description']}.eml".to_s.force_encoding('utf-8') - else - 'Mail.eml' - end - rescue - filename = 'Mail.eml' - end - end - - # e. g. Content-Type: video/quicktime; name="Video.MOV"; - if filename.blank? - ['name="(.+?)"(;|$)', "name='(.+?)'(;|$)", 'name=(.+?)(;|$)'].each do |regexp| - if headers_store['Content-Type'] =~ /#{regexp}/i - filename = $1 - break - end - end - end - - # e. g. Content-Type: video/quicktime - if filename.blank? - map = { - 'message/delivery-status': ['txt', 'delivery-status'], - 'text/plain': %w[txt document], - 'text/html': %w[html document], - 'video/quicktime': %w[mov video], - 'image/jpeg': %w[jpg image], - 'image/jpg': %w[jpg image], - 'image/png': %w[png image], - 'image/gif': %w[gif image], - } - map.each do |type, ext| - next if headers_store['Content-Type'] !~ /^#{Regexp.quote(type)}/i - filename = if headers_store['Content-Description'].present? - "#{headers_store['Content-Description']}.#{ext[0]}".to_s.force_encoding('utf-8') - else - "#{ext[1]}.#{ext[0]}" - end - break - end - end - end - - if filename.blank? - filename = 'file' - end - - attachment_count = 0 - local_filename = '' - local_extention = '' - if filename =~ /^(.*?)\.(.+?)$/ - local_filename = $1 - local_extention = $2 - end - - (1..1000).each do |count| - filename_exists = false - attachments.each do |attachment| - if attachment[:filename] == filename - filename_exists = true - end - end - break if filename_exists == false - filename = if local_extention.present? - "#{local_filename}#{count}.#{local_extention}" - else - "#{local_filename}#{count}" - end - end - - # get mime type - if file.header[:content_type]&.string - headers_store['Mime-Type'] = file.header[:content_type].string - end - - # get charset - if file.header&.charset - headers_store['Charset'] = file.header.charset - end - - # remove not needed header - headers_store.delete('Content-Transfer-Encoding') - headers_store.delete('Content-Disposition') - - # workaround for mail gem - # https://github.com/zammad/zammad/issues/928 - filename = Mail::Encodings.value_decode(filename) - - attach = { - data: file.body.to_s, - filename: filename, - preferences: headers_store, - } - [attach] + message_attributes.reduce({}.with_indifferent_access, &:merge) end =begin @@ -708,45 +329,51 @@ returns true end - def self.sender_properties(from) - data = {} - return data if from.blank? - begin - list = Mail::AddressList.new(from) - list.addresses.each do |address| - data[:from_email] = address.address - data[:from_local] = address.local - data[:from_domain] = address.domain - data[:from_display_name] = address.display_name || - (address.comments && address.comments[0]) - break if data[:from_email].present? && data[:from_email] =~ /@/ - end - rescue => e - if from =~ /<>/ && from =~ /<.+?>/ - data = sender_properties(from.gsub(/<>/, '')) - end + def self.sender_attributes(from) + if from.is_a?(Mail::Message) + from = SENDER_FIELDS.map { |f| from.header[f] }.compact + .map(&:to_utf8).reject(&:blank?) + .partition { |address| address.match?(EMAIL_REGEX) } + .flatten.first end - if data.blank? || data[:from_email].blank? - from.strip! - if from =~ /^(.+?)<(.+?)@(.+?)>$/ - data[:from_email] = "#{$2}@#{$3}" - data[:from_local] = $2 - data[:from_domain] = $3 - data[:from_display_name] = $1 - else - data[:from_email] = from - data[:from_local] = from - data[:from_domain] = from - end + data = {}.with_indifferent_access + return data if from.blank? + + from = from.gsub('<>', '').strip + mail_address = begin + Mail::AddressList.new(from).addresses + .select { |a| a.address.present? } + .partition { |a| a.address.match?(EMAIL_REGEX) } + .flatten.first + rescue Mail::Field::ParseError => e + STDOUT.puts e + end + + if mail_address&.address.present? + data[:from_email] = mail_address.address + data[:from_local] = mail_address.local + data[:from_domain] = mail_address.domain + data[:from_display_name] = mail_address.display_name || mail_address.comments&.first + elsif from =~ /^(.+?)<((.+?)@(.+?))>$/ + data[:from_email] = $2 + data[:from_local] = $3 + data[:from_domain] = $4 + data[:from_display_name] = $1 + else + data[:from_email] = from + data[:from_local] = from + data[:from_domain] = from + data[:from_display_name] = from end # do extra decoding because we needed to use field.value - data[:from_display_name] = Mail::Field.new('X-From', data[:from_display_name].to_utf8).to_s - data[:from_display_name].delete!('"') - data[:from_display_name].strip! - data[:from_display_name].gsub!(/^'/, '') - data[:from_display_name].gsub!(/'$/, '') + data[:from_display_name] = + Mail::Field.new('X-From', data[:from_display_name].to_utf8) + .to_s + .delete('"') + .strip + .gsub(/(^'|'$)/, '') data end @@ -835,6 +462,270 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again files end + private + + def message_header_hash(mail) + imported_fields = mail.header.fields.map do |f| + value = begin + f.to_utf8 + rescue NameError # handle bug #1238 in Mail 2.7.1.rc1 + '' # swap out for commented line below once upgrade is available + end + + [f.name.downcase, value] + end.to_h + + # imported_fields = mail.header.fields.map { |f| [f.name.downcase, f.to_utf8] }.to_h + raw_fields = mail.header.fields.map { |f| ["raw-#{f.name.downcase}", f] }.to_h + custom_fields = {}.tap do |h| + validated_recipients = imported_fields.slice(*RECIPIENT_FIELDS) + .transform_values { |v| v.match?(EMAIL_REGEX) ? v : '' } + h.merge!(validated_recipients) + + h['date'] = Time.zone.parse(mail.date.to_s) || imported_fields['date'] + h['message_id'] = imported_fields['message-id'] + h['subject'] = imported_fields['subject']&.sub(/^=\?us-ascii\?Q\?(.+)\?=$/, '\1') + h['x-any-recipient'] = validated_recipients.values.select(&:present?).join(', ') + end + + [imported_fields, raw_fields, custom_fields].reduce({}.with_indifferent_access, &:merge) + end + + def message_body_hash(mail) + message = [mail.html_part, mail.text_part, mail].find { |m| m&.body.present? } + + if message.mime_type.nil? || message.mime_type.match?(%r{^text/(plain|html)$}) + content_type = message.mime_type || 'text/plain' + body = body_text(message, strict_html: content_type.eql?('text/html')) + end + + content_type = 'text/plain' if body.blank? + + { + attachments: collect_attachments(mail), + content_type: content_type || 'text/plain', + body: body.presence || 'no visible content' + }.with_indifferent_access + end + + def body_text(message, **options) + body_text = begin + message.body.to_s + rescue Mail::UnknownEncodingType # see test/data/mail/mail043.box / issue #348 + message.body.raw_source + end + + body_text = body_text.utf8_encode(from: message.charset, fallback: :read_as_sanitized_binary) + body_text = Mail::Utilities.to_lf(body_text) + + return body_text.html2html_strict if options[:strict_html] + body_text + end + + def collect_attachments(mail) + attachments = [] + + # Add non-plaintext body as an attachment + if mail.html_part&.body.present? || + (!mail.multipart? && mail.mime_type.present? && mail.mime_type != 'text/plain') + message = mail.html_part || mail + + filename = message.filename.presence || + (message.mime_type.eql?('text/html') ? 'message.html' : '-no name-') + + headers_store = { + 'content-alternative' => true, + 'original-format' => message.mime_type.eql?('text/html'), + 'Mime-Type' => message.mime_type, + 'Charset' => message.charset, + }.reject { |_, v| v.blank? } + + attachments.push({ data: body_text(message), + filename: filename, + preferences: headers_store }) + end + + mail.parts.each do |part| + begin + new_attachments = get_attachments(part, attachments, mail).flatten.compact + attachments.push(*new_attachments) + rescue => e # Protect process to work with spam emails (see test/fixtures/mail15.box) + raise e if (fail_count ||= 0).positive? + (fail_count += 1) && retry + end + end + + attachments + end + + def get_attachments(file, attachments, mail) + return file.parts.map { |p| get_attachments(p, attachments, mail) } if file.parts.any? + return [] if [mail.text_part, mail.html_part].include?(file) + + # get file preferences + headers_store = {} + file.header.fields.each do |field| + + # full line, encode, ready for storage + begin + value = field.to_utf8 + if value.blank? + value = field.raw_value + end + headers_store[field.name.to_s] = value + rescue => e + headers_store[field.name.to_s] = field.raw_value + end + end + + # cleanup content id, <> will be added automatically later + if headers_store['Content-ID'] + headers_store['Content-ID'].gsub!(/^$/, '') + end + + # get filename from content-disposition + + # workaround for: NoMethodError: undefined method `filename' for # + filename = file.header[:content_disposition].try(:filename) + + begin + if file.header[:content_disposition].to_s =~ /filename="(.+?)"/i + filename = $1 + elsif file.header[:content_disposition].to_s =~ /filename='(.+?)'/i + filename = $1 + elsif file.header[:content_disposition].to_s =~ /filename=(.+?);/i + filename = $1 + end + rescue + Rails.logger.debug { 'Unable to get filename' } + end + + # as fallback, use raw values + if filename.blank? + if headers_store['Content-Disposition'].to_s =~ /filename="(.+?)"/i + filename = $1 + elsif headers_store['Content-Disposition'].to_s =~ /filename='(.+?)'/i + filename = $1 + elsif headers_store['Content-Disposition'].to_s =~ /filename=(.+?);/i + filename = $1 + end + end + + # for some broken sm mail clients (X-MimeOLE: Produced By Microsoft Exchange V6.5) + filename ||= file.header[:content_location].to_s + + # generate file name based on content-id + if filename.blank? && headers_store['Content-ID'].present? + if headers_store['Content-ID'] =~ /(.+?)@.+?/i + filename = $1 + end + end + + # generate file name based on content type + if filename.blank? && headers_store['Content-Type'].present? + if headers_store['Content-Type'].match?(%r{^message/rfc822}i) + begin + parser = Channel::EmailParser.new + mail_local = parser.parse(file.body.to_s) + filename = if mail_local[:subject].present? + "#{mail_local[:subject]}.eml" + elsif headers_store['Content-Description'].present? + "#{headers_store['Content-Description']}.eml".to_s.force_encoding('utf-8') + else + 'Mail.eml' + end + rescue + filename = 'Mail.eml' + end + end + + # e. g. Content-Type: video/quicktime; name="Video.MOV"; + if filename.blank? + ['name="(.+?)"(;|$)', "name='(.+?)'(;|$)", 'name=(.+?)(;|$)'].each do |regexp| + if headers_store['Content-Type'] =~ /#{regexp}/i + filename = $1 + break + end + end + end + + # e. g. Content-Type: video/quicktime + if filename.blank? + map = { + 'message/delivery-status': ['txt', 'delivery-status'], + 'text/plain': %w[txt document], + 'text/html': %w[html document], + 'video/quicktime': %w[mov video], + 'image/jpeg': %w[jpg image], + 'image/jpg': %w[jpg image], + 'image/png': %w[png image], + 'image/gif': %w[gif image], + } + map.each do |type, ext| + next if headers_store['Content-Type'] !~ /^#{Regexp.quote(type)}/i + filename = if headers_store['Content-Description'].present? + "#{headers_store['Content-Description']}.#{ext[0]}".to_s.force_encoding('utf-8') + else + "#{ext[1]}.#{ext[0]}" + end + break + end + end + end + + if filename.blank? + filename = 'file' + end + + local_filename = '' + local_extention = '' + if filename =~ /^(.*?)\.(.+?)$/ + local_filename = $1 + local_extention = $2 + end + + 1.upto(1000) do |i| + filename_exists = false + attachments.each do |attachment| + if attachment[:filename] == filename + filename_exists = true + end + end + break if filename_exists == false + filename = if local_extention.present? + "#{local_filename}#{i}.#{local_extention}" + else + "#{local_filename}#{i}" + end + end + + # get mime type + if file.header[:content_type]&.string + headers_store['Mime-Type'] = file.header[:content_type].string + end + + # get charset + if file.header&.charset + headers_store['Charset'] = file.header.charset + end + + # remove not needed header + headers_store.delete('Content-Transfer-Encoding') + headers_store.delete('Content-Disposition') + + # workaround for mail gem + # https://github.com/zammad/zammad/issues/928 + filename = Mail::Encodings.value_decode(filename) + + attach = { + data: file.body.to_s, + filename: filename, + preferences: headers_store, + } + + [attach] + end end module Mail @@ -848,7 +739,7 @@ module Mail end end - # workaround to parse subjects with 2 different encodings correctly (e. g. quoted-printable see test/data/mail/mail009.box) + # workaround to parse subjects with 2 different encodings correctly (e. g. quoted-printable see test/fixtures/mail9.box) module Encodings def self.value_decode(str) # Optimization: If there's no encoded-words in the string, just return it @@ -883,19 +774,4 @@ module Mail end.join('') end end - - # issue#348 - IMAP mail fetching stops because of broken spam email (e. g. broken Content-Transfer-Encoding value see test/data/mail/mail043.box) - # https://github.com/zammad/zammad/issues/348 - class Body - def decoded - if !Encodings.defined?(encoding) - #raise UnknownEncodingType, "Don't know how to decode #{encoding}, please call #encoded and decode it yourself." - Rails.logger.info "UnknownEncodingType: Don't know how to decode #{encoding}!" - raw_source - else - Encodings.get_encoding(encoding).decode(raw_source) - end - end - end - end diff --git a/app/models/channel/filter/reply_to_based_sender.rb b/app/models/channel/filter/reply_to_based_sender.rb index a4c3939f6..996ee0285 100644 --- a/app/models/channel/filter/reply_to_based_sender.rb +++ b/app/models/channel/filter/reply_to_based_sender.rb @@ -19,7 +19,7 @@ module Channel::Filter::ReplyToBasedSender mail['origin_from_display_name'.to_sym] = mail[:from_display_name] # get properties of reply-to header - result = Channel::EmailParser.sender_properties(reply_to) + result = Channel::EmailParser.sender_attributes(reply_to) if setting == 'as_sender_of_email' diff --git a/test/data/mail/mail023.yml b/test/data/mail/mail023.yml index 5f2fb92ba..0f32b3f30 100644 --- a/test/data/mail/mail023.yml +++ b/test/data/mail/mail023.yml @@ -2,4 +2,4 @@ from: marketingmanager@nthcpghana.com from_email: marketingmanager@nthcpghana.com from_display_name: '' -to: +to: '' From 5583369d8b59bfa7c3c5f617bdf900895993337a Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Thu, 7 Jun 2018 18:38:09 +0800 Subject: [PATCH 6/7] Render umlauts and other multi-byte characters correctly in HtmlSanitizer::strict --- lib/html_sanitizer.rb | 34 ++++++++++++++------------------ test/unit/email_process_test.rb | 28 ++++++++++++++++++++++++++ test/unit/html_sanitizer_test.rb | 2 ++ 3 files changed, 45 insertions(+), 19 deletions(-) diff --git a/lib/html_sanitizer.rb b/lib/html_sanitizer.rb index 00fbfd896..ecb76c383 100644 --- a/lib/html_sanitizer.rb +++ b/lib/html_sanitizer.rb @@ -373,34 +373,29 @@ cleanup html string: string.gsub('&', '&').gsub('<', '<').gsub('>', '>').gsub('"', '"').gsub(' ', ' ') end - def self.cleanup_target(string, keep_spaces: false) - string = CGI.unescape(string).utf8_encode(fallback: :read_as_sanitized_binary) - blank_regex = if keep_spaces - /\t|\n|\r/ - else - /[[:space:]]|\t|\n|\r/ - end - cleaned_string = string.strip.gsub(blank_regex, '').gsub(%r{/\*.*?\*/}, '').gsub(//, '').gsub(/\[.+?\]/, '').delete("\u0000") + def self.cleanup_target(string, **options) + cleaned_string = CGI.unescape(string).utf8_encode(fallback: :read_as_sanitized_binary) + cleaned_string = cleaned_string.delete(' ') unless options[:keep_spaces] + cleaned_string = cleaned_string.strip + .delete("\t\n\r\u0000") + .gsub(%r{/\*.*?\*/}, '') + .gsub(//, '') + .gsub(/\[.+?\]/, '') + sanitize_attachment_disposition(cleaned_string) end def self.sanitize_attachment_disposition(url) uri = URI(url) - return url if uri.host != Setting.get('fqdn') - params = CGI.parse(uri.query || '') - if params.key?('disposition') - params['disposition'] = 'attachment' + if uri.host == Setting.get('fqdn') && uri.query.present? + params = CGI.parse(uri.query || '') + .tap { |p| p.merge!('disposition' => 'attachment') if p.include?('disposition') } + uri.query = URI.encode_www_form(params) end - uri.query = if params.blank? - nil - else - URI.encode_www_form(params) - end - uri.to_s - rescue URI::InvalidURIError + rescue URI::Error url end @@ -485,6 +480,7 @@ satinize style of img tags end private_class_method :cleanup_target + private_class_method :sanitize_attachment_disposition private_class_method :add_link private_class_method :url_same? private_class_method :html_decode diff --git a/test/unit/email_process_test.rb b/test/unit/email_process_test.rb index f1f29b676..e4b934f20 100644 --- a/test/unit/email_process_test.rb +++ b/test/unit/email_process_test.rb @@ -2776,6 +2776,34 @@ Some Text', ], }, }, + { + data: <<~RAW_MAIL.chomp, + From: me@example.com + To: customer@example.com + Subject: some subject + Content-Type: text/html; charset=us-ascii; format=flowed + + + + test + + + RAW_MAIL + success: true, + result: { + 0 => { + priority: '2 normal', + title: 'some subject', + }, + 1 => { + content_type: 'text/html', + body: 'testäöü@example.com', + sender: 'Customer', + type: 'email', + internal: false, + }, + }, + }, ] assert_process(files) end diff --git a/test/unit/html_sanitizer_test.rb b/test/unit/html_sanitizer_test.rb index 9c95a0dad..03b040da2 100644 --- a/test/unit/html_sanitizer_test.rb +++ b/test/unit/html_sanitizer_test.rb @@ -134,5 +134,7 @@ test 123 attachment_url_evil_other = "#{attachment_url}?disposition=some_other" assert_equal(HtmlSanitizer.strict("Evil link"), "Evil link") + + assert_equal(HtmlSanitizer.strict('test'), 'testäöü@example.com') end end From 23f30921dcf1b7ac87f64aba57920e6d0888856a Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Tue, 12 Jun 2018 15:39:17 +0800 Subject: [PATCH 7/7] Fix regression in HtmlSanitizer::cleanup_target (whitespace deletion) --- lib/html_sanitizer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/html_sanitizer.rb b/lib/html_sanitizer.rb index ecb76c383..6305013a4 100644 --- a/lib/html_sanitizer.rb +++ b/lib/html_sanitizer.rb @@ -375,7 +375,7 @@ cleanup html string: def self.cleanup_target(string, **options) cleaned_string = CGI.unescape(string).utf8_encode(fallback: :read_as_sanitized_binary) - cleaned_string = cleaned_string.delete(' ') unless options[:keep_spaces] + cleaned_string = cleaned_string.gsub(/[[:space:]]/, '') if !options[:keep_spaces] cleaned_string = cleaned_string.strip .delete("\t\n\r\u0000") .gsub(%r{/\*.*?\*/}, '')