diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index 46ebc897c..78aa10ad4 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.rb @@ -69,12 +69,22 @@ class Channel::EmailParser data[field.name.to_s.downcase.to_sym] = Encode.conv( 'utf8', field.to_s ) } + # get sender + from = nil + ['from', 'reply-to', 'return-path'].each { |item| + if !from + if mail[ item.to_sym ] + from = mail[ item.to_sym ].value + end + end + } + # set extra headers - data[:from_email] = Mail::Address.new( mail[:from].value ).address - data[:from_local] = Mail::Address.new( mail[:from].value ).local - data[:from_domain] = Mail::Address.new( mail[:from].value ).domain - data[:from_display_name] = Mail::Address.new( mail[:from].value ).display_name || - ( Mail::Address.new( mail[:from].value ).comments && Mail::Address.new( mail[:from].value ).comments[0] ) + data[:from_email] = Mail::Address.new( from ).address + data[:from_local] = Mail::Address.new( from ).local + data[:from_domain] = Mail::Address.new( from ).domain + data[:from_display_name] = Mail::Address.new( from ).display_name || + ( Mail::Address.new( from ).comments && Mail::Address.new( from ).comments[0] ) # do extra decoding because we needed to use field.value data[:from_display_name] = Mail::Field.new( 'X-From', data[:from_display_name] ).to_s diff --git a/test/fixtures/mail16.box b/test/fixtures/mail16.box new file mode 100644 index 000000000..44559e3b8 --- /dev/null +++ b/test/fixtures/mail16.box @@ -0,0 +1,148 @@ +From w2sjy@ns2.actionserv.com Tue Oct 29 03:52:03 2013 +Return-Path: +X-Original-To: info@znuny.com +Delivered-To: znuny-sales@arber.znuny.com +Received: from mail.sasscoyc.com (unknown [184.22.37.11]) + by arber.znuny.com (Postfix) with ESMTP id EB79D60039 + for ; Tue, 29 Oct 2013 03:52:02 +0100 (CET) +Date: Sun, 8 Dec 2013 08:40:11 +0800 +To: "enterprisemobility.apacservice" +Reply-To: +Subject: =?GB2312?B?ob4g1rHNqMPAufrFxcP7tdo0ObTz0acgs8m5prrzuLa30SChvw==?= +MIME-Version: 1.0 +X-Priority: 3 +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook Express 6.00.2800.1158 +Content-Type: text/html; + charset="GB2312" +Content-Transfer-Encoding: base64 +Content-Disposition: inline +X-UID: 230 +Status: RO +Content-Length: 9411 +Lines: 123 + +PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv +L0VOIj4NCjxIVE1MPjxIRUFEPjxUSVRMRT7Qwr2ozfjSsyAzPC9USVRMRT4NCjxNRVRBIGh0dHAt +ZXF1aXY9Q29udGVudC1MYW5ndWFnZSBjb250ZW50PXpoLWNuPg0KPE1FVEEgaHR0cC1lcXVpdj1D +b250ZW50LVR5cGUgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PWdiayI+DQo8TUVUQSBjb250 +ZW50PSJNU0hUTUwgNi4wMC4yODAwLjExMDYiIG5hbWU9R0VORVJBVE9SPjwvSEVBRD4NCjxCT0RZ +PjxTUEFOIHN0eWxlPSJGT05ULVNJWkU6IDE1cHQ7IENPTE9SOiBibHVlOyBGT05ULUZBTUlMWTog +y87M5SI+DQo8RElWPjxGT05UIGNvbG9yPWJsYWNrIHNpemU9Mj7E+rrDo6zV4rfi0MXI57n707DP +7LW9xPq1xMn6u+66zbmk1/ejrM7Sw8fP8sT6s8+/0rXEtcDHuKGjPC9GT05UPjwvRElWPg0KPERJ +Vj48Rk9OVCBjb2xvcj1ibGFjayBzaXplPTI+xPq72Li0tMvTys/kvLS/yc3LtqmjrNLUuvO++LbU +sru74dTZtM7K1bW9o6w8L0ZPTlQ+PC9ESVY+DQo8RElWPjxGT05UIGNvbG9yPWJsYWNrPjxGT05U +IGZhY2U9utrM5SANCnNpemU9Mz48U1RST05HPtTZtM7Xo7ijxPq5pNf3y7PA+6Osu+nS9sPAwvqj +rLzSzaXQ0rijo6zJ+tLi0MvCoaGjPC9TVFJPTkc+PC9GT05UPiA8L0ZPTlQ+PC9ESVY+DQo8RElW +PiZuYnNwOzwvRElWPjwvU1BBTj4NCjxQIGNsYX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email_parser_test.rb b/test/unit/email_parser_test.rb index 4092e5fe5..66a1076b3 100644 --- a/test/unit/email_parser_test.rb +++ b/test/unit/email_parser_test.rb @@ -314,6 +314,18 @@ Hof :to => 'info42@znuny.com', }, }, + # spam email + { + :data => IO.read('test/fixtures/mail16.box'), + :body_md5 => 'b255fb5620db3b63131924513061d974', + :params => { + :from => nil, + :from_email => 'vipyimin@126.com', + :from_display_name => "", + :subject => '【 直通美国排名第49大学 成功后付费 】', + :to => '"enterprisemobility.apacservice" ', + }, + }, ] files.each { |file|