sup 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/checks.yml +70 -0
- data/.rubocop.yml +5 -0
- data/CONTRIBUTORS +3 -2
- data/Gemfile +5 -1
- data/History.txt +20 -0
- data/Manifest.txt +149 -0
- data/README.md +9 -3
- data/Rakefile +40 -1
- data/bin/sup-add +4 -8
- data/ext/mkrf_conf_xapian.rb +10 -4
- data/lib/sup/colormap.rb +1 -1
- data/lib/sup/hook.rb +1 -1
- data/lib/sup/index.rb +2 -2
- data/lib/sup/keymap.rb +1 -1
- data/lib/sup/maildir.rb +4 -4
- data/lib/sup/mbox.rb +4 -4
- data/lib/sup/message.rb +6 -5
- data/lib/sup/message_chunks.rb +27 -19
- data/lib/sup/modes/completion_mode.rb +0 -1
- data/lib/sup/modes/file_browser_mode.rb +2 -2
- data/lib/sup/modes/label_list_mode.rb +1 -1
- data/lib/sup/modes/search_list_mode.rb +2 -2
- data/lib/sup/modes/thread_view_mode.rb +1 -2
- data/lib/sup/rfc2047.rb +21 -6
- data/lib/sup/source.rb +8 -2
- data/lib/sup/textfield.rb +0 -1
- data/lib/sup/thread.rb +0 -1
- data/lib/sup/util.rb +28 -48
- data/lib/sup/version.rb +1 -1
- data/lib/sup.rb +12 -8
- data/man/sup-add.1 +15 -15
- data/man/sup-config.1 +11 -11
- data/man/sup-dump.1 +9 -9
- data/man/sup-import-dump.1 +15 -15
- data/man/sup-psych-ify-config-files.1 +9 -9
- data/man/sup-recover-sources.1 +12 -12
- data/man/sup-sync-back-maildir.1 +14 -14
- data/man/sup-sync.1 +20 -20
- data/man/sup-tweak-labels.1 +16 -16
- data/man/sup.1 +21 -21
- data/sup.gemspec +6 -4
- data/test/dummy_source.rb +21 -15
- data/test/fixtures/embedded-message.eml +34 -0
- data/test/fixtures/non-ascii-header-in-nested-message.eml +36 -0
- data/test/fixtures/non-ascii-header.eml +8 -0
- data/test/fixtures/rfc2047-header-encoding.eml +15 -0
- data/test/fixtures/text-attachments-with-charset.eml +15 -1
- data/test/fixtures/utf8-header.eml +17 -0
- data/test/integration/test_mbox.rb +1 -1
- data/test/integration/test_sup-add.rb +83 -0
- data/test/test_crypto.rb +44 -0
- data/test/test_header_parsing.rb +9 -1
- data/test/test_helper.rb +7 -4
- data/test/test_message.rb +124 -32
- data/test/test_messages_dir.rb +13 -15
- data/test/unit/test_horizontal_selector.rb +4 -4
- data/test/unit/test_locale_fiddler.rb +1 -1
- data/test/unit/util/test_query.rb +1 -1
- data/test/unit/util/test_string.rb +3 -3
- data/test/unit/util/test_uri.rb +2 -2
- metadata +46 -18
- data/.travis.yml +0 -18
- data/bin/sup-psych-ify-config-files +0 -21
- data/test/integration/test_label_service.rb +0 -18
- data/test/test_yaml_migration.rb +0 -85
data/man/sup-recover-sources.1
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
.\" Automatically generated by Pandoc 2.
|
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
|
-
|
31
|
+
--unusual
|
32
32
|
Mark sources as `unusual'.
|
33
33
|
Only usual sources will be polled by hand (default: false)
|
34
34
|
.TP
|
35
|
-
|
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
|
-
|
40
|
+
--scan-num N
|
41
41
|
Number of messages to scan per source (default: 10)
|
42
42
|
.TP
|
43
|
-
|
43
|
+
-h, --help
|
44
44
|
Show help message
|
45
45
|
.SH FILES
|
46
46
|
.TP
|
47
|
-
|
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
|
-
|
61
|
-
<
|
60
|
+
The Sup web page:
|
61
|
+
<https://sup-heliotrope.github.io/>
|
62
62
|
.TP
|
63
|
-
|
63
|
+
Code repository:
|
64
64
|
<https://github.com/sup-heliotrope/sup/>
|
65
65
|
.TP
|
66
|
-
|
66
|
+
Sup Wiki:
|
67
67
|
<https://github.com/sup-heliotrope/sup/wiki/>
|
68
68
|
.TP
|
69
|
-
|
69
|
+
Sup IRC channel:
|
70
70
|
#sup \[at] freenode.net
|
71
71
|
.TP
|
72
|
-
|
72
|
+
Mailing list:
|
73
73
|
supmua\[at]googlegroups.com
|
74
74
|
.RS
|
75
75
|
.PP
|
data/man/sup-sync-back-maildir.1
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
.\" Automatically generated by Pandoc 2.
|
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
|
-
|
38
|
+
-n, --no-confirm
|
39
39
|
Don\[cq]t ask for confirmation before synchronizing
|
40
40
|
.TP
|
41
|
-
|
41
|
+
-m, --no-merge
|
42
42
|
Don\[cq]t merge new supported Maildir flags (R and P)
|
43
43
|
.TP
|
44
|
-
|
44
|
+
-l, --list-sources
|
45
45
|
List your Maildir sources and exit
|
46
46
|
.TP
|
47
|
-
|
47
|
+
-u, --unusual-sources-too
|
48
48
|
Sync unusual sources too if no specific source information is given
|
49
49
|
.TP
|
50
|
-
|
50
|
+
--version
|
51
51
|
Print version and exit
|
52
52
|
.TP
|
53
|
-
|
53
|
+
-h, --help
|
54
54
|
Show brief help message
|
55
55
|
.SH FILES
|
56
56
|
.TP
|
57
|
-
|
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
|
-
|
72
|
-
<
|
71
|
+
The Sup web page:
|
72
|
+
<https://sup-heliotrope.github.io/>
|
73
73
|
.TP
|
74
|
-
|
74
|
+
Code repository:
|
75
75
|
<https://github.com/sup-heliotrope/sup/>
|
76
76
|
.TP
|
77
|
-
|
77
|
+
Sup Wiki:
|
78
78
|
<https://github.com/sup-heliotrope/sup/wiki/>
|
79
79
|
.TP
|
80
|
-
|
80
|
+
Sup IRC channel:
|
81
81
|
#sup \[at] freenode.net
|
82
82
|
.TP
|
83
|
-
|
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.
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
45
|
+
-x, -
|
46
46
|
When using the default source state, mark messages as archived.
|
47
47
|
.TP
|
48
|
-
|
48
|
+
-r, --read
|
49
49
|
When using the default source state, mark messages as read.
|
50
50
|
.TP
|
51
|
-
|
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
|
-
|
56
|
+
-v, --verbose
|
57
57
|
Print message ids as they\[cq]re processed.
|
58
58
|
.TP
|
59
|
-
|
59
|
+
-o, --optimize
|
60
60
|
As the final operation, optimize the index.
|
61
61
|
.TP
|
62
|
-
|
62
|
+
--all-sources
|
63
63
|
Scan over all sources.
|
64
64
|
.TP
|
65
|
-
|
65
|
+
-n, --dry-run
|
66
66
|
Don\[cq]t actually modify the index.
|
67
67
|
Probably only useful with --verbose.
|
68
68
|
.TP
|
69
|
-
|
69
|
+
--version
|
70
70
|
Show version information
|
71
71
|
.TP
|
72
|
-
|
72
|
+
-h, --help
|
73
73
|
Show help message
|
74
74
|
.SH FILES
|
75
75
|
.TP
|
76
|
-
|
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
|
-
|
91
|
-
<
|
90
|
+
The Sup web page:
|
91
|
+
<https://sup-heliotrope.github.io/>
|
92
92
|
.TP
|
93
|
-
|
93
|
+
Code repository:
|
94
94
|
<https://github.com/sup-heliotrope/sup/>
|
95
95
|
.TP
|
96
|
-
|
96
|
+
Sup Wiki:
|
97
97
|
<https://github.com/sup-heliotrope/sup/wiki/>
|
98
98
|
.TP
|
99
|
-
|
99
|
+
Sup IRC channel:
|
100
100
|
#sup \[at] freenode.net
|
101
101
|
.TP
|
102
|
-
|
102
|
+
Mailing list:
|
103
103
|
supmua\[at]googlegroups.com
|
104
104
|
.RS
|
105
105
|
.PP
|
data/man/sup-tweak-labels.1
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
.\" Automatically generated by Pandoc 2.
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
31
|
+
-v, --verbose
|
32
32
|
Print message ids as they\[cq]re processed
|
33
33
|
.TP
|
34
|
-
|
34
|
+
-e, --very-verbose
|
35
35
|
Print message names and subjects as they\[cq]re processed
|
36
36
|
.TP
|
37
|
-
|
37
|
+
--all-sources
|
38
38
|
Scan over all sources
|
39
39
|
.TP
|
40
|
-
|
40
|
+
-n, --dry-run
|
41
41
|
Don\[cq]t actually modify the index.
|
42
42
|
Probably only useful with --verbose
|
43
43
|
.TP
|
44
|
-
|
44
|
+
--version
|
45
45
|
Show version information
|
46
46
|
.TP
|
47
|
-
|
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
|
-
|
61
|
-
<
|
60
|
+
The Sup web page:
|
61
|
+
<https://sup-heliotrope.github.io/>
|
62
62
|
.TP
|
63
|
-
|
63
|
+
Code repository:
|
64
64
|
<https://github.com/sup-heliotrope/sup/>
|
65
65
|
.TP
|
66
|
-
|
66
|
+
Sup Wiki:
|
67
67
|
<https://github.com/sup-heliotrope/sup/wiki/>
|
68
68
|
.TP
|
69
|
-
|
69
|
+
Sup IRC channel:
|
70
70
|
#sup \[at] freenode.net
|
71
71
|
.TP
|
72
|
-
|
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.
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
37
|
+
-o, --no-initial-poll
|
38
38
|
Don\[cq]t poll for new messages when starting.
|
39
39
|
.TP
|
40
|
-
|
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
|
-
|
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
|
-
|
46
|
+
-j \f[I]STRING\f[R], --subject \f[I]STRING\f[R]
|
47
47
|
When composing, use this subject
|
48
48
|
.TP
|
49
|
-
|
49
|
+
-v, --version
|
50
50
|
Print version and exit
|
51
51
|
.TP
|
52
|
-
|
52
|
+
-h, --help
|
53
53
|
Show brief help message
|
54
54
|
.SH ENVIRONMENT
|
55
55
|
.TP
|
56
|
-
|
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
|
-
|
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
|
-
|
66
|
+
$HOME/.sup/config.yaml
|
67
67
|
Configuration file for Sup
|
68
68
|
.TP
|
69
|
-
|
69
|
+
$HOME/.sup/sources.yaml
|
70
70
|
Configuration file for Sup mail sources
|
71
71
|
.TP
|
72
|
-
|
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
|
-
|
88
|
-
<
|
87
|
+
The Sup web page:
|
88
|
+
<https://sup-heliotrope.github.io/>
|
89
89
|
.TP
|
90
|
-
|
90
|
+
Code repository:
|
91
91
|
<https://github.com/sup-heliotrope/sup/>
|
92
92
|
.TP
|
93
|
-
|
93
|
+
Sup Wiki:
|
94
94
|
<https://github.com/sup-heliotrope/sup/wiki/>
|
95
95
|
.TP
|
96
|
-
|
96
|
+
Sup IRC channel:
|
97
97
|
#sup \[at] freenode.net
|
98
98
|
.TP
|
99
|
-
|
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
|
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 =
|
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", "
|
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
|
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
|
29
|
-
|
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
|
33
|
-
|
33
|
+
def load_header id
|
34
|
+
with_file_for(id) { |f| parse_raw_email_header f }
|
34
35
|
end
|
35
36
|
|
36
|
-
def
|
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
|
-
|
39
|
-
|
40
|
-
|
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
|
46
|
-
|
51
|
+
def raw_message id
|
52
|
+
with_file_for(id) { |f| f.read }
|
47
53
|
end
|
48
54
|
|
49
|
-
def each_raw_message_line
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
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,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
|
-
|
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>
|