sup 1.0 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/checks.yml +70 -0
  3. data/.rubocop.yml +5 -0
  4. data/CONTRIBUTORS +3 -2
  5. data/Gemfile +5 -1
  6. data/History.txt +20 -0
  7. data/Manifest.txt +149 -0
  8. data/README.md +9 -3
  9. data/Rakefile +40 -1
  10. data/bin/sup-add +4 -8
  11. data/ext/mkrf_conf_xapian.rb +10 -4
  12. data/lib/sup/colormap.rb +1 -1
  13. data/lib/sup/hook.rb +1 -1
  14. data/lib/sup/index.rb +2 -2
  15. data/lib/sup/keymap.rb +1 -1
  16. data/lib/sup/maildir.rb +4 -4
  17. data/lib/sup/mbox.rb +4 -4
  18. data/lib/sup/message.rb +6 -5
  19. data/lib/sup/message_chunks.rb +27 -19
  20. data/lib/sup/modes/completion_mode.rb +0 -1
  21. data/lib/sup/modes/file_browser_mode.rb +2 -2
  22. data/lib/sup/modes/label_list_mode.rb +1 -1
  23. data/lib/sup/modes/search_list_mode.rb +2 -2
  24. data/lib/sup/modes/thread_view_mode.rb +1 -2
  25. data/lib/sup/rfc2047.rb +21 -6
  26. data/lib/sup/source.rb +8 -2
  27. data/lib/sup/textfield.rb +0 -1
  28. data/lib/sup/thread.rb +0 -1
  29. data/lib/sup/util.rb +28 -48
  30. data/lib/sup/version.rb +1 -1
  31. data/lib/sup.rb +12 -8
  32. data/man/sup-add.1 +15 -15
  33. data/man/sup-config.1 +11 -11
  34. data/man/sup-dump.1 +9 -9
  35. data/man/sup-import-dump.1 +15 -15
  36. data/man/sup-psych-ify-config-files.1 +9 -9
  37. data/man/sup-recover-sources.1 +12 -12
  38. data/man/sup-sync-back-maildir.1 +14 -14
  39. data/man/sup-sync.1 +20 -20
  40. data/man/sup-tweak-labels.1 +16 -16
  41. data/man/sup.1 +21 -21
  42. data/sup.gemspec +6 -4
  43. data/test/dummy_source.rb +21 -15
  44. data/test/fixtures/embedded-message.eml +34 -0
  45. data/test/fixtures/non-ascii-header-in-nested-message.eml +36 -0
  46. data/test/fixtures/non-ascii-header.eml +8 -0
  47. data/test/fixtures/rfc2047-header-encoding.eml +15 -0
  48. data/test/fixtures/text-attachments-with-charset.eml +15 -1
  49. data/test/fixtures/utf8-header.eml +17 -0
  50. data/test/integration/test_mbox.rb +1 -1
  51. data/test/integration/test_sup-add.rb +83 -0
  52. data/test/test_crypto.rb +44 -0
  53. data/test/test_header_parsing.rb +9 -1
  54. data/test/test_helper.rb +7 -4
  55. data/test/test_message.rb +124 -32
  56. data/test/test_messages_dir.rb +13 -15
  57. data/test/unit/test_horizontal_selector.rb +4 -4
  58. data/test/unit/test_locale_fiddler.rb +1 -1
  59. data/test/unit/util/test_query.rb +1 -1
  60. data/test/unit/util/test_string.rb +3 -3
  61. data/test/unit/util/test_uri.rb +2 -2
  62. metadata +46 -18
  63. data/.travis.yml +0 -18
  64. data/bin/sup-psych-ify-config-files +0 -21
  65. data/test/integration/test_label_service.rb +0 -18
  66. data/test/test_yaml_migration.rb +0 -85
@@ -1,4 +1,4 @@
1
- .\" Automatically generated by Pandoc 2.7.3
1
+ .\" Automatically generated by Pandoc 2.9.2.1
2
2
  .\"
3
3
  .TH "SUP-RECOVER-SOURCES" "1" "April 9, 2012" "Sup User Manual" ""
4
4
  .hy
@@ -28,23 +28,23 @@ source, so you will have to run sup-import --rebuild for each new source
28
28
  after doing this.
29
29
  .SH OPTIONS
30
30
  .TP
