2012-05-06 20:48:23 +00:00
|
|
|
|
# encoding: utf-8
|
|
|
|
|
require 'test_helper'
|
2014-06-08 03:11:21 +00:00
|
|
|
|
|
2012-05-06 20:48:23 +00:00
|
|
|
|
class EmailProcessTest < ActiveSupport::TestCase
|
2014-06-08 15:14:51 +00:00
|
|
|
|
test 'process simple' do
|
2012-05-06 20:48:23 +00:00
|
|
|
|
files = [
|
|
|
|
|
{
|
|
|
|
|
:data => 'From: me@example.com
|
|
|
|
|
To: customer@example.com
|
|
|
|
|
Subject: some subject
|
|
|
|
|
|
|
|
|
|
Some Text',
|
2014-06-08 15:14:51 +00:00
|
|
|
|
:trusted => false,
|
2012-05-06 20:48:23 +00:00
|
|
|
|
:success => true,
|
|
|
|
|
},
|
2012-12-05 00:28:04 +00:00
|
|
|
|
{
|
|
|
|
|
:data => "From: me@example.com
|
|
|
|
|
To: customer@example.com
|
|
|
|
|
Subject: äöü some subject
|
|
|
|
|
|
2013-09-25 13:58:25 +00:00
|
|
|
|
Some Textäöü",
|
2014-06-08 15:14:51 +00:00
|
|
|
|
:trusted => false,
|
2012-12-05 00:28:04 +00:00
|
|
|
|
:success => true,
|
|
|
|
|
:result => {
|
|
|
|
|
0 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:priority => '2 normal',
|
|
|
|
|
:title => 'äöü some subject',
|
2012-12-05 00:28:04 +00:00
|
|
|
|
},
|
|
|
|
|
1 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:body => 'Some Textäöü',
|
|
|
|
|
:sender => 'Customer',
|
|
|
|
|
:type => 'email',
|
|
|
|
|
:internal => false,
|
2012-12-05 00:28:04 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2013-09-25 13:58:25 +00:00
|
|
|
|
{
|
|
|
|
|
:data => "From: me@example.com
|
|
|
|
|
To: customer@example.com
|
|
|
|
|
Subject: äöü some subject
|
|
|
|
|
|
|
|
|
|
Some Textäöü".encode("ISO-8859-1"),
|
|
|
|
|
:success => true,
|
|
|
|
|
:result => {
|
|
|
|
|
0 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:priority => '2 normal',
|
|
|
|
|
:title => '', # should be äöü some subject, but can not be parsed from mime tools
|
2013-09-25 13:58:25 +00:00
|
|
|
|
},
|
|
|
|
|
1 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:body => 'Some Textäöü',
|
|
|
|
|
:sender => 'Customer',
|
|
|
|
|
:type => 'email',
|
|
|
|
|
:internal => false,
|
2013-11-14 13:16:57 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
:data => "From: me@example.com
|
|
|
|
|
To: customer@example.com
|
|
|
|
|
Subject: Subject: =?utf-8?B?44CQ5LiT5Lia5Li65oKo5rOo5YaM6aaZ5riv5Y+K5rW35aSW5YWs5Y+477yI5aW95aSE5aSa5aSa77yJ?=
|
|
|
|
|
=?utf-8?B?44CR44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA44CA?=
|
|
|
|
|
=?utf-8?B?44CA44CA44CA44CA44CA44CA44CA44CA5Lq654mpICAgICAgICAgIA==?=
|
|
|
|
|
=?utf-8?B?ICAgICAgICAgIOS6kuiBlOe9keS6i+eZvuW6puaWsOmXu+eLrOWutg==?=
|
|
|
|
|
=?utf-8?B?5Ye65ZOB5Lyg5aqS5o2i5LiA5om55o235YWL5oi057u05pav5p2v5Yaz6LWb5YmN5Lu75ZG95Li05pe2?=
|
|
|
|
|
=?utf-8?B?6aKG6ZifIOWJjemihumYn+WboOeXheS9j+mZouacgOaWsDrnm5bkuJbmsb3ovaborq8gMQ==?=
|
|
|
|
|
=?utf-8?B?MeaciDbml6XvvIzpgJrnlKjmsb3ovablrqPluIPku4rlubQxMOaciOS7veWcqOWNjumUgA==?=
|
|
|
|
|
=?utf-8?B?6YePLi4u5YeP5oyB5LiJ54m557Si6YGTIOWtn+WHr+WwhuWFqOWKm+WPkeWxlea5mOmEgg==?=
|
|
|
|
|
=?utf-8?B?5oOF5rGf6Z2S5pGE5b2x5L2c5ZOB56eR5oqA5pel5oql6K6vIO+8iOiusOiAhei/h+WbveW/oCA=?=
|
|
|
|
|
=?utf-8?B?6YCa6K6v5ZGY6ZmI6aOe54eV77yJ5rGf6IuP55yB5peg57q/55S156eR5a2m56CU56m25omA5pyJ6ZmQ?=
|
|
|
|
|
=?utf-8?B?5YWs5Y+46Zmi5aOr5bel5L2c56uZ5pel5YmN5q2j5byP5bu6Li4uW+ivpue7hl0=?=
|
|
|
|
|
|
|
|
|
|
Some Text",
|
2014-06-08 15:14:51 +00:00
|
|
|
|
:trusted => false,
|
2013-11-14 13:16:57 +00:00
|
|
|
|
:success => true,
|
|
|
|
|
:result => {
|
|
|
|
|
0 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:priority => '2 normal',
|
|
|
|
|
:title => '【专业为您注册香港及海外公司(好处多多)】 ',
|
2013-11-14 13:16:57 +00:00
|
|
|
|
},
|
|
|
|
|
1 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:body => 'Some Text',
|
|
|
|
|
:sender => 'Customer',
|
|
|
|
|
:type => 'email',
|
2013-09-25 13:58:25 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2014-08-06 11:41:10 +00:00
|
|
|
|
{
|
|
|
|
|
:data => IO.read('test/fixtures/mail21.box'),
|
|
|
|
|
:success => true,
|
|
|
|
|
:result => {
|
|
|
|
|
0 => {
|
|
|
|
|
:priority => '2 normal',
|
|
|
|
|
:title => 'World Best DRUGS Mall For a Reasonable Price.',
|
|
|
|
|
},
|
|
|
|
|
1 => {
|
|
|
|
|
: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.
|
|
|
|
|
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<V401i421aθ1Tg21Gr9E2aΡBw →2ÖSRSLu72lpL6Ve191r1HL FEpA229cP¬ltÒcDib2XvTtFel3®+bVM 252aXWas4º2 μ2Kl∏7mo√23wSg1 ι£Ca11Xso18 1L2$…412Jo↑.0Λa53iè55W2
|
|
|
|
|
23IV4◊9iF2Va2Õóg8³9r℘buaf12 fc7Pg3⊆rzç8o2−⋅fÿ≥ZeaPÑs5⇐TsiΨ∋i92uoU8RnΨ⌉•aw1flf22 TQNaU›ésvDu B1Il6Θlo∠HfwNX8 36Xa∼α1sT1d ŠHG$2õ13QW1.‰›Y52g80¦ao
|
|
|
|
|
|
|
|
|
|
LKNV0ÄwiM4xafsJgFJ2r27”a⇐M2 ∠O5SQ2Mut21p2ÅÃe¨2HrZ41 1UΛF¨Tso2wXr24Icky2e1qY 074a2l⌊s2H1 42pl24Xob0aw4FÔ 28∴a70lsA30 ßWF$Z¸v4AEG.2612t9p5¶1Q
|
|
|
|
|
M91Cε92i0qPa1A2lW5Pi5Vusi8ë 2O0SE2Eu2∈2p2Y3eTs6r622 l12Ay2jcQpet13õiiqXvPVOe81V+1“G 126a1Π7sJ2g 1J2l♥Š1o2olwBV2 →Amaη2¯sa22 H22$2Ef2∈n5.Œ8H95119⊃ƒ2
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
Ú2eAC2øNË1UT3L♠ICë9-BŒfAoÓCL5Β2LHοNE5∂7RScdGX11IpΣuCCw∨/D16A1v2S0d⊂T1'BHf2ΔM227A63B:
|
|
|
|
|
|
|
|
|
|
2U2V51Ue212nRm2t22Ooγ12ly¼Wi6pxnÀZ1 c2Sa8ï1sG2⊂ ΜJll1£„onb2w⌉ö1 vY8aΘmgs024 å¥G$1592KkU11b0.½Âℜ54Èh0º1h
|
|
|
|
|
Zf1A0j¸dc1ξv™Xpagl2ib8YrSf0 1Wia141s1×7 TAwll1dom1Gw2¿z Β21aˆy2sN8η 3oo$D012Λp14c2z.PA∅9ϒ7354ú9
|
|
|
|
|
|
|
|
|
|
R2íNn¨2aYRøs≅←ÍoPÀynCΧ1ef2ox2∪h E18aN22siÿ5 f47l147oF1jwG2É 108a1edsjÛS ¿e1$KèR1LD272oè.41O99Ý192ϖn
|
|
|
|
|
12↵Sι3”pÝ2‾iEuerΓy0iY30vΤA6a2"Y 465a1m6sg1s C∀ilΑ2Πor6yw712 1KΩa232s∇Δ1 9Χ9$MWN2P02822β.2∩S93220RQ’
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
2²2Gu8NEZ3FNFs2E1RnRÇC9AK4xL151 25bH97CE«20A2q¢L1k→TªJkHe3š:Taking care about matt li ed ryan. Knowing he should be there.
|
|
|
|
|
|
|
|
|
|
Ks£T2bIr74Ea2DZmœH1a17od1∪vo2ozlP3S 23‹azy∝sÚ1Q 42¹ll21ovh7w2D2 1Qwa⇑cΒs¨wH Iµe$⇐J517T2.t5f361B062Ψ
|
|
|
|
|
5z℘Z4nGi289t←f4hvn2rbŸTo1s9m12qand1xxO6 I2∪ak½0s21M 2Η¡l22¾orztw170 —♣≅ar6qsvDv 76T$3×D0erÍ.d107WoI51K2
|
|
|
|
|
|
|
|
|
|
ϒa9P'1¯rP74o2ψ2zχf2aÃ2ñc3qY →®7aaRgsN1k 1‰Σl2p1o7R⊂wÆ2e 3Iha♣d˜s3g7 23M$≡⋅10AY4.Uq√321k5SUΜ
|
|
|
|
|
Zr2A8Ö6cZŸdoΡeumpq1pAoUl2I2ieY2aK>∂ 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 защита активна.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[1] http://piufup.medicatingsafemart.ru
|
|
|
|
|
[2] http://www.avast.com/
|
|
|
|
|
[3] http://www.avast.com/
|
|
|
|
|
',
|
|
|
|
|
:sender => 'Customer',
|
|
|
|
|
:type => 'email',
|
|
|
|
|
:internal => false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
:data => IO.read('test/fixtures/mail22.box'),
|
|
|
|
|
:success => true,
|
|
|
|
|
:result => {
|
|
|
|
|
0 => {
|
|
|
|
|
:priority => '2 normal',
|
|
|
|
|
:title => 'P..E..N-I..S__-E N L A R-G E-M..E..N T-___P..I-L-L..S...Info.',
|
|
|
|
|
},
|
|
|
|
|
1 => {
|
|
|
|
|
: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˜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.
|
|
|
|
|
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.
|
|
|
|
|
Just then returned to believe it here.
|
|
|
|
|
Freemont and pulling out several minutes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[1] http://аоск.рф?jmlfwnwe&ucwkiyyc
|
|
|
|
|
",
|
|
|
|
|
:sender => 'Customer',
|
|
|
|
|
:type => 'email',
|
|
|
|
|
:internal => false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2012-05-06 20:48:23 +00:00
|
|
|
|
]
|
2014-06-08 15:14:51 +00:00
|
|
|
|
process(files)
|
|
|
|
|
end
|
|
|
|
|
test 'process trusted' do
|
|
|
|
|
files = [
|
|
|
|
|
{
|
|
|
|
|
:data => 'From: me@example.com
|
|
|
|
|
To: customer@example.com
|
|
|
|
|
Subject: some subject
|
|
|
|
|
X-Zammad-Ignore: true
|
2012-05-06 20:48:23 +00:00
|
|
|
|
|
2014-06-08 15:14:51 +00:00
|
|
|
|
Some Text',
|
|
|
|
|
:trusted => true,
|
|
|
|
|
:success => false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
:data => 'From: me@example.com
|
|
|
|
|
To: customer@example.com
|
|
|
|
|
Subject: some subject
|
2014-06-08 22:01:20 +00:00
|
|
|
|
X-Zammad-Ticket-priority: 3 high
|
|
|
|
|
X-Zammad-Article-sender: System
|
|
|
|
|
x-Zammad-Article-type: phone
|
2014-06-08 15:14:51 +00:00
|
|
|
|
x-Zammad-Article-Internal: true
|
|
|
|
|
|
|
|
|
|
Some Text',
|
|
|
|
|
:trusted => true,
|
|
|
|
|
:success => true,
|
|
|
|
|
:result => {
|
|
|
|
|
0 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:priority => '3 high',
|
|
|
|
|
:title => 'some subject',
|
2014-06-08 15:14:51 +00:00
|
|
|
|
},
|
|
|
|
|
1 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:sender => 'System',
|
|
|
|
|
:type => 'phone',
|
|
|
|
|
:internal => true,
|
2014-06-08 15:14:51 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
process(files)
|
2014-06-08 03:11:21 +00:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test 'process not trusted' do
|
|
|
|
|
files = [
|
|
|
|
|
{
|
|
|
|
|
:data => 'From: me@example.com
|
|
|
|
|
To: customer@example.com
|
|
|
|
|
Subject: some subject
|
2014-06-08 22:01:20 +00:00
|
|
|
|
X-Zammad-Ticket-Priority: 3 high
|
|
|
|
|
X-Zammad-Article-Sender: System
|
|
|
|
|
x-Zammad-Article-Type: phone
|
2014-06-08 03:11:21 +00:00
|
|
|
|
x-Zammad-Article-Internal: true
|
|
|
|
|
|
|
|
|
|
Some Text',
|
2014-06-08 15:14:51 +00:00
|
|
|
|
:trusted => false,
|
2014-06-08 03:11:21 +00:00
|
|
|
|
:success => true,
|
|
|
|
|
:result => {
|
|
|
|
|
0 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:priority => '2 normal',
|
|
|
|
|
:title => 'some subject',
|
2014-06-08 03:11:21 +00:00
|
|
|
|
},
|
|
|
|
|
1 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:sender => 'Customer',
|
|
|
|
|
:type => 'email',
|
|
|
|
|
:internal => false,
|
2014-06-08 03:11:21 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]
|
2014-06-08 15:14:51 +00:00
|
|
|
|
process(files)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test 'process with postmaster filter' do
|
2014-06-08 16:52:18 +00:00
|
|
|
|
group = Group.create_if_not_exists(
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:name => 'Test Group',
|
2014-06-08 16:52:18 +00:00
|
|
|
|
:created_by_id => 1,
|
|
|
|
|
:updated_by_id => 1,
|
|
|
|
|
)
|
2014-06-08 15:14:51 +00:00
|
|
|
|
PostmasterFilter.destroy_all
|
|
|
|
|
PostmasterFilter.create(
|
|
|
|
|
:name => 'not used',
|
|
|
|
|
:match => {
|
|
|
|
|
:from => 'nobody@example.com',
|
|
|
|
|
},
|
|
|
|
|
:perform => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
'X-Zammad-Ticket-priority' => '3 high',
|
2014-06-08 15:14:51 +00:00
|
|
|
|
},
|
|
|
|
|
:channel => 'email',
|
|
|
|
|
:active => true,
|
|
|
|
|
:created_by_id => 1,
|
|
|
|
|
:updated_by_id => 1,
|
|
|
|
|
)
|
|
|
|
|
PostmasterFilter.create(
|
|
|
|
|
:name => 'used',
|
|
|
|
|
:match => {
|
|
|
|
|
:from => 'me@example.com',
|
|
|
|
|
},
|
|
|
|
|
:perform => {
|
2014-06-08 16:52:18 +00:00
|
|
|
|
'X-Zammad-Ticket-group_id' => group.id,
|
2014-06-08 15:14:51 +00:00
|
|
|
|
'x-Zammad-Article-Internal' => true,
|
|
|
|
|
},
|
|
|
|
|
:channel => 'email',
|
|
|
|
|
:active => true,
|
|
|
|
|
:created_by_id => 1,
|
|
|
|
|
:updated_by_id => 1,
|
|
|
|
|
)
|
|
|
|
|
PostmasterFilter.create(
|
|
|
|
|
:name => 'used x-any-recipient',
|
|
|
|
|
:match => {
|
|
|
|
|
'x-any-recipient' => 'any@example.com',
|
|
|
|
|
},
|
|
|
|
|
:perform => {
|
|
|
|
|
'X-Zammad-Ticket-group_id' => 2,
|
|
|
|
|
'x-Zammad-Article-Internal' => true,
|
|
|
|
|
},
|
|
|
|
|
:channel => 'email',
|
|
|
|
|
:active => true,
|
|
|
|
|
:created_by_id => 1,
|
|
|
|
|
:updated_by_id => 1,
|
|
|
|
|
)
|
|
|
|
|
files = [
|
|
|
|
|
{
|
|
|
|
|
:data => 'From: me@example.com
|
|
|
|
|
To: customer@example.com
|
|
|
|
|
Subject: some subject
|
|
|
|
|
|
|
|
|
|
Some Text',
|
|
|
|
|
:trusted => false,
|
|
|
|
|
:success => true,
|
|
|
|
|
:result => {
|
|
|
|
|
0 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:group => group.name,
|
|
|
|
|
:priority => '2 normal',
|
|
|
|
|
:title => 'some subject',
|
2014-06-08 15:14:51 +00:00
|
|
|
|
},
|
|
|
|
|
1 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:sender => 'Customer',
|
|
|
|
|
:type => 'email',
|
|
|
|
|
:internal => true,
|
2014-06-08 15:14:51 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
:data => 'From: somebody@example.com
|
|
|
|
|
To: bod@example.com
|
|
|
|
|
Cc: any@example.com
|
|
|
|
|
Subject: some subject
|
|
|
|
|
|
|
|
|
|
Some Text',
|
|
|
|
|
:trusted => false,
|
|
|
|
|
:success => true,
|
|
|
|
|
:result => {
|
|
|
|
|
0 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:group => 'Twitter',
|
|
|
|
|
:priority => '2 normal',
|
|
|
|
|
:title => 'some subject',
|
2014-06-08 15:14:51 +00:00
|
|
|
|
},
|
|
|
|
|
1 => {
|
2014-06-08 22:01:20 +00:00
|
|
|
|
:sender => 'Customer',
|
|
|
|
|
:type => 'email',
|
|
|
|
|
:internal => true,
|
2014-06-08 15:14:51 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
process(files)
|
|
|
|
|
PostmasterFilter.destroy_all
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def process(files)
|
2014-06-08 03:11:21 +00:00
|
|
|
|
files.each { |file|
|
|
|
|
|
parser = Channel::EmailParser.new
|
2014-06-08 15:14:51 +00:00
|
|
|
|
result = parser.process( { :trusted => file[:trusted] }, file[:data] )
|
|
|
|
|
if file[:success]
|
|
|
|
|
if result && result.class == Array && result[1]
|
|
|
|
|
assert( true )
|
|
|
|
|
if file[:result]
|
|
|
|
|
[ 0, 1, 2 ].each { |level|
|
|
|
|
|
if file[:result][level]
|
|
|
|
|
file[:result][level].each { |key, value|
|
|
|
|
|
if result[level].send(key).respond_to?('name')
|
2014-08-06 11:41:10 +00:00
|
|
|
|
assert_equal( value.to_s, result[level].send(key).name )
|
2014-06-08 15:14:51 +00:00
|
|
|
|
else
|
2014-08-06 11:41:10 +00:00
|
|
|
|
assert_equal( value, result[level].send(key))
|
2014-06-08 15:14:51 +00:00
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
assert( false, 'ticket not created', file )
|
|
|
|
|
end
|
|
|
|
|
elsif !file[:success]
|
|
|
|
|
if result && result.class == Array && result[1]
|
|
|
|
|
puts result.inspect
|
|
|
|
|
assert( false, 'ticket should not be created but is created' )
|
|
|
|
|
else
|
|
|
|
|
assert( true, 'ticket not created - nice' )
|
2012-05-06 20:48:23 +00:00
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
assert( false, 'UNKNOWN!' )
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
2014-06-08 15:14:51 +00:00
|
|
|
|
end
|