sup 1.1 → 1.3

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/checks.yml +40 -38
  3. data/.gitmodules +1 -0
  4. data/CONTRIBUTORS +3 -1
  5. data/History.txt +32 -3
  6. data/Manifest.txt +34 -1
  7. data/README.md +0 -1
  8. data/bin/sup-sync-back-maildir +1 -1
  9. data/contrib/nix/Gemfile +24 -0
  10. data/contrib/nix/Gemfile.lock +101 -0
  11. data/contrib/nix/README +7 -0
  12. data/contrib/nix/gem-install-shell.nix +14 -0
  13. data/contrib/nix/gemset.nix +391 -0
  14. data/contrib/nix/ruby2.4-Gemfile.lock +85 -0
  15. data/contrib/nix/ruby2.4-gemset.nix +329 -0
  16. data/contrib/nix/ruby2.4-shell.nix +26 -0
  17. data/contrib/nix/ruby2.5-Gemfile.lock +85 -0
  18. data/contrib/nix/ruby2.5-gemset.nix +329 -0
  19. data/contrib/nix/ruby2.5-shell.nix +26 -0
  20. data/contrib/nix/ruby2.6-Gemfile.lock +87 -0
  21. data/contrib/nix/ruby2.6-gemset.nix +339 -0
  22. data/contrib/nix/ruby2.6-shell.nix +26 -0
  23. data/contrib/nix/ruby2.7-Gemfile.lock +91 -0
  24. data/contrib/nix/ruby2.7-gemset.nix +359 -0
  25. data/contrib/nix/ruby2.7-shell.nix +14 -0
  26. data/contrib/nix/ruby3.0-Gemfile.lock +91 -0
  27. data/contrib/nix/ruby3.0-gemset.nix +359 -0
  28. data/contrib/nix/ruby3.0-shell.nix +14 -0
  29. data/contrib/nix/ruby3.1-shell.nix +25 -0
  30. data/contrib/nix/ruby3.2-shell.nix +25 -0
  31. data/contrib/nix/ruby3.3-shell.nix +25 -0
  32. data/contrib/nix/ruby3.4-shell.nix +36 -0
  33. data/contrib/nix/test-all-rubies.sh +6 -0
  34. data/doc/Hooks.txt +1 -1
  35. data/ext/mkrf_conf_xapian.rb +2 -2
  36. data/lib/sup/crypto.rb +8 -6
  37. data/lib/sup/index.rb +2 -2
  38. data/lib/sup/maildir.rb +5 -1
  39. data/lib/sup/mbox.rb +26 -8
  40. data/lib/sup/message.rb +15 -12
  41. data/lib/sup/modes/console_mode.rb +1 -1
  42. data/lib/sup/modes/edit_message_mode.rb +5 -5
  43. data/lib/sup/thread.rb +20 -20
  44. data/lib/sup/util.rb +12 -7
  45. data/lib/sup/version.rb +1 -1
  46. data/man/sup-add.1 +40 -40
  47. data/man/sup-config.1 +30 -26
  48. data/man/sup-dump.1 +38 -38
  49. data/man/sup-import-dump.1 +41 -37
  50. data/man/sup-psych-ify-config-files.1 +32 -28
  51. data/man/sup-recover-sources.1 +39 -35
  52. data/man/sup-sync-back-maildir.1 +39 -34
  53. data/man/sup-sync.1 +50 -46
  54. data/man/sup-tweak-labels.1 +43 -38
  55. data/man/sup.1 +42 -38
  56. data/shell.nix +1 -0
  57. data/sup.gemspec +2 -0
  58. data/test/dummy_source.rb +6 -0
  59. data/test/fixtures/embedded-message-rfc6532.eml +33 -0
  60. data/test/fixtures/invalid-date.eml +8 -0
  61. data/test/gnupg_test_home/private-keys-v1.d/26C05E44706A8E230B3255BB9532B34DC9420232.key +42 -0
  62. data/test/gnupg_test_home/private-keys-v1.d/D187ADC90EC4DEB7047678EAA37E33A53A465D47.key +5 -0
  63. data/test/gnupg_test_home/private-keys-v1.d/FB2D9BD3B1BE90B5BCF697781F8404224B0FCF5B.key +5 -0
  64. data/test/gnupg_test_home/pubring.gpg +0 -0
  65. data/test/gnupg_test_home/receiver_pubring.gpg +0 -0
  66. data/test/gnupg_test_home/receiver_secring.gpg +0 -0
  67. data/test/gnupg_test_home/regen_keys.sh +11 -2
  68. data/test/gnupg_test_home/secring.gpg +0 -0
  69. data/test/gnupg_test_home/sup-test-2@foo.bar.asc +20 -20
  70. data/test/integration/test_maildir.rb +18 -1
  71. data/test/integration/test_mbox.rb +13 -0
  72. data/test/integration/test_sup-sync-back-maildir.rb +40 -0
  73. data/test/test_crypto.rb +108 -71
  74. data/test/test_header_parsing.rb +2 -2
  75. data/test/test_message.rb +42 -0
  76. data/test/unit/test_contact.rb +1 -1
  77. data/test/unit/test_edit_message_mode.rb +94 -0
  78. data/test/unit/test_person.rb +3 -3
  79. data/test/unit/test_rmail_message.rb +36 -0
  80. data/test/unit/util/test_string.rb +3 -3
  81. metadata +73 -5
  82. data/test/gnupg_test_home/private-keys-v1.d/306D2EE90FF0014B5B9FD07E265C751791674140.key +0 -0