31
- .B --unusual
31
+ --unusual
32
32
  Mark sources as `unusual'.
33
33
  Only usual sources will be polled by hand (default: false)
34
34
  .TP
35
- .B --archive
35
+ --archive
36
36
  Mark sources as `archive'.
37
37
  New messages from these sources will not appear in the inbox (default:
38
38
  false)
39
39
  .TP
40
- .B --scan-num N
40
+ --scan-num N
41
41
  Number of messages to scan per source (default: 10)
42
42
  .TP
43
- .B -h, --help
43
+ -h, --help
44
44
  Show help message
45
45
  .SH FILES
46
46
  .TP
47
- .B $HOME/.sup/sources.yaml
47
+ $HOME/.sup/sources.yaml
48
48
  Configuration file for Sup mail sources
49
49
  .SH SEE ALSO
50
50
  .PP
@@ -57,19 +57,19 @@ at
57
57
  <https://github.com/sup-heliotrope/sup/issues>
58
58
  .SH CONTACT INFORMATION
59
59
  .TP
60
- .B The Sup web page:
61
- <http://supmua.org/>
60
+ The Sup web page:
61
+ <https://sup-heliotrope.github.io/>
62
62
  .TP
63
- .B Code repository:
63
+ Code repository:
64
64
  <https://github.com/sup-heliotrope/sup/>
65
65
  .TP
66
- .B Sup Wiki:
66
+ Sup Wiki:
67
67
  <https://github.com/sup-heliotrope/sup/wiki/>
68
68
  .TP
69
- .B Sup IRC channel:
69
+ Sup IRC channel:
70
70
  #sup \[at] freenode.net
71
71
  .TP
72
- .B Mailing list:
72
+ Mailing list:
73
73
  supmua\[at]googlegroups.com
74
74
  .RS
75
75
  .PP
@@ -1,4 +1,4 @@
1
- .\" Automatically generated by Pandoc 2.7.3
1
+ .\" Automatically generated by Pandoc 2.9.2.1
2
2
  .\"
3
3
  .TH "SUP-SYNC-BACK-MAILDIR" "1" "August 25, 2014" "Sup User Manual" ""
4
4
  .hy
@@ -35,26 +35,26 @@ sources marked as usual and that have not disabled sync back using the
35
35
  configuration parameter sync_back = false in sources.yaml.
36
36
  .SH OPTIONS
37
37
  .TP
38
- .B -n, --no-confirm
38
+ -n, --no-confirm
39
39
  Don\[cq]t ask for confirmation before synchronizing
40
40
  .TP
41
- .B -m, --no-merge
41
+ -m, --no-merge
42
42
  Don\[cq]t merge new supported Maildir flags (R and P)
43
43
  .TP
44
- .B -l, --list-sources
44
+ -l, --list-sources
45
45
  List your Maildir sources and exit
46
46
  .TP
47
- .B -u, --unusual-sources-too
47
+ -u, --unusual-sources-too
48
48
  Sync unusual sources too if no specific source information is given
49
49
  .TP
50
- .B --version
50
+ --version
51
51
  Print version and exit
52
52
  .TP
53
- .B -h, --help
53
+ -h, --help
54
54
  Show brief help message
55
55
  .SH FILES
56
56
  .TP
57
- .B $HOME/.sup/sources.yaml
57
+ $HOME/.sup/sources.yaml
58
58
  Configuration file for Sup mail sources
59
59
  .SH SEE ALSO
60
60
  .PP
@@ -68,19 +68,19 @@ at
68
68
  <https://github.com/sup-heliotrope/sup/issues>
69
69
  .SH CONTACT INFORMATION
70
70
  .TP
71
- .B The Sup web page:
72
- <http://supmua.org/>
71
+ The Sup web page:
72
+ <https://sup-heliotrope.github.io/>
73
73
  .TP
74
- .B Code repository:
74
+ Code repository:
75
75
  <https://github.com/sup-heliotrope/sup/>
76
76
  .TP
77
- .B Sup Wiki:
77
+ Sup Wiki:
78
78
  <https://github.com/sup-heliotrope/sup/wiki/>
79
79
  .TP
80
- .B Sup IRC channel:
80
+ Sup IRC channel:
81
81
  #sup \[at] freenode.net
82
82
  .TP
83
- .B Mailing list:
83
+ Mailing list:
84
84
  supmua\[at]googlegroups.com
