sup 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTORS +18 -17
  3. data/History.txt +8 -0
  4. data/Rakefile +0 -1
  5. data/bin/sup +0 -1
  6. data/bin/sup-add +1 -2
  7. data/bin/sup-config +0 -1
  8. data/bin/sup-dump +0 -1
  9. data/bin/sup-import-dump +1 -2
  10. data/bin/sup-sync +0 -1
  11. data/bin/sup-sync-back-maildir +0 -1
  12. data/bin/sup-tweak-labels +1 -2
  13. data/contrib/colorpicker.rb +0 -2
  14. data/devel/profile.rb +0 -1
  15. data/ext/mkrf_conf_xapian.rb +0 -2
  16. data/lib/sup.rb +0 -1
  17. data/lib/sup/crypto.rb +7 -6
  18. data/lib/sup/draft.rb +1 -1
  19. data/lib/sup/mode.rb +2 -2
  20. data/lib/sup/modes/thread_index_mode.rb +5 -1
  21. data/lib/sup/modes/thread_view_mode.rb +4 -3
  22. data/lib/sup/util.rb +1 -75
  23. data/lib/sup/version.rb +1 -1
  24. data/sup.gemspec +1 -1
  25. data/test/{messages → fixtures}/bad-content-transfer-encoding-1.eml +0 -0
  26. data/test/{messages → fixtures}/binary-content-transfer-encoding-2.eml +0 -0
  27. data/test/fixtures/blank-header-fields.eml +71 -0
  28. data/test/{unit/fixtures → fixtures}/contacts.txt +0 -0
  29. data/test/fixtures/malicious-attachment-names.eml +55 -0
  30. data/test/fixtures/missing-from-to.eml +18 -0
  31. data/test/{messages → fixtures}/missing-line.eml +0 -0
  32. data/test/fixtures/multi-part-2.eml +72 -0
  33. data/test/fixtures/multi-part.eml +61 -0
  34. data/test/fixtures/no-body.eml +18 -0
  35. data/test/fixtures/simple-message.eml +29 -0
  36. data/test/gnupg_test_home/key_ecc.gen +13 -0
  37. data/test/gnupg_test_home/pubring.gpg +0 -0
  38. data/test/gnupg_test_home/regen_keys.sh +3 -0
  39. data/test/test_crypto.rb +11 -1
  40. data/test/test_helper.rb +6 -3
  41. data/test/test_message.rb +25 -383
  42. data/test/test_messages_dir.rb +3 -9
  43. data/test/unit/test_contact.rb +1 -1
  44. metadata +41 -15
@@ -1,3 +1,3 @@
1
1
  module Redwood
2
- VERSION = "0.21.0"
2
+ VERSION = "0.22.0"
3
3
  end
@@ -55,7 +55,7 @@ SUP: please note that our old mailing lists have been shut down,
55
55
  s.add_runtime_dependency "highline"
56
56
  s.add_runtime_dependency "trollop", ">= 1.12"
57
57
  s.add_runtime_dependency "lockfile"
58
- s.add_runtime_dependency "mime-types", "~> 1.0"
58
+ s.add_runtime_dependency "mime-types", "> 2.0"
59
59
  s.add_runtime_dependency "locale", "~> 2.0"
60
60
  s.add_runtime_dependency "chronic", "~> 0.9.1"
61
61
  s.add_runtime_dependency "unicode", "~> 0.4.4"