@@ -1,73 +1,73 @@
1
- .\" Automatically generated by Pandoc 2.9.2.1
1
+ .\" Automatically generated by Pandoc 3.1.11.1
2
2
  .\"
3
- .TH "SUP-TWEAK-LABELS" "1" "April 9, 2012" "Sup User Manuel" ""
4
- .hy
3
+ .TH "SUP\-TWEAK\-LABELS" "1" "April 9, 2012" "Sup User Manuel" ""
5
4
  .SH NAME
6
- .PP
7
- sup-tweak-labels - batch modification of message state already in index
5
+ sup\-tweak\-labels \- batch modification of message state already in
6
+ index
8
7
  .SH SYNOPSIS
9
- .PP
10
- sup-tweak-labels [\f[I]options\f[R]] source \&...
8
+ sup\-tweak\-labels [\f[I]options\f[R]] source \&...
11
9
  .SH DESCRIPTION
12
- .PP
13
10
  Batch modification of message state for messages already in the index.
14
11
  .PP
15
- Supported source URI schemes can be seen by running \[lq]sup-add
16
- --help\[rq].
12
+ Supported source URI schemes can be seen by running \[lq]sup\-add
13
+ \-\-help\[rq].
17
14
  .SH OPTIONS
18
15
  .TP
19
- -a \f[I]STRING\f[R], --add \f[I]STRING\f[R]
20
- One or more labels (comma-separated) to add to every message from the
16
+ \-a \f[I]STRING\f[R], \-\-add \f[I]STRING\f[R]
17
+ One or more labels (comma\-separated) to add to every message from the
21
18
  specified sources (default: )
22
19
  .TP
23
- -r \f[I]STRING\f[R], --remove \f[I]STRING\f[R]
24
- One or more labels (comma-separated) to remove from every message from
20
+ \-r \f[I]STRING\f[R], \-\-remove \f[I]STRING\f[R]
21
+ One or more labels (comma\-separated) to remove from every message from
25
22
  the specified sources, if those labels are present (default: )
26
23
  .TP
27
- -q \f[I]QUERY\f[R], --query \f[I]QUERY\f[R]
24
+ \-q \f[I]QUERY\f[R], \-\-query \f[I]QUERY\f[R]
28
25
  A Sup search query
29
26
  .SH OTHER OPTIONS
30
27
  .TP
31
- -v, --verbose
28
+ \-v, \-\-verbose
32
29
  Print message ids as they\[cq]re processed
33
30
  .TP
34
- -e, --very-verbose
31
+ \-e, \-\-very\-verbose
35
32
  Print message names and subjects as they\[cq]re processed
36
33
  .TP
37
- --all-sources
34
+ \-\-all\-sources
38
35
  Scan over all sources
39
36
  .TP
40
- -n, --dry-run
37
+ \-n, \-\-dry\-run
41
38
  Don\[cq]t actually modify the index.
42
- Probably only useful with --verbose
39
+ Probably only useful with \-\-verbose
43
40
  .TP
44
- --version
41
+ \-\-version
45
42
  Show version information
46
43
  .TP
47
- -h, --help
44
+ \-h, \-\-help
48
45
  Show help message
