sup 0.22.1 → 0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -3
- data/.travis.yml +11 -6
- data/CONTRIBUTORS +13 -5
- data/Gemfile +2 -1
- data/History.txt +51 -0
- data/README.md +26 -5
- data/bin/sup +7 -5
- data/bin/sup-add +14 -14
- data/bin/sup-config +30 -44
- data/bin/sup-dump +2 -2
- data/bin/sup-import-dump +4 -4
- data/bin/sup-sync +3 -3
- data/bin/sup-sync-back-maildir +2 -2
- data/bin/sup-tweak-labels +5 -5
- data/ext/mkrf_conf_xapian.rb +1 -1
- data/lib/sup.rb +1 -0
- data/lib/sup/crypto.rb +17 -8
- data/lib/sup/hook.rb +8 -8
- data/lib/sup/index.rb +18 -5
- data/lib/sup/logger.rb +1 -1
- data/lib/sup/message.rb +20 -10
- data/lib/sup/message_chunks.rb +3 -2
- data/lib/sup/mode.rb +1 -0
- data/lib/sup/modes/contact_list_mode.rb +1 -0
- data/lib/sup/modes/reply_mode.rb +3 -1
- data/lib/sup/modes/thread_index_mode.rb +1 -1
- data/lib/sup/modes/thread_view_mode.rb +14 -11
- data/lib/sup/source.rb +1 -1
- data/lib/sup/util.rb +14 -19
- data/lib/sup/util/axe.rb +17 -0
- data/lib/sup/util/ncurses.rb +3 -3
- data/lib/sup/version.rb +10 -1
- data/sup.gemspec +7 -6
- data/test/fixtures/mailing-list-header.eml +80 -0
- data/test/fixtures/text-attachments-with-charset.eml +46 -0
- data/test/fixtures/zimbra-quote-with-bottom-post.eml +27 -0
- data/test/gnupg_test_home/gpg.conf +2 -1
- data/test/gnupg_test_home/private-keys-v1.d/306D2EE90FF0014B5B9FD07E265C751791674140.key +0 -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 +69 -18
- data/test/gnupg_test_home/secring.gpg +0 -0
- data/test/gnupg_test_home/sup-test-2@foo.bar.asc +20 -22
- data/test/test_crypto.rb +2 -0
- data/test/test_message.rb +74 -0
- data/test/unit/util/test_query.rb +10 -4
- data/test/unit/util/test_string.rb +6 -0
- metadata +52 -38
- data/test/gnupg_test_home/key1.gen +0 -15
- data/test/gnupg_test_home/key2.gen +0 -15
- data/test/gnupg_test_home/key_ecc.gen +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f073aae1fcb4d1c56fc300ed854e5edd398bddd078e073eeae2aede068122ae3
|
4
|
+
data.tar.gz: 8f5956c3305f5accb16de9ca57dd2ae370696c4e0f0cda18305af98a895338bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb9c3e0de8d3a17936a47f7ba925f380d3b84303d7d132b581b4fd9f6d71887e9d7fe137d2f18ec4fbb898e81f59fac38c2396d911df233e98f2fc401b949cc
|
7
|
+
data.tar.gz: f24c2c5f0f95dc042f330d5d949b740ec0c29363f480d8f8fdcefb972b53ab41eb3f2255848c5437c0e32bbc177ad2e7559c421d0c2fafd861e1a91c037f9603
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,13 +1,18 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
|
+
dist: focal
|
4
|
+
|
3
5
|
rvm:
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
- 2.
|
6
|
+
- 2.5
|
7
|
+
- 2.6
|
8
|
+
- 2.7
|
7
9
|
|
8
10
|
before_install:
|
9
|
-
- sudo apt
|
10
|
-
- sudo apt
|
11
|
+
- sudo apt update -qq
|
12
|
+
- sudo apt install -qq uuid-dev uuid libncursesw5-dev libncursesw5 gnupg2 pandoc
|
11
13
|
- git submodule update --init --recursive
|
12
14
|
|
13
|
-
script:
|
15
|
+
script:
|
16
|
+
- bundle exec rake travis
|
17
|
+
- bundle exec gem install pkg/sup-*.gem
|
18
|
+
|
data/CONTRIBUTORS
CHANGED
@@ -8,14 +8,16 @@ Damien Leone
|
|
8
8
|
Sascha Silbe <sascha-pgp at the silbe dot orgs>
|
9
9
|
Eric Weikl <eric.weikl at the gmx dot nets>
|
10
10
|
Paweł Wilk <siefca at the gnu dot orgs>
|
11
|
-
Ismo Puustinen <ismo at the iki dot fis>
|
12
11
|
Matthieu Rakotojaona <matthieu.rakotojaona at the gmail dot coms>
|
12
|
+
Ismo Puustinen <ismo at the iki dot fis>
|
13
|
+
Dan Callaghan <djc at the djc.id dot aus>
|
13
14
|
Nicolas Pouillard <nicolas.pouillard at the gmail dot coms>
|
14
15
|
Michael Stapelberg <michael at the stapelberg dot des>
|
15
16
|
Eric Sherman <hyperbolist at the gmail dot coms>
|
16
17
|
Tero Tilus <tero at the tilus dot nets>
|
17
18
|
Ben Walton <bwalton at the artsci.utoronto dot cas>
|
18
19
|
Scott Bonds <scott at the ggr dot coms>
|
20
|
+
Iain Parris <ipv2.vcs at the parris dot orgs>
|
19
21
|
Mike Stipicevic <stipim at the rpi dot edus>
|
20
22
|
Martin Bähr <mbaehr at the societyserver dot orgs>
|
21
23
|
Timon Vonk <timonv at the gmail dot coms>
|
@@ -23,12 +25,12 @@ Clint Byrum
|
|
23
25
|
Wael M. Nasreddine <wael.nasreddine at the gmail dot coms>
|
24
26
|
Marcus Williams <marcus-sup at the bar-coded dot nets>
|
25
27
|
Lionel Ott <white.magic at the gmx dot des>
|
26
|
-
Gaudenz Steinlin <gaudenz at the soziologie dot chs>
|
27
28
|
Per Andersson <avtobiff at the gmail dot coms>
|
29
|
+
Gaudenz Steinlin <gaudenz at the soziologie dot chs>
|
28
30
|
Mark Alexander <marka at the pobox dot coms>
|
29
31
|
Ingmar Vanhassel <ingmar at the exherbo dot orgs>
|
30
32
|
Edward Z. Yang <ezyang at the mit dot edus>
|
31
|
-
julien
|
33
|
+
julien at the macbook <julien.stechele at the gmail dot coms>
|
32
34
|
Christopher Warrington <chrisw at the rice dot edus>
|
33
35
|
W. Trevor King <wking at the drexel dot edus>
|
34
36
|
Richard Brown <rbrown at the exherbo dot orgs>
|
@@ -61,16 +63,21 @@ Jeff Balogh
|
|
61
63
|
Matías Aguirre <matiasaguirre at the gmail dot coms>
|
62
64
|
PaulSmecker <paul.smecker at the gmail dot coms>
|
63
65
|
Ruthard Baudach <rthrd at the web dot des>
|
66
|
+
Vickenty Fesunov <kent at the setattr dot nets>
|
64
67
|
Kornilios Kourtis <kkourt at the cslab.ece.ntua dot grs>
|
68
|
+
Antoni Kaniowski <a at the generativestuff dot coms>
|
65
69
|
Lars Fischer <fischer at the wiwi.uni-siegen dot des>
|
70
|
+
Sharif Olorin <sio at the tesser dot orgs>
|
71
|
+
Steven Lawrance <stl at the koffein dot nets>
|
66
72
|
madhat2r <MaDhAt2r at the dukefoo dot coms>
|
67
73
|
Kevin Riggle <kevinr at the free-dissociation dot coms>
|
68
74
|
Giorgio Lando <patroclo7 at the gmail dot coms>
|
69
75
|
Benoît PIERRE <benoit.pierre at the gmail dot coms>
|
70
|
-
|
76
|
+
Seva Zhidkov <zhidkovseva at the gmail dot coms>
|
71
77
|
Alvaro Herrera <alvherre at the alvh.no-ip dot orgs>
|
72
78
|
Jonah <Jonah at the GoodCoffee dot cas>
|
73
79
|
ian <itaylor at the uark dot edus>
|
80
|
+
Simon Tatham <anakin at the pobox dot coms>
|
74
81
|
Elias Norberg <xyzzy at the kudzu dot ses>
|
75
82
|
0xACE <0xACE at the users.noreply.github dot coms>
|
76
83
|
MichaelRevell <mikearevell at the gmail dot coms>
|
@@ -78,9 +85,10 @@ Gregor Hoffleit
|
|
78
85
|
Adam Lloyd <adam at the alloy-d dot nets>
|
79
86
|
Todd Eisenberger <teisenbe at the andrew.cmu dot edus>
|
80
87
|
Johannes Larsen <mail at the johslarsen dot nets>
|
81
|
-
Sharif Olorin <sio at the tesser dot orgs>
|
82
88
|
Steven Schmeiser <steven at the schmeiser dot orgs>
|
83
89
|
Steven Walter <swalter at the monarch.(none)>
|
90
|
+
Michael Dwyer <mdwyer at the michaelmdwyer dot coms>
|
91
|
+
Kyle Hunt <Kyle_Hunt at the ymail dot coms>
|
84
92
|
William A. Kennington III <william at the wkennington dot coms>
|
85
93
|
akojo <atte.kojo at the gmail dot coms>
|
86
94
|
Horacio Sanson <horacio at the skillupjapan.co dot jps>
|
data/Gemfile
CHANGED
data/History.txt
CHANGED
@@ -1,3 +1,54 @@
|
|
1
|
+
== 0.23 / 2020-07-10
|
2
|
+
|
3
|
+
* #505: Shell metacharacters in attachment filenames are no longer escaped when
|
4
|
+
saving the attachment to disk using 's'. Fixes attachments being saved with
|
5
|
+
unnecessary \ escapes in their filename. (Felix Van der Jeugt)
|
6
|
+
* When saving attachments, Sup now creates all parent directories of the
|
7
|
+
destination path. (Matthieu Rakotojaona)
|
8
|
+
* The '@' key now reloads all messages in thread view. (Seva Zhidkov)
|
9
|
+
* #517: The 'g' key now correctly opens each selected URL if multiple URLs are
|
10
|
+
under the cursor, instead of opening the last URL multiple times.
|
11
|
+
(Matthieu Rakotojaona)
|
12
|
+
* The 'g' key now works when the cursor is over a URL inside a signature block.
|
13
|
+
(Michael Dwyer)
|
14
|
+
* The 'reply-to' hook is now passed a 'message' variable, the message being
|
15
|
+
replied to, so that the hook can choose the reply mode based on properties of
|
16
|
+
the message like the list address. (Simon Tatham)
|
17
|
+
* The contacts list now shows also email addresses supplied by the
|
18
|
+
'extra-contract-addresses' hook. (Matthieu Rakotojaona)
|
19
|
+
* #510: The micalg= parameter is now set correctly when sending
|
20
|
+
multipart/signed messages. Fixes issues with other mail clients which fail to
|
21
|
+
handle a missing micalg= parameter on signed messages. (Dan Callaghan)
|
22
|
+
* Attachments with text/plain MIME type are now correctly decoded according to
|
23
|
+
their charset= parameter. (Dan Callaghan)
|
24
|
+
* Strings returned by the 'mime-decode' hook are now kept in their original
|
25
|
+
encoding and displayed as is, instead of being wrongly transcoded.
|
26
|
+
(Dan Callaghan)
|
27
|
+
* Rendering speed of thread list views is improved. (Vickenty Fesunov)
|
28
|
+
* Fixed display width calculation for emoji. Previously, sender names and
|
29
|
+
thread subjects using emoji would be incorrectly truncated, if the terminal
|
30
|
+
emulator displays emoji as double-width. (Dan Callaghan)
|
31
|
+
* List address is parsed from the non-standard Mailing-List header used by
|
32
|
+
Groups.io. (Dan Callaghan)
|
33
|
+
* Fixed misinterpretation of quoted text where the quote uses both an
|
34
|
+
"---- Original Message ----" marker and > delimiters, for example from
|
35
|
+
Zimbra users. (Steven Lawrance)
|
36
|
+
* Added a new option 'indent_spaces' in config.yaml, to control the number of
|
37
|
+
spaces for indenting each child message when displaying the thread view.
|
38
|
+
The default remains 2. (Antoni Kaniowski)
|
39
|
+
* Attachment sizes are now displayed using standard unit abbreviations like
|
40
|
+
"MiB". (Sharif Olorin)
|
41
|
+
* Sup now gives a hint if a search query results in an empty search after
|
42
|
+
tokenization (for example, if the user tries to search for only punctuation).
|
43
|
+
(Per Andersson)
|
44
|
+
* The --list-hooks option now takes an additional option --hooks-matching, to
|
45
|
+
filter the listed hooks. (Matthieu Rakotojaona)
|
46
|
+
* Fixed ArgumentError in logging methods on Ruby 2.7. (Dan Callaghan)
|
47
|
+
* Fixed FrozenError in verified_ok? method on Ruby 2.7. (Iain Parris)
|
48
|
+
* Fixed Fixnum deprecation warnings on Ruby 2.4+. (Dan Callaghan)
|
49
|
+
* Several dependency version updates. The optimist gem replaces trollop. The
|
50
|
+
unicode-display_width gem is a new dependency.
|
51
|
+
|
1
52
|
== 0.22.1 / 2015-06-18
|
2
53
|
|
3
54
|
* Fix bug (#429) in gem build / install.
|
data/README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# Sup
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
Sup is a console-based email client for people with a lot of email.
|
4
|
+
|
5
|
+
<img src="https://sup-heliotrope.github.io/images/old_screenshot_1.png" />
|
5
6
|
|
6
7
|
## Installation
|
7
8
|
|
@@ -30,20 +31,40 @@ Current limitations:
|
|
30
31
|
|
31
32
|
## Problems
|
32
33
|
|
33
|
-
Please report bugs to the [
|
34
|
+
Please report bugs to the [GitHub issue tracker](https://github.com/sup-heliotrope/sup/issues).
|
34
35
|
|
35
36
|
## Links
|
36
37
|
|
37
|
-
* [Homepage](
|
38
|
+
* [Homepage](https://sup-heliotrope.github.io/)
|
38
39
|
* [Code repository](https://github.com/sup-heliotrope/sup)
|
39
40
|
* [Wiki](https://github.com/sup-heliotrope/sup/wiki)
|
40
41
|
* IRC: [#sup @ freenode.net](http://webchat.freenode.net/?channels=#sup)
|
41
42
|
* Mailing list: supmua@googlegroups.com (subscribe: supmua+subscribe@googlegroups.com, archive: https://groups.google.com/d/forum/supmua )
|
42
43
|
|
44
|
+
## Maintenance status
|
45
|
+
|
46
|
+
Sup is a mature, production-quality mail client. The maintainers are also
|
47
|
+
long-term users, and mainly focus on preserving the current feature set. Pull
|
48
|
+
requests are very welcome, especially to fix bugs or improve compatibility,
|
49
|
+
however pull requests for major new features are unlikely to be merged.
|
50
|
+
|
51
|
+
## Alternatives
|
52
|
+
|
53
|
+
If Sup is missing a feature you are interested in, it might be possible to
|
54
|
+
accomplish using Sup's [powerful hooks mechanism][hooks]. Otherwise, here are
|
55
|
+
some alternatives to consider:
|
56
|
+
|
57
|
+
* [Notmuch](https://notmuchmail.org/) was inspired by Sup. There are a wide
|
58
|
+
variety of [Notmuch clients](https://notmuchmail.org/frontends/) available.
|
59
|
+
The most similar to Sup's look-and-feel is
|
60
|
+
[Alot](https://github.com/pazz/alot) — also a curses-based frontend.
|
61
|
+
Alot even ships with a built-in
|
62
|
+
[Sup theme](https://github.com/pazz/alot/blob/master/extra/themes/sup)!
|
63
|
+
|
43
64
|
## License
|
44
65
|
|
45
66
|
```
|
46
|
-
Copyright (c) 2013
|
67
|
+
Copyright (c) 2013-- Sup developers.
|
47
68
|
Copyright (c) 2006--2009 William Morgan.
|
48
69
|
|
49
70
|
This program is free software; you can redistribute it and/or
|
data/bin/sup
CHANGED
@@ -7,6 +7,7 @@ require 'ncursesw'
|
|
7
7
|
|
8
8
|
require 'sup/util/ncurses'
|
9
9
|
require 'sup/util/locale_fiddler'
|
10
|
+
require 'sup/util/axe'
|
10
11
|
|
11
12
|
no_gpgme = false
|
12
13
|
begin
|
@@ -16,7 +17,7 @@ rescue LoadError
|
|
16
17
|
end
|
17
18
|
|
18
19
|
require 'fileutils'
|
19
|
-
require '
|
20
|
+
require 'optimist'
|
20
21
|
require "sup"
|
21
22
|
|
22
23
|
if ENV['SUP_PROFILE']
|
@@ -28,7 +29,7 @@ if no_gpgme
|
|
28
29
|
info "No 'gpgme' gem detected. Install it for email encryption, decryption and signatures."
|
29
30
|
end
|
30
31
|
|
31
|
-
$opts =
|
32
|
+
$opts = Optimist::options do
|
32
33
|
version "sup v#{Redwood::VERSION}"
|
33
34
|
banner <<EOS
|
34
35
|
Sup is a curses-based email client.
|
@@ -38,7 +39,8 @@ Usage:
|
|
38
39
|
|
39
40
|
Options are:
|
40
41
|
EOS
|
41
|
-
opt :list_hooks, "List all hooks and descriptions, and quit."
|
42
|
+
opt :list_hooks, "List all hooks and descriptions, and quit. Use --hooks-matching to filter."
|
43
|
+
opt :hooks_matching, "If given, list all hooks and descriptions matching the given pattern. Needs the --list-hooks option", short: "m", default: ""
|
42
44
|
opt :no_threads, "Turn off threading. Helps with debugging. (Necessarily disables background polling for new messages.)"
|
43
45
|
opt :no_initial_poll, "Don't poll for new messages when starting."
|
44
46
|
opt :search, "Search for this query upon startup", :type => String
|
@@ -46,7 +48,7 @@ EOS
|
|
46
48
|
opt :subject, "When composing, use this subject", :type => String, :short => "j"
|
47
49
|
end
|
48
50
|
|
49
|
-
|
51
|
+
Optimist::die :subject, "requires --compose" if $opts[:subject] && !$opts[:compose]
|
50
52
|
|
51
53
|
Redwood::HookManager.register "startup", <<EOS
|
52
54
|
Executes at startup
|
@@ -64,7 +66,7 @@ EOS
|
|
64
66
|
|
65
67
|
if $opts[:list_hooks]
|
66
68
|
Redwood.start
|
67
|
-
Redwood::HookManager.print_hooks
|
69
|
+
Redwood::HookManager.print_hooks $opts[:hooks_matching]
|
68
70
|
exit
|
69
71
|
end
|
70
72
|
|
data/bin/sup-add
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
4
4
|
|
5
5
|
require 'uri'
|
6
|
-
require '
|
7
|
-
require 'trollop'
|
6
|
+
require 'optimist'
|
8
7
|
require "sup"
|
8
|
+
require 'sup/util/axe'
|
9
9
|
|
10
|
-
$opts =
|
10
|
+
$opts = Optimist::options do
|
11
11
|
version "sup-add (sup #{Redwood::VERSION})"
|
12
12
|
banner <<EOS
|
13
13
|
Adds a source to the Sup source list.
|
@@ -35,7 +35,7 @@ EOS
|
|
35
35
|
opt :force_account, "Reuse previously defined account user@hostname.", :type => String
|
36
36
|
end
|
37
37
|
|
38
|
-
|
38
|
+
Optimist::die "require one or more sources" if ARGV.empty?
|
39
39
|
|
40
40
|
## for sources that require login information, prompt the user for
|
41
41
|
## that. also provide a list of previously-defined login info to
|
@@ -53,11 +53,11 @@ def get_login_info uri, sources
|
|
53
53
|
if $opts[:force_account]
|
54
54
|
host, username, password = accounts.find { |h, u, p| $opts[:force_account] == "#{u}@#{h}" }
|
55
55
|
unless username && password
|
56
|
-
say "No previous account #{$opts[:force_account].inspect} found."
|
56
|
+
@cli.say "No previous account #{$opts[:force_account].inspect} found."
|
57
57
|
end
|
58
58
|
else
|
59
|
-
say "Would you like to use the same account as for a previous source for #{uri}?"
|
60
|
-
choose do |menu|
|
59
|
+
@cli.say "Would you like to use the same account as for a previous source for #{uri}?"
|
60
|
+
@cli.choose do |menu|
|
61
61
|
accounts.each do |host, olduser, oldpw|
|
62
62
|
menu.choice("Use the account info for #{olduser}@#{host}") { username, password = olduser, oldpw }
|
63
63
|
end
|
@@ -68,15 +68,15 @@ def get_login_info uri, sources
|
|
68
68
|
end
|
69
69
|
|
70
70
|
unless username && password
|
71
|
-
username = ask("Username for #{uri.host}: ");
|
72
|
-
password = ask("Password for #{uri.host}: ") { |q| q.echo = false }
|
71
|
+
username = @cli.ask("Username for #{uri.host}: ");
|
72
|
+
password = @cli.ask("Password for #{uri.host}: ") { |q| q.echo = false }
|
73
73
|
puts # why?
|
74
74
|
end
|
75
75
|
|
76
76
|
[username, password]
|
77
77
|
end
|
78
78
|
|
79
|
-
|
79
|
+
@cli.wrap_at = :auto
|
80
80
|
Redwood::start
|
81
81
|
index = Redwood::Index.init
|
82
82
|
index.load
|
@@ -90,7 +90,7 @@ begin
|
|
90
90
|
labels = $opts[:labels] ? $opts[:labels].split(/\s*,\s*/).uniq : []
|
91
91
|
|
92
92
|
if !$opts[:force_new] && Redwood::SourceManager.source_for(uri)
|
93
|
-
say "Already know about #{uri}; skipping."
|
93
|
+
@cli.say "Already know about #{uri}; skipping."
|
94
94
|
next
|
95
95
|
end
|
96
96
|
|
@@ -103,11 +103,11 @@ begin
|
|
103
103
|
when "mbox"
|
104
104
|
Redwood::MBox.new uri, !$opts[:unusual], $opts[:archive], nil, labels
|
105
105
|
when nil
|
106
|
-
|
106
|
+
Optimist::die "Sources must be specified with an URI"
|
107
107
|
else
|
108
|
-
|
108
|
+
Optimist::die "Unknown source type #{parsed_uri.scheme.inspect}"
|
109
109
|
end
|
110
|
-
say "Adding #{source}..."
|
110
|
+
@cli.say "Adding #{source}..."
|
111
111
|
Redwood::SourceManager.add_source source
|
112
112
|
end
|
113
113
|
ensure
|
data/bin/sup-config
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
4
4
|
|
5
|
-
require '
|
6
|
-
require 'trollop'
|
5
|
+
require 'optimist'
|
7
6
|
require "sup"
|
7
|
+
require 'sup/util/axe'
|
8
8
|
|
9
|
-
$opts =
|
9
|
+
$opts = Optimist::options do
|
10
10
|
version "sup-config (sup #{Redwood::VERSION})"
|
11
11
|
banner <<EOS
|
12
12
|
Interactive configuration tool for Sup. Won't destroy existing
|
@@ -19,20 +19,6 @@ No options.
|
|
19
19
|
EOS
|
20
20
|
end
|
21
21
|
|
22
|
-
def axe q, default=nil
|
23
|
-
question = if default && !default.empty?
|
24
|
-
"#{q} (enter for \"#{default}\"): "
|
25
|
-
else
|
26
|
-
"#{q}: "
|
27
|
-
end
|
28
|
-
ans = ask question
|
29
|
-
ans.empty? ? default : ans.to_s
|
30
|
-
end
|
31
|
-
|
32
|
-
def axe_yes q, default="n"
|
33
|
-
axe(q, default) =~ /^y|yes$/i
|
34
|
-
end
|
35
|
-
|
36
22
|
def build_cmd cmd
|
37
23
|
(ENV["RUBY_INVOCATION"] ? ENV["RUBY_INVOCATION"] + " " : "") + File.join(File.dirname($0), cmd)
|
38
24
|
end
|
@@ -42,8 +28,8 @@ def add_source
|
|
42
28
|
|
43
29
|
type = nil
|
44
30
|
|
45
|
-
say "Ok, adding a new source."
|
46
|
-
choose do |menu|
|
31
|
+
@cli.say "Ok, adding a new source."
|
32
|
+
@cli.choose do |menu|
|
47
33
|
menu.prompt = "What type of mail source is it? "
|
48
34
|
menu.choice("mbox file") { type = :mbox }
|
49
35
|
menu.choice("maildir directory") { type = :maildir }
|
@@ -51,7 +37,7 @@ def add_source
|
|
51
37
|
end
|
52
38
|
|
53
39
|
while true do
|
54
|
-
say "Ok, now for the details."
|
40
|
+
@cli.say "Ok, now for the details."
|
55
41
|
|
56
42
|
default_labels, components = case type
|
57
43
|
when :mbox
|
@@ -75,11 +61,11 @@ def add_source
|
|
75
61
|
uri = begin
|
76
62
|
Redwood::Util::Uri.build components
|
77
63
|
rescue URI::Error => e
|
78
|
-
say "Whoopsie! I couldn't build a URI from that: #{e.message}"
|
64
|
+
@cli.say "Whoopsie! I couldn't build a URI from that: #{e.message}"
|
79
65
|
if axe_yes("Try again?") then next else return end
|
80
66
|
end
|
81
67
|
|
82
|
-
say "I'm going to add this source: #{uri}"
|
68
|
+
@cli.say "I'm going to add this source: #{uri}"
|
83
69
|
unless axe("Does that look right?", "y") =~ /^y|yes$/i
|
84
70
|
if axe_yes("Try again?") then next else return end
|
85
71
|
end
|
@@ -108,21 +94,21 @@ def add_source
|
|
108
94
|
|
109
95
|
system cmd
|
110
96
|
if $?.success?
|
111
|
-
say "Great! Added!"
|
97
|
+
@cli.say "Great! Added!"
|
112
98
|
break
|
113
99
|
else
|
114
|
-
say "Rats, that failed. You may have to do it manually."
|
100
|
+
@cli.say "Rats, that failed. You may have to do it manually."
|
115
101
|
if axe_yes("Try again?") then next else return end
|
116
102
|
end
|
117
103
|
end
|
118
104
|
end
|
119
105
|
|
120
|
-
|
106
|
+
@cli.wrap_at = :auto
|
121
107
|
Redwood::start
|
122
108
|
index = Redwood::Index.init
|
123
109
|
Redwood::SourceManager.load_sources
|
124
110
|
|
125
|
-
say <<EOS
|
111
|
+
@cli.say <<EOS
|
126
112
|
Howdy neighbor! This here's sup-config, ready to help you jack in to
|
127
113
|
the next generation of digital cyberspace: the text-based email
|
128
114
|
program. Get ready to be the envy of everyone in your internets
|
@@ -138,11 +124,11 @@ account = $config[:accounts][:default]
|
|
138
124
|
name = axe "What's your name?", account[:name]
|
139
125
|
email = axe "What's your (primary) email address?", account[:email]
|
140
126
|
|
141
|
-
say "Ok, your from header will look like this:"
|
142
|
-
say " From: #{name} <#{email}>"
|
127
|
+
@cli.say "Ok, your from header will look like this:"
|
128
|
+
@cli.say " From: #{name} <#{email}>"
|
143
129
|
|
144
|
-
say "\nDo you have any alternate email addresses that also receive email?"
|
145
|
-
say "If so, enter them now, separated by spaces."
|
130
|
+
@cli.say "\nDo you have any alternate email addresses that also receive email?"
|
131
|
+
@cli.say "If so, enter them now, separated by spaces."
|
146
132
|
alts = axe("Alternate email addresses", account[:alternates].join(" ")).split(/\s+/)
|
147
133
|
|
148
134
|
sigfn = axe "What file contains your signature?", account[:signature]
|
@@ -159,36 +145,36 @@ $config[:time_mode] = time_mode
|
|
159
145
|
|
160
146
|
done = false
|
161
147
|
until done
|
162
|
-
say "\nNow, we'll tell Sup where to find all your email."
|
148
|
+
@cli.say "\nNow, we'll tell Sup where to find all your email."
|
163
149
|
Redwood::SourceManager.load_sources
|
164
|
-
say "Current sources:"
|
150
|
+
@cli.say "Current sources:"
|
165
151
|
if Redwood::SourceManager.sources.empty?
|
166
|
-
say " No sources!"
|
152
|
+
@cli.say " No sources!"
|
167
153
|
else
|
168
154
|
Redwood::SourceManager.sources.each { |s| puts "* #{s}" }
|
169
155
|
end
|
170
156
|
|
171
|
-
say "\n"
|
172
|
-
choose do |menu|
|
157
|
+
@cli.say "\n"
|
158
|
+
@cli.choose do |menu|
|
173
159
|
menu.prompt = "Your wish? "
|
174
160
|
menu.choice("Add a new source.") { add_source }
|
175
161
|
menu.choice("Done adding sources!") { done = true }
|
176
162
|
end
|
177
163
|
end
|
178
164
|
|
179
|
-
say "\nSup needs to know where to store your sent messages."
|
180
|
-
say "Only sources capable of storing mail will be listed.\n\n"
|
165
|
+
@cli.say "\nSup needs to know where to store your sent messages."
|
166
|
+
@cli.say "Only sources capable of storing mail will be listed.\n\n"
|
181
167
|
|
182
168
|
Redwood::SourceManager.load_sources
|
183
169
|
if Redwood::SourceManager.sources.empty?
|
184
|
-
say "\nUsing the default sup://sent, since you haven't configured other sources yet."
|
170
|
+
@cli.say "\nUsing the default sup://sent, since you haven't configured other sources yet."
|
185
171
|
$config[:sent_source] = 'sup://sent'
|
186
172
|
else
|
187
173
|
# this handles the event that source.yaml already contains the SentLoader
|
188
174
|
# source.
|
189
175
|
have_sup_sent = false
|
190
176
|
|
191
|
-
choose do |menu|
|
177
|
+
@cli.choose do |menu|
|
192
178
|
menu.prompt = "Store my sent mail in? "
|
193
179
|
|
194
180
|
menu.choice('Default (an mbox in ~/.sup, aka sup://sent)') { $config[:sent_source] = 'sup://sent'} unless have_sup_sent
|
@@ -202,9 +188,9 @@ end
|
|
202
188
|
|
203
189
|
Redwood::save_yaml_obj $config, Redwood::CONFIG_FN, false, true
|
204
190
|
|
205
|
-
say "Ok, I've saved you up a nice lil' #{Redwood::CONFIG_FN}."
|
191
|
+
@cli.say "Ok, I've saved you up a nice lil' #{Redwood::CONFIG_FN}."
|
206
192
|
|
207
|
-
say <<EOS
|
193
|
+
@cli.say <<EOS
|
208
194
|
|
209
195
|
The final step is to import all your messages into the Sup index.
|
210
196
|
Depending on how many messages are in the sources, this could take
|
@@ -218,10 +204,10 @@ if axe_yes "Run sup-sync to import all messages now?"
|
|
218
204
|
puts "Ok, trying to run \"#{cmd}\"..."
|
219
205
|
system cmd
|
220
206
|
if $?.success?
|
221
|
-
say "Great! It worked!"
|
207
|
+
@cli.say "Great! It worked!"
|
222
208
|
break
|
223
209
|
else
|
224
|
-
say "Rats, that failed. You may have to do it manually."
|
210
|
+
@cli.say "Rats, that failed. You may have to do it manually."
|
225
211
|
if axe_yes("Try again?") then next else break end
|
226
212
|
end
|
227
213
|
end
|
@@ -229,7 +215,7 @@ end
|
|
229
215
|
|
230
216
|
index.load
|
231
217
|
|
232
|
-
say <<EOS
|
218
|
+
@cli.say <<EOS
|
233
219
|
|
234
220
|
Okee doke, you've got yourself an index of #{index.size} messages. Looks
|
235
221
|
like you're ready to jack in to cyberspace there, cowboy.
|