sup 1.2 → 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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/checks.yml +16 -2
  3. data/.gitmodules +1 -0
  4. data/History.txt +16 -0
  5. data/Manifest.txt +12 -1
  6. data/contrib/nix/Gemfile +2 -0
  7. data/contrib/nix/Gemfile.lock +37 -16
  8. data/contrib/nix/gem-install-shell.nix +2 -0
  9. data/contrib/nix/gemset.nix +83 -31
  10. data/contrib/nix/ruby2.4-Gemfile.lock +5 -1
  11. data/contrib/nix/ruby2.4-gemset.nix +22 -2
  12. data/contrib/nix/ruby2.4-shell.nix +2 -6
  13. data/contrib/nix/ruby2.5-Gemfile.lock +5 -1
  14. data/contrib/nix/ruby2.5-gemset.nix +22 -2
  15. data/contrib/nix/ruby2.5-shell.nix +2 -6
  16. data/contrib/nix/ruby2.6-Gemfile.lock +5 -1
  17. data/contrib/nix/ruby2.6-gemset.nix +22 -2
  18. data/contrib/nix/ruby2.6-shell.nix +2 -6
  19. data/contrib/nix/ruby2.7-Gemfile.lock +91 -0
  20. data/contrib/nix/ruby2.7-gemset.nix +359 -0
  21. data/contrib/nix/ruby2.7-shell.nix +2 -11
  22. data/contrib/nix/ruby3.0-Gemfile.lock +91 -0
  23. data/contrib/nix/ruby3.0-gemset.nix +359 -0
  24. data/contrib/nix/ruby3.0-shell.nix +2 -11
  25. data/contrib/nix/ruby3.1-shell.nix +9 -7
  26. data/contrib/nix/ruby3.2-shell.nix +9 -7
  27. data/contrib/nix/ruby3.3-shell.nix +9 -7
  28. data/contrib/nix/ruby3.4-shell.nix +36 -0
  29. data/contrib/nix/test-all-rubies.sh +1 -1
  30. data/lib/sup/crypto.rb +7 -5
  31. data/lib/sup/maildir.rb +4 -0
  32. data/lib/sup/mbox.rb +25 -7
  33. data/lib/sup/message.rb +13 -10
  34. data/lib/sup/modes/edit_message_mode.rb +5 -5
  35. data/lib/sup/util.rb +9 -2
  36. data/lib/sup/version.rb +1 -1
  37. data/man/sup-add.1 +15 -15
  38. data/man/sup-config.1 +9 -9
  39. data/man/sup-dump.1 +13 -12
  40. data/man/sup-import-dump.1 +20 -20
  41. data/man/sup-psych-ify-config-files.1 +11 -11
  42. data/man/sup-recover-sources.1 +18 -18
  43. data/man/sup-sync-back-maildir.1 +18 -17
  44. data/man/sup-sync.1 +29 -29
  45. data/man/sup-tweak-labels.1 +22 -21
  46. data/man/sup.1 +21 -21
  47. data/sup.gemspec +2 -0
  48. data/test/dummy_source.rb +6 -0
  49. data/test/fixtures/embedded-message-rfc6532.eml +33 -0
  50. data/test/fixtures/invalid-date.eml +8 -0
  51. data/test/gnupg_test_home/private-keys-v1.d/26C05E44706A8E230B3255BB9532B34DC9420232.key +42 -0
  52. data/test/gnupg_test_home/private-keys-v1.d/D187ADC90EC4DEB7047678EAA37E33A53A465D47.key +5 -0
  53. data/test/gnupg_test_home/private-keys-v1.d/FB2D9BD3B1BE90B5BCF697781F8404224B0FCF5B.key +5 -0
  54. data/test/gnupg_test_home/pubring.gpg +0 -0
  55. data/test/gnupg_test_home/receiver_pubring.gpg +0 -0
  56. data/test/gnupg_test_home/receiver_secring.gpg +0 -0
  57. data/test/gnupg_test_home/regen_keys.sh +11 -2
  58. data/test/gnupg_test_home/secring.gpg +0 -0
  59. data/test/gnupg_test_home/sup-test-2@foo.bar.asc +20 -20
  60. data/test/integration/test_maildir.rb +15 -1
  61. data/test/integration/test_mbox.rb +10 -0
  62. data/test/test_crypto.rb +108 -71
  63. data/test/test_message.rb +42 -0
  64. data/test/unit/test_contact.rb +1 -1
  65. data/test/unit/test_edit_message_mode.rb +94 -0
  66. data/test/unit/test_person.rb +3 -3
  67. data/test/unit/test_rmail_message.rb +36 -0
  68. data/test/unit/util/test_string.rb +3 -3
  69. metadata +50 -5
  70. data/test/gnupg_test_home/private-keys-v1.d/306D2EE90FF0014B5B9FD07E265C751791674140.key +0 -0