49
46
  .SH SEE ALSO
50
- .PP
51
- sup(1), sup-add(1)
47
+ sup(1), sup\-add(1)
52
48
  .SH REPORTING BUGS
53
- .PP
54
49
  You are welcome to submit bug reports to the Sup issue tracker, located
55
50
  at
56
51
  .PP
57
- <https://github.com/sup-heliotrope/sup/issues>
52
+ \c
53
+ .UR https://github.com/sup-heliotrope/sup/issues
54
+ .UE \c
58
55
  .SH CONTACT INFORMATION
59
56
  .TP
60
57
  The Sup web page:
61
- <https://sup-heliotrope.github.io/>
58
+ \c
59
+ .UR https://sup-heliotrope.github.io/
60
+ .UE \c
62
61
  .TP
63
62
  Code repository:
64
- <https://github.com/sup-heliotrope/sup/>
63
+ \c
64
+ .UR https://github.com/sup-heliotrope/sup/
65
+ .UE \c
65
66
  .TP
66
67
  Sup Wiki:
67
- <https://github.com/sup-heliotrope/sup/wiki/>
68
- .TP
69
- Sup IRC channel:
70
- #sup \[at] freenode.net
68
+ \c
69
+ .UR https://github.com/sup-heliotrope/sup/wiki/
70
+ .UE \c
71
71
  .TP
72
72
  Mailing list:
73
73
  supmua\[at]googlegroups.com
@@ -75,17 +75,22 @@ supmua\[at]googlegroups.com
75
75
  .PP
76
76
  supmua+subscribe\[at]googlegroups.com
77
77
  .PP
78
- Archives: <https://groups.google.com/d/forum/supmua/>
78
+ Archives: \c
79
+ .UR https://groups.google.com/d/forum/supmua/
80
+ .UE \c
79
81
  .RE
80
82
  .SH COPYRIGHT
83
+ Copyright © 2006\-2009 William Morgan \c
84
+ .MT mworgan-sup@masanjin.net
85
+ .ME \c
81
86
  .PP
82
- Copyright \[co] 2006-2009 William Morgan <mworgan-sup@masanjin.net>
83
- .PP
84
- Copyright \[at] 2013-2014 Sup developers
87
+ Copyright \[at] 2013\-2014 Sup developers
85
88
  .PP
86
89
  Permission is granted to copy and distribute this manual under the terms
87
90
  of the GNU General Public License; either version 2 or (at your option)
88
91
  any later version.
89
92
  .SH AUTHORS
90
- Sup was originally written by William Morgan <wmorgan-sup@masanjin.net>
91
- and is now developed and maintained by the Sup developers.
93
+ Sup was originally written by William Morgan \c
94
+ .MT wmorgan-sup@masanjin.net
95
+ .ME \c
96
+ \ and is now developed and maintained by the Sup developers.
data/man/sup.1 CHANGED
@@ -1,55 +1,51 @@
1
- .\" Automatically generated by Pandoc 2.9.2.1
1
+ .\" Automatically generated by Pandoc 3.1.11.1
2
2
  .\"
3
3
  .TH "SUP" "1" "April 8, 2014" "Sup User Manual" ""
4
- .hy
5
4
  .SH NAME
6
- .PP
7
- sup - a curses-based email client
5
+ sup \- a curses\-based email client
8
6
  .SH SYNOPSIS
9
- .PP
10
7
  sup [\f[I]options\f[R]]
11
8
  .SH DESCRIPTION
12
- .PP
13
- Sup is a console-based email client for people with a lot of email.
9
+ Sup is a console\-based email client for people with a lot of email.
14
10
  .PP
15
11
  It presents an interface of a list of threads, which are each
16
12
  hierarchical collections email messages.
17
13
  Threads can have multiple tags applied to them.
18
- It supports a very fast full-text search, automatic contact-list
14
+ It supports a very fast full\-text search, automatic contact\-list
19
15
  management, custom code insertion via a Ruby hook system, and more.
20
16
  If you\[cq]re the type of person who treats email as an extension of
21
- your long-term memory, Sup is for you.
17
+ your long\-term memory, Sup is for you.
22
18
  .SH OPTIONS
23
19
  .TP
24
- -l, --list-hooks
20
+ \-l, \-\-list\-hooks
25
21
  List all hooks and descriptions, and quit.