85
85
  .RS
86
86
  .PP
data/man/sup-sync.1 CHANGED
@@ -1,4 +1,4 @@
1
- .\" Automatically generated by Pandoc 2.7.3
1
+ .\" Automatically generated by Pandoc 2.9.2.1
2
2
  .\"
3
3
  .TH "SUP-SYNC" "1" "April 9, 2012" "Sup User Manual" ""
4
4
  .hy
@@ -30,50 +30,50 @@ Supported source URI schemes can be seen by running \[lq]sup-add
30
30
  --help\[rq].
31
31
  .SH MESSAGE STATE OPTIONS
32
32
  .TP
33
- .B --asis
33
+ --asis
34
34
  If the message is already in the index, preserve its state.
35
35
  Otherwise, use default source state (default)
36
36
  .TP
37
- .B --restore dumpfile
37
+ --restore dumpfile
38
38
  Restore message state from a dump file created with sup-dump.
39
39
  If a message is not in this dumpfile, act as --asis
40
40
  .TP
41
- .B --discard
41
+ --discard
42
42
  Discard any message state in the index and use the default source state.
43
43
  \f[B]Dangerous!\f[R]
44
44
  .TP
45
- .B -x, -
45
+ -x, -
46
46
  When using the default source state, mark messages as archived.
47
47
  .TP
48
- .B -r, --read
48
+ -r, --read
49
49
  When using the default source state, mark messages as read.
50
50
  .TP
51
- .B --extra-labels \f[I]STRING\f[R]
51
+ --extra-labels \f[I]STRING\f[R]
52
52
  When using the default source state, also apply these user-defined
53
53
  labels (a comma-separated list) (default)
54
54
  .SH OTHER OPTIONS
55
55
  .TP
56
- .B -v, --verbose
56
+ -v, --verbose
57
57
  Print message ids as they\[cq]re processed.
58
58
  .TP
59
- .B -o, --optimize
59
+ -o, --optimize
60
60
  As the final operation, optimize the index.
61
61
  .TP
62
- .B --all-sources
62
+ --all-sources
63
63
  Scan over all sources.
64
64
  .TP
65
- .B -n, --dry-run
65
+ -n, --dry-run
66
66
  Don\[cq]t actually modify the index.
67
67
  Probably only useful with --verbose.
68
68
  .TP
69
- .B --version
69
+ --version
70
70
  Show version information
71
71
  .TP
72
- .B -h, --help
72
+ -h, --help
73
73
  Show help message
74
74
  .SH FILES
75
75
  .TP
76
- .B $HOME/.sup/sources.yaml
76
+ $HOME/.sup/sources.yaml
77
77
  Configuration file for Sup mail sources
78
78
  .SH SEE ALSO
79
79
  .PP
@@ -87,19 +87,19 @@ at
87
87
  <https://github.com/sup-heliotrope/sup/issues>
88
88
  .SH CONTACT INFORMATION
89
89
  .TP
90
- .B The Sup web page:
91
- <http://supmua.org/>
90
+ The Sup web page:
91
+ <https://sup-heliotrope.github.io/>
92
92
  .TP
93
- .B Code repository:
93
+ Code repository:
94
94
  <https://github.com/sup-heliotrope/sup/>
95
95
  .TP
96
- .B Sup Wiki:
96
+ Sup Wiki:
97
97
  <https://github.com/sup-heliotrope/sup/wiki/>
98
98
  .TP
99
- .B Sup IRC channel:
99
+ Sup IRC channel:
100
100
  #sup \[at] freenode.net
101
101
  .TP
102
- .B Mailing list:
102
+ Mailing list:
103
103
  supmua\[at]googlegroups.com
104
104
  .RS
105
105
  .PP
@@ -1,4 +1,4 @@
1
- .\" Automatically generated by Pandoc 2.7.3
1
+ .\" Automatically generated by Pandoc 2.9.2.1
2
2
  .\"
3
3
  .TH "SUP-TWEAK-LABELS" "1" "April 9, 2012" "Sup User Manuel" ""
4
4
  .hy
@@ -16,35 +16,35 @@ Supported source URI schemes can be seen by running \[lq]sup-add
16
16
  --help\[rq].
17
17
  .SH OPTIONS
18
18
  .TP
