diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index 1a20e7f29..1d76f988a 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.rb @@ -12,17 +12,17 @@ class Channel::EmailParser mail = parse( msg_as_string ) mail = { - :from => 'Some Name ', - :from_email => 'some@example.com', - :from_local => 'some', - :from_domain => 'example.com', - :from_display_name => 'Some Name', - :message_id => 'some_message_id@example.com', - :to => 'Some System ', - :cc => 'Somebody ', - :subject => 'some message subject', - :body => 'some message body', - :attachments => [ + :from => 'Some Name ', + :from_email => 'some@example.com', + :from_local => 'some', + :from_domain => 'example.com', + :from_display_name => 'Some Name', + :message_id => 'some_message_id@example.com', + :to => 'Some System ', + :cc => 'Somebody ', + :subject => 'some message subject', + :body => 'some message body', + :attachments => [ { :data => 'binary of attachment', :filename => 'file_name_of_attachment.txt', @@ -50,9 +50,9 @@ class Channel::EmailParser :x-zammad-ticket-owner => 'some_owner_login', # article headers - :x-zammad-article-internal => false, - :x-zammad-article-type => 'agent', - :x-zammad-article-sender => 'customer', + :x-zammad-article-internal => false, + :x-zammad-article-type => 'agent', + :x-zammad-article-sender => 'customer', # all other email headers :some-header => 'some_value', @@ -133,7 +133,7 @@ class Channel::EmailParser filename = 'message.html' data[:body] = mail.html_part.body.to_s data[:body] = Encode.conv( mail.html_part.charset.to_s, data[:body] ) - data[:body] = html2ascii( data[:body] ).to_s.force_encoding('utf-8') + data[:body] = data[:body].html2text.to_s.force_encoding('utf-8') if !data[:body].valid_encoding? data[:body] = data[:body].encode('utf-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '?') @@ -199,7 +199,7 @@ class Channel::EmailParser filename = 'message.html' data[:body] = mail.body.decoded data[:body] = Encode.conv( mail.charset, data[:body] ) - data[:body] = html2ascii( data[:body] ).to_s.force_encoding('utf-8') + data[:body] = data[:body].html2text.to_s.force_encoding('utf-8') if !data[:body].valid_encoding? data[:body] = data[:body].encode('utf-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '?') @@ -349,7 +349,7 @@ class Channel::EmailParser # reset current_user UserInfo.current_user_id = 1 - + # create sender if mail[ 'x-zammad-customer-login'.to_sym ] user = User.where( :login => mail[ 'x-zammad-customer-login'.to_sym ] ).first end @@ -358,20 +358,28 @@ class Channel::EmailParser end if !user puts 'create user...' - roles = Role.where( :name => 'Customer' ) - user = User.create( - :login => mail[ 'x-zammad-customer-login'.to_sym ] || mail[ 'x-zammad-customer-email'.to_sym ] || mail[:from_email], - :firstname => mail[ 'x-zammad-customer-firstname'.to_sym ] || mail[:from_display_name], - :lastname => mail[ 'x-zammad-customer-lastname'.to_sym ], - :email => mail[ 'x-zammad-customer-email'.to_sym ] || mail[:from_email], - :password => '', - :active => true, - :roles => roles, - :updated_by_id => 1, - :created_by_id => 1, + user = user_create( + :login => mail[ 'x-zammad-customer-login'.to_sym ] || mail[ 'x-zammad-customer-email'.to_sym ] || mail[:from_email], + :firstname => mail[ 'x-zammad-customer-firstname'.to_sym ] || mail[:from_display_name], + :lastname => mail[ 'x-zammad-customer-lastname'.to_sym ], + :email => mail[ 'x-zammad-customer-email'.to_sym ] || mail[:from_email], ) end + # create to and cc user + ['to', 'cc'].each { |item| + if mail[item.to_sym] + items = Mail::AddressList.new( mail[item.to_sym] ) + items.addresses.each {|item| + user_create( + :firstname => item.display_name, + :lastname => '', + :email => item.address, + ) + } + end + } + # set current user UserInfo.current_user_id = user.id @@ -479,6 +487,35 @@ class Channel::EmailParser return ticket, article, user end + def user_create(data) + + # return existing + user = User.where( :login => data[:email].downcase ).first + return user if user + + # create new user + roles = Role.where( :name => 'Customer' ) + + # fillup + ['firstname', 'lastname'].each { |item| + if data[item.to_sym] == nil + data[item.to_sym] = '' + end + } + data[:password] = '' + data[:active] = true + data[:roles] = roles + data[:updated_by_id] = 1 + data[:created_by_id] = 1 + + user = User.create(data) + user.update_attributes( + :updated_by_id => user.id, + :created_by_id => user.id, + ) + user + end + def set_attributes_by_x_headers( item_object, header_name, mail ) # loop all x-zammad-hedaer-* headers @@ -525,85 +562,6 @@ class Channel::EmailParser } end - - def html2ascii(string) - - # in case of invalid encodeing, strip invalid chars - # see also test/fixtures/mail21.box - # note: string.encode!('UTF-8', 'UTF-8', :invalid => :replace, :replace => '?') was not detecting invalid chars - if !string.valid_encoding? - string = string.chars.select { |c| c.valid_encoding? }.join - end - - # find and replace it with [x] - link_list = '' - counter = 0 - string.gsub!( //ix ) { |item| - link = $2 - counter = counter + 1 - link_list += "[#{counter}] #{link}\n" - "[#{counter}]" - } - - # remove empty lines - string.gsub!( /^\s*/m, '' ) - - # fix some bad stuff from opera and others - string.gsub!( /(\n\r|\r\r\n|\r\n)/, "\n" ) - - # strip all other tags - string.gsub!( /\<(br|br\/|br\s\/)\>/, "\n" ) - - # strip all other tags - string.gsub!( /\<.+?\>/, '' ) - - # strip all & < > " - string.gsub!( '&', '&' ) - string.gsub!( '<', '<' ) - string.gsub!( '>', '>' ) - string.gsub!( '"', '"' ) - - # encode html entities like "–" - string.gsub!( /(&\#(\d+);?)/x ) { |item| - $2.chr - } - - # encode html entities like "d;" - string.gsub!( /(&\#[xX]([0-9a-fA-F]+);?)/x ) { |item| - chr_orig = $1 - hex = $2.hex - if hex - chr = hex.chr - if chr - chr_orig = chr - else - chr_orig - end - else - chr_orig - end - - # check valid encoding - begin - if !chr_orig.encode('UTF-8').valid_encoding? - chr_orig = '?' - end - rescue - chr_orig = '?' - end - chr_orig - } - - # remove empty lines - string.gsub!( /^\s*\n\s*\n/m, "\n" ) - - # add extracted links - if link_list - string += "\n\n" + link_list - end - - return string - end end # workaround to parse subjects with 2 different encodings correctly (e. g. quoted-printable see test/fixtures/mail9.box) @@ -642,4 +600,4 @@ module Mail end.join("") end end -end +end \ No newline at end of file diff --git a/app/models/user.rb b/app/models/user.rb index 4cce8452b..7f0b09320 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -86,10 +86,10 @@ returns def fullname fullname = '' - if self.firstname + if self.firstname && !self.firstname.empty? fullname = fullname + self.firstname end - if self.lastname + if self.lastname && !self.lastname.empty? if fullname != '' fullname = fullname + ' ' end @@ -132,16 +132,16 @@ returns result = [ { - :id =>2, - :o_id =>2, + :id => 2, + :o_id => 2, :created_by_id => 3, :created_at => '2013-09-28 00:57:21', :object => "User", :type => "created", }, { - :id =>2, - :o_id =>2, + :id => 2, + :o_id => 2, :created_by_id => 3, :created_at => '2013-09-28 00:59:21', :object => "User", @@ -414,23 +414,35 @@ returns scan = self.firstname.scan(/, /) if scan[0] name = self.firstname.split(', ', 2) - self.lastname = name[0] - self.firstname = name[1] + if name[0] != nil + self.lastname = name[0] + end + if name[1] != nil + self.firstname = name[1] + end return end # Firstname Lastname name = self.firstname.split(' ', 2) - self.firstname = name[0] - self.lastname = name[1] + if name[0] != nil + self.firstname = name[0] + end + if name[1] != nil + self.lastname = name[1] + end return - # -no name- firstname.lastname@example.com + # -no name- firstname.lastname@example.com elsif ( !self.firstname || self.firstname.empty? ) && ( !self.lastname || self.lastname.empty? ) && ( self.email && !self.email.empty? ) scan = self.email.scan(/^(.+?)\.(.+?)\@.+?$/) if scan[0] - self.firstname = scan[0][0].capitalize - self.lastname = scan[0][1].capitalize + if scan[0][0] != nil + self.firstname = scan[0][0].capitalize + end + if scan[0][1] != nil + self.lastname = scan[0][1].capitalize + end end end end diff --git a/db/migrate/20120101000001_create_base.rb b/db/migrate/20120101000001_create_base.rb index b41f51df2..39112c33c 100644 --- a/db/migrate/20120101000001_create_base.rb +++ b/db/migrate/20120101000001_create_base.rb @@ -12,24 +12,24 @@ class CreateBase < ActiveRecord::Migration create_table :users do |t| t.references :organization, :null => true t.column :login, :string, :limit => 100, :null => false - t.column :firstname, :string, :limit => 100, :null => true - t.column :lastname, :string, :limit => 100, :null => true - t.column :email, :string, :limit => 140, :null => true + t.column :firstname, :string, :limit => 100, :null => true, :default => '' + t.column :lastname, :string, :limit => 100, :null => true, :default => '' + t.column :email, :string, :limit => 140, :null => true, :default => '' t.column :image, :string, :limit => 100, :null => true t.column :image_source, :string, :limit => 200, :null => true - t.column :web, :string, :limit => 100, :null => true + t.column :web, :string, :limit => 100, :null => true, :default => '' t.column :password, :string, :limit => 100, :null => true - t.column :phone, :string, :limit => 100, :null => true - t.column :fax, :string, :limit => 100, :null => true - t.column :mobile, :string, :limit => 100, :null => true - t.column :department, :string, :limit => 200, :null => true - t.column :street, :string, :limit => 120, :null => true - t.column :zip, :string, :limit => 100, :null => true - t.column :city, :string, :limit => 100, :null => true - t.column :country, :string, :limit => 100, :null => true + t.column :phone, :string, :limit => 100, :null => true, :default => '' + t.column :fax, :string, :limit => 100, :null => true, :default => '' + t.column :mobile, :string, :limit => 100, :null => true, :default => '' + t.column :department, :string, :limit => 200, :null => true, :default => '' + t.column :street, :string, :limit => 120, :null => true, :default => '' + t.column :zip, :string, :limit => 100, :null => true, :default => '' + t.column :city, :string, :limit => 100, :null => true, :default => '' + t.column :country, :string, :limit => 100, :null => true, :default => '' t.column :verified, :boolean, :null => false, :default => false t.column :active, :boolean, :null => false, :default => true - t.column :note, :string, :limit => 250, :null => true + t.column :note, :string, :limit => 250, :null => true, :default => '' t.column :last_login, :timestamp, :null => true t.column :source, :string, :limit => 200, :null => true t.column :login_failed, :integer, :null => false, :default => 0 @@ -104,7 +104,7 @@ class CreateBase < ActiveRecord::Migration t.column :name, :string, :limit => 100, :null => false t.column :shared, :boolean, :null => false, :default => true t.column :active, :boolean, :null => false, :default => true - t.column :note, :string, :limit => 250, :null => true + t.column :note, :string, :limit => 250, :null => true, :default => '' t.column :updated_by_id, :integer, :null => false t.column :created_by_id, :integer, :null => false t.timestamps diff --git a/lib/core_ext/string.rb b/lib/core_ext/string.rb index f2c19dd84..f88fddbba 100644 --- a/lib/core_ext/string.rb +++ b/lib/core_ext/string.rb @@ -45,37 +45,111 @@ class String =end - # base from https://gist.github.com/petrblaho/657856 def html2text - text = self. - gsub(/( |\n|\s)+/im, ' ').squeeze(' ').strip. - gsub(/<([^\s]+)[^>]*(src|href)=\s*(.?)([^>\s]*)\3[^>]*>\4<\/\1>/i, '\4') + string = self - links = [] - linkregex = /<[^>]*(src|href)=\s*(.?)([^>\s]*)\2[^>]*>\s*/i - while linkregex.match(text) - links << $~[3] - text.sub!(linkregex, "[#{links.size}]") + # in case of invalid encodeing, strip invalid chars + # see also test/fixtures/mail21.box + # note: string.encode!('UTF-8', 'UTF-8', :invalid => :replace, :replace => '?') was not detecting invalid chars + if !string.valid_encoding? + string = string.chars.select { |c| c.valid_encoding? }.join end - text = CGI.unescapeHTML( - text. - gsub(/<(script|style)[^>]*>.*<\/\1>/im, ''). - gsub(//m, ''). - gsub(/]*)>/i, "___\n"). - gsub(/]*)>/i, "\n* "). - gsub(/]*)>/i, '> '). - gsub(/<(br)(|\/| [^>]*)>/i, "\n"). - gsub(/<\/div(| [^>]*)>/i, "\n"). - gsub(/<(\/h[\d]+|p)(| [^>]*)>/i, "\n\n"). - gsub(/<[^>]*>/, '') - ).lstrip.gsub(/\n[ ]+/, "\n") + "\n" + # find and replace it with [x] + link_list = '' + counter = 0 + string.gsub!( //ix ) { |item| + link = $2 + counter = counter + 1 + link_list += "[#{counter}] #{link}\n" + "[#{counter}] " + } - for i in (0...links.size).to_a - text = text + "\n [#{i+1}] <#{CGI.unescapeHTML(links[i])}>" unless links[i].nil? + # remove empty lines + string.gsub!( /^\s*/m, '' ) + + # pre/code handling 1/2 + string.gsub!( /
(.+?)<\/pre>/m ) { |placeholder|
+      placeholder = placeholder.gsub(/\n/, "###BR###")
+    }
+    string.gsub!( /(.+?)<\/code>/m ) { |placeholder|
+      placeholder = placeholder.gsub(/\n/, "###BR###")
+    }
+
+    # remove all new lines
+    string.gsub!( /(\n\r|\r\r\n|\r\n|\n)/, '' )
+
+    # pre/code handling 2/2
+    string.gsub!( /###BR###/, "\n" )
+
+    # add counting
+    string.gsub!(/]*)>/i, "\n* ")
+
+    # add quoting
+    string.gsub!(/]*)>/i, '> ')
+
+    # add hr
+    string.gsub!(/]*)>/i, "___\n")
+
+    # add new lines
+    string.gsub!( /\<(br|table)(|\/| [^>]*)\>/i, "\n" )
+    string.gsub!( /\<\/(div|p|pre|blockquote|table|tr)(|\s.+?)\>/i, "\n" )
+    string.gsub!( /\<\/td\>/i, ' '  )
+
+    # strip all other tags
+    string.gsub!( /\<.+?\>/, '' )
+
+    # strip all & < > "
+    string.gsub!( '&', '&' )
+    string.gsub!( '<', '<' )
+    string.gsub!( '>', '>' )
+    string.gsub!( '"', '"' )
+    string.gsub!( ' ', ' ' )
+
+    # encode html entities like "–"
+    string.gsub!( /(&\#(\d+);?)/x ) { |item|
+      $2.chr
+    }
+
+    # encode html entities like "d;"
+    string.gsub!( /(&\#[xX]([0-9a-fA-F]+);?)/x ) { |item|
+      chr_orig = $1
+      hex      = $2.hex
+      if hex
+        chr = hex.chr
+        if chr
+          chr_orig = chr
+        else
+          chr_orig
+        end
+      else
+        chr_orig
+      end
+
+      # check valid encoding
+      begin
+        if !chr_orig.encode('UTF-8').valid_encoding?
+          chr_orig = '?'
+        end
+      rescue
+        chr_orig = '?'
+      end
+      chr_orig
+    }
+
+
+    # remove tailing empty spaces
+    string.gsub!(/\s+\n$/, "\n")
+
+    # remove multible empty lines
+    string.gsub!(/\n\n\n/, "\n\n")
+
+    # add extracted links
+    if link_list != ''
+      string += "\n\n" + link_list
     end
-    links = nil
-    text.chomp
+
+    string.strip
   end
 
 =begin
diff --git a/test/unit/email_build_test.rb b/test/unit/email_build_test.rb
index 864872dc2..dfd775612 100644
--- a/test/unit/email_build_test.rb
+++ b/test/unit/email_build_test.rb
@@ -52,8 +52,7 @@ class EmailBuildTest < ActiveSupport::TestCase
     should = '> Welcome!
 >
 > Thank you for installing Zammad. äöüß
->
-'
+>'
     assert_equal( should, mail.text_part.body.to_s )
     assert_equal( html, mail.html_part.body.to_s )
 
@@ -90,8 +89,7 @@ class EmailBuildTest < ActiveSupport::TestCase
     text = '> Welcome!
 >
 > Thank you for installing Zammad. äöüß
->
-'
+>'
     mail = Channel::EmailBuild.build(
       :from         => 'sender@example.com',
       :to           => 'recipient@example.com',
@@ -108,8 +106,7 @@ class EmailBuildTest < ActiveSupport::TestCase
     should = '> Welcome!
 >
 > Thank you for installing Zammad. äöüß
->
-'
+>'
     assert_equal( should, mail.text_part.body.to_s )
     assert_equal( nil, mail.html_part )
 
@@ -141,8 +138,7 @@ class EmailBuildTest < ActiveSupport::TestCase
     text = '> Welcome!
 >
 > Thank you for installing Zammad. äöüß
->
-'
+>'
     mail = Channel::EmailBuild.build(
       :from         => 'sender@example.com',
       :to           => 'recipient@example.com',
@@ -152,8 +148,7 @@ class EmailBuildTest < ActiveSupport::TestCase
     should = '> Welcome!
 >
 > Thank you for installing Zammad. äöüß
->
-'
+>'
     assert_equal( should, mail.body.to_s )
     assert_equal( nil, mail.html_part )
 
@@ -169,22 +164,63 @@ class EmailBuildTest < ActiveSupport::TestCase
   end
 
   test 'html2text' do
-    html = '
-
-  
-    
-  
-  
-    
> Welcome!
>
> Thank you for installing Zammad.
>
- -' - should = '> Welcome! -> -> Thank you for installing Zammad. -> -' - assert_equal( should, html.html2text ) + html = 'test' + result = 'test' + assert_equal( result, html.html2text ) + + html = ' test ' + result = 'test' + assert_equal( result, html.html2text ) + + html = "\n\n test \n\n\n" + result = 'test' + assert_equal( result, html.html2text ) + + html = '
test
' + result = 'test' + assert_equal( result, html.html2text ) + + html = '
test
' + result = 'test' + assert_equal( result, html.html2text ) + + html = "
test


\n
\n
\n
" + result = 'test' + assert_equal( result, html.html2text ) + + html = "
test\n\ntest
" + result = "test\ntest" + assert_equal( result, html.html2text ) + + html = "test\n\ntest" + result = "test\ntest" + assert_equal( result, html.html2text ) + + html = "
testcol
test4711
" + result = "test col \ntest 4711" + assert_equal( result, html.html2text ) + + + html = " +
+ test


\n
\n
\n +
" + result = 'test' + assert_equal( result, html.html2text ) + + html = "\n
+
" + result = "[1] Best Tool of the Worldsome other text\n\n\n[1] http://zammad.org" + assert_equal( result, html.html2text ) + + html = " +
+ test


\n
\n
\n +
" + result = "test\n\n___" + assert_equal( result, html.html2text ) html = ' line 1
you
@@ -200,5 +236,20 @@ you * #2' assert_equal( should, html.html2text ) + html = ' + + + + + +
> Welcome!
>
> Thank you for installing Zammad.
>
+ +' + should = '> Welcome! +> +> Thank you for installing Zammad. +>' + assert_equal( should, html.html2text ) + end end \ No newline at end of file diff --git a/test/unit/email_parser_test.rb b/test/unit/email_parser_test.rb index 5a5a23949..9457aff0c 100644 --- a/test/unit/email_parser_test.rb +++ b/test/unit/email_parser_test.rb @@ -85,46 +85,49 @@ Liebe Grüße! }, { :data => IO.read('test/fixtures/mail6.box'), - :body_md5 => '88c0c9e004021a4ed2a0c1e5f6b3455d', + :body_md5 => 'cc60217317756f45a6e02829c0a8c49c', :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: Сергей Углицких', - :body => "this is a test [1]Compare Cable, DSL or Satellite plans: As low as $2.95. + :body => "this is a test + +___ + [1] Compare Cable, DSL or Satellite plans: As low as $2.95. Test1:8 - Test2:& - Test3:∋ - Test4:& - Test5:= - - -[1] http://localhost/8HMZENUS/2737??PS= -" +[1] http://localhost/8HMZENUS/2737??PS=" }, }, { :data => IO.read('test/fixtures/mail7.box'), - :body_md5 => '6029e6b6106a6dd11ed887ec31f118ac', + :body_md5 => 'c78f6a91905538ee32bc0bf71f70fcf2', :params => { :from => 'Eike.Ehringer@example.com', :from_email => 'Eike.Ehringer@example.com', :from_display_name => '', :subject => 'AW:Installation [Ticket#11392]', - :body_md5 => "Hallo. + :body => "Hallo. Jetzt muss ich dir noch kurzfristig absagen für morgen. Lass uns evtl morgen Tel. -Mfg eike +Mfg eike + +Martin Edenhofer via Znuny Team --- Installation [Ticket#11392] --- + +Von: \"Martin Edenhofer via Znuny Team\" +An eike.xx@xx-corpxx.com +Datum: Mi., 13.06.2012 14:30 +Betreff Installation [Ticket#11392] + +___ -Martin Edenhofer via Znuny Team --- Installation [Ticket#11392] --- -Von:\"Martin Edenhofer via Znuny Team\" Aneike.xx@xx-corpxx.comDatum:Mi., 13.06.2012 14:30BetreffInstallation [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. @@ -139,10 +142,7 @@ 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 - - -", +Managing Director: Martin Edenhofer", }, }, { @@ -326,7 +326,7 @@ Hof # spam email { :data => IO.read('test/fixtures/mail16.box'), - :body_md5 => 'b255fb5620db3b63131924513061d974', + :body_md5 => 'a2367adfa77857a078dad83826d659e8', :params => { :from => nil, :from_email => 'vipyimin@126.com', @@ -360,7 +360,7 @@ Hof }, { :data => IO.read('test/fixtures/mail19.box'), - :body_md5 => '2fa47e9122f4c1b9c5057400529c7567', + :body_md5 => '3e42be74f967379a3053f21f4125ca66', :params => { :from => '"我" <>', :from_email => '"=?GB2312?B?ztI=?=" <>', @@ -371,7 +371,7 @@ Hof }, { :data => IO.read('test/fixtures/mail20.box'), - :body_md5 => 'd2b65203aaf2bbbd50fc73cb14d781bc', + :body_md5 => '65ca1367dfc26abcf49d30f68098f122', :params => { :from => 'Health and Care-Mall ', :from_email => 'drugs-cheapest8@sicor.com', @@ -380,72 +380,38 @@ Hof :to => 'info2@znuny.com', :body => "________________________________________________________________________Yeah but even when they. Beth liî ed her neck as well -ó25aHw511IΨ11xG⌊o8KHCmς9-2½23QgñV6UAD12AX←t1Lf7⊕1Ir²r1TLA5pYJhjV gPnãM36V1E89RUDΤÅ12I92s2CΘYEϒAfg∗bT11∫rIoiš¦O5oUIN1Is2S21Pp Ÿ2q1FΧ⇑eGOz⌈F1R98y§ 74”lTr8r1H2æu2E2P2q VmkfB∫SKNElst4S∃182T2G1í lY92Pu×8>RÒ¬⊕ΜIÙzÙCC412QEΡºS2!XgŒs. - -2γ⇓B[1]cwspC L8I C K88H E1R?E2e31 !Calm dylan for school today. +ó25aHw511IΨ11xG⌊o8KHCmς9-2½23QgñV6UAD12AX←t1Lf7⊕1Ir²r1TLA5pYJhjV gPnãM36V1E89RUDΤÅ12I92s2CΘYEϒAfg∗bT11∫rIoiš¦O5oUIN1Is2S21Pp Ÿ2q1FΧ⇑eGOz⌈F1R98y§ 74”lTr8r1H2æu2E2P2q VmkfB∫SKNElst4S∃182T2G1í lY92Pu×8>RÒ¬⊕ΜIÙzÙCC412QEΡºS2!XgŒs. +2γ⇓B[1] cwspC L8I C K88H E1R?E2e31 !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¶1vΖ'1⇓∝5S2225 Χ0jΔHbAgþE—2i6A2lD⇑LGj2nTOy11H2τ9’:Their mother and tugged it seemed like - -d3RsV¶H2Θi¯B∂gax1bîgdH23r2Jÿ1aIK1² n1jfaTk1Vs3952 C˜lBl‘mxGo0√2XwT8Ya 28ksa∫f1ℵs”62Q 2Ad7$p32d1e∏2e.0”261a2Κ63αSM2 -Nf52CdL∪1i↔xcaa52R3l6Lc3i2z16só9èU zDE1aE21gs25Ë2 hE1cl⊃¢11o21µBw1zF1 q2kõaXUius1r0⊆ d•∈2$1Z2F1218l.07d56PÚl25JAO6 - -45loV2iv1i2ãΥ⌊a2⊃d2gÃΥ3™r22u¸aWjO8 n40–Soyè2u1∅23p1JΜNeÌ22jrá2rΚ 1229A2rAkc8nuEtl22ai‡OB8vSbéσeιõq1+65cw 2s8Uaò4PrsE1y8 ⟨fMElhϒ⋅Jo8pmzwjˆN1 wv39aW1WtsvuU3 1aœ1$2ΝnR2O2⌉B.∀2c→5Ê9χw5p1⁄N -fHGFVfE³2iσjGpa51kgg12cWrUq52akx2h 0F24P¸2L2rn22Ïo2Ý2HfoRb2eUαw6s2N‾ws¶13Βi2X1¸ofgtHnR⊥32ase92lF1H5 26B1a⊃2iϒsô12i ÅkMyl2J1ÄoQ–0ℑwvmù2 2ˆμ\"aQ7jVse62f 1h2p$L2r£3i1t2.323h5qP8g0♥÷R2 - -·iƒPV1Β∋øiF1R1a4v32gL9¢wr1722a2û0η þ12ßStu21u7á¡lp2ocEe1SLlrV2Xj ⊥Uµ1F¬48ðov71Arm242c2Vw2e1§⊇N 1242aLþZ2ski×5 c€pBlû26∂ol1fÚwKß32 4i2la4C12sRE21 ãeI2$2z8t442fG.¸1≤12F’Ã152in⊄ -Tl1ëC2v7Ci71X8a225NlþU⟩ιicO∑«s·iKN UuϒjS1j52u2Jü§pn5°1e¥Û3℘r1W‡2 J‹S7A1j0sc&1pkt1qq2iZ561vn81∗e22Q3+723Š ∑RkLaKX2as2s22 ï111lD2z8o278wwU–ÀC T6U2aϒ938s20Gÿ Ox2∈$98‘R21H25.ÒL6b9θrδ292f9j - -Please matt on his neck. Okay matt huï ed into your mind -Since her head to check dylan. Where dylan matt got up there - -1ȱΑAYQ1dN12ϒXT00ÀvI∨ío8-1b®8AΕ1V4LgÕ↑7LKtgcEiw1yR5Y22GRA1°I10C2C2Tiü/2wc0Ax211SÜÂ2ŒTÁ22òHpNâùM6È10A5Tb1:Simmons and now you really is what. Matt picked up this moment later that. - -251yV922Yeg1↑DnJ3l4t22b1os∏jll÷iS2iwBÎ4n021Ö 1f÷2a11l2suÚ82 2LCblgvN½o1oP3wn♠90 FZora&M™xsΚbb1 251ξ$12·22iG2∇1⊇Ξ¬3.0P0κ53V1203ÝYz -2X¢BAZ4Kwddu2vvuB↑Βa1’THi0—93rZεj0 1rΜ1a2111s71Ιf 8⇓2olW„62o6yH¥wKZ∧6 21h2aKJ“ℜs48IÌ 21¬1$ZΣ122ñ26B42YMZ.21V19f10å54⌈R8 - -2w\"9N2gBÀa2Sê1s≅gGÔo0Dn4n↵γ7⊗eS7e2xf3Jd q÷CMa221isNMZp zz0˜lΚLw8o229ww1§Qu 1D⌈ía2212sJ811 3où2$¦1Nℜ1>R2t7WPM1.181D92k5D9∗8≈R -l131Sj1Ψ8pΣ2Kùi6rr2rbÛu¬i2V∗∏v5ª10a27B1 Ú♦Ξsa9j3χsa1iΟ Oi℘ml6óf2owbz∀wA6ù→ 22b2ai1wbs♦βGs 281i$iÀˆ12⊃2wC82n8o.13NJ9S11Θ0P1Sd - -What made no one in each time. -Mommy was thinking of course beth. Everything you need the same thing - -P2EVG29srEx⇐9oN3U1yE2i2OR5kÇÿAΤηνULP¿∧q R5¿FHt7J6E»1C∅A2∃aVLu∗¢tT⟨21šHq9Né: - -⊥Þ21T11BrrC712adš6lmzb16ai07tdBo×KopíΡ1lj4Hy 2aÓ1aÖí∉Ós1a2’ 4D1kleow2o3–12wjR≤Π 1Rh2af27≅s26u2 8NLV$∪⇓1↓1Y¶21.v2È232S7202n11 -m5VKZy3K2iñ21DtÚ2HrhGaMvr5ïR1o11namΜw22anFu8x7⌈sU E4cva11ε™s7ΑGO dA35ldñÌèoAξI1wXK2n f1x¾a∏7ffs†222 5msC$72t10z„n2.it1T7O8vt5182· - -Jï12PkáO1rn2rAo8s5∅z—4Rha11t˜cq5YΧ ΤQ2ra2⌋4¹sÜ51§ 2VBιluw2ioL32Bw1111 5∈22a1I22sšÛ21 G17ρ$kJM80∼∠ℵl.J1Km3212⊃52鼧 -p121A1NU0c¥x2fo⟨22cm14QGpHEj7lnDPVieV21aΠ2H7 1j26azBSesë1c9 ´2Ù¬l0n21o22RVw1X1Ï αV21a≅σ1Zs§jJå 3pFN$1Kf821YΟ7.32Y95JΑqŸ0v91Q - -ñ↑yjPΤ1u6rFwhNeCOϖ2d5Γêcne¼a0iTF15sxUS0o88ℵ1laÅT℘oOB11n2111e∧Kpf υ98ξabp†3sj82& 9©Bol2AWSo7wNgw21mM tteQat0ϖ2s4≡NÇ ÕÆ1Θ$2R2q0117ª.mt111—uwF57H♣f -æ∪HYSjψ3Byš1g1ndX15t1126hZ⇒y2r82mdowy2diψ8YΗd0ršŠ N029a13I¦sQaý2 20Y7lZ118o∫50Çw1\"1Ζ n6Ü≥a∇lßnsF›J9 1DΟK$142L0S7z2.Ta2X31R9953911 - -Turning to mess up with. Well that to give her face -Another for what she found it then. Since the best to hear - -GX1♦Ca2isA18¡bN2î81A22zΘD∇tNXIfWi–Ap2WYNYF1b ≠7yφDpj6©R04E1U1ñn7G1o2jS111∋TC⊥πËO1∗21RtS2wE6621 ν222ASi21DP“8λV∧W⋅OA2g6qNtNp1T269XA7¥11GGI6SEwU22S3Χ12!Okay let matt climbed in front door. Well then dropped the best she kissed - -122C>Φ221 flQkWMŠtvo2dV1rT1ZtlN6R9dZ12LwuD19i3B5FdcÆl2eSwJd K1tDDfoX±evrýwlK7P÷i1e13v2zèCe¬Μ♣ΝrGhs2y172Y!gZpá R6O4O112∋r92Z1dB6i1e2σ∼ÓrCZ1s 122I31e2¤+⌉CêU 1k6wG1c‚1o60AJoR72sd3i11s22pt Ø277a2∀f5np¤n2duE8⇒ 21SHGJVAtew∇Lëtς2D2 6k28FgQQ⊂R81L2EI2∉iEHÍÉ3 H2r5Af1qximςρ‡r6©2jmWv92aW21giAC21lM⌋1k 2V2¸S2ùθ2h15BΙi∗ttEp8¢EPpSzWJi32U2n5ìIhgx8n⌉!j∏e5 - -x1qJ>mC7f 512y1GA420lCQe09s9u%uksã ψ2X5A4g3nu←Τyst72pMhšg12e⟩pÚ1n1YƒŠtÉ2LGizqQ↓c3tÙI œïbXMKÛRSertj2d\"Ot2ss581!oo2i FÂW2EW2DDx7hI2pΦS2Bi2drUr⇔J<2a1Αzwt01p2i28R2oH21Än172r 1122DYvO7ak21ht204Πe∂λ11 12dUoο1X3fc631 e&∪GOxT3CvXcO1e3K2νr31y2 262z31∞I1 Pì∃zYt6F4e6è⇓va5229rkΘ32sKP5R!ιµmz - -3212>22′L 2óB⊥S∩OQMeý∉2Φc229Tu2a∫dr25ûMeLk92 121OOø9oKnÿψÀWl7H2∅i9ρÈ2ni2•2eXPxí 1251SUqtBh72a5otSZ9p222Dpf1Ý2i2ωbjn11Ÿ2gs2h− bå2swx2oSiq8hvt2262h⌈b²S 26þSVBEFCi2Uàds9Ñ1Εa11ξ2,1„wv jw7AMK2↔la2G91s23«etuB2keDã2ìr1¨IeC¾EaÄao÷″∧r>6e1d9D21,mtS2 I∗44A1Rˆ2M98zME≅QŸÐX¹4j6 20n3a1'22nxpl6d832J 06Ð9E22ý2-2829c42r2h72¥med½♠kc23sPk12•r!⟩QCa - +When someone who gave up from here. Feel of god knows what. +TBϖ∃M5T5ΕEf2û–N¶1vΖ'1⇓∝5S2225 Χ0jΔHbAgþE—2i6A2lD⇑LGj2nTOy11H2τ9’:Their mother and tugged it seemed like +d3RsV¶H2Θi¯B∂gax1bîgdH23r2Jÿ1aIK1² n1jfaTk1Vs3952 C˜lBl‘mxGo0√2XwT8Ya 28ksa∫f1ℵs”62Q 2Ad7$p32d1e∏2e.0”261a2Κ63αSM2 Nf52CdL∪1i↔xcaa52R3l6Lc3i2z16só9èU zDE1aE21gs25Ë2 hE1cl⊃¢11o21µBw1zF1 q2kõaXUius1r0⊆ d•∈2$1Z2F1218l.07d56PÚl25JAO6 +45loV2iv1i2ãΥ⌊a2⊃d2gÃΥ3™r22u¸aWjO8 n40–Soyè2u1∅23p1JΜNeÌ22jrá2rΚ 1229A2rAkc8nuEtl22ai‡OB8vSbéσeιõq1+65cw 2s8Uaò4PrsE1y8 ⟨fMElhϒ⋅Jo8pmzwjˆN1 wv39aW1WtsvuU3 1aœ1$2ΝnR2O2⌉B.∀2c→5Ê9χw5p1⁄N fHGFVfE³2iσjGpa51kgg12cWrUq52akx2h 0F24P¸2L2rn22Ïo2Ý2HfoRb2eUαw6s2N‾ws¶13Βi2X1¸ofgtHnR⊥32ase92lF1H5 26B1a⊃2iϒsô12i ÅkMyl2J1ÄoQ–0ℑwvmù2 2ˆμ\"aQ7jVse62f 1h2p$L2r£3i1t2.323h5qP8g0♥÷R2 +·iƒPV1Β∋øiF1R1a4v32gL9¢wr1722a2û0η þ12ßStu21u7á¡lp2ocEe1SLlrV2Xj ⊥Uµ1F¬48ðov71Arm242c2Vw2e1§⊇N 1242aLþZ2ski×5 c€pBlû26∂ol1fÚwKß32 4i2la4C12sRE21 ãeI2$2z8t442fG.¸1≤12F’Ã152in⊄ Tl1ëC2v7Ci71X8a225NlþU⟩ιicO∑«s·iKN UuϒjS1j52u2Jü§pn5°1e¥Û3℘r1W‡2 J‹S7A1j0sc&1pkt1qq2iZ561vn81∗e22Q3+723Š ∑RkLaKX2as2s22 ï111lD2z8o278wwU–ÀC T6U2aϒ938s20Gÿ Ox2∈$98‘R21H25.ÒL6b9θrδ292f9j +Please matt on his neck. Okay matt huï ed into your mind Since her head to check dylan. Where dylan matt got up there +1ȱΑAYQ1dN12ϒXT00ÀvI∨ío8-1b®8AΕ1V4LgÕ↑7LKtgcEiw1yR5Y22GRA1°I10C2C2Tiü/2wc0Ax211SÜÂ2ŒTÁ22òHpNâùM6È10A5Tb1:Simmons and now you really is what. Matt picked up this moment later that. +251yV922Yeg1↑DnJ3l4t22b1os∏jll÷iS2iwBÎ4n021Ö 1f÷2a11l2suÚ82 2LCblgvN½o1oP3wn♠90 FZora&M™xsΚbb1 251ξ$12·22iG2∇1⊇Ξ¬3.0P0κ53V1203ÝYz 2X¢BAZ4Kwddu2vvuB↑Βa1’THi0—93rZεj0 1rΜ1a2111s71Ιf 8⇓2olW„62o6yH¥wKZ∧6 21h2aKJ“ℜs48IÌ 21¬1$ZΣ122ñ26B42YMZ.21V19f10å54⌈R8 +2w\"9N2gBÀa2Sê1s≅gGÔo0Dn4n↵γ7⊗eS7e2xf3Jd q÷CMa221isNMZp zz0˜lΚLw8o229ww1§Qu 1D⌈ía2212sJ811 3où2$¦1Nℜ1>R2t7WPM1.181D92k5D9∗8≈R l131Sj1Ψ8pΣ2Kùi6rr2rbÛu¬i2V∗∏v5ª10a27B1 Ú♦Ξsa9j3χsa1iΟ Oi℘ml6óf2owbz∀wA6ù→ 22b2ai1wbs♦βGs 281i$iÀˆ12⊃2wC82n8o.13NJ9S11Θ0P1Sd +What made no one in each time. Mommy was thinking of course beth. Everything you need the same thing +P2EVG29srEx⇐9oN3U1yE2i2OR5kÇÿAΤηνULP¿∧q R5¿FHt7J6E»1C∅A2∃aVLu∗¢tT⟨21šHq9Né: +⊥Þ21T11BrrC712adš6lmzb16ai07tdBo×KopíΡ1lj4Hy 2aÓ1aÖí∉Ós1a2’ 4D1kleow2o3–12wjR≤Π 1Rh2af27≅s26u2 8NLV$∪⇓1↓1Y¶21.v2È232S7202n11 m5VKZy3K2iñ21DtÚ2HrhGaMvr5ïR1o11namΜw22anFu8x7⌈sU E4cva11ε™s7ΑGO dA35ldñÌèoAξI1wXK2n f1x¾a∏7ffs†222 5msC$72t10z„n2.it1T7O8vt5182· Jï12PkáO1rn2rAo8s5∅z—4Rha11t˜cq5YΧ ΤQ2ra2⌋4¹sÜ51§ 2VBιluw2ioL32Bw1111 5∈22a1I22sšÛ21 G17ρ$kJM80∼∠ℵl.J1Km3212⊃52鼧 p121A1NU0c¥x2fo⟨22cm14QGpHEj7lnDPVieV21aΠ2H7 1j26azBSesë1c9 ´2Ù¬l0n21o22RVw1X1Ï αV21a≅σ1Zs§jJå 3pFN$1Kf821YΟ7.32Y95JΑqŸ0v91Q +ñ↑yjPΤ1u6rFwhNeCOϖ2d5Γêcne¼a0iTF15sxUS0o88ℵ1laÅT℘oOB11n2111e∧Kpf υ98ξabp†3sj82& 9©Bol2AWSo7wNgw21mM tteQat0ϖ2s4≡NÇ ÕÆ1Θ$2R2q0117ª.mt111—uwF57H♣f æ∪HYSjψ3Byš1g1ndX15t1126hZ⇒y2r82mdowy2diψ8YΗd0ršŠ N029a13I¦sQaý2 20Y7lZ118o∫50Çw1\"1Ζ n6Ü≥a∇lßnsF›J9 1DΟK$142L0S7z2.Ta2X31R9953911 +Turning to mess up with. Well that to give her face Another for what she found it then. Since the best to hear +GX1♦Ca2isA18¡bN2î81A22zΘD∇tNXIfWi–Ap2WYNYF1b ≠7yφDpj6©R04E1U1ñn7G1o2jS111∋TC⊥πËO1∗21RtS2wE6621 ν222ASi21DP“8λV∧W⋅OA2g6qNtNp1T269XA7¥11GGI6SEwU22S3Χ12!Okay let matt climbed in front door. Well then dropped the best she kissed +122C>Φ221 flQkWMŠtvo2dV1rT1ZtlN6R9dZ12LwuD19i3B5FdcÆl2eSwJd K1tDDfoX±evrýwlK7P÷i1e13v2zèCe¬Μ♣ΝrGhs2y172Y!gZpá R6O4O112∋r92Z1dB6i1e2σ∼ÓrCZ1s 122I31e2¤+⌉CêU 1k6wG1c‚1o60AJoR72sd3i11s22pt Ø277a2∀f5np¤n2duE8⇒ 21SHGJVAtew∇Lëtς2D2 6k28FgQQ⊂R81L2EI2∉iEHÍÉ3 H2r5Af1qximςρ‡r6©2jmWv92aW21giAC21lM⌋1k 2V2¸S2ùθ2h15BΙi∗ttEp8¢EPpSzWJi32U2n5ìIhgx8n⌉!j∏e5 +x1qJ>mC7f 512y1GA420lCQe09s9u%uksã ψ2X5A4g3nu←Τyst72pMhšg12e⟩pÚ1n1YƒŠtÉ2LGizqQ↓c3tÙI œïbXMKÛRSertj2d\"Ot2ss581!oo2i FÂW2EW2DDx7hI2pΦS2Bi2drUr⇔J<2a1Αzwt01p2i28R2oH21Än172r 1122DYvO7ak21ht204Πe∂λ11 12dUoο1X3fc631 e&∪GOxT3CvXcO1e3K2νr31y2 262z31∞I1 Pì∃zYt6F4e6è⇓va5229rkΘ32sKP5R!ιµmz +3212>22′L 2óB⊥S∩OQMeý∉2Φc229Tu2a∫dr25ûMeLk92 121OOø9oKnÿψÀWl7H2∅i9ρÈ2ni2•2eXPxí 1251SUqtBh72a5otSZ9p222Dpf1Ý2i2ωbjn11Ÿ2gs2h− bå2swx2oSiq8hvt2262h⌈b²S 26þSVBEFCi2Uàds9Ñ1Εa11ξ2,1„wv jw7AMK2↔la2G91s23«etuB2keDã2ìr1¨IeC¾EaÄao÷″∧r>6e1d9D21,mtS2 I∗44A1Rˆ2M98zME≅QŸÐX¹4j6 20n3a1'22nxpl6d832J 06Ð9E22ý2-2829c42r2h72¥med½♠kc23sPk12•r!⟩QCa Še21>1σ12 bpøNERN8eaD61ns7Abhy±12∩ D7sVR8'1Ee22DVfc˜32u72Æqnc23qd2∼4∇sρmi5 6212a21∝TnQb9sd1Mùℑ ∑gM22bN2¶4cä½⊆/4X1κ71f1z ϖ12ECzf•1uMbycs1•9¾ts0T2o3h2DmSs31e7B2Ér2⋅22 φ81″SSXð1uúI15p58uHp2c2±o∂T1Rrd6sMt∪1µξ!24Xb 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. - -[1] http://pxmzcgy.storeprescription.ru?zz=fkxffti -" +[1] http://pxmzcgy.storeprescription.ru?zz=fkxffti" }, }, { :data => IO.read('test/fixtures/mail21.box'), - :body_md5 => 'a232a7b7b29d20950b9f7b748137ba9d', + :body_md5 => 'f909a17fde261099903f3236f8755249', :params => { :from => 'Viagra Super Force Online ', :from_email => 'pharmacy_affordable1@ertelecom.ru', @@ -456,7 +422,7 @@ Wade to give it seemed like this. Yeah but one for any longer. Everything you go }, { :data => IO.read('test/fixtures/mail22.box'), - :body_md5 => '57cf207fb52f01f107ae008eb2f8d6cc', + :body_md5 => '9e79cb133d52afe9e18e8438df539305', :params => { :from => 'Gilbertina Suthar ', :from_email => 'ireoniqla@lipetsk.ru', @@ -470,16 +436,15 @@ Thinking of bed and whenever adam. Mike was too tired man to hear.I10PQSHEJl2Nwf˜2113S173 Î1mEbb5N371LϖC7AlFnR1♦HG64B242¦M2242zkΙN⌉7⌉TBNÐ T2xPIògI2ÃlL2ÕML⊥22SaΨ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. +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]†p1C?L I?C K?88 5 E R?EEOD !Chuckled adam leaned forward and le? charlie. +Men joined the pickup truck pulled away. Chuck could make sure that.[1] †p1C?L I?C K?88 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] http://аоск.рф?jmlfwnwe&ucwkiyyc -", +[1] http://аоск.рф?jmlfwnwe&ucwkiyyc", }, }, @@ -565,14 +530,14 @@ gate GmbH * Gladbacher Str. 74 * 40219 Düsseldorf }, { :data => IO.read('test/fixtures/mail27.box'), - :body_md5 => 'e1c06d85ae7b8b032bef47e42e4c08f9', + :body_md5 => 'd41d8cd98f00b204e9800998ecf8427e', :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 => "\n\n", + :body => "", }, :attachments => [ { @@ -609,8 +574,10 @@ gate GmbH * Gladbacher Str. 74 * 40219 Düsseldorf 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 diff --git a/test/unit/email_process_test.rb b/test/unit/email_process_test.rb index 89758b61a..1101e10b9 100644 --- a/test/unit/email_process_test.rb +++ b/test/unit/email_process_test.rb @@ -138,77 +138,43 @@ Some Text", :title => 'World Best DRUGS Mall For a Reasonable Price.', }, 1 => { - :body => '_________________________________________________________________________________Please beth saw his head + :body => "_________________________________________________________________________________Please beth saw his head -92hH3ÿoI221G1¿iH16u-2◊NQ422U1awAq¹JLZμ2IicgT1ζ2Y7⊆t 63‘M236E2Ý→DA2†I048CvJ9A↑3iTc4ÉIΥvXO502N1FJSð1r 154F1HPO11CRxZp tLîT9öXH1b3Es1W mN2Bg3õEbPŒS2fτTóY4 sU2P2ζΔRFkcI21™CÓZ3EΛRq!Cass is good to ask what that - -86Ë[1]2u2C L I C1K   H E R E28MLuke had been thinking about that. +92hH3ÿoI221G1¿iH16u-2◊NQ422U1awAq¹JLZμ2IicgT1ζ2Y7⊆t 63‘M236E2Ý→DA2†I048CvJ9A↑3iTc4ÉIΥvXO502N1FJSð1r 154F1HPO11CRxZp tLîT9öXH1b3Es1W mN2Bg3õEbPŒS2fτTóY4 sU2P2ζΔRFkcI21™CÓZ3EΛRq!Cass is good to ask what that +86Ë[1] 2u2C L I C1K 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. - -á•XMY2ÅEE12N°kP\'dÄ1S4⌉d √p¨HΣ>jE4y4AC22L2“vT∧4tHX1X: - -x5VV"1ti21aaΦ3fg¦z2r1°haeJw n1Va879sÆ3j f1ïl29lo5F1wν11 κψ›a9f4sLsL 2Vo$v3x1¸nz.u2¦1H4s3527 -yoQC1FMiMzda1ZεlÝHNi1c2s2–ϖ DYhaã7Ns421 n3dl1X1o11¶wpN↑ YQ7a239s1q2 QyL$fc21ΝS5.5Wy621d5Ä1H - -17∂ 3n6ax1Qs20b °Häl91ÑoÏ6aw≡d2 ΗÅ2a1Óvs⊃17 C⊆1$2Bz2sl2.∫Pb5ØMx0oQd - -ZΙμPCqmrµp0eAΦ♥dô‾Ωn∠2si4y2s28«o6∀ClDeÌoPbqnd1Jelè2 2ˆ5aWl⟨sbP2 2²2l8¢OoH¸ew’90 Υ66a21dsh6K r61$7Ey0Wc2.£—012C857Aþ -i1σS€53yxµ2n80ntΡΠmhç≡hrB1doµS1ih2rdOKK 712a←2Is2⌉V Cssl1´RoT1QwyÉΔ •∏∞a2YGs18E 1πx$04ò0gMF.bTQ3Íx6582ς - -Maybe even though she followed. -Does this mean you talking about. Whatever else to sit on them back - -←4BC32hAGAWNr2jAGυ»D1f4I2m√AHM9N⟩12 ‚1HD19ÜR23∨U90IG199S1∪”T123O2°cR0E⇑E211 42aA″XΝD14ℑVAK8A1d9Nr1DT112A5khGA3mE98ÔS9KC!5TU - -AMm>EjL w∗LWυIaoKd1rΘ22l2IΚdê5PwO4Hi2y6dÖH⌊eÃìg j14Dr15e700lH12iJ12vY…2e1mhr114yrÆ2!∑η2 21υOΔfδrKZwd4KVeB12rℜ01 PΖ2341o+A7Y 126GM17oGOºos7∑d272s18P ο♦QaRn–n5b2d02w 2rϒGI2ℑem0∀t1b2 20rF4O7R221E12⊆ESΥ4 KF0A212i5ïcrt⊆€mRJ7aNΛ2in26l5bQ 1ϒtSZbwh3¶3ig♠9p2″2p×12iK11nsWsgdXW!tBO - -m0W>Y2 b1u1xΔd03¯¬0vHK%21ó 674Aj32uQ←ÏtÈH1houqey1Yn221t⌋BZi1V2c1Tn >ZΓM222e311d2s5s22›!102 2¡2Em21x2V2p1∨6i2dârB9ra72mtSzIiMlVo0NLngΒû 22LD7⇑maNx3tUζ∪etc2 902o123fv49 w≅1O0giv12YeX2NryfT 3fP3xZ2 F2ÃY8q1eE1ÜaâyfrΜpls92Â!qκ2 - -î5A>∀pƒ ZµÍSδ32em2sc⊕7vu41JrÒ1we2yh qaρO2p¼nΣxZlrN1i♠2cnl4jeN1Q y2≅Sb63h17⟩of1ypÅA1pþh0iÔcbnec4gI21 h2Uw23‹i92ktS12h6V1 g1sVŒ2uipV1se2⋅a42V,T6D 228MΡY1a⊃ºΕs5ù2t9IDeFDℑrXpOCe“μan1Mr11Kd122,e27 DfmA21NM92hEU2∨XσψG 4j0a181nhTAdmT2 192Eνμr-U4fc121h8ª¸eoycc9xjk⁄ko!29K - +Maybe we can have anything you sure. +á•XMY2ÅEE12N°kP'dÄ1S4⌉d √p¨HΣ>jE4y4AC22L2“vT∧4tHX1X: +x5VV\"1ti21aaΦ3fg¦z2r1°haeJw n1Va879sÆ3j f1ïl29lo5F1wν11 κψ›a9f4sLsL 2Vo$v3x1¸nz.u2¦1H4s3527 yoQC1FMiMzda1ZεlÝHNi1c2s2–ϖ DYhaã7Ns421 n3dl1X1o11¶wpN↑ YQ7a239s1q2 QyL$fc21ΝS5.5Wy621d5Ä1H +17∂ 3n6ax1Qs20b °Häl91ÑoÏ6aw≡d2 ΗÅ2a1Óvs⊃17 C⊆1$2Bz2sl2.∫Pb5ØMx0oQd +ZΙμPCqmrµp0eAΦ♥dô‾Ωn∠2si4y2s28«o6∀ClDeÌoPbqnd1Jelè2 2ˆ5aWl⟨sbP2 2²2l8¢OoH¸ew’90 Υ66a21dsh6K r61$7Ey0Wc2.£—012C857Aþ i1σS€53yxµ2n80ntΡΠmhç≡hrB1doµS1ih2rdOKK 712a←2Is2⌉V Cssl1´RoT1QwyÉΔ •∏∞a2YGs18E 1πx$04ò0gMF.bTQ3Íx6582ς +Maybe even though she followed. Does this mean you talking about. Whatever else to sit on them back +←4BC32hAGAWNr2jAGυ»D1f4I2m√AHM9N⟩12 ‚1HD19ÜR23∨U90IG199S1∪”T123O2°cR0E⇑E211 42aA″XΝD14ℑVAK8A1d9Nr1DT112A5khGA3mE98ÔS9KC!5TU +AMm>EjL w∗LWυIaoKd1rΘ22l2IΚdê5PwO4Hi2y6dÖH⌊eÃìg j14Dr15e700lH12iJ12vY…2e1mhr114yrÆ2!∑η2 21υOΔfδrKZwd4KVeB12rℜ01 PΖ2341o+A7Y 126GM17oGOºos7∑d272s18P ο♦QaRn–n5b2d02w 2rϒGI2ℑem0∀t1b2 20rF4O7R221E12⊆ESΥ4 KF0A212i5ïcrt⊆€mRJ7aNΛ2in26l5bQ 1ϒtSZbwh3¶3ig♠9p2″2p×12iK11nsWsgdXW!tBO +m0W>Y2 b1u1xΔd03¯¬0vHK%21ó 674Aj32uQ←ÏtÈH1houqey1Yn221t⌋BZi1V2c1Tn >ZΓM222e311d2s5s22›!102 2¡2Em21x2V2p1∨6i2dârB9ra72mtSzIiMlVo0NLngΒû 22LD7⇑maNx3tUζ∪etc2 902o123fv49 w≅1O0giv12YeX2NryfT 3fP3xZ2 F2ÃY8q1eE1ÜaâyfrΜpls92Â!qκ2 +î5A>∀pƒ ZµÍSδ32em2sc⊕7vu41JrÒ1we2yh qaρO2p¼nΣxZlrN1i♠2cnl4jeN1Q y2≅Sb63h17⟩of1ypÅA1pþh0iÔcbnec4gI21 h2Uw23‹i92ktS12h6V1 g1sVŒ2uipV1se2⋅a42V,T6D 228MΡY1a⊃ºΕs5ù2t9IDeFDℑrXpOCe“μan1Mr11Kd122,e27 DfmA21NM92hEU2∨XσψG 4j0a181nhTAdmT2 192Eνμr-U4fc121h8ª¸eoycc9xjk⁄ko!29K 12…>J6Á 1⟩8EÖ22a141s117y3â8 1f2R6olewtzfw¹suýoQn⇓³³d24Gs¢7« AlDa1H1n9Ejdtg› 12θ2ε1⊇41″A/42v72z→ 231C622u56Xs9⁄1t∑ΙioxÉjm2R2e1W2rH25 o¥2S≥gmuX2gp3yip·12oD13rc3μ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. -[2] - -Это сообщение свободно от вирусов и вредоносного ПО благодаря [3]avast! Antivirus защита активна. +___ +[2] Это сообщение свободно от вирусов и вредоносного ПО благодаря [3] avast! Antivirus защита активна. [1] http://piufup.medicatingsafemart.ru [2] http://www.avast.com/ -[3] http://www.avast.com/ -', +[3] http://www.avast.com/", :sender => 'Customer', :type => 'email', :internal => false, @@ -231,16 +197,15 @@ Thinking of bed and whenever adam. Mike was too tired man to hear.I10PQSHEJl2Nwf˜2113S173 Î1mEbb5N371LϖC7AlFnR1♦HG64B242¦M2242zkΙN⌉7⌉TBNÐ T2xPIògI2ÃlL2ÕML⊥22SaΨ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. +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]†p1C?L I?C K?88 5 E R?EEOD !Chuckled adam leaned forward and le? charlie. +Men joined the pickup truck pulled away. Chuck could make sure that.[1] †p1C?L I?C K?88 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] http://аоск.рф?jmlfwnwe&ucwkiyyc -", +[1] http://аоск.рф?jmlfwnwe&ucwkiyyc", :sender => 'Customer', :type => 'email', :internal => false, @@ -2007,8 +1972,8 @@ Some Text', }, }, { - :data => 'From: somebody@example.com -To: bod@example.com + :data => 'From: Some Body +To: Bob Cc: any@example.com Subject: some subject @@ -2027,6 +1992,27 @@ Some Text', :internal => true, }, }, + :verify => { + :users => [ + { + :firstname => 'Some', + :lastname => 'Body', + :email => 'somebody@example.com', + }, + { + :firstname => 'Bob', + :lastname => '', + :fullname => 'Bob', + :email => 'bod@example.com', + }, + { + :firstname => '', + :lastname => '', + :email => 'any@example.com', + :fullname => 'any@example.com', + }, + ], + } }, ] process(files) @@ -2053,6 +2039,25 @@ Some Text', end } end + if file[:verify] + # verify if users are created + if file[:verify][:users] + file[:verify][:users].each { |user_result| + user = User.where(:email => user_result[:email]).first + if !user + assert( false, "No user '#{user_result[:email]}' found!" ) + return + end + user_result.each { |key,value| + if user.respond_to?( key ) + assert_equal( value, user.send(key), "user check #{ key }" ) + else + assert_equal( value, user[key], "user check #{ key }" ) + end + } + } + end + end else assert( false, 'ticket not created', file ) end diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index 2d57c882a..fa3667175 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -45,7 +45,7 @@ class UserTest < ActiveSupport::TestCase :name => '#3 - simple create - nil as lastname', :create => { :firstname => 'Firstname Lastname', - :lastname => nil, + :lastname => '', :email => 'some@example.com', :login => 'some@example.com', :updated_by_id => 1, @@ -114,8 +114,8 @@ class UserTest < ActiveSupport::TestCase { :name => '#7 - simple create - nill as fristname and lastname', :create => { - :firstname => nil, - :lastname => nil, + :firstname => '', + :lastname => '', :email => 'FIRSTNAME.lastname@example.com', :login => 'login-3', :updated_by_id => 1,
Best Tool of the World + some other text