26
- Use \[en]hooks-matching to filter
22
+ Use \[en]hooks\-matching to filter
27
23
  .TP
28
- -m, --hooks-matching=<s>
24
+ \-m, \-\-hooks\-matching=<s>
29
25
  If given, list all hooks and descriptions matching the given pattern.
30
- Needs the \[en]list-hooks option (default: )
26
+ Needs the \[en]list\-hooks option (default: )
31
27
  .TP
32
- -n, --no-threads
28
+ \-n, \-\-no\-threads
33
29
  Turn off threading.
34
30
  Helps with debugging.
35
31
  (Necessarily disables background polling for new messages.)
36
32
  .TP
37
- -o, --no-initial-poll
33
+ \-o, \-\-no\-initial\-poll
38
34
  Don\[cq]t poll for new messages when starting.
39
35
  .TP
40
- -s \f[I]QUERY\f[R], --search \f[I]QUERY\f[R]
36
+ \-s \f[I]QUERY\f[R], \-\-search \f[I]QUERY\f[R]
41
37
  Search for this query upon startup
42
38
  .TP
43
- -c \f[I]STRING\f[R], --compose \f[I]STRING\f[R]
39
+ \-c \f[I]STRING\f[R], \-\-compose \f[I]STRING\f[R]
44
40
  Compose message to this recipient upon startup
45
41
  .TP
46
- -j \f[I]STRING\f[R], --subject \f[I]STRING\f[R]
42
+ \-j \f[I]STRING\f[R], \-\-subject \f[I]STRING\f[R]
47
43
  When composing, use this subject
48
44
  .TP
49
- -v, --version
45
+ \-v, \-\-version
50
46
  Print version and exit
51
47
  .TP
52
- -h, --help
48
+ \-h, \-\-help
53
49
  Show brief help message
54
50
  .SH ENVIRONMENT
55
51
  .TP
@@ -72,29 +68,32 @@ Configuration file for Sup mail sources
72
68
  $HOME/.sup/colors.yaml
73
69
  Color theme for Sup
74
70
  .SH SEE ALSO
75
- .PP
76
- mail(1), sup-add(1), sup-config(1), sup-dump(1), sup-import-dump(1),
77
- sup-recover-sources(1), sup-sync(1), sup-sync-back-maildir(1),
78
- sup-tweak-labels(1)
71
+ mail(1), sup\-add(1), sup\-config(1), sup\-dump(1),
72
+ sup\-import\-dump(1), sup\-recover\-sources(1), sup\-sync(1),
73
+ sup\-sync\-back\-maildir(1), sup\-tweak\-labels(1)
79
74
  .SH REPORTING BUGS
80
- .PP
81
75
  You are welcome to submit bug reports to the Sup issue tracker, located
82
76
  at
83
77
  .PP
84
- <https://github.com/sup-heliotrope/sup/issues>
78
+ \c
79
+ .UR https://github.com/sup-heliotrope/sup/issues
80
+ .UE \c
85
81
  .SH CONTACT INFORMATION
86
82
  .TP
87
83
  The Sup web page:
88
- <https://sup-heliotrope.github.io/>
84
+ \c
85
+ .UR https://sup-heliotrope.github.io/
86
+ .UE \c
89
87
  .TP
90
88
  Code repository:
91
- <https://github.com/sup-heliotrope/sup/>
89
+ \c
90
+ .UR https://github.com/sup-heliotrope/sup/
91
+ .UE \c
92
92
  .TP
93
93
  Sup Wiki:
94
- <https://github.com/sup-heliotrope/sup/wiki/>
95
- .TP
96
- Sup IRC channel:
97
- #sup \[at] freenode.net
94
+ \c
95
+ .UR https://github.com/sup-heliotrope/sup/wiki/
96
+ .UE \c
98
97
  .TP
99
98
  Mailing list:
100
99
  supmua\[at]googlegroups.com
@@ -102,17 +101,22 @@ supmua\[at]googlegroups.com
102
101
  .PP
103
102
  supmua+subscribe\[at]googlegroups.com
104
103
  .PP
105
- Archives: <https://groups.google.com/d/forum/supmua/>
104
+ Archives: \c
105
+ .UR https://groups.google.com/d/forum/supmua/
106
+ .UE \c
106
107
  .RE
107
108
  .SH COPYRIGHT