19
- .B -a \f[I]STRING\f[R], --add \f[I]STRING\f[R]
19
+ -a \f[I]STRING\f[R], --add \f[I]STRING\f[R]
20
20
  One or more labels (comma-separated) to add to every message from the
21
21
  specified sources (default: )
22
22
  .TP
23
- .B -r \f[I]STRING\f[R], --remove \f[I]STRING\f[R]
23
+ -r \f[I]STRING\f[R], --remove \f[I]STRING\f[R]
24
24
  One or more labels (comma-separated) to remove from every message from
25
25
  the specified sources, if those labels are present (default: )
26
26
  .TP
27
- .B -q \f[I]QUERY\f[R], --query \f[I]QUERY\f[R]
27
+ -q \f[I]QUERY\f[R], --query \f[I]QUERY\f[R]
28
28
  A Sup search query
29
29
  .SH OTHER OPTIONS
30
30
  .TP
31
- .B -v, --verbose
31
+ -v, --verbose
32
32
  Print message ids as they\[cq]re processed
33
33
  .TP
34
- .B -e, --very-verbose
34
+ -e, --very-verbose
35
35
  Print message names and subjects as they\[cq]re processed
36
36
  .TP
37
- .B --all-sources
37
+ --all-sources
38
38
  Scan over all sources
39
39
  .TP
40
- .B -n, --dry-run
40
+ -n, --dry-run
41
41
  Don\[cq]t actually modify the index.
42
42
  Probably only useful with --verbose
43
43
  .TP
44
- .B --version
44
+ --version
45
45
  Show version information
46
46
  .TP
47
- .B -h, --help
47
+ -h, --help
48
48
  Show help message
49
49
  .SH SEE ALSO
50
50
  .PP
@@ -57,19 +57,19 @@ at
57
57
  <https://github.com/sup-heliotrope/sup/issues>
58
58
  .SH CONTACT INFORMATION
59
59
  .TP
60
- .B The Sup web page:
61
- <http://supmua.org/>
60
+ The Sup web page:
61
+ <https://sup-heliotrope.github.io/>
62
62
  .TP
63
- .B Code repository:
63
+ Code repository:
64
64
  <https://github.com/sup-heliotrope/sup/>
65
65
  .TP
66
- .B Sup Wiki:
66
+ Sup Wiki:
67
67
  <https://github.com/sup-heliotrope/sup/wiki/>
68
68
  .TP
69
- .B Sup IRC channel:
69
+ Sup IRC channel:
70
70
  #sup \[at] freenode.net
71
71
  .TP
72
- .B Mailing list:
72
+ Mailing list:
73
73
  supmua\[at]googlegroups.com
74
74
  .RS
75
75
  .PP
data/man/sup.1 CHANGED
@@ -1,4 +1,4 @@
1
- .\" Automatically generated by Pandoc 2.7.3
1
+ .\" Automatically generated by Pandoc 2.9.2.1
2
2
  .\"
3
3
  .TH "SUP" "1" "April 8, 2014" "Sup User Manual" ""
4
4
  .hy
@@ -21,55 +21,55 @@ If you\[cq]re the type of person who treats email as an extension of
21
21
  your long-term memory, Sup is for you.
22
22
  .SH OPTIONS
23
23
  .TP
24
- .B -l, --list-hooks
24
+ -l, --list-hooks
25
25
  List all hooks and descriptions, and quit.
26
26
  Use \[en]hooks-matching to filter
27
27
  .TP
28
- .B -m, --hooks-matching=<s>
28
+ -m, --hooks-matching=<s>
29
29
  If given, list all hooks and descriptions matching the given pattern.
30
30
  Needs the \[en]list-hooks option (default: )
31
31
  .TP
32
- .B -n, --no-threads
32
+ -n, --no-threads
33
33
  Turn off threading.
34
34
  Helps with debugging.
35
35
  (Necessarily disables background polling for new messages.)
36
36
  .TP
37
- .B -o, --no-initial-poll
37
+ -o, --no-initial-poll
38
38
  Don\[cq]t poll for new messages when starting.
39
39
  .TP
40
- .B -s \f[I]QUERY\f[R], --search \f[I]QUERY\f[R]
40
+ -s \f[I]QUERY\f[R], --search \f[I]QUERY\f[R]
41
41
  Search for this query upon startup
42
42
  .TP
