sup 0.19.0 → 0.22.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/.gitmodules +3 -0
- data/.travis.yml +3 -2
- data/CONTRIBUTORS +19 -13
- data/Gemfile +4 -0
- data/History.txt +41 -0
- data/Rakefile +41 -1
- data/ReleaseNotes +17 -0
- data/bin/sup +5 -18
- data/bin/sup-add +1 -2
- data/bin/sup-config +0 -1
- data/bin/sup-dump +0 -1
- data/bin/sup-import-dump +1 -2
- data/bin/sup-sync +0 -1
- data/bin/sup-sync-back-maildir +1 -2
- data/bin/sup-tweak-labels +1 -2
- data/contrib/colorpicker.rb +0 -2
- data/contrib/completion/_sup.bash +102 -0
- data/devel/profile.rb +0 -1
- data/ext/mkrf_conf_xapian.rb +47 -0
- data/lib/sup.rb +9 -8
- data/lib/sup/buffer.rb +12 -0
- data/lib/sup/colormap.rb +5 -2
- data/lib/sup/contact.rb +4 -2
- data/lib/sup/crypto.rb +41 -8
- data/lib/sup/draft.rb +8 -8
- data/lib/sup/hook.rb +1 -1
- data/lib/sup/index.rb +2 -2
- data/lib/sup/label.rb +1 -1
- data/lib/sup/maildir.rb +16 -5
- data/lib/sup/mbox.rb +13 -5
- data/lib/sup/message.rb +17 -3
- data/lib/sup/message_chunks.rb +10 -2
- data/lib/sup/mode.rb +33 -28
- data/lib/sup/modes/edit_message_mode.rb +3 -2
- data/lib/sup/modes/forward_mode.rb +22 -3
- data/lib/sup/modes/line_cursor_mode.rb +1 -1
- data/lib/sup/modes/text_mode.rb +6 -1
- data/lib/sup/modes/thread_index_mode.rb +11 -1
- data/lib/sup/modes/thread_view_mode.rb +103 -9
- data/lib/sup/person.rb +68 -61
- data/lib/sup/search.rb +1 -1
- data/lib/sup/sent.rb +1 -1
- data/lib/sup/util.rb +1 -75
- data/lib/sup/util/locale_fiddler.rb +24 -0
- data/lib/sup/version.rb +1 -1
- data/sup.gemspec +22 -5
- data/test/{messages → fixtures}/bad-content-transfer-encoding-1.eml +0 -0
- data/test/{messages → fixtures}/binary-content-transfer-encoding-2.eml +0 -0
- data/test/fixtures/blank-header-fields.eml +71 -0
- data/test/fixtures/contacts.txt +1 -0
- data/test/fixtures/malicious-attachment-names.eml +55 -0
- data/test/fixtures/missing-from-to.eml +18 -0
- data/test/{messages → fixtures}/missing-line.eml +0 -0
- data/test/fixtures/multi-part-2.eml +72 -0
- data/test/fixtures/multi-part.eml +61 -0
- data/test/fixtures/no-body.eml +18 -0
- data/test/fixtures/simple-message.eml +29 -0
- data/test/gnupg_test_home/gpg.conf +2 -1
- data/test/gnupg_test_home/key1.gen +15 -0
- data/test/gnupg_test_home/key2.gen +15 -0
- data/test/gnupg_test_home/key_ecc.gen +13 -0
- data/test/gnupg_test_home/pubring.gpg +0 -0
- data/test/gnupg_test_home/receiver_pubring.gpg +0 -0
- data/test/gnupg_test_home/receiver_secring.gpg +0 -0
- data/test/gnupg_test_home/regen_keys.sh +38 -0
- data/test/gnupg_test_home/secring.gpg +0 -0
- data/test/gnupg_test_home/sup-test-2@foo.bar.asc +22 -17
- data/test/integration/test_maildir.rb +75 -0
- data/test/integration/test_mbox.rb +69 -0
- data/test/test_crypto.rb +12 -2
- data/test/test_header_parsing.rb +1 -1
- data/test/test_helper.rb +6 -3
- data/test/test_message.rb +42 -342
- data/test/test_messages_dir.rb +4 -28
- data/test/test_yaml_regressions.rb +1 -1
- data/test/unit/test_contact.rb +33 -0
- data/test/unit/test_locale_fiddler.rb +15 -0
- data/test/unit/test_person.rb +37 -0
- metadata +108 -38
- data/test/gnupg_test_home/receiver_trustdb.gpg +0 -0
- data/test/gnupg_test_home/trustdb.gpg +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
RC: Random Contact <random_dude@gmail.com>
|
@@ -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!
|
File without changes
|
@@ -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> </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!
|
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
trust-model always
|
2
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
%echo Generating a standard key
|
2
|
+
Key-Type: DSA
|
3
|
+
Key-Length: 1024
|
4
|
+
Subkey-Type: ELG-E
|
5
|
+
Subkey-Length: 1024
|
6
|
+
Name-Real: Sup Test Sender 1
|
7
|
+
Name-Comment: Test sender key
|
8
|
+
Name-Email: sup-test-1@foo.bar
|
9
|
+
Expire-Date: 1y
|
10
|
+
%no-protection
|
11
|
+
%pubring pubring.gpg
|
12
|
+
%secring secring.gpg
|
13
|
+
# Do a commit here, so that we can later print "done" :-)
|
14
|
+
%commit
|
15
|
+
%echo done
|
@@ -0,0 +1,15 @@
|
|
1
|
+
%echo Generating a standard key
|
2
|
+
Key-Type: DSA
|
3
|
+
Key-Length: 1024
|
4
|
+
Subkey-Type: ELG-E
|
5
|
+
Subkey-Length: 1024
|
6
|
+
Name-Real: Sup Test Receiver
|
7
|
+
Name-Comment: Test receiver for Sup
|
8
|
+
Name-Email: sup-test-2@foo.bar
|
9
|
+
Expire-Date: 1y
|
10
|
+
%no-protection
|
11
|
+
%pubring pubring.gpg
|
12
|
+
%secring secring.gpg
|
13
|
+
# Do a commit here, so that we can later print "done" :-)
|
14
|
+
%commit
|
15
|
+
%echo done
|
@@ -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
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#! /bin/bash
|
2
|
+
#
|
3
|
+
# re-generate test keys for the sup test base
|
4
|
+
#
|
5
|
+
# https://github.com/sup-heliotrope/sup/wiki/Development%3A-Crypto
|
6
|
+
|
7
|
+
pushd $(dirname $0)
|
8
|
+
|
9
|
+
export GNUPGHOME="$(pwd)"
|
10
|
+
|
11
|
+
echo "genrating keys in: $GNUPGHOME.."
|
12
|
+
|
13
|
+
rm *.gpg *.asc
|
14
|
+
|
15
|
+
echo "generate receiver key.."
|
16
|
+
gpg --batch --gen-key key2.gen
|
17
|
+
|
18
|
+
echo "export receiver key.."
|
19
|
+
|
20
|
+
gpg --output sup-test-2@foo.bar.asc --armor --export sup-test-2@foo.bar
|
21
|
+
|
22
|
+
mv trustdb.gpg receiver_trustdb.gpg
|
23
|
+
mv secring.gpg receiver_secring.gpg
|
24
|
+
mv pubring.gpg receiver_pubring.gpg
|
25
|
+
|
26
|
+
echo "generate sender key.."
|
27
|
+
gpg --batch --gen-key key1.gen
|
28
|
+
|
29
|
+
echo "generate ecc key.."
|
30
|
+
gpg --batch --gen-key key_ecc.gen
|
31
|
+
|
32
|
+
echo "import receiver key.."
|
33
|
+
gpg --import sup-test-2@foo.bar.asc
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
popd
|
38
|
+
|
Binary file
|
@@ -1,20 +1,25 @@
|
|
1
1
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
2
|
-
Version: GnuPG v2
|
2
|
+
Version: GnuPG v2
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
4
|
+
mQGiBFP3VogRBADVBEkaZQXj728C1HUIaTRDCFoKzojwC79Z1BLsD72qQYE8z1ic
|
5
|
+
5P9CJpJU5wbhQFDTGBjw+i1nNTWy01z4q5bfFqok+KorT3XNp5IJRcRIEOkj+Twq
|
6
|
+
7ZaSODwXGsUmdzSoOVDYmtUpVzRQe0IM0rPQQV4vGzgw55FdJBe7a63nIwCg+WvR
|
7
|
+
iQN09PlhpGG7SIEmx0psEqUEAL/t1c5oC9RC7L4a0GM+2AcgFRBMXvzpdnytrzgt
|
8
|
+
73Ud6CcUplQp6WODrUYhX0RLzSJPO4zWDsBmkBad/iQCwbCKpFPfAFdBMArJpknx
|
9
|
+
rc6vRED4a9dLfCNTT1g86CkiElge9t36juZgOoFT3xt/XP7BxhU1fCFshZNR6VK6
|
10
|
+
tN9eA/9G4fUX6XvEGIrNiBYKyU4QvM1nyMXCBujm7vYF6KfSlYyAvVXxG4h+mvUy
|
11
|
+
ZXQ/WHMQJSbPTY3dd4hmo0p0GUMlSvXU8JLf7qienW1IccD9Pv88J1XjkbFd+wgw
|
12
|
+
feoSx1sAfc36gH+aE17lvsU+PPAP4Bc9CSiScNo0iQv7v/KZjrQ+U3VwIFRlc3Qg
|
13
|
+
UmVjZWl2ZXIgKFRlc3QgcmVjZWl2ZXIgZm9yIFN1cCkgPHN1cC10ZXN0LTJAZm9v
|
14
|
+
LmJhcj6IaQQTEQIAKQUCU/dWiAIbIwUJAeEzgAcLCQgHAwIBBhUIAgkKCwQWAgMB
|
15
|
+
Ah4BAheAAAoJEKfs+g8ACvQGPxIAnj1CSZCzjwyIFLgNEQnIhntU+b28AKDsMEVN
|
16
|
+
gf9mHqwhabN+UKgBwX0U3LkBDQRT91aIEAQAjQZEnDK++SKp/l2Oiku6H9IuCsi4
|
17
|
+
lv+MhLQP0bMuD4DrPk3mauZNc8BB+U0wgAMh/kZoCKySEdMK1mcf2iOsd5yOCrK+
|
18
|
+
sJQAMsALAnrYjCE9QA2xIQs8gHF4PrKopycF55iRHQMDNa1QWfs+j4WJaXderlGQ
|
19
|
+
S0dGfLyoqtZsFusAAwUEAIi0+aDZlAVVIdDO2cvR0lu6eDW2Mr2ExZzuwTfAI6dS
|
20
|
+
tJLoPzoA2OAVW7cFVVpCOHcVLiF2GOHvtJPw1MgpxaNjzpNdJPTiP2sYZg253dfR
|
21
|
+
v66Cw9IuWKgZcElWXmIy5vFWqWWbLyTBOuwEQxCsFnjN9UUZauSADOJSPFy1sekf
|
22
|
+
iE8EGBECAA8FAlP3VogCGwwFCQHhM4AACgkQp+z6DwAK9Ab/swCg8LWNwfMwNk+H
|
23
|
+
gLgnS1LVsesZ8D4An2Ie2P0/oYuSmPPFV44kbWySX9wW
|
24
|
+
=Jo82
|
20
25
|
-----END PGP PUBLIC KEY BLOCK-----
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class TestMaildir < Minitest::Test
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@path = Dir.mktmpdir
|
7
|
+
|
8
|
+
@test_message_1 = <<EOS
|
9
|
+
From: Bob <bob@bob.com>
|
10
|
+
To: a dear friend
|
11
|
+
|
12
|
+
Hello there friend. How are you? Blah is blah blah.
|
13
|
+
Wow. Maildir FTW, am I right?
|
14
|
+
EOS
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
def teardown
|
19
|
+
ObjectSpace.each_object(Class).select {|a| a < Redwood::Singleton}.each do |klass|
|
20
|
+
klass.deinstantiate! unless klass == Redwood::Logger
|
21
|
+
end
|
22
|
+
FileUtils.rm_r @path
|
23
|
+
end
|
24
|
+
|
25
|
+
def create_a_maildir(extra='')
|
26
|
+
maildir = File.join @path, "test_maildir#{extra}"
|
27
|
+
['', 'cur', 'new', 'tmp'].each do |dir|
|
28
|
+
Dir.mkdir(File.join maildir, dir)
|
29
|
+
end
|
30
|
+
maildir
|
31
|
+
end
|
32
|
+
|
33
|
+
def create_a_maildir_email(folder, content)
|
34
|
+
File.write(File.join(folder, "#{Time.now.to_f}.hostname:2,S"), content)
|
35
|
+
end
|
36
|
+
|
37
|
+
def start_sup_and_add_source(source)
|
38
|
+
start
|
39
|
+
Index.init @path
|
40
|
+
Index.load
|
41
|
+
SourceManager.instance.instance_eval '@sources = {}'
|
42
|
+
SourceManager.instance.add_source source
|
43
|
+
PollManager.poll_from source
|
44
|
+
end
|
45
|
+
|
46
|
+
# and now, let the tests begin!
|
47
|
+
|
48
|
+
def test_can_index_a_maildir_directory
|
49
|
+
|
50
|
+
maildir = create_a_maildir
|
51
|
+
create_a_maildir_email(File.join(maildir, 'cur'), @test_message_1)
|
52
|
+
start_sup_and_add_source Maildir.new "maildir:#{maildir}"
|
53
|
+
|
54
|
+
messages_in_index = []
|
55
|
+
Index.instance.each_message {|a| messages_in_index << a}
|
56
|
+
refute_empty messages_in_index, 'There are no messages in the index'
|
57
|
+
assert_equal(messages_in_index.first.raw_message, @test_message_1)
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_can_index_a_maildir_directory_with_special_characters
|
62
|
+
|
63
|
+
maildir = create_a_maildir URI_ENCODE_CHARS
|
64
|
+
create_a_maildir_email(File.join(maildir, 'cur'), @test_message_1)
|
65
|
+
start_sup_and_add_source Maildir.new "maildir:#{maildir}"
|
66
|
+
|
67
|
+
messages_in_index = []
|
68
|
+
Index.instance.each_message {|a| messages_in_index << a}
|
69
|
+
refute_empty messages_in_index, 'There are no messages in the index'
|
70
|
+
assert_equal(messages_in_index.first.raw_message, @test_message_1)
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|