109
+ Copyright © 2006\-2009 William Morgan \c
110
+ .MT mworgan-sup@masanjin.net
111
+ .ME \c
108
112
  .PP
109
- Copyright \[co] 2006-2009 William Morgan <mworgan-sup@masanjin.net>
110
- .PP
111
- Copyright \[at] 2013-2014 Sup developers
113
+ Copyright \[at] 2013\-2014 Sup developers
112
114
  .PP
113
115
  Permission is granted to copy and distribute this manual under the terms
114
116
  of the GNU General Public License; either version 2 or (at your option)
115
117
  any later version.
116
118
  .SH AUTHORS
117
- Sup was originally written by William Morgan <wmorgan-sup@masanjin.net>
118
- and is now developed and maintained by the Sup developers.
119
+ Sup was originally written by William Morgan \c
120
+ .MT wmorgan-sup@masanjin.net
121
+ .ME \c
122
+ \ and is now developed and maintained by the Sup developers.
data/shell.nix ADDED
@@ -0,0 +1 @@
1
+ contrib/nix/ruby3.3-shell.nix
data/sup.gemspec CHANGED
@@ -61,6 +61,8 @@ SUP: please note that our old mailing lists have been shut down,
61
61
  s.add_runtime_dependency "unicode", "~> 0.4.4"
62
62
  s.add_runtime_dependency "unicode-display_width"
63
63
  s.add_runtime_dependency "string-scrub" if /^2\.0\./ =~ RUBY_VERSION
64
+ s.add_runtime_dependency "benchmark"
65
+ s.add_runtime_dependency "fiddle"
64
66
 
65
67
  s.add_development_dependency "bundler", ">= 1.3", "< 3"
66
68
  s.add_development_dependency "rake"
data/test/dummy_source.rb CHANGED
@@ -10,10 +10,12 @@ module Redwood
10
10
  class DummySource < Source
11
11
 
12
12
  attr_accessor :messages
13
+ attr_writer :fallback_date
13
14
 
14
15
  def initialize uri, last_date=nil, usual=true, archived=false, id=nil, labels=[]
15
16
  super uri, usual, archived, id
16
17
  @messages = nil
18
+ @fallback_date = Time.utc 2001, 2, 3, 4, 56, 57
17
19
  end
18
20
 
19
21
  def start_offset
@@ -59,6 +61,10 @@ class DummySource < Source
59
61
  end
60
62
  end
61
63
  end
64
+
65
+ def fallback_date_for_message id
66
+ @fallback_date
67
+ end
62
68
  end
63
69
 
64
70
  end