43
- .B -c \f[I]STRING\f[R], --compose \f[I]STRING\f[R]
43
+ -c \f[I]STRING\f[R], --compose \f[I]STRING\f[R]
44
44
  Compose message to this recipient upon startup
45
45
  .TP
46
- .B -j \f[I]STRING\f[R], --subject \f[I]STRING\f[R]
46
+ -j \f[I]STRING\f[R], --subject \f[I]STRING\f[R]
47
47
  When composing, use this subject
48
48
  .TP
49
- .B -v, --version
49
+ -v, --version
50
50
  Print version and exit
51
51
  .TP
52
- .B -h, --help
52
+ -h, --help
53
53
  Show brief help message
54
54
  .SH ENVIRONMENT
55
55
  .TP
56
- .B SUP_LOG_LEVEL
56
+ SUP_LOG_LEVEL
57
57
  Set log level verbosity.
58
58
  Valid values ordered by decresing verbosity: debug info warn error.
59
59
  Default log level is info.
60
60
  .TP
61
- .B SUP_BASE\[rs]
61
+ SUP_BASE\[rs]
62
62
  Specify home directory for configuration files and xapian index,
63
63
  defaults to: $HOME/.sup.
64
64
  .SH FILES
65
65
  .TP
66
- .B $HOME/.sup/config.yaml
66
+ $HOME/.sup/config.yaml
67
67
  Configuration file for Sup
68
68
  .TP
69
- .B $HOME/.sup/sources.yaml
69
+ $HOME/.sup/sources.yaml
70
70
  Configuration file for Sup mail sources
71
71
  .TP
72
- .B $HOME/.sup/colors.yaml
72
+ $HOME/.sup/colors.yaml
73
73
  Color theme for Sup
74
74
  .SH SEE ALSO
75
75
  .PP
@@ -84,19 +84,19 @@ at
84
84
  <https://github.com/sup-heliotrope/sup/issues>
85
85
  .SH CONTACT INFORMATION
86
86
  .TP
87
- .B The Sup web page:
88
- <http://supmua.org/>
87
+ The Sup web page:
88
+ <https://sup-heliotrope.github.io/>
89
89
  .TP
90
- .B Code repository:
90
+ Code repository:
91
91
  <https://github.com/sup-heliotrope/sup/>
92
92
  .TP
93
- .B Sup Wiki:
93
+ Sup Wiki:
94
94
  <https://github.com/sup-heliotrope/sup/wiki/>
95
95
  .TP
96
- .B Sup IRC channel:
96
+ Sup IRC channel:
97
97
  #sup \[at] freenode.net
98
98
  .TP
99
- .B Mailing list:
99
+ Mailing list:
100
100
  supmua\[at]googlegroups.com
101
101
  .RS
102
102
  .PP
data/sup.gemspec CHANGED
@@ -4,7 +4,7 @@ require 'sup/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "sup"
7
- s.version = ENV["REL"] || (::Redwood::VERSION == "git" ? "999" : ::Redwood::VERSION)
7
+ s.version = ENV["REL"] || (/-git-/ =~ ::Redwood::VERSION ? "999" : ::Redwood::VERSION)
8
8
  s.date = Time.now.strftime "%Y-%m-%d"
9
9
  s.authors = ["William Morgan", "Gaute Hope", "Hamish Downer", "Matthieu Rakotojaona"]
10
10
  s.email = "supmua@googlegroups.com"
@@ -32,7 +32,7 @@ SUP: please note that our old mailing lists have been shut down,
32
32
  https://github.com/sup-heliotrope/sup/wiki/Installation%3A-OpenBSD.
33
33
  EOF
34
34
 
35
- s.files = `git ls-files -z`.split("\x0")
35
+ s.files = File.read("Manifest.txt").split
36
36
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
37
37
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
38
38
  s.require_paths = ["lib"]
@@ -51,7 +51,7 @@ SUP: please note that our old mailing lists have been shut down,
51
51
  ## ext/mkrf_conf_xapian.rb and Gemfile.
52
52
 
53
53
  s.add_runtime_dependency "ncursesw", "~> 1.4.0"
54
- s.add_runtime_dependency "rmail", "~> 1.1"
54
+ s.add_runtime_dependency "rmail", ">= 1.1.2", "< 2"
55
55
  s.add_runtime_dependency "highline"
56
56
  s.add_runtime_dependency "optimist"
57
57
  s.add_runtime_dependency "lockfile"