@@ -1,49 +1,50 @@
1
- .\" Automatically generated by Pandoc 3.1.9
1
+ .\" Automatically generated by Pandoc 3.1.11.1
2
2
  .\"
3
- .TH "SUP-TWEAK-LABELS" "1" "April 9, 2012" "Sup User Manuel" ""
3
+ .TH "SUP\-TWEAK\-LABELS" "1" "April 9, 2012" "Sup User Manuel" ""
4
4
  .SH NAME
5
- sup-tweak-labels - batch modification of message state already in index
5
+ sup\-tweak\-labels \- batch modification of message state already in
6
+ index
6
7
  .SH SYNOPSIS
7
- sup-tweak-labels [\f[I]options\f[R]] source \&...
8
+ sup\-tweak\-labels [\f[I]options\f[R]] source \&...
8
9
  .SH DESCRIPTION
9
10
  Batch modification of message state for messages already in the index.
10
11
  .PP
11
- Supported source URI schemes can be seen by running \[lq]sup-add
12
- --help\[rq].
12
+ Supported source URI schemes can be seen by running \[lq]sup\-add
13
+ \-\-help\[rq].
13
14
  .SH OPTIONS
14
15
  .TP
15
- -a \f[I]STRING\f[R], --add \f[I]STRING\f[R]
16
- 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
17
18
  specified sources (default: )
18
19
  .TP
19
- -r \f[I]STRING\f[R], --remove \f[I]STRING\f[R]
20
- 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
21
22
  the specified sources, if those labels are present (default: )
22
23
  .TP
23
- -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]
24
25
  A Sup search query
25
26
  .SH OTHER OPTIONS
26
27
  .TP
27
- -v, --verbose
28
+ \-v, \-\-verbose
28
29
  Print message ids as they\[cq]re processed
29
30
  .TP
30
- -e, --very-verbose
31
+ \-e, \-\-very\-verbose
31
32
  Print message names and subjects as they\[cq]re processed
32
33
  .TP
33
- --all-sources
34
+ \-\-all\-sources
34
35
  Scan over all sources
35
36
  .TP
36
- -n, --dry-run
37
+ \-n, \-\-dry\-run
37
38
  Don\[cq]t actually modify the index.
38
- Probably only useful with --verbose
39
+ Probably only useful with \-\-verbose
39
40
  .TP
40
- --version
41
+ \-\-version
41
42
  Show version information
42
43
  .TP
43
- -h, --help
44
+ \-h, \-\-help
44
45
  Show help message
45
46
  .SH SEE ALSO
46
- sup(1), sup-add(1)
47
+ sup(1), sup\-add(1)
47
48
  .SH REPORTING BUGS
48
49
  You are welcome to submit bug reports to the Sup issue tracker, located
49
50
  at
@@ -79,11 +80,11 @@ Archives: \c
79
80
  .UE \c
80
81
  .RE
81
82
  .SH COPYRIGHT
82
- Copyright © 2006-2009 William Morgan \c
83
+ Copyright © 2006\-2009 William Morgan \c
83
84
  .MT mworgan-sup@masanjin.net
84
85
  .ME \c
85
86
  .PP
86
- Copyright \[at] 2013-2014 Sup developers
87
+ Copyright \[at] 2013\-2014 Sup developers
87
88
  .PP
88
89
  Permission is granted to copy and distribute this manual under the terms
89
90
  of the GNU General Public License; either version 2 or (at your option)
data/man/sup.1 CHANGED
@@ -1,51 +1,51 @@
1
- .\" Automatically generated by Pandoc 3.1.9
1
+ .\" Automatically generated by Pandoc 3.1.11.1
2
2
  .\"
3
3
  .TH "SUP" "1" "April 8, 2014" "Sup User Manual" ""