@@ -0,0 +1,33 @@
1
+ Return-Path: <return@example.com>
2
+ From: Sender <sender@example.com>
3
+ To: <recipient@example.invalid>
4
+ Subject: Email with embedded message
5
+ MIME-Version: 1.0
6
+ Content-Type: multipart/mixed; boundary="----------=_4F506AC2.EE281DC4"
7
+ Message-Id: <9181f493-df49-4af5-8ad2-e1a8eb692a98>
8
+ Date: Wed, 15 Jul 2020 19:48:41 +0100
9
+
10
+ This is a multi-part message in MIME format.
11
+
12
+ ------------=_4F506AC2.EE281DC4
13
+ Content-Type: text/plain; charset=iso-8859-1
14
+ Content-Disposition: inline
15
+ Content-Transfer-Encoding: 8bit
16
+
17
+ Example outer message.
18
+
19
+
20
+ ------------=_4F506AC2.EE281DC4
21
+ Content-Type: message/global
22
+ Content-Transfer-Encoding: 8bit
23
+
24
+ From: "Embed sender" <embed@example.com>
25
+ To: <rcpt2@example.invalid>
26
+ Subject: Embedded subject line with emoji ✨
27
+ X-heävy-mëtal-ümlaut: yes
28
+ Date: Sun, 12 May 2024 17:34:29 +1000
29
+
30
+ Example embedded message, with UTF-8 headers.
31
+
32
+ ------------=_4F506AC2.EE281DC4--
33
+
@@ -0,0 +1,8 @@
1
+ To: person@example.invalid
2
+ Subject: pre-RFC2822 Date header
3
+ Content-type: text/plain
4
+ From: anotherperson@example.invalid
5
+ Message-Id: <6965470922807932796@example.invalid>
6
+ Date: ons, 26 maj 1999 11:00:34 +0200 (CEST)
7
+
8
+ A message body.
@@ -0,0 +1,42 @@
1
+ Created: 20241014T073358
2
+ Key: (private-key (rsa (n #00C0EF24D44D17ABD33603EDED46A2F639BDB90C9A72
3
+ E6AD03E83B597169BF7B8F6DEF42A5EED6F9BBDD0BDE326075969886D11D2875FB6972
4
+ D8D73ECC98F6A14AB083E93990567C78EEDA09260096B4B99C67824B39005DEA7D75B5
5
+ ECF3F03D042EEEB49E9871AA3B2DC4552FC7598B8DDAD6454EF0CCD11D8C4BAEEFEBCC
6
+ CF4BCDB4FBB05BCC026910D4249E24BB657BD2287E6999FD2C499C54C29CE079437CB3
7
+ 8AE685C6D733749B046FF2235A29B22822C23EFFF38302B3A8EEC81CE9505BF8D4CCF5
8
+ EB958AFBDE50488F56E14B3CC116E413CE5E449D65537DDFB90F841A3B6580BEA20783
9
+ 002699B584F53EE4C29C7381071536659E50BE9AA445068F5B2B2B0185E850DF4790FD
10
+ 455A91135FE29A79A0E7EF73A8C6B6328603C5B46466B1A674AE205256C79B8A39E73D
11
+ 15587A123C2FEC23C14CD2ADD2D41344408E713A10D986766F17F93011998788DEF294
12
+ DA6C3E86CEC1562FB574014CA2937FA7ACF7C57D80E9925994FCF8EA55102FC987FAD6
13
+ 7393E2011515856AE9FEB6DDB9#)(e #010001#)(d
14
+ #1AC7D73BE4EB993D3B2D36748E2E86B12325B19B2AC1DC58437F217E3DA887B53414
15
+ 5713036131CF22F2C7C8045DAE26C3E7F8FD29CB592AC8F0AFD5E491AF77D7A2A7D806
16
+ B20A9B1AC4872A90405B1BBC9B1D99E572A896A90D92D02E5835900417BC589B5E83BB
17
+ AD31A885764D76B29D22CB021728C70A2BF441772A2B06C745E98E5A3F93C4EDE2991F
18
+ F017B72F720D8CF3672329E260E1635E943A107B0EAF3963A04426910CE98BA7225C47
19
+ E2ABC92872001EB52585557CE8903C7B225D342894EFB6CCA4ED2397E970EAB675BE69
20
+ 70F1009E87396923D13A6B4B1E941EA9433C386EFA94843C67C5C5D08B688BDCD3075D
21
+ 29ACB0D3D3F156562ABB19345B547040782FA7DD199F20CA7042D8548FF72FAB96394C
22
+ 2ADFCAFA4E38196AED778C777BA8BF4646A8E4F5DA3E44C0330AC71AFAD1FCF1C792F2
23
+ 34C7D0BFA59E1435813695CC813C1395DDCD61BE60B1693B89DC5B8480DE5BD5065AED
24
+ 3822B865574D55155FCACDB51807679040D6952E073982C6075E07111A205D7EBEA015
25
+ #)(p #00D8DF87835F964777CC15BA16559A04CD40D570084AF06117224D9B6DE56CB5
26
+ DCC0F5A66DEAF9DBA1542475808017B318D152FA7425376508A48E1591C75605504799
27
+ 184C0F11059B5625C799356CC895314DD684A25CC36775DFB2270DBB1E92E7457773BB
28
+ 9E2C1BCDB93BD7A9E4AE316F23FC06D9AC6E538A7A9A53D454B1548A80291777704EA7
29
+ B5D798C8378C4C7B040A4BD64875755A8CC092D4D1C340D22CA798F177F0A0A9893BC7
30
+ 026A9023660CBF155F22CC295880965E75832AA01F#)(q
31
+ #00E3BDF8A4560327A98A63D6B00B7474FC0F918F043CF0A99253F41EEEF4895BFAF8
32
+ 50AFDC107C4A741958667F7B567F280632C8B3454494CA1B253A33DD4E45ACC5194F53
33
+ 1B67DD975D15470FA52CF2C71CEA669B1471CF1B8B76EE0E5925F5CC1103D75184D7C3
34
+ BB8EE7498ECC34483EEDD5516AF5F234ADA9C0BFDE2E3A15F7027B109E136C56C4779C
35
+ 6E032DC25B5D2E68D7079C5CEBC15B25ADE6481A1E1E78305B067C452C677908BE6D16
36
+ EC7B1869689FC9F70FB4D45449C336D9B46727#)(u
37
+ #009C3200C269390035DB78F0259D81B22712470EE1FBA278564DDDE0C667EA48A511
38
+ 7B8AB17C2DAEFD2078BF99CE548A72661E8FCA2288BE39447854F79AFDAFB4415BB60A
39
+ C72562E2DDB31D52DDE9D638EEDBF9636AB6BCDD2870E6C9B59AFAB04C169CF51433BE
40
+ C75EC697575686029F36FA2537896ACCD35EB766BB3A2EBC84DBFC24C0D049699813B1
41
+ 1A7679D87D38B222ECD1238DCFB84AB58D5C4D8B5E90D627D9C1BEA3793AC2AEA225FC
42
+ 7C7021EA0FA08CAF614286537134929A47097D#)))
@@ -0,0 +1,5 @@
1
+ Created: 20241014T073400
2
+ Key: (private-key (ecc (curve Ed25519)(flags eddsa)(q
3
+ #4049C4EFC8EEB81658624601387C3ECCDE9A3D76476C10773DE55E025580B9AE17#)
4
+ (d #C9A9E5DAE378425DDCFBC4B565845883A198F96B86E31D3F4763665633D9F51E#)
5
+ ))
@@ -0,0 +1,5 @@
1
+ Created: 20241014T073400
2
+ Key: (private-key (ecc (curve Curve25519)(flags djb-tweak)(q
3
+ #404F9277B8281579076BE50AF2D30484B4B72E56035A3F36A99F38A6FA06065521#)
4
+ (d #5390C4E04165F6AAF4CDCA43C6FF4C5B6FF3F55137B11A5BC64CE8C7B67E3948#)
5
+ ))
Binary file
@@ -67,6 +67,15 @@ gpg2 \
67
67
  --passphrase '' \
68
68
  --quick-generate-key sup-test-1@foo.bar rsa encrypt,sign 0
69
69
 
70
+ echo "Generating key pair for sender alternate address (email sup-fake-ecc@fake.fake)"
71
+ gpg2 \
72
+ --homedir . \
73
+ --batch \
74
+ --pinentry-mode loopback \
75
+ --passphrase '' \
76
+ --default-new-key-algo "ed25519/cert,sign+cv25519/encr" \
77
+ --quick-generate-key sup-fake-ecc@fake.fake default default 0
78
+
70
79
  echo "Importing public key for receiver, into sender's key store"
71
80
  gpg2 \
72
81
  --homedir . \
@@ -80,10 +89,10 @@ gpg2 \
80
89
 
81
90
  echo "Done."
82
91
 
83
- echo "We now have two non-expiring public keys (receiver & sender):"
92
+ echo "We now have some non-expiring public keys:"
84
93
  gpg2 --homedir . --list-keys
85
94
 
86
- echo "And we also have only *one* corresponding private key (sender only):"
95
+ echo "And we also have some corresponding private keys:"
87
96
  gpg2 --homedir . --list-secret-keys
88
97
 
89
98
  popd
Binary file
@@ -1,23 +1,23 @@
1
1
  -----BEGIN PGP PUBLIC KEY BLOCK-----
2
2
 
3
- mQGNBF7leTkBDAC3auy8xodH6jxoISylFZTpVqy/0L2ul879YUb/QbC58+F/H36S
4
- CjLfPxFlq0FAOXHelOvktxaybg+BG5UpSvTgBLbcArq5nctee+04TMXCzQzrG2V1
5
- zb9gIRT665fX3+WYncSIXdr4LAp7r8Jw3RT3tTOZqbaencumCWaJblnvfFwPrMKf
6
- AXWa/NVndNMAXmJ5uBf1MRr45KXaQ2tczPIeHqSOKhKNnKZPRqPs0fg4i3d0Vb6G
7
- yItgtJapfBo50FV+PvtodMHo3LDlz/BBjdEJHSvghqEjb1S7xGo+hdXs+lfCMfa0
8
- 3PAWoj+OeHNorbK0YbVKOtS0E0xYvScbyC7bfwtA9yb3LZYmy7VHsKJmQfygCNQ6
9
- wIKQGAVN1NcQcJsvWyAwk9+WMN5oqB5lb76u40beoWlUjSJRlph2VvWvkGuh/huU
10
- sVGqcN7EO4SFkwi2YQLoWfQRGur3mids/PQTBywpGE1SyziP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itest::Test
4
5
 
6
+ include Redwood
7
+
5
8
  def setup
6
9
  @path = Dir.mktmpdir
7
10
 
@@ -31,7 +34,9 @@ EOS
31
34
  end
32
35
 
33
36
  def create_a_maildir_email(folder, content)
34
- File.write(File.join(folder, "#{Time.now.to_f}.hostname:2,S"), content)
37
+ filename = File.join folder, "#{Time.now.to_f}.hostname:2,S"
38
+ File.write filename, content
39
+ filename
35
40
  end
36
41
 
37
42
  def start_sup_and_add_source(source)
@@ -71,5 +76,17 @@ EOS
71
76
 
72
77
  end
73
78
 
79
+ def test_missing_date_header
80
+ ## The message is missing a Date header so we should use its modtime
81
+ ## as a fallback.
82
+ fallback_date = Time.new 2004, 4, 19, 11, 12, 13
83
+ maildir = create_a_maildir
84
+ filename = create_a_maildir_email(File.join(maildir, 'cur'), @test_message_1)
85
+ File.utime fallback_date, fallback_date, filename
86
+ start_sup_and_add_source Maildir.new "maildir:#{maildir}"
87
+
88
+ messages_in_index = Index.instance.enum_for(:each_message).to_a
89
+ assert_equal fallback_date, messages_in_index.first.date
90
+ end
74
91
  end
75
92
 
@@ -1,7 +1,10 @@
1
+ require "sup"
1
2
  require "test_helper"
2
3
 
3
4
  class TestMbox < Minitest::Test
4
5
 
6
+ include Redwood
7
+
5
8
  def setup
6
9
  @path = Dir.mktmpdir
7
10
 
@@ -66,4 +69,14 @@ EOS
66
69
 
67
70
  end
68
71
 
72
+ def test_missing_date_header
73
+ ## The message is missing a Date header so we should use envelope date
74
+ ## stored in the From line as a fallback.
75
+ fallback_date = Time.new 2009, 4, 27, 12, 56, 18
76
+ mbox = create_a_mbox
77
+ start_sup_and_add_source MBox.new "mbox:#{mbox}"
78
+
79
+ messages_in_index = Index.instance.enum_for(:each_message).to_a
80
+ assert_equal fallback_date, messages_in_index.first.date
81
+ end
69
82
  end
@@ -0,0 +1,40 @@
1
+ require "test_helper"
2
+
3
+ class TestSupSyncBackMaildir < Minitest::Test
4
+
5
+ def setup
6
+ @path = Dir.mktmpdir
7
+
8
+ @maildir = File.join @path, "test_maildir"
9
+ Dir.mkdir @maildir
10
+ %w[cur new tmp].each do |subdir|
11
+ Dir.mkdir (File.join @maildir, subdir)
12
+ end
13
+ msg_path = File.join @maildir, "new", "123.hostname"
14
+ FileUtils.copy_file fixture_path("simple-message.eml"), msg_path
15
+
16
+ _out, _err = capture_subprocess_io do
17
+ assert system({"SUP_BASE" => @path}, "bin/sup-add", "maildir://#{@maildir}")
18
+ assert system({"SUP_BASE" => @path}, "bin/sup-sync")
19
+ end
20
+ end
21
+
22
+ def teardown
23
+ FileUtils.rm_r @path
24
+ end
25
+
26
+ def test_it_syncs_seen_unread_flags
27
+ _out, _err = capture_subprocess_io do
28
+ assert system({"SUP_BASE" => @path},
29
+ "bin/sup-tweak-labels",
30
+ "--all-sources",
31
+ "--add=replied",
32
+ "--remove=unread")
33
+ assert system({"SUP_BASE" => @path}, "bin/sup-sync-back-maildir", "--no-confirm")
34
+ end
35
+
36
+ refute File.exist? (File.join @maildir, "new", "123.hostname")
37
+ assert File.exist? (File.join @maildir, "cur", "123.hostname:2,RS")
38
+ end
39
+
40
+ end