@@ -60,12 +60,14 @@ SUP: please note that our old mailing lists have been shut down,
60
60
  s.add_runtime_dependency "chronic"
61
61
  s.add_runtime_dependency "unicode", "~> 0.4.4"
62
62
  s.add_runtime_dependency "unicode-display_width"
63
+ s.add_runtime_dependency "string-scrub" if /^2\.0\./ =~ RUBY_VERSION
63
64
 
64
65
  s.add_development_dependency "bundler", ">= 1.3", "< 3"
65
66
  s.add_development_dependency "rake"
66
- s.add_development_dependency 'minitest', '~> 5.5.1'
67
+ s.add_development_dependency 'minitest', '~> 5.5'
67
68
  s.add_development_dependency "rr", "~> 1.1"
68
69
  s.add_development_dependency "gpgme", ">= 2.0.2"
69
70
  s.add_development_dependency "pry"
71
+ s.add_development_dependency "rubocop-packaging" unless /^2\.[012]\./ =~ RUBY_VERSION
70
72
 
71
73
  end
data/test/dummy_source.rb CHANGED
@@ -25,32 +25,38 @@ class DummySource < Source
25
25
  return @messages ? @messages.length - 1 : 0
26
26
  end
27
27
 
28
- def load_header offset
29
- Source.parse_raw_email_header StringIO.new(raw_header(offset))
28
+ def with_file_for id
29
+ fn = @messages[id]
30
+ File.open(fn, 'rb') { |f| yield f }
30
31
  end
31
32
 
32
- def load_message offset
33
- RMail::Parser.read raw_message(offset)
33
+ def load_header id
34
+ with_file_for(id) { |f| parse_raw_email_header f }
34
35
  end
35
36
 
36
- def raw_header offset
37
+ def load_message id
38
+ with_file_for(id) { |f| RMail::Parser.read f }
39
+ end
40
+
41
+ def raw_header id
37
42
  ret = ""
38
- f = StringIO.new(@messages[offset])
39
- until f.eof? || (l = f.gets) =~ /^$/
40
- ret += l
43
+ with_file_for(id) do |f|
44
+ until f.eof? || (l = f.gets) =~ /^$/
45
+ ret += l
46
+ end
41
47
  end
42
48
  ret
43
49
  end
44
50
 
45
- def raw_message offset
46
- @messages[offset]
51
+ def raw_message id
52
+ with_file_for(id) { |f| f.read }
47
53
  end
48
54
 
49
- def each_raw_message_line offset
50
- ret = ""
51
- f = StringIO.new(@messages[offset])
52
- until f.eof?
53
- yield f.gets
55
+ def each_raw_message_line id
56
+ with_file_for(id) do |f|
57
+ until f.eof?
58
+ yield f.gets
59
+ end
54
60
  end
55
61
  end
56
62
  end
