2013-10-02 09:47:41 -04:00
define ( function ( require ) {
'use strict' ;
2014-06-11 03:42:34 -04:00
var expect = chai . expect ,
ImapClient = require ( 'imap-client' ) ,
BrowserCrow = require ( 'browsercrow' ) ,
BrowserSMTP = require ( 'browsersmtp' ) ,
SmtpClient = require ( 'smtpclient' ) ,
appController = require ( 'js/app-controller' ) ,
mailreader = require ( 'mailreader' ) ,
openpgp = require ( 'openpgp' ) ,
PgpMailer = require ( 'pgpmailer' ) ;
2013-10-02 09:47:41 -04:00
describe ( 'Email DAO integration tests' , function ( ) {
2014-06-11 03:42:34 -04:00
this . timeout ( 100000 ) ;
chai . Assertion . includeStack = true ;
2013-10-02 09:47:41 -04:00
2014-06-11 03:42:34 -04:00
var emailDao , imapClient , imapMessages , imapFolders , imapServer , smtpServer , smtpClient , userStorage ,
mockKeyPair ;
2013-10-02 09:47:41 -04:00
2014-06-11 03:42:34 -04:00
var testAccount = {
user : 'safewithme.testuser@gmail.com' ,
pass : 'passphrase' ,
xoauth2 : 'testtoken'
} ;
2013-10-02 09:47:41 -04:00
2014-06-11 03:42:34 -04:00
beforeEach ( function ( done ) {
2013-10-02 09:47:41 -04:00
2014-06-11 03:42:34 -04:00
imapMessages = [ {
raw : 'Message-id: <a>\r\nSubject: hello 1\r\n\r\nWorld 1!' ,
internaldate : '14-Sep-2013 21:22:28 -0300' ,
uid : 500
} , {
raw : 'Message-id: <b>\r\nSubject: hello 2\r\n\r\nWorld 2!' ,
flags : [ '\\Seen' ] ,
uid : 600
} , {
raw : 'Message-id: <c>\r\nSubject: hello 3\r\n\r\nWorld 3!'
} , {
raw : 'From: sender name <sender@example.com>\r\n' +
'To: Receiver name <receiver@example.com>\r\n' +
'Subject: hello 4\r\n' +
'Message-Id: <d>\r\n' +
'Date: Fri, 13 Sep 2013 15:01:00 +0300\r\n' +
'\r\n' +
'World 4!'
} , {
raw : 'Message-id: <e>\r\nSubject: hello 5\r\n\r\nWorld 5!'
} , {
raw : 'Message-id: <f>Subject: hello 6\r\n\r\nWorld 6!'
} , {
raw : ' Message - id : < g > \ nFrom : safewithme . testuser @ gmail . com \ nTo : safewithme . testuser @ gmail . com \ nSubject : enigmail encrypted pgp / mime with attachment \ nContent - Type : multipart / encrypted ; \ n protocol = \ "application/pgp-encrypted\";\n boundary=\"abc\"\n\nThis is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)\n--abc\nContent-Type: application/pgp-encrypted\nContent-Description: PGP/MIME version identification\n\nVersion: 1\n\n--abc\nContent-Type: application/octet-stream; name=\"encrypted.asc\"\nContent-Description: OpenPGP encrypted message\nContent-Disposition: inline; filename=\"encrypted.asc\" \ n \ n -- -- - BEGIN PGP MESSAGE -- -- - \ nVersion : GnuPG / MacGPG2 v2 . 0.22 ( Darwin ) \ nComment : GPGTools - http : //gpgtools.org\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\nhQEMA9f7k/zfv8I8AQf/XY1dJfGWb2iU0GYhZLNXkXoi7k4pnWSbRKQoVcEFoYpz\niltbJo70U6rdRziUO2VnGzsdnyi+NtpaZSXdxAKrE2KxQsPwNUziBWyTCL9WyAa/\nz9L5PldfK7H1o8C9CqC3LU6Ppwafaw2WImbPgnvwvuSD+BeAJlPQ9QyzhKmG8faq\nG67yMLm76kP1zKiEacIZng4ilGQ+K5cy43ryod/7HNQWUkHXt/E4YJXzjyNOXzYh\n5r2fbz0OIYcyFIuAIDqzDG5wtGmRc/6qVkUVdOs+H3RPCFPJjPUsRdH5kW6uiHQ2\nMMr5blSzWt0Q7cIqlZJgoMRte3VGEy0ED/oJZaIo3Mnst2ue5uIc5j6Q31nJCvJt\nY37ldHgrN+RpU6pcSjLgfkntjw5nQaV+KnNoB4BpKhODYMVZIuA8TivgVjpDFDgu\n8X/X0gMXD8l6hqMGP48g7etD+poYDWUp5DnsjuyNo2uFXDRyO5GZLM31jh2pIiQw\neoOmijPWy2/CSuMV6swNMbUryhp1idrujC5ggKeLBYARefDKD1T40PUFV88THCyL\n2NPZY1XKp2NIMH+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XSqXMOdusGbISLItQZyUnPpicOgd\nAHJoIVf1QaTTfal/ozvAFuhxJtVFFa1F3UotXD3DaYDfczLYeq/NtNT3LoZ94PIr\nWpxznhaxZICABGeiBgRemJtPeBrO68hdZAV+2hSgSNyK0gzGlRv95ql0JmBSVK3S\nfPJCimDNoynasdCM68Av0GB/AHr4rT5PQd0UQyRmPvh4+lD6CHGWMZoYqjDvMM5n\nqv1h/Cwt/nKk68Ehi1tzbOHup3TT0jZC811FyYKvHwLT0rVJxJgn93MnSgkwJbVs\nhEfdYZee1dTFlaLFOCB5llGYyTae60Gp8qppz9Xr3jdk+ertl7GjG/IUvU8K56Si\nHKDPWLd/8uSeajKYHthwAKAlYbXQrNpUgozaQjt7G9NbqdWfT1NOsmCSCFOCDjOs\nTTJ21dz5f4pk6j1GNNAe20iJXBayPplCaG/GxneY1V+0t2UTwF1DaqhLLb1PZ0k9\n9ejZuwqRXFReFx+DLSUMTNsxYOekHVdAEBkti5vzfqLUc6f3LZ4cZV5+COi
internaldate : '14-Sep-2013 20:22:28 -0300' ,
uid : 800
} , {
raw : "Message-id: <h>\nFrom: safewithme.testuser@gmail.com\nTo: safewithme.testuser@gmail.com\nSubject: enigmail encrypted signed pgp/mime with attachment\nContent-Type: multipart/encrypted;\n protocol=\"application/pgp-encrypted\";\n boundary=\"abc\"\n\nThis is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)\n--abc\nContent-Type: application/pgp-encrypted\nContent-Description: PGP/MIME version identification\n\nVersion: 1\n\n--abc\nContent-Type: application/octet-stream; name=\"encrypted.asc\"\nContent-Description: OpenPGP encrypted message\nContent-Disposition: inline; filename=\"encrypted.asc\" \ n \ n -- -- - BEGIN PGP MESSAGE -- -- - \ nVersion : GnuPG / MacGPG2 v2 . 0.22 ( Darwin ) \ nComment : GPGTools - http : //gpgtools.org\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\nhQELA9f7k/zfv8I8AQf3WUkThZZkrDcKyCmrnWoUC75EKDD6L9R40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sep-2013 22:22:28 -0300' ,
uid : 801
2014-06-25 09:03:50 -04:00
} , {
raw : ' Delivered - To : throwaway . felix @ gmail . com \ r \ nReceived : by 10.42 . 174.3 with SMTP id t3csp241492icz ; \ r \ n Wed , 25 Jun 2014 05 : 45 : 10 - 0700 ( PDT ) \ r \ nX - Received : by 10.180 . 20.206 with SMTP id p14mr10320792wie . 26.1403700309809 ; \ r \ n Wed , 25 Jun 2014 05 : 45 : 09 - 0700 ( PDT ) \ r \ nReturn - Path : < mail @ felixhammerl . com > \ r \ nReceived : from mail - wi0 - f172 . google . com ( mail - wi0 - f172 . google . com [ 209.85 . 212.172 ] ) \ r \ n by mx . google . com with ESMTPS id d9si4992982wje . 76.2014 . 06.25 . 05.44 . 59 \ r \ n for < throwaway . felix @ gmail . com > \ r \ n ( version = TLSv1 cipher = ECDHE - RSA - RC4 - SHA bits = 128 / 128 ) ; \ r \ n Wed , 25 Jun 2014 05 : 44 : 59 - 0700 ( PDT ) \ r \ nReceived - SPF : pass ( google . com : domain of mail @ felixhammerl . com designates 209.85 . 212.172 as permitted sender ) client - ip = 209.85 . 212.172 ; \ r \ nAuthentication - Results : mx . google . com ; \ r \ n spf = pass ( google . com : domain of mail @ felixhammerl . com designates 209.85 . 212.172 as permitted sender ) smtp . mail = mail @ felixhammerl . com \ r \ nReceived : by mail - wi0 - f172 . google . com with SMTP id hi2so7776737wib . 11 \ r \ n for < throwaway . felix @ gmail . com > ; Wed , 25 Jun 2014 05 : 44 : 59 - 0700 ( PDT ) \ r \ nX - Google - DKIM - Signature : v = 1 ; a = rsa - sha256 ; c = relaxed / relaxed ; \ r \ n d = 1e100 . net ; s = 20130820 ; \ r \ n h = x - gm - message - state : from : content - type : subject : message - id : date : to \ r \ n : mime - version ; \ r \ n bh = s4NMXN5u + JHQKeYuoCYcsqfFEEqH1GauOiEzb6O3ma0 = ; \ r \ n b = khBrYuEYLBy6IZOWmdXQi4lvi9PhH67 + zvkfZUJ5aV / SyWZUHNsuXsnJThI0Fj7Xbx \ r \ n XbeSDiZCJhD1XZgkVoERUmKFIgRmQURgm44SC6ZgBgDJvHXB2gVapPUAPIWIM9S8OuqH \ r \ n n5YKWob9M4GO6jV5WrTGx + tiDP6GiRO0dM4 / nGe + MC + xAvVMPtqESxhNu6L6gGXJHVXC \ r \ n XMVx6ZP64SsLrFOCEqGCea49bPi7ee474nT + uL2zNc69fbpkqdRzRGSrru + 11 Buf6ZDV \ r \ n gcTsA9Xrmpy0DwIUxkIDyyxaEgAMc9qnprM2f0CYuub26RnSryeLCdX4KRfcQaVEFKTd \ r \ n 38 AQ == \ r \ nX - Gm - Message - State : ALoCoQmv6i9holEFjurNeEf5WgK5j3TDeENKMSkaBtsR08RK6tt9BShN8lvr0y0ktwghZqRf6823 \ r \ nX - Received : by 10.194 . 174.35 with SMTP id bp3mr1720884wjc . 33.1403700299213 ; \ r \ n Wed , 25 Jun 2014 05 : 44 : 59 - 0700 ( PDT ) \ r \ nReturn - Path : < mail @ felixhammerl . com > \ r \ nReceived : from [ 192.168 . 16.29 ] ( host - 88 - 217 - 174 - 118. customer . m - online . net . [ 88.217 . 174.118 ] ) \ r \ n by mx . google . com with ESMTPSA id wk8sm7294078wjb . 22.2014 . 06.25 . 05.44 . 58 \ r \ n for < throwaway . felix @ gmail . com > \ r \ n ( version = TLSv1 cipher = ECDHE - RSA - RC4 - SHA bits = 128 / 128 ) ; \ r \ n Wed , 25 Jun 2014 05 : 44 : 58 - 0700 ( PDT ) \ r \ nFrom : Felix Hammerl < mail @ felixhammerl . com > \ r \ nContent - Type : multipart / alternative ; boundary = "Apple-Mail=_F62EFD38-9B1E-4FAC-A419-2C6F1F765727" \ r \ nSubject : asd \ r \ nMessage - Id : < C49155D8 - E2F6 - 47 F1 - 9176 - B1FBB7E8AE6B @ felixhammerl . com > \ r \ nDate : Wed , 25 Jun 2014 14 : 44 : 56 + 0200 \ r \ nTo : throwaway . felix @ gmail . com \ r \ nMime - Version : 1.0 ( Mac OS X Mail 7.3 1878.2 ) \ r \ nX - Mailer : Apple Mail ( 2.1878 . 2 ) \ r \ n \ r \ n \ r \ n -- Apple - Mail = _F62EFD38 - 9 B1E - 4 FAC - A419 - 2 C6F1F765727 \ r \ nContent - Transfer - Encoding : 7 bit \ r \ nContent - Type : text / plain ; \ r \ n charset = us - ascii \ r \ n \ r \ nasd \ r \ n -- Apple - Mail = _F62EFD38 - 9 B1E - 4 FAC - A419 - 2 C6F1F765727 \ r \ nContent - Type : multipart / related ; \ r \ n type = "text/html" ; \ r \ n boundary = "Apple-Mail=_0A59F0C0-A5CC-4402-B716-0D94B95BA062" \ r \ n \ r \ n \ r \ n -- Apple - Mail = _0A59F0C0 - A5CC - 4402 - B716 - 0 D94B95BA062 \ r \ nContent - Transfer - Encoding : 7 bit \ r \ nContent - Type : text / html ; \ r \ n charset = us - ascii \ r \ n \ r \ n < html > < head > < meta http - equiv = "Content-Type" content = "text/html charset=us-ascii" > < / h e a d > < b o d y s t y l e = " w o r d - w r a p : b r e a k - w o r d ; - w e b k i t - n b s p - m o d e : s p a c e ; - w e b k i t - l i n e - b r e a k : a f t e r - w h i t e - s p a c e ; " > a s d < i m g a p p l e - i n l i n e = " y e s " i d = " 5 3 B 7 3 B D D - 6 9 A 0 - 4 E 8 E - B A 7 B - 3 D 2 E F 3 9 9 C 0 D 3 " h e i g h t = " 1 " w i d t h = " 1 " a p p l e - w i d t h = " y e s " a p p l e - h e i g h t = " y e s " s r c = " c i d : 2 0 1 5 4 2 0 2 - B B 6 F - 4 9 D 7 - A 1 B B - 1 7 E 9 9 3 7 B 4 2 B 5 " > < / b o d y > < / h t m l > \ r \ n - - A p p l e - M a i l = _ 0 A 5 9 F 0 C 0 - A 5 C C - 4 4 0 2 - B 7 1 6 - 0 D 9 4 B 9 5 B A 0 6 2 \ r \ n C o n t e n t - T r a n s f e r - E n c o d i n g : b a s e 6 4 \ r \ n C o n t e n t - D i s p o s i t i o n : i n l i n e ; \ r \ n f i l e n a m e = i m a g e . j p g \ r \ n C o n t e n t - T y p e : i m a g e / j p g ; \ r \ n x - u n i x - m o d e = 0 6 4 4 ; \ r \ n n a m e = " i m a g e . j p g " \ r \ n C o n t e n t - I d : < 2 0 1 5 4 2 0 2 - B B 6 F - 4 9 D 7 - A 1 B B - 1 7 E 9 9 3 7 B 4 2 B 5 > \ r \ n \ r \ n / 9 j / 4 A A Q S k Z J R g A B A Q E A S A B I A A D / 4 g x Y S U N D X 1 B S T 0 Z J T E U A A Q E A A A x I T G l u b w I Q A A B t b n R y U k d C \ r \ n I F h Z W i A H z g A C A A k A B g A x A A
internaldate : '14-Sep-2013 22:22:28 -0300' ,
uid : 802
2014-06-23 17:00:46 -04:00
} , {
description : "Apple Mail (attachment - PGP/MIME): Encrypted" ,
raw : "Content-Type: multipart/encrypted; boundary=\"Apple-Mail=_D90EDAD0-7A85-4304-83EE-59979A5446B0\"; protocol=\"application/pgp-encrypted\";\r\nSubject: test16\r\nMime-Version: 1.0 (Mac OS X Mail 7.3 \\(1878.2\\))\r\nX-Pgp-Agent: GPGMail (null)\r\nFrom: safewithme <safewithme.testuser@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:25:41 +0200\r\nContent-Transfer-Encoding: 7bit\r\nMessage-Id: <7D6AE636-EA7D-4C85-A918-AB3212791604@gmail.com>\r\nContent-Description: OpenPGP encrypted message\r\nTo: safewithme.testuser@gmail.com\r\nX-Mailer: Apple Mail (2.1878.2)\r\n\r\nThis is an OpenPGP/MIME encrypted message (RFC 2440 and 3156)\r\n--Apple-Mail=_D90EDAD0-7A85-4304-83EE-59979A5446B0\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: application/pgp-encrypted\r\nContent-Description: PGP/MIME Versions Identification\r\n\r\nVersion: 1\r\n\r\n--Apple-Mail=_D90EDAD0-7A85-4304-83EE-59979A5446B0\r\nContent-Transfer-Encoding: 7bit\r\nContent-Disposition: inline;\r\n\tfilename=encrypted.asc\r\nContent-Type: application/octet-stream;\r\n\tname=encrypted.asc\r\nContent-Description: OpenPGP encrypted message\r\n\r\n-----BEGIN PGP MESSAGE-----\r\nComment: GPGTools - https://gpgtools.org\r\n\r\nhQEMA9f7k/zfv8I8AQf/THKyD9sA69c9asAGtbVNRtu9zsmfapLQvSW00YIYDQQA\r\nK4QQZit08FL+Fkaa1TCQ0ARF96V2NnshEEmrfLYy7b+eiKGFb1BqKwng18vpsEFu\r\nsZAJeX+ZnBkzNoHqOD+a4HHRO6iQhZYI7arfOnnf7e6woag4dJ5IpOH48hq35R7a\r\n942igGudw8fKuk2D5Or+XqpOYASEhjCSPHxPtqppuNSwQP/KSVY0evEWffE0aQYJ\r\nedqXAAZ7+idU3B1K7nw9cZafXjFkVui02G7SG68/izQq+8SjxJH0SYox4+ZPw1cD\r\nbb8RhWvXBVJ6FIRBZxdsV2gtcvw+1MxDoXHX4BblEMnAU8dGOT68cC88KIDTeSdd\r\nuOPdZ+RdYbQVwk5UuiKKVq3wzlH/q2oP7kk6DeiPd24VhKgzcX3UWS+jBm56S2UD\r\nZFYCznUWvx2ubwRsBBPAiUhAFizkfNL72Ft9LPCI8Hhjd7PZMNqDQklqD092Z5Of\r\nv7j1X/LYbNo3V6Ia4qZpf0Ivgze0309q5IFxswarSmlEdJYcJc+yNLikzgE3/7Ks\r\nOTOQA6tyG7r18V9YjB5570FPTDyDWHFLnt6bRPhe8SYH2OTRomxyFVkTvvN37D5i\r\n+wGigIZxyS07OIXApApc/eNpN74rkbsPMMFLqe2IAI6y+4+G2ukloMSS04EPX9GR\r\nhOnv6pC2MBIKKg70Ck3EHavlMCrs\r\n=JVbV\r\n-----END PGP MESSAGE-----\r\n\r\n--Apple-Mail=_D90EDAD0-7A85-4304-83EE-59979A5446B0--" ,
2014-06-27 10:19:30 -04:00
uid : 803
2014-06-23 17:00:46 -04:00
} , {
description : "Apple Mail (attachment - PGP/MIME): Encrypted and signed" ,
raw : "Content-Type: multipart/encrypted; boundary=\"Apple-Mail=_FE60F127-D74F-4377-93CC-56430132A178\"; protocol=\"application/pgp-encrypted\";\r\nSubject: test15\r\nMime-Version: 1.0 (Mac OS X Mail 7.3 \\(1878.2\\))\r\nX-Pgp-Agent: GPGMail (null)\r\nFrom: safewithme <safewithme.testuser@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:25:10 +0200\r\nContent-Transfer-Encoding: 7bit\r\nMessage-Id: <E5A9BAE2-0FC3-4BEC-9208-39C629CF33AB@gmail.com>\r\nContent-Description: OpenPGP encrypted message\r\nTo: safewithme.testuser@gmail.com\r\nX-Mailer: Apple Mail (2.1878.2)\r\n\r\nThis is an OpenPGP/MIME encrypted message (RFC 2440 and 3156)\r\n--Apple-Mail=_FE60F127-D74F-4377-93CC-56430132A178\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: application/pgp-encrypted\r\nContent-Description: PGP/MIME Versions Identification\r\n\r\nVersion: 1\r\n\r\n--Apple-Mail=_FE60F127-D74F-4377-93CC-56430132A178\r\nContent-Transfer-Encoding: 7bit\r\nContent-Disposition: inline;\r\n\tfilename=encrypted.asc\r\nContent-Type: application/octet-stream;\r\n\tname=encrypted.asc\r\nContent-Description: OpenPGP encrypted message\r\n\r\n-----BEGIN PGP MESSAGE-----\r\nComment: GPGTools - https://gpgtools.org\r\n\r\nhQEMA9f7k/zfv8I8AQf/U11mVSMI5wFM4gh20M1eF1xx5Gs+JJK7hIqKoW7z127k\r\nqB+QEnPvWqa5vV2+gi22bDeXgVNELN3wb2CAznMM82TnpiSbmLLMSrGtx8BAJsfW\r\n+yxaDMvGMn6JHsGPQ6rij7ar9yGCgw6gGOrCuxzCLSgeajbmEn76lyIOtDxY0KSK\r\nisW0K1iD9SeJJiMnMg/EP0Sf9sUzIZjQNJpoz9S23keAHqij/eNexrdmobLMQamF\r\n9BxforwfewMEBv+/+atTj91nS260RBB2g+S6tv1RNJbZ3zTbqr06lviPTQ5zoWT0\r\n2uUEipYhNp4WTaqHg2KfopfzUIt1M0TJGwSidPWkkcnpb+dDeC1JYd3gy0IejhiJ\r\nOUo67gwaiFiwbK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\n9cpldxBtLBbMohJ29N0V9fQ=\r\n=cI14\r\n-----END PGP MESSAGE-----\r\n\r\n--Apple-Mail=_FE60F127-D74F-4377-93CC-56430132A178--" ,
2014-06-27 10:19:30 -04:00
uid : 804
2014-06-23 17:00:46 -04:00
} , {
description : "Apple Mail (no attachment): Encrypted and signed" ,
raw : "Content-Type: multipart/encrypted; boundary=\"Apple-Mail=_2E255D9C-89D7-4F15-81B9-0821710B1B04\"; protocol=\"application/pgp-encrypted\";\r\nSubject: test12\r\nMime-Version: 1.0 (Mac OS X Mail 7.3 \\(1878.2\\))\r\nX-Pgp-Agent: GPGMail (null)\r\nFrom: safewithme <safewithme.testuser@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:22:54 +0200\r\nContent-Transfer-Encoding: 7bit\r\nMessage-Id: <1995DC5D-366B-427A-8420-C0E6F93FCAE6@gmail.com>\r\nContent-Description: OpenPGP encrypted message\r\nTo: safewithme.testuser@gmail.com\r\nX-Mailer: Apple Mail (2.1878.2)\r\n\r\nThis is an OpenPGP/MIME encrypted message (RFC 2440 and 3156)\r\n--Apple-Mail=_2E255D9C-89D7-4F15-81B9-0821710B1B04\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: application/pgp-encrypted\r\nContent-Description: PGP/MIME Versions Identification\r\n\r\nVersion: 1\r\n\r\n--Apple-Mail=_2E255D9C-89D7-4F15-81B9-0821710B1B04\r\nContent-Transfer-Encoding: 7bit\r\nContent-Disposition: inline;\r\n\tfilename=encrypted.asc\r\nContent-Type: application/octet-stream;\r\n\tname=encrypted.asc\r\nContent-Description: OpenPGP encrypted message\r\n\r\n-----BEGIN PGP MESSAGE-----\r\nComment: GPGTools - https://gpgtools.org\r\n\r\nhQEMA9f7k/zfv8I8AQf/SN6kzGCE5Ht0OHBofUocR3CaADSI1ricHiWLzk74FT+6\r\nB7wZcqNR2wI35nwYR2qGjJdLHQP321b6viA0SH5w2drDnfuOAvdGDv/9dK0X4c2z\r\n4WZLu7AndKQ9HlpwY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8pFjqkm25q2aTPkFeVzWMYL/1w9EEPbFuqVXmD153NElebL4odAPE3ZCHpZs\r\nxgbcLw6zAYnQgNal8papOHrghs37iej++gBrzDbAf6Mj09wqTv7xESxpqH9hhSEs\r\nqcoEg2l5U9pSZ3oHq9z783EONSfDXQAl0RE=\r\n=Wsnw\r\n-----END PGP MESSAGE-----\r\n\r\n--Apple-Mail=_2E255D9C-89D7-4F15-81B9-0821710B1B04--" ,
2014-06-27 10:19:30 -04:00
uid : 805
2014-06-23 17:00:46 -04:00
} , {
description : "Apple Mail (no attachment): Encrypted" ,
raw : "Content-Type: multipart/encrypted; boundary=\"Apple-Mail=_930898CD-0C01-4F0E-8769-2B6F056DC2CD\"; protocol=\"application/pgp-encrypted\";\r\nSubject: test13\r\nMime-Version: 1.0 (Mac OS X Mail 7.3 \\(1878.2\\))\r\nX-Pgp-Agent: GPGMail (null)\r\nFrom: safewithme <safewithme.testuser@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:23:32 +0200\r\nContent-Transfer-Encoding: 7bit\r\nMessage-Id: <0AF825EB-5923-4F11-B189-A3D8032A6D6C@gmail.com>\r\nContent-Description: OpenPGP encrypted message\r\nTo: safewithme.testuser@gmail.com\r\nX-Mailer: Apple Mail (2.1878.2)\r\n\r\nThis is an OpenPGP/MIME encrypted message (RFC 2440 and 3156)\r\n--Apple-Mail=_930898CD-0C01-4F0E-8769-2B6F056DC2CD\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: application/pgp-encrypted\r\nContent-Description: PGP/MIME Versions Identification\r\n\r\nVersion: 1\r\n\r\n--Apple-Mail=_930898CD-0C01-4F0E-8769-2B6F056DC2CD\r\nContent-Transfer-Encoding: 7bit\r\nContent-Disposition: inline;\r\n\tfilename=encrypted.asc\r\nContent-Type: application/octet-stream;\r\n\tname=encrypted.asc\r\nContent-Description: OpenPGP encrypted message\r\n\r\n-----BEGIN PGP MESSAGE-----\r\nComment: GPGTools - https://gpgtools.org\r\n\r\nhQEMA9f7k/zfv8I8AQf/WaCFHXTlBnLbqis/zjpRP7gcOvS8uUT3D77RO8Tbuu/6\r\nrh9AtSf78QLF3ogkDB5jlGkfQOxrPbMMyE9CzC8UPRZy5xdbGsUbv7z3biFfVX8P\r\nBmZSyAXTTduf4ewrp6cy7Mbm/wxSGnSMWW6ut30276izXJsw+SywMhg7dWojJyYs\r\nLWNhs5qQWHDoJdB6j/3T++gtpdE2Tv+hrzXrhskBf/rf3XfZmvi7UmFk0lVGpVXP\r\nyuX0iyyfaj8cV2ubycR79NKUlBp76HSZFBsDEY1Zbb/GJaHG/5lHbixf9klFbdoL\r\nGPF51IbQypL1dlYPffvGz/u3M5ctBvoUK4jgLYWOsMlnbIzD5WpmjmL5e3+cwcJj\r\noCbbtyYBJSuzY/4tmx5DRVAnoN0hWo3nLTfVNweMtKd1jms4FookhVZchxtuJkjy\r\nxPjygCncmf3PNmGARKFxZ05PvHlSPhGQ1YcqDRRpXRU+Cj78OHtbaA==\r\n=Ckmq\r\n-----END PGP MESSAGE-----\r\n\r\n--Apple-Mail=_930898CD-0C01-4F0E-8769-2B6F056DC2CD--" ,
2014-06-27 10:19:30 -04:00
uid : 806
2014-06-23 17:00:46 -04:00
} , {
description : "Apple Mail (attachment - PGP/MIME): Signed" ,
raw : "From: safewithme <safewithme.testuser@gmail.com>\r\nContent-Type: multipart/signed; boundary=\"Apple-Mail=_D557BC30-CF1E-41FD-8932-E73ED2C124EA\"; protocol=\"application/pgp-signature\"; micalg=pgp-sha512\r\nSubject: test17\r\nMessage-Id: <6B942730-FFE4-476C-980C-FF1ABA0740BD@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:26:11 +0200\r\nTo: safewithme.testuser@gmail.com\r\nMime-Version: 1.0 (Mac OS X Mail 7.3 \\(1878.2\\))\r\nX-Mailer: Apple Mail (2.1878.2)\r\n\r\n\r\n--Apple-Mail=_D557BC30-CF1E-41FD-8932-E73ED2C124EA\r\nContent-Type: multipart/mixed;\r\n\tboundary=\"Apple-Mail=_6461D724-7906-49CB-BA38-D66A4E146EC3\"\r\n\r\n\r\n--Apple-Mail=_6461D724-7906-49CB-BA38-D66A4E146EC3\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: text/plain;\r\n\tcharset=us-ascii\r\n\r\ntest17\r\n\r\n--Apple-Mail=_6461D724-7906-49CB-BA38-D66A4E146EC3\r\nContent-Disposition: attachment;\r\n\tfilename=test.bin\r\nContent-Type: application/macbinary;\r\n\tx-unix-mode=0644;\r\n\tname=\"test.bin\"\r\nContent-Transfer-Encoding: 7bit\r\n\r\ntestattachment\r\n--Apple-Mail=_6461D724-7906-49CB-BA38-D66A4E146EC3\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: text/plain;\r\n\tcharset=us-ascii\r\n\r\n\r\n\r\n--Apple-Mail=_6461D724-7906-49CB-BA38-D66A4E146EC3--\r\n\r\n--Apple-Mail=_D557BC30-CF1E-41FD-8932-E73ED2C124EA\r\nContent-Transfer-Encoding: 7bit\r\nContent-Disposition: attachment;\r\n\tfilename=signature.asc\r\nContent-Type: application/pgp-signature;\r\n\tname=signature.asc\r\nContent-Description: Message signed with OpenPGP using GPGMail\r\n\r\n-----BEGIN PGP SIGNATURE-----\r\nComment: GPGTools - https://gpgtools.org\r\n\r\niQEcBAEBCgAGBQJTqH9TAAoJENf7k/zfv8I8ygYH/j6ICLJaxBLNhUvBxuXlZHse\r\nH1Rfg/rtF1UCJdqHRrefIYDTVUu1jiTjH1DKXJdujD+mNGhDUqBkF8vn+Hmu86H4\r\n/E9trGeygCkYZNdug1HINI4+fezGa3D28uDkPeN9LlDZBKBVXuEx+EAGBgJLaPbH\r\n7vdlqDqbwlXCU2JO6uGr4sqcTS0UMZaC0VLhBQyXelGQurjoD8XvamBnt5oRxtEc\r\nvftg7s9FKdErNC3mPoUkhFeQKXUiHACH/TzFUdXTh0K7y2ZXQFVmEg/+jjmoFX4D\r\nKPIvjrlM6FqDwo067tIT+S4WJ5MdcDcZRbyS6QkBuMVbugWeUokf/f8zgHQPnHA=\r\n=pJiW\r\n-----END PGP SIGNATURE-----\r\n\r\n--Apple-Mail=_D557BC30-CF1E-41FD-8932-E73ED2C124EA--" ,
2014-06-27 10:19:30 -04:00
uid : 807
2014-06-23 17:00:46 -04:00
} , {
description : "Apple Mail (no attachment): Signed" ,
raw : "From: safewithme <safewithme.testuser@gmail.com>\r\nContent-Type: multipart/signed; boundary=\"Apple-Mail=_D32A0631-70E5-46E7-8204-7A7D5EF145B1\"; protocol=\"application/pgp-signature\"; micalg=pgp-sha512\r\nSubject: test14\r\nMessage-Id: <ED2509B2-8CA2-4D38-B039-8E37A675FB26@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:24:23 +0200\r\nTo: safewithme.testuser@gmail.com\r\nMime-Version: 1.0 (Mac OS X Mail 7.3 \\(1878.2\\))\r\nX-Mailer: Apple Mail (2.1878.2)\r\n\r\n\r\n--Apple-Mail=_D32A0631-70E5-46E7-8204-7A7D5EF145B1\r\nContent-Transfer-Encoding: 7bit\r\nContent-Type: text/plain;\r\n\tcharset=us-ascii\r\n\r\ntest14\r\n\r\n--Apple-Mail=_D32A0631-70E5-46E7-8204-7A7D5EF145B1\r\nContent-Transfer-Encoding: 7bit\r\nContent-Disposition: attachment;\r\n\tfilename=signature.asc\r\nContent-Type: application/pgp-signature;\r\n\tname=signature.asc\r\nContent-Description: Message signed with OpenPGP using GPGMail\r\n\r\n-----BEGIN PGP SIGNATURE-----\r\nComment: GPGTools - https://gpgtools.org\r\n\r\niQEcBAEBCgAGBQJTqH7nAAoJENf7k/zfv8I8crcH/1h2LEOiAddU7tXokMxfA+FT\r\nSPezAU3eUSzlDLIjq+6pFlFXmH+IVQcxx7dbiHekLtDiIweII58KOAHYodadO4Gg\r\ni/wist5rGpysHX1djQ6D/pqvxr8jEwxQ0tyvEkcDzMXcGolUZLQTDRHaCpgJAFrM\r\n525YHJ1UxAzlojq+/92EzI8JdqH+KT56BGCiBHFj6QlWF1OXV4L+mNk1zRMyESjI\r\n0LPYFYrUtBopy/0DvrqAkFFOOS6j6XjPa2Finofv49LqOc4ntpOSs0DwrDPb5Nn3\r\nMlDvsT80Bf+RfQdc8PzTAyN5Puv+XjDET407jVUsfKwEv/aUHRZnNXWAR2G+9xE=\r\n=CGVw\r\n-----END PGP SIGNATURE-----\r\n\r\n--Apple-Mail=_D32A0631-70E5-46E7-8204-7A7D5EF145B1--" ,
2014-06-27 10:19:30 -04:00
uid : 808
2014-06-23 17:00:46 -04:00
} , {
description : "Thunderbird (attachment - PGP/MIME): Encrypted" ,
raw : "Message-ID: <53A87E12.8040902@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:20:50 +0200\r\nFrom: Andris Testbox2 <safewithme.testuser@gmail.com>\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0\r\nMIME-Version: 1.0\r\nTo: safewithme <safewithme.testuser@gmail.com>\r\nSubject: test10\r\nX-Enigmail-Version: 1.6\r\nContent-Type: multipart/encrypted;\r\n protocol=\"application/pgp-encrypted\";\r\n boundary=\"MrDkNHd70n0CBWqJqodk50MfrlELiXLgn\"\r\n\r\nThis is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)\r\n--MrDkNHd70n0CBWqJqodk50MfrlELiXLgn\r\nContent-Type: application/pgp-encrypted\r\nContent-Description: PGP/MIME version identification\r\n\r\nVersion: 1\r\n\r\n--MrDkNHd70n0CBWqJqodk50MfrlELiXLgn\r\nContent-Type: application/octet-stream; name=\"encrypted.asc\"\r\nContent-Description: OpenPGP encrypted message\r\nContent-Disposition: inline; filename=\"encrypted.asc\"\r\n\r\n-----BEGIN PGP MESSAGE-----\r\nVersion: GnuPG v1.4.13 (Darwin)\r\nComment: GPGTools - https://gpgtools.org\r\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\r\n\r\nhQEMA9f7k/zfv8I8AQf/SY0E1+kzz5VFpxeTMEvc1sqpMyWJC2kIvZL+c5mjQ6yZ\r\nkAtYwGb7MPzqUc9gHSWTEdqCB0I2hVk6n6mjWkaX6t2y8ko42Xxpf2/nEM062gPm\r\nv4+r/eQeC6ey8DXjCLE+h3gbKsu3ebuQF2Bqci6eCcU9njTzkwOlTxA3fCQWW4pF\r\nWtKMiGmCpusEdli5dB/JvKDzYo0zXKUWNkwcyT9kcu36DsOAWFldNFwzEWJWk1SR\r\naN5Fx1AARh51Cw4mEFW/FHgf6Ajt9Krj+B+E4FHmyy4E0rvoo8RNINeCKZOoSFLW\r\nOPWdIAZyTTRrw2cdsyLLhqX0ddYSobnIoz2/WJ/T48nAaYkb3ASulujtz6HUAK+B\r\nyn9HSyt7YxR+n0w6nvs21tidlT+TGQnj4KQVdx30V+i9DX3dXDdd4MXJYnGBAEqc\r\nc/FpqrJVP6V6CSsdvY5WVd/+17kZJEcyH+rfdDi3Y5c/bSnJBmc5UqY0FvbW4TRh\r\nfij0pZMMBvji5nagKIP2fHRDpxvP2UIosD5oj0xkhh6dpWtbyuL3KES2XodSJBxm\r\nRqTvns2ONWtu93MT3cjTAHDMH5edGFqrSDXWfh2sgYhg9vdD7RoWe2df6BEBywKf\r\nldTim+X5vUasHiRK6adIGRHmrs9CvU9p1u+N3CLRUZsMvwy5Uj1LVim89HKOu+QI\r\nultWesSVB+UiYnfQRQ7urzE/xAZyTniA1eJNKygyriQyI+uLTC/gi59yHw==\r\n=3OkT\r\n-----END PGP MESSAGE-----\r\n\r\n--MrDkNHd70n0CBWqJqodk50MfrlELiXLgn--" ,
2014-06-27 10:19:30 -04:00
uid : 809
2014-06-23 17:00:46 -04:00
} , {
description : "Thunderbird (attachment - PGP/MIME): Encrypted and signed" ,
raw : "Message-ID: <53A87DC2.6010102@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:19:30 +0200\r\nFrom: Andris Testbox2 <safewithme.testuser@gmail.com>\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0\r\nMIME-Version: 1.0\r\nTo: safewithme <safewithme.testuser@gmail.com>\r\nSubject: test9\r\nX-Enigmail-Version: 1.6\r\nContent-Type: multipart/encrypted;\r\n protocol=\"application/pgp-encrypted\";\r\n boundary=\"N184DqJgpX0F6MPTPjS0P6IxMgfbap3qD\"\r\n\r\nThis is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)\r\n--N184DqJgpX0F6MPTPjS0P6IxMgfbap3qD\r\nContent-Type: application/pgp-encrypted\r\nContent-Description: PGP/MIME version identification\r\n\r\nVersion: 1\r\n\r\n--N184DqJgpX0F6MPTPjS0P6IxMgfbap3qD\r\nContent-Type: application/octet-stream; name=\"encrypted.asc\"\r\nContent-Description: OpenPGP encrypted message\r\nContent-Disposition: inline; filename=\"encrypted.asc\"\r\n\r\n-----BEGIN PGP MESSAGE-----\r\nVersion: GnuPG v1.4.13 (Darwin)\r\nComment: GPGTools - https://gpgtools.org\r\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\r\n\r\nhQEMA9f7k/zfv8I8AQf5AX+nmpkoDAn7MHFwQZ9ENIOtYRRTY1aakavO0oVuiOWm\r\nerJO+/4ORrtSapkZjp9cnE0Kwuo44fkmbObt+JquHVg4Bcxee3IpViTOx1dV+IPr\r\n/R5zcPp3myk9hqwkpwlCPOUVXmD8YQeLQQfiM90E0+ldF9q1Q4UKW/usmaJQBwWd\r\nWrR9KURfBrh1eqIO927YXIInnhlCl0ZiYwghCeJ7nrfHF7a3ftHuSMJhkywNKGWH\r\nhL7FghCwpmVuHyneB8lJVGz4txwnW51kK05Il46Uab1y9jSutUN+5IVWmRx6m+zt\r\n7aj3Cyd8rAzc9LdP0XEPOe1+cht9GTXXMdj+Kk5758npNB32pMfQ8YSOcIU1luyk\r\nKWE6yG5+7ZWFXrbdXVjXRKXMN31c4Hw0Ccv1kO/viAvthAU3hFZM0cBp+PtiOrxS\r\nynBBi7r2o3xb8NTGGYRq/P0H9Odemj2x6OGbIXS40ApTAGKeNNhHpF5HwaAWuMul\r\n2Pnjdt8x34PiKd/L/TOSAtmQZqkQ3xmYOMpP5XKiCYTBeMMM46Gz4rbTnrJawW5X\r\n8nxvQjJmDzcAByS9bJSNh0a6vF+JbTNbTH7kIjqPUm57zyie2+uBCjg5dIeqZt4l\r\nF85Ai+chMwtUNZ50tEfPhk1opf+HsJ8OfrNEOiA8xCQNL3ZUPnaHkhLAd8bh05zI\r\nyzJOBLwSrFpCMZWkPm1PK6J99M6JH5MJyZxvdQfH/YyhCdqiyCUQc1lObdPBLN/A\r\n/Lb1xUnqppA7yvr6RpWQ+EAUVohknGRhqdL/PxOcCv9GY2DW0dHxUdYbyBzoFj6h\r\nhmzaCIUmhjDGLi4qCxLdn46IKKFtEncMBGgrIQTgDGHXyUaUlEVtWs3I6aRkgYbz\r\no2t3UytJxyMUevCpSBADlHO0Rd1q0MyEsmGKKYoyJSt1NX4C6pmEl3kVJoyvkQWb\r\nbgFBG0KYkx5+UtBGlubYrP2MS2xRQ+6hHCJtIFOfQHcWlUg4jy8mZNVjV+S+zvbV\r\nGjIhjdmvFAvp/sgcwTGmYbh4LpUP/pI+jmIh3Gg8l1PDlh95uSzKJ770m2U8W7ws\r\nNbgG3RdxD0ZocJkeYslvHKid3kf2LIKeH1ADJj/t6rfD/4k31iQeGcNASnDNsel3\r\njbp8HJ9LSm0h0xeWCiOLqa/c6ysXLravA7nBC1XHKE3u4tcIjcZEYt6Z\r\n=qwkL\r\n-----END PGP MESSAGE-----\r\n\r\n--N184DqJgpX0F6MPTPjS0P6IxMgfbap3qD--" ,
2014-06-27 10:19:30 -04:00
uid : 810
2014-06-23 17:00:46 -04:00
} , {
description : "Thunderbird (no attachment): Encrypted and signed" ,
raw : "Message-ID: <53A8796A.6000502@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:00:58 +0200\r\nFrom: Andris Testbox2 <safewithme.testuser@gmail.com>\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0\r\nMIME-Version: 1.0\r\nTo: safewithme.testuser@gmail.com\r\nSubject: test4\r\nX-Enigmail-Version: 1.6\r\nContent-Type: text/plain; charset=ISO-8859-1\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n\r\n-----BEGIN PGP MESSAGE-----\r\nCharset: ISO-8859-1\r\nVersion: GnuPG v1.4.13 (Darwin)\r\nComment: GPGTools - https://gpgtools.org\r\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\r\n\r\nhQEMA9f7k/zfv8I8AQf8CCwYxQuhh9kAd4Vz8nUP8YLScfexq8juAawc5bsq3sf5\r\nMl1E6zzM8d0M8ultmL+Y2RRYX82/kEvc1c3bWNJNSagwqxlD54dToXTraGkE+hbF\r\nlMnsAq/jpcsXH0G9oFPwMi5NMWKbZQIUdsi3Iszx8x1WEWcV9XE4C0xg0LfN66vr\r\n1ykTTcg+wv4XmxvljvgA+VT6HvS1jqE/NrfseDtQJNIs42sfylgJF0neOfkrjrn/\r\nDljslmd1WgbDjbAk+hzT+8zmRfCLK2GhRtsRskdGGSzDiYhAc1qLU6GtVuhig088\r\nF3Gk1Sqgnffi1/X16j2sN5URjteaXnvHIJwGypuoLsnAjmQyh0vVs8hVb4jZw+aR\r\n8atbrYPLCN8VnIRK+4E9v45aGef3U8Dul3FXx06s6UZVGTaPHOFIkFJhfA4Vswh5\r\n6n7A5kAhGx9VgChOyjaGpBdpFuhsD1fpixhVlTCAmIanJwYi5Cvz2nfN8QOIamsc\r\ndM0bE0utru2YCmmzVgVjDr4xtM7tAPfresDnEXt/eqRiIFntT/tD8yke4/vTMS3s\r\nJVMhFrlm14BohvRnaF0sUeFiMSbDL1ox8pmtRUdIFY3mhq+R9XUpFb7ktOd6husG\r\nthMDtT+1Tb7/W2rHFx7nJIQtjKbgM79/Pson+O2LzX6fY7qeQKnUX9dBb15t5e94\r\n78yazU5T1JmMHA+Szzu6OMy3eHkkOqxsst62nMXgrgGk7NhUNl+3oP5k/aT6iqA2\r\n3deWy5YfwtC0hRHWnT6zweJJohOVwrQQJ9oxTSi3iJ0=3D\r\n=3D9EeZ\r\n-----END PGP MESSAGE-----\r\n\r\n" ,
2014-06-27 10:19:30 -04:00
uid : 811
2014-06-23 17:00:46 -04:00
} , {
description : "Thunderbird (no attachment): Encrypted" ,
raw : "Message-ID: <53A87AD7.9090109@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:07:03 +0200\r\nFrom: Andris Testbox2 <safewithme.testuser@gmail.com>\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0\r\nMIME-Version: 1.0\r\nTo: safewithme.testuser@gmail.com\r\nSubject: test5\r\nX-Enigmail-Version: 1.6\r\nContent-Type: text/plain; charset=ISO-8859-1\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n\r\n-----BEGIN PGP MESSAGE-----\r\nCharset: ISO-8859-1\r\nVersion: GnuPG v1.4.13 (Darwin)\r\nComment: GPGTools - https://gpgtools.org\r\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\r\n\r\nhQEMA9f7k/zfv8I8AQf+KmR4WIpBMlhm7HFxWEEmRAezEaKWX1X9oDCMBMC/WTPa\r\nzegDeysvFsh7SvLDZngm+hPDxCWIh+h/6EZaWGuQBJKcyglTncZEA3T5vz+IRJoP\r\ngFUVZ9YLaT58DAzLOpg8noNAEp0+E+cfDsVvhBI8Hzx7VRt1/msO+RWWEZOnD1xw\r\nD5iJ0AfONzAcfHc0jJosz8/iUkWBexBwtG+dm4mdyE+X6g30zHY6afa5/E7LvfXd\r\nZUFr+pgHa1eQYKtqtyeZPrli0zSHtFMOdr8eDkp89/MZgQbbYHEaLTjWUzDsogDT\r\n3FzTbm4t4fPolEHgZFnDwCrqPTRZAN999zscD12CiMkdTc0iVy4mH50QgeF/m/w7\r\n7ewbgh38TN8YbXvaA6A=3D\r\n=3Di2Il\r\n-----END PGP MESSAGE-----\r\n\r\n" ,
2014-06-27 10:19:30 -04:00
uid : 812
2014-06-23 17:00:46 -04:00
} , {
description : "Thunderbird (no attachment): plaintext reply to an encrypted message" ,
raw : "Message-ID: <53A87D09.9050602@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:16:25 +0200\r\nFrom: Andris Testbox2 <safewithme.testuser@gmail.com>\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0\r\nMIME-Version: 1.0\r\nTo: safewithme <safewithme.testuser@gmail.com>\r\nSubject: Re: test8\r\nReferences: <A67E19EA-233D-4527-855B-292054BED73F@gmail.com>\r\nIn-Reply-To: <A67E19EA-233D-4527-855B-292054BED73F@gmail.com>\r\nX-Enigmail-Version: 1.6\r\nContent-Type: text/plain; charset=ISO-8859-1\r\nContent-Transfer-Encoding: 7bit\r\n\r\ntest8\r\n\r\n23.06.14 21:12, safewithme kirjutas:\r\n> test8\r\n" ,
2014-06-27 10:19:30 -04:00
uid : 813
2014-06-23 17:00:46 -04:00
} , {
description : "Thunderbird (attachment - PGP/MIME): Signed" ,
raw : "Message-ID: <53A87E4B.50702@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:21:47 +0200\r\nFrom: Andris Testbox2 <safewithme.testuser@gmail.com>\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0\r\nMIME-Version: 1.0\r\nTo: safewithme <safewithme.testuser@gmail.com>\r\nSubject: test11\r\nX-Enigmail-Version: 1.6\r\nContent-Type: multipart/signed; micalg=pgp-sha512;\r\n protocol=\"application/pgp-signature\";\r\n boundary=\"LldNQubkCiWQwPKXrfghi6DLbotCLEBuX\"\r\n\r\nThis is an OpenPGP/MIME signed message (RFC 4880 and 3156)\r\n--LldNQubkCiWQwPKXrfghi6DLbotCLEBuX\r\nContent-Type: multipart/mixed;\r\n boundary=\"------------070307080002050009010403\"\r\n\r\nThis is a multi-part message in MIME format.\r\n--------------070307080002050009010403\r\nContent-Type: text/plain; charset=ISO-8859-1\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\ntest11\r\n\r\n--------------070307080002050009010403\r\nContent-Type: application/macbinary;\r\n name=\"test.bin\"\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment;\r\n filename=\"test.bin\"\r\n\r\ndGVzdGF0dGFjaG1lbnQ=\r\n--------------070307080002050009010403--\r\n\r\n--LldNQubkCiWQwPKXrfghi6DLbotCLEBuX\r\nContent-Type: application/pgp-signature; name=\"signature.asc\"\r\nContent-Description: OpenPGP digital signature\r\nContent-Disposition: attachment; filename=\"signature.asc\"\r\n\r\n-----BEGIN PGP SIGNATURE-----\r\nVersion: GnuPG v1.4.13 (Darwin)\r\nComment: GPGTools - https://gpgtools.org\r\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\r\n\r\niQEcBAEBCgAGBQJTqH5OAAoJENf7k/zfv8I8oFoH/R6EFTw2CYUQoOKSAQstWIHp\r\nfVVseLOkFbByUV5eLuGVBNI3DM4GQ6C7dGntKAn34a1iTGcAIZH+fIhaZ2WtNdtA\r\nR+Ijn8xDjbF/BWvcTBOaRvgw9b8viPxhkVYa3PioHYz6krt/LmFqFdp/phWZcqR4\r\njzWMX55h4FOw3YBNGiz2NuIg+iGrFRWPYgd8NVUmJKReZHs8C/6HGz7F4/A24k6Y\r\n7xms9D6Er+MhspSl+1dlRdHjtXiRqC5Ld1hi2KBKc6YzgOLpVw5l9sffbnH+aRG4\r\ndH+2J5U3elqBDK1i3GyG8ixLSB0FGW9+lhYNosZne2xy8SbQKdgsnTBnWSGevP0=\r\n=xiih\r\n-----END PGP SIGNATURE-----\r\n\r\n--LldNQubkCiWQwPKXrfghi6DLbotCLEBuX--" ,
2014-06-27 10:19:30 -04:00
uid : 814
2014-06-23 17:00:46 -04:00
} , {
description : "Thunderbird (no attachment): Signed" ,
raw : "Message-ID: <53A87B12.9010706@gmail.com>\r\nDate: Mon, 23 Jun 2014 21:08:02 +0200\r\nFrom: Andris Testbox2 <safewithme.testuser@gmail.com>\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0\r\nMIME-Version: 1.0\r\nTo: safewithme.testuser@gmail.com\r\nSubject: test6\r\nX-Enigmail-Version: 1.6\r\nContent-Type: text/plain; charset=ISO-8859-1\r\nContent-Transfer-Encoding: 7bit\r\n\r\n\r\n-----BEGIN PGP SIGNED MESSAGE-----\r\nHash: SHA512\r\n\r\ntest6\r\n-----BEGIN PGP SIGNATURE-----\r\nVersion: GnuPG v1.4.13 (Darwin)\r\nComment: GPGTools - https://gpgtools.org\r\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\r\n\r\niQEcBAEBCgAGBQJTqHsSAAoJENf7k/zfv8I8wz4H/RWo1qJvvJtMl7GyqGGbaByX\r\n/D7/yWJzMdE0Y7J/tHIexQ/sZnmcDlHG0mtJKgI7EOh2EyV+r+78vF71Mlc+bg8g\r\n3B4TKyp0QU1Pb6SETG//FtKrU7SnkjKujHvRMpzcOcm0ZLBDpmftyWLvp9Dg3KOF\r\n5sMBGpJRn1pqX2DxXZtc1rYOmSAaxFI5jewPws0DCDkLDGp9gLyusNeDHkmAT4AG\r\nDqsDPQvW0R4Sy7aQFT7GjrdnCiLyikynkocUpR95fDnjHJ6Xbyj2Yj9/ofewPQ//\r\nMq39sIYbcqlDBAhsOlii3ekdzLS4xEOkvtFoD4pufyLj3pYY60FG4bPygcccYkI=\r\n=IkRV\r\n-----END PGP SIGNATURE-----\r\n" ,
2014-06-27 10:19:30 -04:00
uid : 815
2014-06-11 03:42:34 -04:00
} ] ;
2013-10-09 10:40:36 -04:00
2014-06-11 03:42:34 -04:00
imapFolders = {
separator : '/' ,
folders : {
'[Gmail]' : {
flags : [ '\\Noselect' ] ,
folders : {
'All Mail' : {
'special-use' : '\\All'
} ,
Drafts : {
'special-use' : '\\Drafts'
} ,
Important : {
'special-use' : '\\Important'
} ,
'Sent Mail' : {
'special-use' : '\\Sent'
} ,
Spam : {
'special-use' : '\\Junk'
} ,
Starred : {
'special-use' : '\\Flagged'
} ,
Trash : {
'special-use' : '\\Trash'
}
}
}
}
} ;
2013-10-02 09:47:41 -04:00
2014-06-11 03:42:34 -04:00
var serverUsers = { } ;
serverUsers [ testAccount . user ] = {
password : testAccount . pass ,
xoauth2 : {
accessToken : testAccount . xoauth2 ,
sessionTimeout : 3600 * 1000
}
} ;
2013-10-09 10:40:36 -04:00
2014-06-11 03:42:34 -04:00
imapServer = new BrowserCrow ( {
debug : false ,
plugins : [ 'sasl-ir' , 'xoauth2' , 'special-use' , 'id' , 'idle' , 'unselect' , 'enable' , 'condstore' ] ,
id : {
name : 'browsercrow' ,
version : '0.1.0'
} ,
storage : {
'INBOX' : {
messages : imapMessages
} ,
'' : imapFolders
} ,
users : serverUsers
} ) ;
2013-10-29 07:19:27 -04:00
2014-06-11 03:42:34 -04:00
smtpServer = new BrowserSMTP ( {
debug : false ,
users : serverUsers
} ) ;
2013-10-29 07:19:27 -04:00
2014-06-11 03:42:34 -04:00
mockKeyPair = {
privateKey : {
2014-06-18 04:02:33 -04:00
_id : 'D7FB93FCDFBFC23C' ,
2014-06-11 03:42:34 -04:00
userId : testAccount . user ,
2014-06-18 04:02:33 -04:00
userIds : [ {
name : 'John Doe' ,
emailAddress : testAccount . user
} ] ,
2014-06-11 03:42:34 -04:00
encryptedKey : '-----BEGIN PGP PRIVATE KEY BLOCK-----\r\nVersion: OpenPGP.js v.1.20131116\r\nComment: Whiteout Mail - http://whiteout.io\r\n\r\nxcL+BFKODs4BB/9iOF4THsjQMY+WEpT7ShgKxj4bHzRRaQkqczS4nZvP0U3g\r\nqeqCnbpagyeKXA+bhWFQW4GmXtgAoeD5PXs6AZYrw3tWNxLKu2Oe6Tp9K/XI\r\nxTMQ2wl4qZKDXHvuPsJ7cmgaWqpPyXtxA4zHHS3WrkI/6VzHAcI/y6x4szSB\r\nKgSuhI3hjh3s7TybUC1U6AfoQG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7W7Tp6afNb+sqyzEw5Bknypn0Hc3cr9wy1P8jLMM2woL\r\nGRDZ5IutCAV/D/h881dHJs0tV2hpdGVvdXQgVXNlciA8c2FmZXdpdGhtZS50\r\nZXN0dXNlckBnbWFpbC5jb20+wsBcBBABCAAQBQJSjg7aCRDX+5P837/CPAAA\r\n3ZwH/2AVGYB+8RDarP5a5uZPYSxJKeM8zHMbi7LKQWhr5NpkJajZdra1CCGZ\r\nTXTeQSRBvU4SNGOmDAlhf0qCGeXwMHIzrzovkBedHIc/vypEkItdJeXQAaJx\r\nuhQOnmyi9priuzBBx4e9x1aBn+aAdNGiJB4l13L2T4fow8WLIVpVwXB6BWya\r\nlz50JwLzJP6qHxkhvIZElTrQ+Yoo3stS6w/7wNtK/f3MIYkIGVVUrIDgzN0X\r\nm4z6ypN1dsrM6tPkMZ0JlqjHiz7DXpKrWsfNkoVZ9A98osMH2nIDS58JVEDc\r\nAXoFSLsbdmqFmIc2Ew828TjlX+FLU9tlx89WhSMTapzUjHU=\r\n=wxuK\r\n-----END PGP PRIVATE KEY BLOCK-----'
} ,
publicKey : {
2014-06-18 04:02:33 -04:00
_id : 'D7FB93FCDFBFC23C' ,
2014-06-11 03:42:34 -04:00
userId : testAccount . user ,
2014-06-18 04:02:33 -04:00
userIds : [ {
name : 'John Doe' ,
emailAddress : testAccount . user
} ] ,
2014-06-11 03:42:34 -04:00
publicKey : '-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nVersion: OpenPGP.js v.1.20131116\r\nComment: Whiteout Mail - http://whiteout.io\r\n\r\nxsBNBFKODs4BB/9iOF4THsjQMY+WEpT7ShgKxj4bHzRRaQkqczS4nZvP0U3g\r\nqeqCnbpagyeKXA+bhWFQW4GmXtgAoeD5PXs6AZYrw3tWNxLKu2Oe6Tp9K/XI\r\nxTMQ2wl4qZKDXHvuPsJ7cmgaWqpPyXtxA4zHHS3WrkI/6VzHAcI/y6x4szSB\r\nKgSuhI3hjh3s7TybUC1U6AfoQGx/S7e3WwlCOrK8GTClirN/2mCPRC5wuIft\r\nnkoMfA6jK8d2OPrJ63shy5cgwHOjQg/xuk46dNS7tkvGmbaa+X0PgqSKB+Hf\r\nYPPNS/ylg911DH9qa8BqYU2QpNh9jUKXSF+HbaOM+plWkCSAL7czV+R3ABEB\r\nAAHNLVdoaXRlb3V0IFVzZXIgPHNhZmV3aXRobWUudGVzdHVzZXJAZ21haWwu\r\nY29tPsLAXAQQAQgAEAUCUo4O2gkQ1/uT/N+/wjwAAN2cB/9gFRmAfvEQ2qz+\r\nWubmT2EsSSnjPMxzG4uyykFoa+TaZCWo2Xa2tQghmU103kEkQb1OEjRjpgwJ\r\nYX9Kghnl8DByM686L5AXnRyHP78qRJCLXSXl0AGicboUDp5sovaa4rswQceH\r\nvcdWgZ/mgHTRoiQeJddy9k+H6MPFiyFaVcFwegVsmpc+dCcC8yT+qh8ZIbyG\r\nRJU60PmKKN7LUusP+8DbSv39zCGJCBlVVKyA4MzdF5uM+sqTdXbKzOrT5DGd\r\nCZaox4s+w16Sq1rHzZKFWfQPfKLDB9pyA0ufCVRA3AF6BUi7G3ZqhZiHNhMP\r\nNvE45V/hS1PbZcfPVoUjE2qc1Ix1\r\n=7Wpe\r\n-----END PGP PUBLIC KEY BLOCK-----'
}
} ;
// don't multithread, Function.prototype.bind() is broken in phantomjs in web workers
window . Worker = undefined ;
navigator . online = true ;
imapClient = new ImapClient ( {
auth : {
user : testAccount . user ,
xoauth2 : testAccount . xoauth2
} ,
secure : true ,
ca : [ 'random string' ]
} ) ;
imapClient . _client . client . _TCPSocket = imapServer . createTCPSocket ( ) ;
imapClient . _listeningClient . client . _TCPSocket = imapServer . createTCPSocket ( ) ;
imapClient . onError = function ( err ) {
console . log ( 'IMAP error.' , err ) ;
console . log ( 'IMAP reconnecting...' ) ;
// re-init client modules on error
appController . onConnect ( function ( err ) {
if ( err ) {
console . error ( 'IMAP reconnect failed!' , err ) ;
return ;
}
console . log ( 'IMAP reconnect attempt complete.' ) ;
2013-10-02 09:47:41 -04:00
} ) ;
2014-06-11 03:42:34 -04:00
} ;
smtpClient = new SmtpClient ( 'localhost' , 25 , {
auth : {
user : testAccount . user ,
xoauth2 : testAccount . xoauth2
} ,
secure : true ,
ca : [ 'random string' ] ,
onError : console . error
2013-10-02 09:47:41 -04:00
} ) ;
2014-06-11 03:42:34 -04:00
smtpClient . _TCPSocket = smtpServer . createTCPSocket ( ) ;
sinon . stub ( mailreader , 'startWorker' , function ( ) { } ) ;
sinon . stub ( openpgp , 'initWorker' , function ( ) { } ) ;
sinon . stub ( appController , 'onConnect' , function ( cb ) {
appController . _emailDao . onConnect ( {
imapClient : imapClient ,
pgpMailer : new PgpMailer ( {
tls : {
ca : 'random string'
}
} , appController . _pgpbuilder )
} , cb ) ;
} ) ;
appController . start ( {
onError : function ( ) { }
} , function ( err ) {
expect ( err ) . to . not . exist ;
userStorage = appController . _userStorage ;
appController . init ( {
emailAddress : testAccount . user
} , function ( err ) {
2013-10-10 13:15:16 -04:00
expect ( err ) . to . not . exist ;
2014-06-11 03:42:34 -04:00
emailDao = appController . _emailDao ;
emailDao . onIncomingMessage = function ( ) { } ;
emailDao . unlock ( {
passphrase : testAccount . pass ,
keypair : mockKeyPair
} , function ( err ) {
2013-10-10 13:15:16 -04:00
expect ( err ) . to . not . exist ;
2014-06-11 03:42:34 -04:00
appController . onConnect ( function ( err ) {
expect ( err ) . to . not . exist ;
done ( ) ;
} ) ;
2013-10-10 13:15:16 -04:00
} ) ;
} ) ;
} ) ;
} ) ;
2014-06-11 03:42:34 -04:00
afterEach ( function ( done ) {
openpgp . initWorker . restore ( ) ;
mailreader . startWorker . restore ( ) ;
appController . onConnect . restore ( ) ;
imapClient . _client . close ( ) ;
imapClient . _listeningClient . close ( ) ;
userStorage . clear ( done ) ;
} ) ;
2014-06-30 13:59:02 -04:00
it ( 'should run beforeEach and afterEach' , function ( ) {
2014-06-23 17:00:46 -04:00
// afterEach clears userStorage
expect ( emailDao ) . to . exist ;
} ) ;
2014-06-11 03:42:34 -04:00
describe ( 'IMAP Tests' , function ( ) {
var currentFolder ;
beforeEach ( function ( done ) {
emailDao . openFolder ( {
folder : {
path : 'INBOX'
}
2013-10-02 09:47:41 -04:00
} , function ( err ) {
expect ( err ) . to . not . exist ;
2014-06-11 03:42:34 -04:00
currentFolder = emailDao . _account . folders . filter ( function ( folder ) {
return folder . path === 'INBOX' ;
} ) . pop ( ) ;
expect ( currentFolder ) . to . exist ;
2013-10-02 09:47:41 -04:00
done ( ) ;
} ) ;
} ) ;
2014-06-11 03:42:34 -04:00
afterEach ( function ( ) {
emailDao . onIncomingMessage = function ( ) { } ;
} ) ;
it ( 'should receive new messages on startup' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
expect ( messages . length ) . to . equal ( imapMessages . length ) ;
2013-10-02 09:47:41 -04:00
done ( ) ;
2014-06-11 03:42:34 -04:00
} ;
} ) ;
it ( 'should receive new messages' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
expect ( messages . length ) . to . equal ( imapMessages . length ) ;
emailDao . onIncomingMessage = function ( messages ) {
expect ( messages . length ) . to . equal ( 1 ) ;
expect ( messages [ 0 ] . answered ) . to . be . false ;
emailDao . onIncomingMessage = function ( messages ) {
expect ( messages . length ) . to . equal ( 1 ) ;
expect ( messages [ 0 ] . answered ) . to . be . true ;
done ( ) ;
} ;
} ;
setTimeout ( function ( ) {
imapServer . appendMessage ( 'INBOX' , [ '$My$Flag' ] , false , 'Message-id: <n1>\r\nSubject: new message\r\n\r\nhello world!' ) ;
setTimeout ( function ( ) {
imapServer . appendMessage ( 'INBOX' , [ '$My$Flag' , '\\Answered' ] , false , 'Message-id: <n2>\r\nSubject: new message\r\n\r\nhello world!' ) ;
} , 1000 ) ;
} , 1000 ) ;
} ;
} ) ;
it ( 'should delete a message' , function ( done ) {
emailDao . onIncomingMessage = function ( ) {
emailDao . deleteMessage ( {
folder : currentFolder ,
message : {
uid : 600
}
} , function ( err ) {
expect ( err ) . to . not . exist ;
emailDao . openFolder ( {
folder : {
path : '[Gmail]/Trash'
}
} , function ( err , folder ) {
expect ( err ) . to . not . exist ;
expect ( folder . exists ) . to . equal ( 1 ) ;
emailDao . onIncomingMessage = function ( messages ) {
expect ( messages . length ) . to . equal ( 1 ) ;
expect ( messages [ 0 ] . id ) . to . equal ( 'b' ) ;
done ( ) ;
} ;
} ) ;
} ) ;
} ;
} ) ;
it ( 'should get body' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
message : messages [ 4 ]
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
expect ( message . body ) . to . equal ( 'World 5!' ) ;
done ( ) ;
} ) ;
} ;
2014-06-25 09:03:50 -04:00
} ) ;
it ( 'should insert images into html mail' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
message : messages [ 8 ]
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
expect ( message . html ) . to . equal ( ' < html > < head > < meta http - equiv = "Content-Type" content = "text/html charset=us-ascii" > < / h e a d > < b o d y s t y l e = " w o r d - w r a p : b r e a k - w o r d ; - w e b k i t - n b s p - m o d e : s p a c e ; - w e b k i t - l i n e - b r e a k : a f t e r - w h i t e - s p a c e ; " > a s d < i m g a p p l e - i n l i n e = " y e s " i d = " 5 3 B 7 3 B D D - 6 9 A 0 - 4 E 8 E - B A 7 B - 3 D 2 E F 3 9 9 C 0 D 3 " h e i g h t = " 1 " w i d t h = " 1 " a p p l e - w i d t h = " y e s " a p p l e - h e i g h t = " y e s " s r c = " d a t a : a p p l i c a t i o n / o c t e t - s t r e a m ; b a s e 6 4 , / 9 j / 4 A A Q S k Z J R g A B A Q E A S A B I A A D / 4 g x Y S U N D X 1 B S T 0 Z J T E U A A Q E A A A x I T G l u b w I Q A A B t b n R y U k d C I F h Z W i A H z g A C A A k A B g A x A A B h Y 3 N w T V N G V A A A A A B J R U M g c 1 J H Q g A A A A A A A A A A A A A A A A A A 9 t Y A A Q A A A A D T L U h Q I C A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A B F j c H J 0 A A A B U A A A A D N k Z X N j A A A B h A A A A G x 3 d H B 0 A A A B 8 A A A A B R i a 3 B 0 A A A C B A A A A B R y W F l a A A A C G A A A A B R n W F l a A A A C L A A A A B R i W F l a A A A C Q A A A A B R k b W 5 k A A A C V A A A A H B k b W R k A A A C x A A A A I h 2 d W V k A A A D T A A A A I Z 2 a W V 3 A A A D 1 A A A A C R s d W 1 p A A A D + A A A A B R t Z W F z A A A E D A A A A C R 0 Z W N o A A A E M A A A A A x y V F J D A A A E P A A A C A x n V F J D A A A E P A A A C A x i V F J D A A A E P A A A C A x 0 Z X h 0 A A A A A E N v c H l y a W d o d C A o Y y k g M T k 5 O C B I Z X d s Z X R 0 L V B h Y 2 t h c m Q g Q 2 9 t c G F u e Q A A Z G V z Y w A A A A A A A A A S c 1 J H Q i B J R U M 2 M T k 2 N i 0 y L j E A A A A A A A A A A A A A A B J z U k d C I E l F Q z Y x O T Y 2 L T I u M Q A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A W F l a I A A A A A A A A P N R A A E A A A A B F s x Y W V o g A A A A A A A A A A A A A A A A A A A A A F h Z W i A A A A A A A A B v o g A A O P U A A A O Q W F l a I A A A A A A A A G K Z A A C 3 h Q A A G N p Y W V o g A A A A A A A A J K A A A A + E A A C 2 z 2 R l c 2 M A A A A A A A A A F k l F Q y B o d H R w O i 8 v d 3 d 3 L m l l Y y 5 j a A A A A A A A A A A A A A A A F k l F Q y B o d H R w O i 8 v d 3 d 3 L m l l Y y 5 j a A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A B k Z X N j A A A A A A A A A C 5 J R U M g N j E 5 N j Y t M i 4 x I E R l Z m F 1 b H Q g U k d C I G N v b G 9 1 c i B z c G F j Z S A t I H N S R 0 I A A A A A A A A A A A A A A C 5 J R U M g N j E 5 N j Y t M i 4 x I E R l Z m F 1 b H Q g U k d C I G N v b G 9 1 c i B z c G F j Z S A t I H N S R 0 I A A A A A A A A A A A A A A A A A A A A A A A A A A A A A Z G V z Y w A A A A A A A A A s U m V m Z X J l b m N l I F Z p Z X d p b m c g Q 2 9 u Z G l 0 a W 9 u I G l u I E l F Q z Y x O T Y 2 L T I u M Q A A A A A A A A A A A A A A L F J l Z m V y Z W 5 j Z S B W a W V 3 a W 5 n I E N v b m R p d G l v b i B p b i B J R U M 2 M T k 2 N i 0 y L j E A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A H Z p Z X c A A A A A A B O k / g A U X y 4 A E M 8 U A A P t z A A E E w s A A 1 y e A A A A A V h Z W i A A A A A A A E w J V g B Q A A A A V x / n b W V h c w A A A A A A A A A B A A A A A A A A A A A A A A A A A A A A A A A A A o 8 A A A A C c 2 l n I A A A A A B D U l Q g Y 3 V y d g A A A A A A A A Q A A A A A B Q A K A A 8 A F A A Z A B 4 A I w A o A C 0 A M g A 3 A D s A Q A B F A E o A T w B U A F k A X g B j A G g A b Q B y A H c A f A C B A I Y A i w C Q A J U A m g C f A K Q A q Q C u A L I A t w C 8 A M E A x g D L A N A A 1 Q D b A O A A 5 Q D r A P A A 9 g D 7 A Q E B B w E N A R M B G Q E f A S U B K w E y A T g B P g F F A U w B U g F Z A W A B Z w F u A X U B f A G D A Y s B k g G a A a E B q Q G x A b k B w Q H J A d E B 2 Q H h A e k B 8 g H 6 A g M C D A I U A h 0 C J g I v A j g C Q Q J L A l Q C X Q J n A n E C e g K E A o 4 C m A K i A q w C t g L B A s s C 1 Q L g A u s C 9 Q M A A w s D F g M h A y 0 D O A N D A 0 8 D W g N m A 3 I D f g O K A 5 Y D o g O u A 7 o D x w P T A + A D 7 A P 5 B A Y E E w Q g B C 0 E O w R I B F U E Y w R x B H 4 E j A S a B K g E t g T E B N M E 4 Q T w B P 4 F D Q U c B S s F O g V J B V g F Z w V 3 B Y Y F l g W m B b U F x Q X V B e U F 9 g Y G B h Y G J w Y 3 B k g G W Q Z q B n s G j A a d B q 8 G w A b R B u M G 9 Q c H B x k H K w c 9 B 0 8 H Y Q d 0 B 4 Y H m Q e s B 7 8 H 0 g f l B / g I C w g f C D I I R g h a C G 4 I g g i W C K o I v g j S C O c I + w k Q C S U J O g l P C W Q J e Q m P C a Q J u g n P C e U J + w o R C i c K P Q p U C m o K g Q q Y C q 4 K x Q r c C v M L C w s i C z k L U Q t p C 4 A L m A u w C 8 g L 4 Q v 5 D B I M K g x D D F w M d Q y O D K c M w A z Z D P M N D Q 0 m D U A N W g 1 0 D Y 4 N q Q 3 D D d 4 N + A 4 T D i 4 O S Q 5 k D n 8 O m w 6 2 D t I O 7 g 8 J D y U P Q Q 9 e D 3 o P l g + z D 8 8 P 7 B A J E C Y Q Q x B h E H 4 Q m x C 5 E N c Q 9 R E T E T E R T x F t E Y w R q h H J E e g S B x I m E k U S Z B K E E q M S w x L j E w M T I x N D E 2 M T g x O k E 8 U T 5 R Q G F C c U S R R q F I s U r R T O F P A V E h U 0 F V Y V e B W b F b 0 V 4 B Y D F i Y W S R Z s F o 8 W s h b W F v o X H R d B F 2 U X i R e u F 9 I X 9 x g b G E A Y Z R i K G K 8 Y 1 R j 6 G S A Z R R l r G Z E Z t x n d G g Q a K h p R G n c a n h r F G u w b F B s 7 G 2 M b i h u y G 9 o c A h w q H F I c e x y j H M w c 9 R 0 e H U c d c B 2 Z H c M d 7 B 4 W H k A e a h 6 U H r 4 e 6 R 8 T H z 4 f a R + U H 7 8 f 6 i A V I E E g b C C Y I M Q g 8 C E c I U g h d S G h I c 4 h + y I n I l U i g i K v I t 0 j C i M 4 I 2 Y j l C P C I / A k H y R N J H w k q y T a J Q k l O C V o J Z c l x y X 3 J i c m V y a H J r c m 6 C c Y J 0 k n e i e r J 9 w o D S g / K H E o o i j U K Q Y p O C l r K Z 0 p 0 C o C K j U q a C q b K s 8 r A i s 2 K 2 k r n S v R L A U s O S x u L K I s 1 y 0 M L U E t d i 2 r L e E u F i 5 M L o I u t y 7 u L y Q v W i + R L 8 c v / j A 1 M G w w p D D b M R I x S j G C M b o x 8 j I q M m M y m z L U M w 0 z R j N / M 7 g z 8 T Q r N G U 0 n j T Y N R M 1 T T W H N c I 1 / T Y 3 N n I 2 r j b p N y Q 3 Y D e c N 9 c 4 F D h Q O I w 4 y D k F O U I 5 f z m 8 O f k 6 N j p 0 O r I 6 7 z s t O 2 s 7 q j v o P C c 8 Z T y k P O M 9 I j 1 h P a E 9 4 D 4 g P m A + o D 7 g P y E / Y T + i P + J A I 0 B k Q K Z A 5 0 E p Q W p B r E H u Q j B C c k K 1 Q v d D O k N 9 Q 8 B E A 0 R H R I p E z k U S R V V F m k X e R i J G Z 0 a r R v B H N U d 7 R 8 B I B U h L S J F I 1 0 k d S W N J q U n w S j d K f U r E S w x L U 0 u a S + J M K k x y T L p N A k 1 K T Z N N 3 E 4 l T m 5 O t 0 8 A T 0 l P k 0 / d U C d Q c V C 7 U Q Z R U F G b U e Z S M V J 8 U s d T E 1 N f U 6 p T 9 l R C V I 9 U 2 1 U o V X V V w l Y P V l x W q V b 3 V 0 R X k l f g W C 9 Y f V j L W R p Z a V m 4 W g d a V l q m W v V b R V u V W + V c N V y G X N Z d J 1 1 4 X c l e G l 5 s X r 1 f D 1 9 h X 7 N g B W B X Y K p g / G F P Y a J h 9 W J J Y p x i 8 G N D Y 5 d j 6 2 R A Z J R k 6 W U 9 Z Z J l 5 2 Y 9 Z p J m 6 G c 9 Z 5 N n 6 W g / a J Z o 7 G l D a Z p p 8 W p I a p 9 q 9 2 t P a 6 d r / 2 x X b K 9 t C G 1 g b b l u E m 5 r b s R v H m 9 4 b 9 F w K 3 C G c O B x O n G V c f B y S 3 K m c w F z X X O 4 d B R 0 c H T M d S h 1 h X X h d j 5 2 m 3 b 4 d 1 Z 3 s 3 g R e G 5 4 z H k q e Y l 5 5 3 p G e q V 7 B H t j e 8 J 8 I X y B f O F 9 Q X 2 h f g F + Y n 7 C f y N / h H / l g E e A q I E K g W u B z Y I w g p K C 9 I N X g 7 q E H Y S A h O O F R 4 W r h g 6 G c o b X h z u H n 4 g E i G m I z o k z i Z m J / o p k i s q L M I u W i / y M Y 4 z K j T G N m I 3 / j m a O z o 8 2 j 5 6 Q B p B u k N a R P 5 G o k h G S e p L j k 0 2 T t p Q g l I q U 9 J V f l c m W N J a f l w q X d Z f g m
done ( ) ;
} ) ;
} ;
2014-06-11 03:42:34 -04:00
} ) ;
[ {
nr : 6 ,
hasAttachments : true
} , {
nr : 7 ,
hasAttachments : true
} ] . forEach ( function ( email ) {
it ( 'should get and decrypt body #' + email . nr , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
message : messages [ email . nr ]
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . body ) . to . equal ( 'asdf' ) ;
if ( email . hasAttachments ) {
expect ( message . attachments . length ) . to . equal ( 1 ) ;
}
done ( ) ;
} ) ;
} ) ;
} ;
2013-10-02 09:47:41 -04:00
} ) ;
} ) ;
2014-06-11 03:42:34 -04:00
it ( 'should set flags' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
var message = messages [ 0 ] ;
message . unread = false ;
message . answered = true ;
emailDao . setFlags ( {
folder : currentFolder ,
message : message
} , function ( err ) {
expect ( err ) . to . not . exist ;
done ( ) ;
} ) ;
} ;
} ) ;
2014-06-23 17:00:46 -04:00
describe ( 'Real life data mail parsing' , function ( ) {
it ( 'should parse Apple Mail (attachment - PGP/MIME): Encrypted' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 9 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . true ;
2014-07-01 17:28:44 -04:00
expect ( message . signed ) . to . be . false ;
expect ( message . signaturesValid ) . to . be . undefined ;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 1 ) ;
expect ( message . body ) . to . equal ( 'test16' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
2014-06-27 10:19:30 -04:00
it . skip ( 'should parse Apple Mail (attachment - PGP/MIME): Encrypted and signed' , function ( done ) {
2014-06-23 17:00:46 -04:00
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 10 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . true ;
expect ( message . signed ) . to . be . true ;
2014-07-01 17:28:44 -04:00
expect ( message . signaturesValid ) . to . be . true ;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 1 ) ;
expect ( message . body ) . to . equal ( 'test15' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
2014-06-27 10:19:30 -04:00
it . skip ( 'should parse Apple Mail (no attachment): Encrypted and signed' , function ( done ) {
2014-06-23 17:00:46 -04:00
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 11 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . true ;
expect ( message . signed ) . to . be . true ;
2014-07-01 17:28:44 -04:00
expect ( message . signaturesValid ) . to . be . true ;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 0 ) ;
expect ( message . body ) . to . equal ( 'test12' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
it ( 'should parse Apple Mail (no attachment): Encrypted' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 12 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . true ;
2014-07-01 17:28:44 -04:00
expect ( message . signed ) . to . be . false ;
expect ( message . signaturesValid ) . to . be . undefined ;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 0 ) ;
expect ( message . body ) . to . equal ( 'test13' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
it ( 'should parse Apple Mail (attachment - PGP/MIME): Signed' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 13 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . false ;
expect ( message . signed ) . to . be . true ;
2014-07-01 17:28:44 -04:00
//TODO (check plaintext signatures): expect(message.signaturesValid).to.be.true;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 1 ) ;
expect ( message . body ) . to . equal ( 'test17\n' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
it ( 'should parse Apple Mail (no attachment): Signed' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 14 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . false ;
expect ( message . signed ) . to . be . true ;
2014-07-01 17:28:44 -04:00
//TODO (check plaintext signatures): expect(message.signaturesValid).to.be.true;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 0 ) ;
expect ( message . body ) . to . equal ( 'test14' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
it ( 'should parse Thunderbird (attachment - PGP/MIME): Encrypted' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 15 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . true ;
2014-07-01 17:28:44 -04:00
expect ( message . signed ) . to . be . false ;
expect ( message . signaturesValid ) . to . be . undefined ;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 1 ) ;
expect ( message . body ) . to . equal ( 'test10' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
2014-07-01 17:28:44 -04:00
it ( 'should parse Thunderbird (attachment - PGP/MIME): Encrypted and signed' , function ( done ) {
2014-06-23 17:00:46 -04:00
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 16 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . true ;
expect ( message . signed ) . to . be . true ;
2014-07-01 17:28:44 -04:00
expect ( message . signaturesValid ) . to . be . true ;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 1 ) ;
expect ( message . body ) . to . equal ( 'test9' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
2014-07-01 17:28:44 -04:00
it ( 'should parse Thunderbird (no attachment): Encrypted and signed' , function ( done ) {
2014-06-23 17:00:46 -04:00
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 17 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . true ;
expect ( message . signed ) . to . be . true ;
2014-07-01 17:28:44 -04:00
expect ( message . signaturesValid ) . to . be . true ;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 0 ) ;
expect ( message . body ) . to . equal ( 'test4\n' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
it ( 'should parse Thunderbird (no attachment): Encrypted' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 18 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . true ;
expect ( message . signed ) . to . be . false ;
2014-07-01 17:28:44 -04:00
expect ( message . signaturesValid ) . to . be . undefined ;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 0 ) ;
expect ( message . body ) . to . equal ( 'test5\n' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
it ( 'should parse Thunderbird (no attachment): plaintext reply to an encrypted message' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 19 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . false ;
expect ( message . signed ) . to . be . false ;
2014-07-01 17:28:44 -04:00
expect ( message . signaturesValid ) . to . be . undefined ;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 0 ) ;
expect ( message . body ) . to . equal ( 'test8\n\n23.06.14 21:12, safewithme kirjutas:\n> test8' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
it ( 'should parse Thunderbird (attachment - PGP/MIME): Signed' , function ( done ) {
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 20 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . false ;
expect ( message . signed ) . to . be . true ;
2014-07-01 17:28:44 -04:00
//TODO (check plaintext signatures): expect(message.signaturesValid).to.be.true;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 1 ) ;
expect ( message . body ) . to . equal ( 'test11' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
2014-06-27 10:19:30 -04:00
it ( 'should parse Thunderbird (no attachment): Signed w/ PGP/inline' , function ( done ) {
2014-06-23 17:00:46 -04:00
emailDao . onIncomingMessage = function ( messages ) {
emailDao . getBody ( {
folder : currentFolder ,
2014-06-27 10:19:30 -04:00
message : messages [ 21 ]
2014-06-23 17:00:46 -04:00
} , function ( err , message ) {
expect ( err ) . to . not . exist ;
emailDao . decryptBody ( {
message : message ,
folder : currentFolder
} , function ( err ) {
expect ( err ) . to . not . exist ;
expect ( message . encrypted ) . to . be . false ;
expect ( message . signed ) . to . be . true ;
2014-07-01 17:28:44 -04:00
//TODO (check plaintext signatures): expect(message.signaturesValid).to.be.true;
2014-06-23 17:00:46 -04:00
expect ( message . attachments . length ) . to . equal ( 0 ) ;
expect ( message . body ) . to . equal ( 'test6' ) ;
done ( ) ;
} ) ;
} ) ;
} ;
} ) ;
} ) ;
2013-10-02 09:47:41 -04:00
} ) ;
2014-06-11 03:42:34 -04:00
describe ( 'SMTP Tests' , function ( ) {
// phantomjs is just sooo slow
it ( 'should send a plaintext message' , function ( done ) {
sinon . stub ( smtpServer , 'onmail' , function ( mail ) {
expect ( mail . from ) . to . equal ( testAccount . user ) ;
expect ( mail . to ) . to . deep . equal ( [ testAccount . user ] ) ;
expect ( /^Content-Type: multipart\/signed/ . test ( mail . body ) ) . to . be . true ;
} ) ;
emailDao . sendPlaintext ( {
smtpclient : smtpClient ,
email : {
from : [ testAccount . user ] ,
to : [ testAccount . user ] ,
subject : 'plaintext test' ,
body : 'hello world!'
}
2013-10-04 07:15:16 -04:00
} , function ( err ) {
expect ( err ) . to . not . exist ;
2014-06-11 03:42:34 -04:00
expect ( smtpServer . onmail . callCount ) . to . equal ( 1 ) ;
smtpServer . onmail . restore ( ) ;
2013-10-04 07:15:16 -04:00
done ( ) ;
} ) ;
} ) ;
2014-06-11 03:42:34 -04:00
it ( 'should send an encrypted message' , function ( done ) {
sinon . stub ( smtpServer , 'onmail' , function ( mail ) {
expect ( mail . from ) . to . equal ( testAccount . user ) ;
expect ( mail . to ) . to . deep . equal ( [ testAccount . user ] ) ;
expect ( /^Content-Type: multipart\/mixed/ . test ( mail . body ) ) . to . be . true ;
expect ( mail . body ) . to . contain ( 'this is a private conversation' ) ;
} ) ;
emailDao . sendEncrypted ( {
smtpclient : smtpClient ,
email : {
from : [ testAccount . user ] ,
to : [ testAccount . user ] ,
subject : 'plaintext test' ,
body : 'hello world!' ,
publicKeysArmored : [ mockKeyPair . publicKey . publicKey ]
}
} , function ( err ) {
2013-10-04 07:15:16 -04:00
expect ( err ) . to . not . exist ;
2014-06-11 03:42:34 -04:00
expect ( smtpServer . onmail . callCount ) . to . equal ( 1 ) ;
smtpServer . onmail . restore ( ) ;
2013-10-04 07:15:16 -04:00
done ( ) ;
} ) ;
} ) ;
} ) ;
2013-10-02 09:47:41 -04:00
} ) ;
} ) ;