4
4
  .SH NAME
5
- sup - a curses-based email client
5
+ sup \- a curses\-based email client
6
6
  .SH SYNOPSIS
7
7
  sup [\f[I]options\f[R]]
8
8
  .SH DESCRIPTION
9
- 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.
10
10
  .PP
11
11
  It presents an interface of a list of threads, which are each
12
12
  hierarchical collections email messages.
13
13
  Threads can have multiple tags applied to them.
14
- It supports a very fast full-text search, automatic contact-list
14
+ It supports a very fast full\-text search, automatic contact\-list
15
15
  management, custom code insertion via a Ruby hook system, and more.
16
16
  If you\[cq]re the type of person who treats email as an extension of
17
- your long-term memory, Sup is for you.
17
+ your long\-term memory, Sup is for you.
18
18
  .SH OPTIONS
19
19
  .TP
20
- -l, --list-hooks
20
+ \-l, \-\-list\-hooks
21
21
  List all hooks and descriptions, and quit.
22
- Use \[en]hooks-matching to filter
22
+ Use \[en]hooks\-matching to filter
23
23
  .TP
24
- -m, --hooks-matching=<s>
24
+ \-m, \-\-hooks\-matching=<s>
25
25
  If given, list all hooks and descriptions matching the given pattern.
26
- Needs the \[en]list-hooks option (default: )
26
+ Needs the \[en]list\-hooks option (default: )
27
27
  .TP
28
- -n, --no-threads
28
+ \-n, \-\-no\-threads
29
29
  Turn off threading.
30
30
  Helps with debugging.
31
31
  (Necessarily disables background polling for new messages.)
32
32
  .TP
33
- -o, --no-initial-poll
33
+ \-o, \-\-no\-initial\-poll
34
34
  Don\[cq]t poll for new messages when starting.
35
35
  .TP
36
- -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]
37
37
  Search for this query upon startup
38
38
  .TP
39
- -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]
40
40
  Compose message to this recipient upon startup
41
41
  .TP
42
- -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]
43
43
  When composing, use this subject
44
44
  .TP
45
- -v, --version
45
+ \-v, \-\-version
46
46
  Print version and exit
47
47
  .TP
48
- -h, --help
48
+ \-h, \-\-help
49
49
  Show brief help message
50
50
  .SH ENVIRONMENT
51
51
  .TP
@@ -68,9 +68,9 @@ Configuration file for Sup mail sources
68
68
  $HOME/.sup/colors.yaml
69
69
  Color theme for Sup
70
70
  .SH SEE ALSO
71
- mail(1), sup-add(1), sup-config(1), sup-dump(1), sup-import-dump(1),
72
- sup-recover-sources(1), sup-sync(1), sup-sync-back-maildir(1),
73
- 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)
74
74
  .SH REPORTING BUGS
75
75
  You are welcome to submit bug reports to the Sup issue tracker, located
76
76
  at
@@ -106,11 +106,11 @@ Archives: \c
106
106
  .UE \c
107
107
  .RE
108
108
  .SH COPYRIGHT
109
- Copyright © 2006-2009 William Morgan \c
109
+ Copyright © 2006\-2009 William Morgan \c
110
110
  .MT mworgan-sup@masanjin.net
111
111
  .ME \c
112
112
  .PP
113
- Copyright \[at] 2013-2014 Sup developers
113
+ Copyright \[at] 2013\-2014 Sup developers
114
114
  .PP
115
115
  Permission is granted to copy and distribute this manual under the terms
116
116
  of the GNU General Public License; either version 2 or (at your option)
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+Oe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UnX3R5xXGm5Sf66VwR+0Vo9J
21
+ EFqKZ/vYa3YwJ+hfzIBVKGxBKXpXQv83
22
+ =kQ2o
23
23
  -----END PGP PUBLIC KEY BLOCK-----
@@ -34,7 +34,9 @@ EOS
34
34
  end
35
35
 
36
36
  def create_a_maildir_email(folder, content)
37
- 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
38
40
  end
39
41
 
40
42
  def start_sup_and_add_source(source)
@@ -74,5 +76,17 @@ EOS
74
76
 
75
77
  end
76
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
77
91
  end
78
92
 
@@ -69,4 +69,14 @@ EOS
69
69
 
70
70
  end
71
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
72
82
  end