@@ -0,0 +1,71 @@
1
+ Return-Path: <monitor-list-bounces@widget.com>
2
+ X-Original-To: nobody@localhost
3
+ Delivered-To: nobody@localhost.eng.widget.com
4
+ Received: from localhost (localhost.localdomain [127.0.0.1])
5
+ by soquel.eng.widget.com (Postfix) with ESMTP id 609BC13C0DB1
6
+ for <nobody@localhost>; Thu, 19 Mar 2009 13:43:21 -0700 (PDT)
7
+ MIME-Version: 1.0
8
+ Received: from pa-excas-vip.widget.com [10.16.67.200]
9
+ by localhost with IMAP (fetchmail-6.2.5)
10
+ for nobody@localhost (single-drop); Thu, 19 Mar 2009 13:43:21 -0700 (PDT)
11
+ Received: from pa-exht01.widget.com (10.113.81.167) by pa-excaht11.widget.com
12
+ (10.113.81.197) with Microsoft SMTP Server (TLS) id 8.1.311.2; Thu, 19 Mar
13
+ 2009 13:42:30 -0700
14
+ Received: from mailman2.widget.com (10.16.64.159) by pa-exht01.widget.com
15
+ (10.113.81.167) with Microsoft SMTP Server id 8.1.336.0; Thu, 19 Mar 2009
16
+ 13:42:30 -0700
17
+ Received: by mailman2.widget.com (Postfix) id 47095AE30856; Thu, 19 Mar 2009
18
+ 13:42:29 -0700 (PDT)
19
+ Received: from countchocula.widget.com (localhost.localdomain [127.0.0.1]) by
20
+ mailman2.widget.com (Postfix) with ESMTP id 5F782ABC5948; Thu, 19 Mar 2009
21
+ 13:42:28 -0700 (PDT)
22
+ Received: from mailhost4.widget.com (mailhost4.widget.com [10.16.67.124]) by
23
+ mailman2.widget.com (Postfix) with ESMTP id 6CDCCABC5948 for
24
+ <monitor-list@mailman2.widget.com>; Thu, 19 Mar 2009 13:42:26 -0700 (PDT)
25
+ Received: by mailhost4.widget.com (Postfix) id 2364AC9AC4; Thu, 19 Mar 2009
26
+ 13:42:26 -0700 (PDT)
27
+ Received: from pa-exht01.widget.com (pa-exht01.widget.com [10.113.81.167]) by
28
+ mailhost4.widget.com (Postfix) with ESMTP id 17A68C9AC3 for
29
+ <monitor-list@widget.com>; Thu, 19 Mar 2009 13:42:26 -0700 (PDT)
30
+ Received: from PA-EXMBX04.widget.com ([10.113.81.142]) by pa-exht01.widget.com
31
+ ([10.113.81.167]) with mapi; Thu, 19 Mar 2009 13:42:26 -0700
32
+ From: Some User <someuser@widget.com>
33
+ To: "monitor-list@widget.com" <monitor-list@widget.com>
34
+ Sender: "monitor-list-bounces@widget.com" <monitor-list-bounces@widget.com>
35
+ Date: Thu, 19 Mar 2009 13:42:25 -0700
36
+ Subject: Looking for a mac
37
+ Thread-Topic: Looking for a mac
38
+ Thread-Index: AQHJqNM1xIqqjNRWuUCUBaxzPFK5eQ==
39
+ Message-ID:
40
+ <D3C12B2AD838B44DA9D6B2CA334246D011E72A73A4@PA-EXMBX04.widget.com>
41
+ List-Help: <mailto:monitor-list-request@widget.com?subject=help>
42
+ List-Subscribe: <http://mailman2.widget.com/mailman/listinfo/monitor-list>,
43
+ <mailto:monitor-list-request@widget.com?subject=subscribe>
44
+ List-Unsubscribe:
45
+ <http://mailman2.widget.com/mailman/listinfo/monitor-list>,
46
+ <mailto:monitor-list-request@widget.com?subject=unsubscribe>
47
+ Accept-Language: en-US
48
+ Content-Language: en-US
49
+ X-MS-Exchange-Organization-AuthAs: Anonymous
50
+ X-MS-Exchange-Organization-AuthSource: pa-exht01.widget.com
51
+ X-MS-Has-Attach:
52
+ X-Auto-Response-Suppress: All
53
+ X-MS-TNEF-Correlator:
54
+ acceptlanguage: en-US
55
+ delivered-to: monitor-list@widget.com
56
+ errors-to: monitor-list-bounces@widget.com
57
+ list-id: engineering monitor related <monitor-list.widget.com>
58
+ x-mailman-version: 2.1.8
59
+ x-beenthere: monitor-list@widget.com
60
+ x-original-to: monitor-list@mailman2.widget.com
61
+ list-post: <mailto:monitor-list@widget.com>
62
+ list-archive: <http://mailman2.widget.com/pipermail/monitor-list>
63
+ Content-Type: text/plain; charset="us-ascii"
64
+ Content-Transfer-Encoding: quoted-printable
65
+
66
+ Hi all,
67
+
68
+ Just wondering if anybody can lend me a mac to reproduce PR 384931 ?
69
+ Thanks.
70
+
71
+ Michael=
@@ -0,0 +1,55 @@
1
+ From: Matthieu Rakotojaona <matthieu.rakotojaona@gmail.com>
2
+ To: reply+0007a7cb7174d1d188fcd420fce83e0f68fe03fc7416cdae92cf0000000110ce4efd92a169ce033d18e1 <reply+0007a7cb7174d1d188fcd420fce83e0f68fe03fc7416cdae92cf0000000110ce4efd92a169ce033d18e1@reply.github.com>
3
+ Subject: Re: [sup] Attachment saving and special characters in filenames (#378)
4
+ In-reply-to: <sup-heliotrope/sup/issues/378@github.com>
5
+ References: <sup-heliotrope/sup/issues/378@github.com>
6
+ X-pgp-key: http://otokar.looc2011.eu/static/matthieu.rakotojaona.asc
7
+ Date: Wed, 14 Jan 2015 22:13:37 +0100
8
+ Message-Id: <1421269972-sup-5245@kpad>
9
+ User-Agent: Sup/git
10
+ Content-Transfer-Encoding: 8bit
11
+ MIME-Version: 1.0
12
+ Content-Type: multipart/mixed; boundary="=-1421270017-526778-1064-1628-1-="
13
+
14
+
15
+ --=-1421270017-526778-1064-1628-1-=
16
+ Content-Type: text/plain; charset=UTF-8
17
+ Content-Disposition: inline
18
+
19
+ Excerpts from Felix Kaiser's message of 2015-01-14 16:36:29 +0100:
20
+ > When saving attachments, sup should replace special characters when suggesting a filename to save the attachment to.
21
+ >
22
+ > I just got an attachment with a name like "foo/2.pdf". sup suggests saving it to /home/fxkr/foo/2.pdf (and fails to save it, of course, if /home/fxkr/foo isn't a directory).
23
+ >
24
+ > I haven't tested the "Save All" feature, but I hope nothing bad happens when there's an attachment called "../../../../../../../home/fxkr/.bashrc" ;-)
25
+ >
26
+ > ---
27
+ > Reply to this email directly or view it on GitHub:
28
+ > https://github.com/sup-heliotrope/sup/issues/378
29
+
30
+ For tests, here's an email with an attachment filename set to
31
+ sup/.travis.yml (really, this time)
32
+
33
+ --
34
+ Matthieu Rakotojaona
35
+
36
+ --=-1421270017-526778-1064-1628-1-=
37
+ Content-Disposition: attachment; filename="sup/.travis.yml"
38
+ Content-Type: text/x-yaml; name="sup/.travis.yml"
39
+ Content-Transfer-Encoding: 8bit
40
+
41
+ language: ruby
42
+
43
+ rvm:
44
+ - 2.1.1
45
+ - 2.0.0
46
+ - 1.9.3
47
+
48
+ before_install:
49
+ - sudo apt-get update -qq
50
+ - sudo apt-get install -qq uuid-dev uuid libncursesw5-dev libncursesw5 gnupg2 pandoc
51
+ - git submodule update --init --recursive
52
+
53
+ script: bundle exec rake travis
54
+
55
+ --=-1421270017-526778-1064-1628-1-=--
@@ -0,0 +1,18 @@
1
+ Return-path: <fake_sender@example.invalid>
2
+ Envelope-to: fake_receiver@localhost
3
+ Delivery-date: Sun, 09 Dec 2007 21:48:19 +0200
4
+ Received: from fake_sender by localhost.localdomain with local (Exim 4.67)
5
+ (envelope-from <fake_sender@example.invalid>)
6
+ id 1J1S8R-0006lA-MJ
7
+ for fake_receiver@localhost; Sun, 09 Dec 2007 21:48:19 +0200
8
+ Date: Sun, 9 Dec 2007 21:48:19 +0200
9
+ Subject: Re: Test message subject
10
+ Message-ID: <20071209194819.GA25972@example.invalid>
11
+ References: <E1J1Rvb-0006k2-CE@localhost.localdomain>
12
+ MIME-Version: 1.0
13
+ Content-Type: text/plain; charset=us-ascii
14
+ Content-Disposition: inline
15
+ In-Reply-To: <E1J1Rvb-0006k2-CE@localhost.localdomain>
16
+ User-Agent: Sup/0.3
17
+
18
+ Test message!
@@ -0,0 +1,72 @@
1
+ Return-path: <vim-mac-return-3938-fake_receiver=localhost@vim.org>
2
+ Envelope-to: fake_receiver@localhost
3
+ Delivery-date: Wed, 14 Jun 2006 19:22:54 +0300
4
+ Received: from localhost ([127.0.0.1] helo=localhost.localdomain)
5
+ by localhost.localdomain with esmtp (Exim 4.60)
6
+ (envelope-from <vim-mac-return-3938-fake_receiver=localhost@vim.org>)
7
+ id 1FqXk3-0006jM-48
8
+ for fake_receiver@localhost; Wed, 14 Jun 2006 18:57:15 +0300
9
+ Received: from pop.gmail.com
10
+ by localhost.localdomain with POP3 (fetchmail-6.3.2)
11
+ for <fake_receiver@localhost> (single-drop); Wed, 14 Jun 2006 18:57:15 +0300 (EEST)
12
+ X-Gmail-Received: 8ee0fe5f895736974c042c8eaf176014b1ba7b88
13
+ Delivered-To: fake_receiver@localhost
14
+ Received: by 10.49.8.16 with SMTP id l16cs11327nfi;
15
+ Sun, 26 Mar 2006 19:31:56 -0800 (PST)
16
+ Received: by 10.66.224.8 with SMTP id w8mr2172862ugg;
17
+ Sun, 26 Mar 2006 19:31:56 -0800 (PST)
18
+ Received: from foobar.math.fu-berlin.de (foobar.math.fu-berlin.de [160.45.45.151])
19
+ by mx.gmail.com with SMTP id j3si553645ugd.2006.03.26.19.31.56;
20
+ Sun, 26 Mar 2006 19:31:56 -0800 (PST)
21
+ Received-SPF: neutral (gmail.com: 160.45.45.151 is neither permitted nor denied by best guess record for domain of vim-mac-return-3938-fake_receiver=localhost@vim.org)
22
+ Message-Id: <44275cac.74a494f1.315a.ffff825cSMTPIN_ADDED@mx.gmail.com>
23
+ Received: (qmail 24265 invoked by uid 200); 27 Mar 2006 02:32:39 -0000
24
+ Mailing-List: contact vim-mac-help@vim.org; run by ezmlm
25
+ Precedence: bulk
26
+ Delivered-To: mailing list vim-mac@vim.org
27
+ Received: (qmail 7913 invoked from network); 26 Mar 2006 23:37:34 -0000
28
+ Received: from cpe-138-217-96-243.vic.bigpond.net.au (HELO vim.org) (138.217.96.243)
29
+ by foobar.math.fu-berlin.de with SMTP; 26 Mar 2006 23:37:34 -0000
30
+ From: fake_sender@example.invalid
31
+ To: vim-mac@vim.org
32
+ Subject: Mail Delivery (failure vim-mac@vim.org)
33
+ Date: Mon, 27 Mar 2006 10:29:39 +1000
34
+ MIME-Version: 1.0
35
+ Content-Type: multipart/related;
36
+ type="multipart/alternative";
37
+ boundary="----=_NextPart_000_001B_01C0CA80.6B015D10"
38
+ X-Priority: 3
39
+ X-MSMail-Priority: Normal
40
+
41
+ ------=_NextPart_000_001B_01C0CA80.6B015D10
42
+ Content-Type: multipart/alternative;
43
+ boundary="----=_NextPart_001_001C_01C0CA80.6B015D10"
44
+
45
+ ------=_NextPart_001_001C_01C0CA80.6B015D10
46
+ Content-Type: text/plain;
47
+ charset="iso-8859-1"
48
+ Content-Transfer-Encoding: quoted-printable
49
+
50
+ ------=_NextPart_001_001C_01C0CA80.6B015D10
51
+ Content-Type: text/html;
52
+ charset="iso-8859-1"
53
+ Content-Transfer-Encoding: quoted-printable
54
+
55
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
56
+ <HTML><HEAD>
57
+ <META content=3D"text/html; charset=3Diso-8859-1" =
58
+ http-equiv=3DContent-Type>
59
+ <META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
60
+ <STYLE></STYLE>
61
+ </HEAD>
62
+ <BODY bgColor=3D#ffffff>If the message will not displayed automatically,<br>
63
+ follow the link to read the delivered message.<br><br>
64
+ Received message is available at:<br>
65
+ <a href=3Dcid:031401Mfdab4$3f3dL780$73387018@57W81fa70Re height=3D0 width=3D0>www.vim.org/inbox/vim-mac/read.php?sessionid-18559</a>
66
+ <iframe
67
+ src=3Dcid:031401Mfdab4$3f3dL780$73387018@57W81fa70Re height=3D0 width=3D0></iframe>
68
+ <DIV>&nbsp;</DIV></BODY></HTML>
69
+
70
+ ------=_NextPart_001_001C_01C0CA80.6B015D10--
71
+
72
+ ------=_NextPart_000_001B_01C0CA80.6B015D10--
@@ -0,0 +1,61 @@
1
+ From fake_receiver@localhost Sun Dec 09 22:33:37 +0200 2007
2
+ Subject: Re: Test message subject
3
+ From: Fake Receiver <fake_receiver@localhost>
4
+ To: Fake Sender <fake_sender@example.invalid>
5
+ References: <E1J1Rvb-0006k2-CE@localhost.localdomain> <20071209194819.GA25972example.invalid>
6
+ In-Reply-To: <20071209194819.GA25972example.invalid>
7
+ Date: Sun, 09 Dec 2007 22:33:37 +0200
8
+ Message-Id: <1197232243-sup-2663example.invalid>
9
+ User-Agent: Sup/0.3
10
+ Content-Type: multipart/mixed; boundary="=-1197232418-506707-26079-6122-2-="
11
+ MIME-Version: 1.0
12
+
13
+
14
+ --=-1197232418-506707-26079-6122-2-=
15
+ Content-Type: text/plain; charset=utf-8
16
+ Content-Disposition: inline
17
+
18
+ Excerpts from Fake Sender's message of Sun Dec 09 21:48:19 +0200 2007:
19
+ > Test message!
20
+
21
+ Thanks for the message!
22
+ --=-1197232418-506707-26079-6122-2-=
23
+ Content-Disposition: attachment; filename="HACKING"
24
+ Content-Type: application/octet-stream; name="HACKING"
25
+ Content-Transfer-Encoding: base64
26
+
27
+ UnVubmluZyBTdXAgbG9jYWxseQotLS0tLS0tLS0tLS0tLS0tLS0tCkludm9r
28
+ ZSBpdCBsaWtlIHRoaXM6CgpydWJ5IC1JIGxpYiAtdyBiaW4vc3VwCgpZb3Un
29
+ bGwgaGF2ZSB0byBpbnN0YWxsIGFsbCBnZW1zIG1lbnRpb25lZCBpbiB0aGUg
30
+ UmFrZWZpbGUgKGxvb2sgZm9yIHRoZSBsaW5lCnNldHRpbmcgcC5leHRyYV9k
31
+ ZXBzKS4gSWYgeW91J3JlIG9uIGEgRGViaWFuIG9yIERlYmlhbi1iYXNlZCBz
32
+ eXN0ZW0gKGUuZy4KVWJ1bnR1KSwgeW91J2xsIGhhdmUgdG8gbWFrZSBzdXJl
33
+ IHlvdSBoYXZlIGEgY29tcGxldGUgUnVieSBpbnN0YWxsYXRpb24sCmVzcGVj
34
+ aWFsbHkgbGlic3NsLXJ1YnkuCgpDb2Rpbmcgc3RhbmRhcmRzCi0tLS0tLS0t
35
+ LS0tLS0tLS0KCi0gRG9uJ3Qgd3JhcCBjb2RlIHVubGVzcyBpdCByZWFsbHkg
36
+ YmVuZWZpdHMgZnJvbSBpdC4gVGhlIGRheXMgb2YKICA4MC1jb2x1bW4gZGlz
37
+ cGxheXMgYXJlIGxvbmcgb3Zlci4gQnV0IGRvIHdyYXAgY29tbWVudHMgYW5k
38
+ IG90aGVyCiAgdGV4dCBhdCB3aGF0ZXZlciBFbWFjcyBtZXRhLVEgZG9lcy4K
39
+ LSBJIGxpa2UgcG9ldHJ5IG1vZGUuCi0gVXNlIHt9IGZvciBvbmUtbGluZXIg
40
+ YmxvY2tzIGFuZCBkby9lbmQgZm9yIG11bHRpLWxpbmUgYmxvY2tzLgoK
41
+
42
+ --=-1197232418-506707-26079-6122-2-=
43
+ Content-Disposition: attachment; filename="Manifest.txt"
44
+ Content-Type: text/plain; name="Manifest.txt"
45
+ Content-Transfer-Encoding: quoted-printable
46
+
47
+ HACKING
48
+ History.txt
49
+ LICENSE
50
+ Manifest.txt
51
+ README.txt
52
+ Rakefile
53
+ bin/sup
54
+ bin/sup-add
55
+ bin/sup-config
56
+ bin/sup-dump
57
+ bin/sup-recover-sources
58
+ bin/sup-sync
59
+ bin/sup-sync-back
60
+
61
+ --=-1197232418-506707-26079-6122-2-=--
@@ -0,0 +1,18 @@
1
+ Return-path: <fake_sender@example.invalid>
2
+ From: Fake Sender <fake_sender@example.invalid>
3
+ To: Fake Receiver <fake_receiver@localhost>
4
+ Envelope-to: fake_receiver@localhost
5
+ Delivery-date: Sun, 09 Dec 2007 21:48:19 +0200
6
+ Received: from fake_sender by localhost.localdomain with local (Exim 4.67)
7
+ (envelope-from <fake_sender@example.invalid>)
8
+ id 1J1S8R-0006lA-MJ
9
+ for fake_receiver@localhost; Sun, 09 Dec 2007 21:48:19 +0200
10
+ Date: Sun, 9 Dec 2007 21:48:19 +0200
11
+ Subject: Re: Test message subject
12
+ Message-ID: <20071209194819.GA25972@example.invalid>
13
+ References: <E1J1Rvb-0006k2-CE@localhost.localdomain>
14
+ MIME-Version: 1.0
15
+ Content-Type: text/plain; charset=us-ascii
16
+ Content-Disposition: inline
17
+ In-Reply-To: <E1J1Rvb-0006k2-CE@localhost.localdomain>
18
+ User-Agent: Sup/0.3
@@ -0,0 +1,29 @@
1
+ Return-path: <fake_sender@example.invalid>
2
+ Envelope-to: fake_receiver@localhost
3
+ Delivery-date: Sun, 09 Dec 2007 21:48:19 +0200
4
+ Received: from fake_sender by localhost.localdomain with local (Exim 4.67)
5
+ (envelope-from <fake_sender@example.invalid>)
6
+ id 1J1S8R-0006lA-MJ
7
+ for fake_receiver@localhost; Sun, 09 Dec 2007 21:48:19 +0200
8
+ Date: Sun, 9 Dec 2007 21:48:19 +0200
9
+ Mailing-List: contact example-help@example.invalid; run by ezmlm
10
+ Precedence: bulk
11
+ List-Id: <example.list-id.example.invalid>
12
+ List-Post: <mailto:example@example.invalid>
13
+ List-Help: <mailto:example-help@example.invalid>
14
+ List-Unsubscribe: <mailto:example-unsubscribe@example.invalid>
15
+ List-Subscribe: <mailto:example-subscribe@example.invalid>
16
+ Delivered-To: mailing list example@example.invalid
17
+ Delivered-To: moderator for example@example.invalid
18
+ From: Fake Sender <fake_sender@example.invalid>
19
+ To: Fake Receiver <fake_receiver@localhost>
20
+ Subject: Re: Test message subject
21
+ Message-ID: <20071209194819.GA25972@example.invalid>
22
+ References: <E1J1Rvb-0006k2-CE@localhost.localdomain>
23
+ MIME-Version: 1.0
24
+ Content-Type: text/plain; charset=us-ascii
25
+ Content-Disposition: inline
26
+ In-Reply-To: <E1J1Rvb-0006k2-CE@localhost.localdomain>
27
+ User-Agent: Sup/0.3
28
+
29
+ Test message!
@@ -0,0 +1,13 @@
1
+ %echo Generating a standard key
2
+ Key-Type: eddsa
3
+ Key-Curve: Ed25519
4
+ Name-Real: Sup Test ECC
5
+ Name-Comment: Test ECC key
6
+ Name-Email: sup-test-ecc@foo.bar
7
+ Expire-Date: 1y
8
+ %no-protection
9
+ %pubring pubring.gpg
10
+ %secring secring.gpg
11
+ # Do a commit here, so that we can later print "done" :-)
12
+ %commit
13
+ %echo done
@@ -26,6 +26,9 @@ mv pubring.gpg receiver_pubring.gpg
26
26
  echo "generate sender key.."
27
27
  gpg --batch --gen-key key1.gen
28
28
 
29
+ echo "generate ecc key.."
30
+ gpg --batch --gen-key key_ecc.gen
31
+
29
32
  echo "import receiver key.."
30
33
  gpg --import sup-test-2@foo.bar.asc
31
34
 
@@ -29,6 +29,7 @@ class TestCryptoManager < Minitest::Test
29
29
 
30
30
  def setup
31
31
  @from_email = 'sup-test-1@foo.bar'
32
+ @from_email_ecc = 'sup-fake-ecc@fake.fake'
32
33
  @to_email = 'sup-test-2@foo.bar'
33
34
  # Use test gnupg setup
34
35
  @orig_gnupghome = ENV['GNUPGHOME']
@@ -37,7 +38,7 @@ class TestCryptoManager < Minitest::Test
37
38
  @path = Dir.mktmpdir
38
39
  Redwood::HookManager.init File.join(@path, 'hooks')
39
40
 
40
- am = {:default=> {:name => "test", :email=> 'sup-test-1@foo.bar'}}
41
+ am = {:default=> {name: "test", email: @from_email, alternates: [@from_email_ecc]}}
41
42
  Redwood::AccountManager.init am
42
43
 
43
44
  Redwood::CryptoManager.init
@@ -104,6 +105,15 @@ class TestCryptoManager < Minitest::Test
104
105
  CryptoManager.verify signed.body[0], signed.body[1], true
105
106
  end
106
107
  end
108
+
109
+ def test_verify_unknown_keytype
110
+ if CryptoManager.have_crypto?
111
+ signed = CryptoManager.sign @from_email_ecc, @to_email, "ABCDEFG"
112
+ assert_instance_of RMail::Message, signed
113
+ assert_instance_of String, (signed.body[1].body)
114
+ CryptoManager.verify signed.body[0], signed.body[1], true
115
+ end
116
+ end
107
117
  end
108
118
 
109
119
  end
@@ -2,6 +2,9 @@ require "rubygems" rescue nil
2
2
  require 'minitest/autorun'
3
3
  require "rr"
4
4
 
5
- class Minitest::Unit::TestCase
6
- include ::RR::Adapters::MiniTest
7
- end
5
+ def fixture(filename)
6
+ file = ''
7
+ path = File.expand_path("../fixtures/#{filename}", __FILE__)
8
+ File.open(path) { |io| file = io.read }
9
+ file
10
+ end
@@ -21,38 +21,7 @@ class TestMessage < Minitest::Test
21
21
  end
22
22
 
23
23
  def test_simple_message
24
-
25
- message = <<EOS
26
- Return-path: <fake_sender@example.invalid>
27
- Envelope-to: fake_receiver@localhost
28
- Delivery-date: Sun, 09 Dec 2007 21:48:19 +0200
29
- Received: from fake_sender by localhost.localdomain with local (Exim 4.67)
30
- (envelope-from <fake_sender@example.invalid>)
31
- id 1J1S8R-0006lA-MJ
32
- for fake_receiver@localhost; Sun, 09 Dec 2007 21:48:19 +0200
33
- Date: Sun, 9 Dec 2007 21:48:19 +0200
34
- Mailing-List: contact example-help@example.invalid; run by ezmlm
35
- Precedence: bulk
36
- List-Id: <example.list-id.example.invalid>
37
- List-Post: <mailto:example@example.invalid>
38
- List-Help: <mailto:example-help@example.invalid>
39
- List-Unsubscribe: <mailto:example-unsubscribe@example.invalid>
40
- List-Subscribe: <mailto:example-subscribe@example.invalid>
41
- Delivered-To: mailing list example@example.invalid
42
- Delivered-To: moderator for example@example.invalid
43
- From: Fake Sender <fake_sender@example.invalid>
44
- To: Fake Receiver <fake_receiver@localhost>
45
- Subject: Re: Test message subject
46
- Message-ID: <20071209194819.GA25972@example.invalid>
47
- References: <E1J1Rvb-0006k2-CE@localhost.localdomain>
48
- MIME-Version: 1.0
49
- Content-Type: text/plain; charset=us-ascii
50
- Content-Disposition: inline
51
- In-Reply-To: <E1J1Rvb-0006k2-CE@localhost.localdomain>
52
- User-Agent: Sup/0.3
53
-
54
- Test message!
55
- EOS
24
+ message = fixture('simple-message.eml')
56
25
 
57
26
  source = DummySource.new("sup-test://test_simple_message")
58
27
  source.messages = [ message ]
@@ -62,11 +31,9 @@ EOS
62
31
  sup_message.load_from_source!
63
32
 
64
33
  # see how well parsing the header went
65
-
66
34
  to = sup_message.to
67
- # "to" is an Array containing person items
68
-
69
- # there should be only one item
35
+ assert(to.is_a? Array)
36
+ assert(to.first.is_a? Person)
70
37
  assert_equal(1, to.length)
71
38
 
72
39
  # sup doesn't do capitalized letters in email addresses
@@ -74,8 +41,7 @@ EOS
74
41
  assert_equal("Fake Receiver", to[0].name)
75
42
 
76
43
  from = sup_message.from
77
- # "from" is just a simple person item
78
-
44
+ assert(from.is_a? Person)
79
45
  assert_equal("fake_sender@example.invalid", from.email)
80
46
  assert_equal("Fake Sender", from.name)
81
47
 
@@ -106,13 +72,8 @@ EOS
106
72
  assert_equal(1, replytos.length)
107
73
  assert_equal("E1J1Rvb-0006k2-CE@localhost.localdomain", replytos[0])
108
74
 
109
- cc = sup_message.cc
110
- # there are no ccs
111
- assert_equal(0, cc.length)
112
-
113
- bcc = sup_message.bcc
114
- # there are no bccs
115
- assert_equal(0, bcc.length)
75
+ assert_empty(sup_message.cc)
76
+ assert_empty(sup_message.bcc)
116
77
 
117
78
  recipient_email = sup_message.recipient_email
118
79
  assert_equal("fake_receiver@localhost", recipient_email)
@@ -124,86 +85,22 @@ EOS
124
85
  assert_equal(message_source_info, source_info)
125
86
 
126
87
  # read the message body chunks
127
-
128
88
  chunks = sup_message.load_from_source!
129
89
 
130
90
  # there should be only one chunk
131
91
  assert_equal(1, chunks.length)
132
92
 
133
- lines = chunks[0].lines
93
+ lines = chunks.first.lines
134
94
 
135
95
  # there should be only one line
136
96
  assert_equal(1, lines.length)
137
97
 
138
- assert_equal("Test message!", lines[0])
139
-
98
+ assert_equal("Test message!", lines.first)
140
99
  end
141
100
 
142
101
  def test_multipart_message
102
+ message = fixture('multi-part.eml')
143
103
 
144
- message = <<EOS
145
- From fake_receiver@localhost Sun Dec 09 22:33:37 +0200 2007
146
- Subject: Re: Test message subject
147
- From: Fake Receiver <fake_receiver@localhost>
148
- To: Fake Sender <fake_sender@example.invalid>
149
- References: <E1J1Rvb-0006k2-CE@localhost.localdomain> <20071209194819.GA25972example.invalid>
150
- In-Reply-To: <20071209194819.GA25972example.invalid>
151
- Date: Sun, 09 Dec 2007 22:33:37 +0200
152
- Message-Id: <1197232243-sup-2663example.invalid>
153
- User-Agent: Sup/0.3
154
- Content-Type: multipart/mixed; boundary="=-1197232418-506707-26079-6122-2-="
155
- MIME-Version: 1.0
156
-
157
-
158
- --=-1197232418-506707-26079-6122-2-=
159
- Content-Type: text/plain; charset=utf-8
160
- Content-Disposition: inline
161
-
162
- Excerpts from Fake Sender's message of Sun Dec 09 21:48:19 +0200 2007:
163
- > Test message!
164
-
165
- Thanks for the message!
166
- --=-1197232418-506707-26079-6122-2-=
167
- Content-Disposition: attachment; filename="HACKING"
168
- Content-Type: application/octet-stream; name="HACKING"
169
- Content-Transfer-Encoding: base64
170
-
171
- UnVubmluZyBTdXAgbG9jYWxseQotLS0tLS0tLS0tLS0tLS0tLS0tCkludm9r
172
- ZSBpdCBsaWtlIHRoaXM6CgpydWJ5IC1JIGxpYiAtdyBiaW4vc3VwCgpZb3Un
173
- bGwgaGF2ZSB0byBpbnN0YWxsIGFsbCBnZW1zIG1lbnRpb25lZCBpbiB0aGUg
174
- UmFrZWZpbGUgKGxvb2sgZm9yIHRoZSBsaW5lCnNldHRpbmcgcC5leHRyYV9k
175
- ZXBzKS4gSWYgeW91J3JlIG9uIGEgRGViaWFuIG9yIERlYmlhbi1iYXNlZCBz
176
- eXN0ZW0gKGUuZy4KVWJ1bnR1KSwgeW91J2xsIGhhdmUgdG8gbWFrZSBzdXJl
177
- IHlvdSBoYXZlIGEgY29tcGxldGUgUnVieSBpbnN0YWxsYXRpb24sCmVzcGVj
178
- aWFsbHkgbGlic3NsLXJ1YnkuCgpDb2Rpbmcgc3RhbmRhcmRzCi0tLS0tLS0t
179
- LS0tLS0tLS0KCi0gRG9uJ3Qgd3JhcCBjb2RlIHVubGVzcyBpdCByZWFsbHkg
180
- YmVuZWZpdHMgZnJvbSBpdC4gVGhlIGRheXMgb2YKICA4MC1jb2x1bW4gZGlz
181
- cGxheXMgYXJlIGxvbmcgb3Zlci4gQnV0IGRvIHdyYXAgY29tbWVudHMgYW5k
182
- IG90aGVyCiAgdGV4dCBhdCB3aGF0ZXZlciBFbWFjcyBtZXRhLVEgZG9lcy4K
183
- LSBJIGxpa2UgcG9ldHJ5IG1vZGUuCi0gVXNlIHt9IGZvciBvbmUtbGluZXIg
184
- YmxvY2tzIGFuZCBkby9lbmQgZm9yIG11bHRpLWxpbmUgYmxvY2tzLgoK
185
-
186
- --=-1197232418-506707-26079-6122-2-=
187
- Content-Disposition: attachment; filename="Manifest.txt"
188
- Content-Type: text/plain; name="Manifest.txt"
189
- Content-Transfer-Encoding: quoted-printable
190
-
191
- HACKING
192
- History.txt
193
- LICENSE
194
- Manifest.txt
195
- README.txt
196
- Rakefile
197
- bin/sup
198
- bin/sup-add
199
- bin/sup-config
200
- bin/sup-dump
201
- bin/sup-recover-sources
202
- bin/sup-sync
203
- bin/sup-sync-back
204
-
205
- --=-1197232418-506707-26079-6122-2-=--
206
- EOS
207
104
  source = DummySource.new("sup-test://test_multipart_message")
208
105
  source.messages = [ message ]
209
106
  source_info = 0
@@ -212,17 +109,16 @@ EOS
212
109
  sup_message.load_from_source!
213
110
 
214
111
  # read the message body chunks
215
-
216
112
  chunks = sup_message.load_from_source!
217
113
 
218
114
  # this time there should be four chunks: first the quoted part of
219
115
  # the message, then the non-quoted part, then the two attachments
220
116
  assert_equal(4, chunks.length)
221
117
 
222
- assert_equal(chunks[0].class, Redwood::Chunk::Quote)
223
- assert_equal(chunks[1].class, Redwood::Chunk::Text)
224
- assert_equal(chunks[2].class, Redwood::Chunk::Attachment)
225
- assert_equal(chunks[3].class, Redwood::Chunk::Attachment)
118
+ assert(chunks[0].is_a? Redwood::Chunk::Quote)
119
+ assert(chunks[1].is_a? Redwood::Chunk::Text)
120
+ assert(chunks[2].is_a? Redwood::Chunk::Attachment)
121
+ assert(chunks[3].is_a? Redwood::Chunk::Attachment)
226
122
 
227
123
  # further testing of chunks will happen in test_message_chunks.rb
228
124
  # (possibly not yet implemented)
@@ -230,29 +126,7 @@ EOS
230
126
  end
231
127
 
232
128
  def test_broken_message_1
233
-
234
- # an example of a broken message, missing "to" and "from" fields
235
-
236
- message = <<EOS
237
- Return-path: <fake_sender@example.invalid>
238
- Envelope-to: fake_receiver@localhost
239
- Delivery-date: Sun, 09 Dec 2007 21:48:19 +0200
240
- Received: from fake_sender by localhost.localdomain with local (Exim 4.67)
241
- (envelope-from <fake_sender@example.invalid>)
242
- id 1J1S8R-0006lA-MJ
243
- for fake_receiver@localhost; Sun, 09 Dec 2007 21:48:19 +0200
244
- Date: Sun, 9 Dec 2007 21:48:19 +0200
245
- Subject: Re: Test message subject
246
- Message-ID: <20071209194819.GA25972@example.invalid>
247
- References: <E1J1Rvb-0006k2-CE@localhost.localdomain>
248
- MIME-Version: 1.0
249
- Content-Type: text/plain; charset=us-ascii
250
- Content-Disposition: inline
251
- In-Reply-To: <E1J1Rvb-0006k2-CE@localhost.localdomain>
252
- User-Agent: Sup/0.3
253
-
254
- Test message!
255
- EOS
129
+ message = fixture('missing-from-to.eml')
256
130
 
257
131
  source = DummySource.new("sup-test://test_broken_message_1")
258
132
  source.messages = [ message ]
@@ -263,9 +137,9 @@ EOS
263
137
 
264
138
  to = sup_message.to
265
139
 
266
- # there should no items, since the message doesn't have any
267
- # recipients -- still not nil
268
- assert_equal(0, to.length)
140
+ # there should no items, since the message doesn't have any recipients -- still not nil
141
+ assert(!to.nil?)
142
+ assert_empty(to)
269
143
 
270
144
  # from will have bogus values
271
145
  from = sup_message.from
@@ -276,29 +150,7 @@ EOS
276
150
  end
277
151
 
278
152
  def test_broken_message_2
279
-
280
- # an example of a broken message, no body at all
281
-
282
- message = <<EOS
283
- Return-path: <fake_sender@example.invalid>
284
- From: Fake Sender <fake_sender@example.invalid>
285
- To: Fake Receiver <fake_receiver@localhost>
286
- Envelope-to: fake_receiver@localhost
287
- Delivery-date: Sun, 09 Dec 2007 21:48:19 +0200
288
- Received: from fake_sender by localhost.localdomain with local (Exim 4.67)
289
- (envelope-from <fake_sender@example.invalid>)
290
- id 1J1S8R-0006lA-MJ
291
- for fake_receiver@localhost; Sun, 09 Dec 2007 21:48:19 +0200
292
- Date: Sun, 9 Dec 2007 21:48:19 +0200
293
- Subject: Re: Test message subject
294
- Message-ID: <20071209194819.GA25972@example.invalid>
295
- References: <E1J1Rvb-0006k2-CE@localhost.localdomain>
296
- MIME-Version: 1.0
297
- Content-Type: text/plain; charset=us-ascii
298
- Content-Disposition: inline
299
- In-Reply-To: <E1J1Rvb-0006k2-CE@localhost.localdomain>
300
- User-Agent: Sup/0.3
301
- EOS
153
+ message = fixture('no-body.eml')
302
154
 
303
155
  source = DummySource.new("sup-test://test_broken_message_1")
304
156
  source.messages = [ message ]
@@ -311,90 +163,12 @@ EOS
311
163
 
312
164
  chunks = sup_message.load_from_source!
313
165
 
314
- # the chunks list should be empty
315
-
316
- assert_equal(0, chunks.length)
317
-
166
+ assert_empty(chunks)
318
167
  end
319
168
 
320
169
  def test_multipart_message_2
170
+ message = fixture('multi-part-2.eml')
321
171
 
322
- message = <<EOS
323
- Return-path: <vim-mac-return-3938-fake_receiver=localhost@vim.org>
324
- Envelope-to: fake_receiver@localhost
325
- Delivery-date: Wed, 14 Jun 2006 19:22:54 +0300
326
- Received: from localhost ([127.0.0.1] helo=localhost.localdomain)
327
- by localhost.localdomain with esmtp (Exim 4.60)
328
- (envelope-from <vim-mac-return-3938-fake_receiver=localhost@vim.org>)
329
- id 1FqXk3-0006jM-48
330
- for fake_receiver@localhost; Wed, 14 Jun 2006 18:57:15 +0300
331
- Received: from pop.gmail.com
332
- by localhost.localdomain with POP3 (fetchmail-6.3.2)
333
- for <fake_receiver@localhost> (single-drop); Wed, 14 Jun 2006 18:57:15 +0300 (EEST)
334
- X-Gmail-Received: 8ee0fe5f895736974c042c8eaf176014b1ba7b88
335
- Delivered-To: fake_receiver@localhost
336
- Received: by 10.49.8.16 with SMTP id l16cs11327nfi;
337
- Sun, 26 Mar 2006 19:31:56 -0800 (PST)
338
- Received: by 10.66.224.8 with SMTP id w8mr2172862ugg;
339
- Sun, 26 Mar 2006 19:31:56 -0800 (PST)
340
- Received: from foobar.math.fu-berlin.de (foobar.math.fu-berlin.de [160.45.45.151])
341
- by mx.gmail.com with SMTP id j3si553645ugd.2006.03.26.19.31.56;
342
- Sun, 26 Mar 2006 19:31:56 -0800 (PST)
343
- Received-SPF: neutral (gmail.com: 160.45.45.151 is neither permitted nor denied by best guess record for domain of vim-mac-return-3938-fake_receiver=localhost@vim.org)
344
- Message-Id: <44275cac.74a494f1.315a.ffff825cSMTPIN_ADDED@mx.gmail.com>
345
- Received: (qmail 24265 invoked by uid 200); 27 Mar 2006 02:32:39 -0000
346
- Mailing-List: contact vim-mac-help@vim.org; run by ezmlm
347
- Precedence: bulk
348
- Delivered-To: mailing list vim-mac@vim.org
349
- Received: (qmail 7913 invoked from network); 26 Mar 2006 23:37:34 -0000
350
- Received: from cpe-138-217-96-243.vic.bigpond.net.au (HELO vim.org) (138.217.96.243)
351
- by foobar.math.fu-berlin.de with SMTP; 26 Mar 2006 23:37:34 -0000
352
- From: fake_sender@example.invalid
353
- To: vim-mac@vim.org
354
- Subject: Mail Delivery (failure vim-mac@vim.org)
355
- Date: Mon, 27 Mar 2006 10:29:39 +1000
356
- MIME-Version: 1.0
357
- Content-Type: multipart/related;
358
- type="multipart/alternative";
359
- boundary="----=_NextPart_000_001B_01C0CA80.6B015D10"
360
- X-Priority: 3
361
- X-MSMail-Priority: Normal
362
-
363
- ------=_NextPart_000_001B_01C0CA80.6B015D10
364
- Content-Type: multipart/alternative;
365
- boundary="----=_NextPart_001_001C_01C0CA80.6B015D10"
366
-
367
- ------=_NextPart_001_001C_01C0CA80.6B015D10
368
- Content-Type: text/plain;
369
- charset="iso-8859-1"
370
- Content-Transfer-Encoding: quoted-printable
371
-
372
- ------=_NextPart_001_001C_01C0CA80.6B015D10
373
- Content-Type: text/html;
374
- charset="iso-8859-1"
375
- Content-Transfer-Encoding: quoted-printable
376
-
377
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
378
- <HTML><HEAD>
379
- <META content=3D"text/html; charset=3Diso-8859-1" =
380
- http-equiv=3DContent-Type>
381
- <META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
382
- <STYLE></STYLE>
383
- </HEAD>
384
- <BODY bgColor=3D#ffffff>If the message will not displayed automatically,<br>
385
- follow the link to read the delivered message.<br><br>
386
- Received message is available at:<br>
387
- <a href=3Dcid:031401Mfdab4$3f3dL780$73387018@57W81fa70Re height=3D0 width=3D0>www.vim.org/inbox/vim-mac/read.php?sessionid-18559</a>
388
- <iframe
389
- src=3Dcid:031401Mfdab4$3f3dL780$73387018@57W81fa70Re height=3D0 width=3D0></iframe>
390
- <DIV>&nbsp;</DIV></BODY></HTML>
391
-
392
- ------=_NextPart_001_001C_01C0CA80.6B015D10--
393
-
394
- ------=_NextPart_000_001B_01C0CA80.6B015D10--
395
-
396
-
397
- EOS
398
172
  source = DummySource.new("sup-test://test_multipart_message_2")
399
173
  source.messages = [ message ]
400
174
  source_info = 0
@@ -402,86 +176,13 @@ EOS
402
176
  sup_message = Message.build_from_source(source, source_info)
403
177
  sup_message.load_from_source!
404
178
 
405
- # read the message body chunks
179
+ chunks = sup_message.load_from_source! # read the message body chunks
406
180
 
407
- sup_message.load_from_source!
181
+ # TODO: Add more asserts
408
182
  end
409
183
 
410
184
  def test_blank_header_lines
411
-
412
- message = <<EOS
413
- Return-Path: <monitor-list-bounces@widget.com>
414
- X-Original-To: nobody@localhost
415
- Delivered-To: nobody@localhost.eng.widget.com
416
- Received: from localhost (localhost.localdomain [127.0.0.1])
417
- by soquel.eng.widget.com (Postfix) with ESMTP id 609BC13C0DB1
418
- for <nobody@localhost>; Thu, 19 Mar 2009 13:43:21 -0700 (PDT)
419
- MIME-Version: 1.0
420
- Received: from pa-excas-vip.widget.com [10.16.67.200]
421
- by localhost with IMAP (fetchmail-6.2.5)
422
- for nobody@localhost (single-drop); Thu, 19 Mar 2009 13:43:21 -0700 (PDT)
423
- Received: from pa-exht01.widget.com (10.113.81.167) by pa-excaht11.widget.com
424
- (10.113.81.197) with Microsoft SMTP Server (TLS) id 8.1.311.2; Thu, 19 Mar
425
- 2009 13:42:30 -0700
426
- Received: from mailman2.widget.com (10.16.64.159) by pa-exht01.widget.com
427
- (10.113.81.167) with Microsoft SMTP Server id 8.1.336.0; Thu, 19 Mar 2009
428
- 13:42:30 -0700
429
- Received: by mailman2.widget.com (Postfix) id 47095AE30856; Thu, 19 Mar 2009
430
- 13:42:29 -0700 (PDT)
431
- Received: from countchocula.widget.com (localhost.localdomain [127.0.0.1]) by
432
- mailman2.widget.com (Postfix) with ESMTP id 5F782ABC5948; Thu, 19 Mar 2009
433
- 13:42:28 -0700 (PDT)
434
- Received: from mailhost4.widget.com (mailhost4.widget.com [10.16.67.124]) by
435
- mailman2.widget.com (Postfix) with ESMTP id 6CDCCABC5948 for
436
- <monitor-list@mailman2.widget.com>; Thu, 19 Mar 2009 13:42:26 -0700 (PDT)
437
- Received: by mailhost4.widget.com (Postfix) id 2364AC9AC4; Thu, 19 Mar 2009
438
- 13:42:26 -0700 (PDT)
439
- Received: from pa-exht01.widget.com (pa-exht01.widget.com [10.113.81.167]) by
440
- mailhost4.widget.com (Postfix) with ESMTP id 17A68C9AC3 for
441
- <monitor-list@widget.com>; Thu, 19 Mar 2009 13:42:26 -0700 (PDT)
442
- Received: from PA-EXMBX04.widget.com ([10.113.81.142]) by pa-exht01.widget.com
443
- ([10.113.81.167]) with mapi; Thu, 19 Mar 2009 13:42:26 -0700
444
- From: Some User <someuser@widget.com>
445
- To: "monitor-list@widget.com" <monitor-list@widget.com>
446
- Sender: "monitor-list-bounces@widget.com" <monitor-list-bounces@widget.com>
447
- Date: Thu, 19 Mar 2009 13:42:25 -0700
448
- Subject: Looking for a mac
449
- Thread-Topic: Looking for a mac
450
- Thread-Index: AQHJqNM1xIqqjNRWuUCUBaxzPFK5eQ==
451
- Message-ID:
452
- <D3C12B2AD838B44DA9D6B2CA334246D011E72A73A4@PA-EXMBX04.widget.com>
453
- List-Help: <mailto:monitor-list-request@widget.com?subject=help>
454
- List-Subscribe: <http://mailman2.widget.com/mailman/listinfo/monitor-list>,
455
- <mailto:monitor-list-request@widget.com?subject=subscribe>
456
- List-Unsubscribe:
457
- <http://mailman2.widget.com/mailman/listinfo/monitor-list>,
458
- <mailto:monitor-list-request@widget.com?subject=unsubscribe>
459
- Accept-Language: en-US
460
- Content-Language: en-US
461
- X-MS-Exchange-Organization-AuthAs: Anonymous
462
- X-MS-Exchange-Organization-AuthSource: pa-exht01.widget.com
463
- X-MS-Has-Attach:
464
- X-Auto-Response-Suppress: All
465
- X-MS-TNEF-Correlator:
466
- acceptlanguage: en-US
467
- delivered-to: monitor-list@widget.com
468
- errors-to: monitor-list-bounces@widget.com
469
- list-id: engineering monitor related <monitor-list.widget.com>
470
- x-mailman-version: 2.1.8
471
- x-beenthere: monitor-list@widget.com
472
- x-original-to: monitor-list@mailman2.widget.com
473
- list-post: <mailto:monitor-list@widget.com>
474
- list-archive: <http://mailman2.widget.com/pipermail/monitor-list>
475
- Content-Type: text/plain; charset="us-ascii"
476
- Content-Transfer-Encoding: quoted-printable
477
-
478
- Hi all,
479
-
480
- Just wondering if anybody can lend me a mac to reproduce PR 384931 ?
481
- Thanks.
482
-
483
- Michael=
484
- EOS
185
+ message = fixture('blank-header-fields.eml')
485
186
 
486
187
  source = DummySource.new("sup-test://test_blank_header_lines")
487
188
  source.messages = [ message ]
@@ -496,72 +197,14 @@ EOS
496
197
 
497
198
  # Look at another header field whose first line was blank.
498
199
  list_unsubscribe = sup_message.list_unsubscribe
499
- assert_equal("<http://mailman2.widget.com/mailman/listinfo/monitor-list>,\n \t" +
200
+ assert_equal("<http://mailman2.widget.com/mailman/listinfo/monitor-list>,\n\t" +
500
201
  "<mailto:monitor-list-request@widget.com?subject=unsubscribe>",
501
202
  list_unsubscribe)
502
203
 
503
204
  end
504
205
 
505
206
  def test_malicious_attachment_names
506
-
507
-
508
- message = <<EOS
509
- From: Matthieu Rakotojaona <matthieu.rakotojaona@gmail.com>
510
- To: reply+0007a7cb7174d1d188fcd420fce83e0f68fe03fc7416cdae92cf0000000110ce4efd92a169ce033d18e1 <reply+0007a7cb7174d1d188fcd420fce83e0f68fe03fc7416cdae92cf0000000110ce4efd92a169ce033d18e1@reply.github.com>
511
- Subject: Re: [sup] Attachment saving and special characters in filenames (#378)
512
- In-reply-to: <sup-heliotrope/sup/issues/378@github.com>
513
- References: <sup-heliotrope/sup/issues/378@github.com>
514
- X-pgp-key: http://otokar.looc2011.eu/static/matthieu.rakotojaona.asc
515
- Date: Wed, 14 Jan 2015 22:13:37 +0100
516
- Message-Id: <1421269972-sup-5245@kpad>
517
- User-Agent: Sup/git
518
- Content-Transfer-Encoding: 8bit
519
- MIME-Version: 1.0
520
- Content-Type: multipart/mixed; boundary="=-1421270017-526778-1064-1628-1-="
521
-
522
-
523
- --=-1421270017-526778-1064-1628-1-=
524
- Content-Type: text/plain; charset=UTF-8
525
- Content-Disposition: inline
526
-
527
- Excerpts from Felix Kaiser's message of 2015-01-14 16:36:29 +0100:
528
- > When saving attachments, sup should replace special characters when suggesting a filename to save the attachment to.
529
- >
530
- > I just got an attachment with a name like "foo/2.pdf". sup suggests saving it to /home/fxkr/foo/2.pdf (and fails to save it, of course, if /home/fxkr/foo isn't a directory).
531
- >
532
- > I haven't tested the "Save All" feature, but I hope nothing bad happens when there's an attachment called "../../../../../../../home/fxkr/.bashrc" ;-)
533
- >
534
- > ---
535
- > Reply to this email directly or view it on GitHub:
536
- > https://github.com/sup-heliotrope/sup/issues/378
537
-
538
- For tests, here's an email with an attachment filename set to
539
- sup/.travis.yml (really, this time)
540
-
541
- --
542
- Matthieu Rakotojaona
543
-
544
- --=-1421270017-526778-1064-1628-1-=
545
- Content-Disposition: attachment; filename="sup/.travis.yml"
546
- Content-Type: text/x-yaml; name="sup/.travis.yml"
547
- Content-Transfer-Encoding: 8bit
548
-
549
- language: ruby
550
-
551
- rvm:
552
- - 2.1.1
553
- - 2.0.0
554
- - 1.9.3
555
-
556
- before_install:
557
- - sudo apt-get update -qq
558
- - sudo apt-get install -qq uuid-dev uuid libncursesw5-dev libncursesw5 gnupg2 pandoc
559
- - git submodule update --init --recursive
560
-
561
- script: bundle exec rake travis
562
-
563
- --=-1421270017-526778-1064-1628-1-=--
564
- EOS
207
+ message = fixture('malicious-attachment-names.eml')
565
208
 
566
209
  source = DummySource.new("sup-test://test_blank_header_lines")
567
210
  source.messages = [ message ]
@@ -576,7 +219,6 @@ EOS
576
219
  # path.
577
220
  fn = chunks[3].safe_filename
578
221
  assert_equal(fn, File.basename(fn))
579
-
580
222
  end
581
223
  # TODO: test different error cases, malformed messages etc.
582
224