@@ -0,0 +1,34 @@
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
+ Example second line.
19
+
20
+
21
+ ------------=_4F506AC2.EE281DC4
22
+ Content-Type: message/rfc822; x-spam-type=original
23
+ Content-Transfer-Encoding: 8bit
24
+
25
+ From: "Embed sender" <embed@example.com>
26
+ To: <rcpt2@example.invalid>
27
+ Subject: Embedded subject line
28
+ Date: Wed, 15 Jul 2020 12:34:56 +0000
29
+
30
+ Example embedded message.
31
+ Second line.
32
+
33
+ ------------=_4F506AC2.EE281DC4--
34
+
@@ -0,0 +1,36 @@
1
+ Return-Path: <spammer@example.com>
2
+ From: SPAM � <spammer@example.com>
3
+ To: <recipient@example.invalid>
4
+ Subject: spam � spam
5
+ MIME-Version: 1.0
6
+ Content-Type: multipart/mixed; boundary="----------=_4F506AC2.EE281DC4"
7
+ Message-Id: <20120302063755.0FE2122017@a.a.a.a>
8
+ Date: Fri, 2 Mar 2012 07:37:55 +0100 (CET)
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
+ Spam detection software, running on the system "a.a.a.a.a.", has
18
+ identified this incoming email as possible spam. The original message
19
+ has been attached to this so you can view it (if it isn't spam) or label
20
+ similar future email.
21
+
22
+
23
+ ------------=_4F506AC2.EE281DC4
24
+ Content-Type: message/rfc822; x-spam-type=original
25
+ Content-Description: original message before SpamAssassin
26
+ Content-Disposition: attachment
27
+ Content-Transfer-Encoding: 8bit
28
+
29
+ From: SPAM � <spammer@example.com>
30
+ To: <enclosed@example.invalid>
31
+ Subject: spam � spam
32
+
33
+ This is a spam.
34
+
35
+ ------------=_4F506AC2.EE281DC4--
36
+
@@ -0,0 +1,8 @@
1
+ Return-Path: <spammer@example.com>
2
+ From: SPAM � <spammer@example.com>
3
+ To: <a@b.c>
4
+ Subject: spam � spam
5
+ Message-Id: <20120302063755.0FE2122017@a.a.a.a>
6
+ Date: Fri, 2 Mar 2012 07:37:55 +0100 (CET)
7
+
8
+ https://github.com/sup-heliotrope/sup/issues/205
@@ -0,0 +1,15 @@
1
+ From: test@example.invalid
2
+ To: test@example.invalid
3
+ Date: Sun, 19 Jul 2020 17:03:56 +1000
4
+ Subject:
5
+ =?US-ASCII?q?Hans Martin Djupvik?= =?ISO-8859-1?q?,_Ingrid_B=F8?=
6
+ =?KOI8-R?b?LCDp0snOwSDzycTP0s/XwQ?=
7
+ =?UTF-16?b?//4sACAASgBlAHMAcABlAHIAIABCAGUAcgBnAA?=
8
+ =?UTF-7?b?LCBGcmlkYSBFbmcrQVBnLQ?=
9
+ bad: =?UTF16?q?badcharsetname?= =?US-ASCII?b?/w?=
10
+ =?UTF-7?Q?=41=6D=65=72=69=63=61=E2=80=99=73?=
11
+
12
+ The subject header contains various RFC2047 encoded words.
13
+ For completeness we test both base64 and quoted-printable, and some
14
+ ASCII-incompatible encodings.
15
+ We also include some bogus words which cannot be decoded.
@@ -42,5 +42,19 @@ Content-Disposition: attachment; filename="bad.txt"
42
42
  MIME-Version: 1.0
43
43
 
44
44
  Embedded=F0garbage
45
- --===============2385509127900810307==--
45
+
46
+ --===============2385509127900810307==
47
+ Content-Type: text/plain; charset="invalid-test"; name="invalid-charset.txt"
48
+ Content-Transfer-Encoding: quoted-printable
49
+ Content-Disposition: attachment; filename="invalid-charset.txt"
50
+
51
+ Example invalid charset
52
+ --===============2385509127900810307==
53
+ Content-Type: text/plain; charset="utf-7"
54
+ Content-Transfer-Encoding: 7bit
55
+ MIME-Version: 1.0
56
+ Content-Disposition: attachment; filename="ascii.txt"
57
+
58
+ This is +Jyg-UTF-7+Jyg-
59
+ --===============2385509127900810307==
46
60
 
@@ -0,0 +1,17 @@
1
+ Delivered-To: djc@djc.id.au
2
+ Received: from orpheus.librarything.com (orpheus.librarything.com [74.201.105.9])
3
+ by djc.id.au (Postfix) with ESMTP id A0CCB20AAB99
4
+ for <djc@djc.id.au>; Sat, 23 Jan 2021 02:52:15 +1000 (AEST)
5
+ Received: by orpheus.librarything.com (Postfix, from userid 0)
6
+ id 21B172C20F9; Fri, 22 Jan 2021 11:52:08 -0500 (EST)
7
+ To: djc@djc.id.au
8
+ Subject: LibraryThing: State of the Thing — January
9
+ MIME-Version: 1.0
10
+ Content-type: text/html; charset=iso-8859-1
11
+ From: tim@librarything.com
12
+ Reply-To: tim@librarything.com
13
+ Message-Id: <20210122165208.21B172C20F9@orpheus.librarything.com>
14
+ Date: Fri, 22 Jan 2021 11:52:08 -0500 (EST)
15
+ Return-Path: <root@orpheus.librarything.com>
16
+
17
+ <p>Some stuff</p>
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class TestMbox < MiniTest::Test
3
+ class TestMbox < Minitest::Test
4
4
 
5
5
  def setup
6
6
  @path = Dir.mktmpdir