sup 1.4 → 1.5

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTORS +2 -2
  3. data/History.txt +21 -0
  4. data/Manifest.txt +10 -0
  5. data/README.md +1 -1
  6. data/bin/sup-sync +1 -2
  7. data/contrib/nix/.gitignore +1 -0
  8. data/contrib/nix/Gemfile.lock +17 -17
  9. data/contrib/nix/gem-install-shell.nix +1 -1
  10. data/contrib/nix/gemset.nix +28 -28
  11. data/contrib/nix/ruby2.4-Gemfile.lock +1 -1
  12. data/contrib/nix/ruby2.4-gemset.nix +2 -2
  13. data/contrib/nix/ruby2.5-Gemfile.lock +1 -1
  14. data/contrib/nix/ruby2.5-gemset.nix +2 -2
  15. data/contrib/nix/ruby2.6-Gemfile.lock +1 -1
  16. data/contrib/nix/ruby2.6-gemset.nix +2 -2
  17. data/contrib/nix/ruby2.7-Gemfile.lock +1 -1
  18. data/contrib/nix/ruby2.7-gemset.nix +2 -2
  19. data/contrib/nix/ruby3.0-Gemfile.lock +1 -1
  20. data/contrib/nix/ruby3.0-gemset.nix +2 -2
  21. data/contrib/nix/ruby3.1-Gemfile.lock +1 -1
  22. data/contrib/nix/ruby3.1-gemset.nix +2 -2
  23. data/contrib/nix/ruby3.2-Gemfile.lock +1 -1
  24. data/contrib/nix/ruby3.2-gemset.nix +2 -2
  25. data/contrib/nix/ruby3.3-shell.nix +1 -1
  26. data/contrib/nix/ruby3.4-shell.nix +1 -1
  27. data/contrib/nix/ruby4.0-shell.nix +2 -1
  28. data/contrib/nix/test-all-rubies.sh +2 -1
  29. data/contrib/screenshot-generator/.gitignore +1 -0
  30. data/contrib/screenshot-generator/default.nix +253 -0
  31. data/contrib/screenshot-generator/scenes.yaml +51 -0
  32. data/contrib/screenshot-generator/shoot.rb +127 -0
  33. data/contrib/screenshot-generator/sup-is-plain-text-applied.msg +83 -0
  34. data/contrib/screenshot-generator/sup-is-plain-text.msg +78 -0
  35. data/lib/sup/buffer.rb +13 -3
  36. data/lib/sup/draft.rb +0 -4
  37. data/lib/sup/index.rb +7 -1
  38. data/lib/sup/maildir.rb +21 -16
  39. data/lib/sup/mbox.rb +0 -10
  40. data/lib/sup/message.rb +5 -19
  41. data/lib/sup/message_chunks.rb +1 -1
  42. data/lib/sup/modes/edit_message_mode.rb +52 -4
  43. data/lib/sup/modes/thread_index_mode.rb +28 -27
  44. data/lib/sup/person.rb +0 -6
  45. data/lib/sup/poll.rb +1 -4
  46. data/lib/sup/sent.rb +5 -4
  47. data/lib/sup/source.rb +0 -47
  48. data/lib/sup/util.rb +2 -2
  49. data/lib/sup/version.rb +1 -1
  50. data/test/dummy_source.rb +0 -4
  51. data/test/fixtures/folded-from-header.eml +8 -0
  52. data/test/fixtures/rfc2047-header-encoding.eml +1 -0
  53. data/test/fixtures/text-attachments-with-charset.eml +7 -0
  54. data/test/integration/test_index.rb +62 -0
  55. data/test/test_header_parsing.rb +9 -9
  56. data/test/test_message.rb +21 -3
  57. data/test/unit/test_index.rb +27 -3
  58. data/test/unit/test_line_cursor_mode.rb +6 -0
  59. data/test/unit/test_maildir.rb +21 -0
  60. metadata +15 -4
  61. data/man/sup-psych-ify-config-files.1 +0 -76
@@ -0,0 +1,253 @@
1
+ let
2
+ sup-shell = import ../nix/ruby4.0-shell.nix;
3
+ pkgs = sup-shell.pkgs;
4
+ fileset = pkgs.lib.fileset;
5
+ sup = fileset.toSource {
6
+ root = ../..;
7
+ fileset = fileset.difference ../.. ../../contrib;
8
+ };
9
+ ht = pkgs.rustPlatform.buildRustPackage (finalAttrs: {
10
+ pname = "ht";
11
+ version = "0.4.0";
12
+ src = pkgs.fetchFromGitHub {
13
+ owner = "andyk";
14
+ repo = "ht";
15
+ tag = "v${finalAttrs.version}";
16
+ hash = "sha256-LKa5nnGhQITf0SDzE17NUJ9KQ6Soq6jOBWoTONRxiCc=";
17
+ };
18
+ cargoHash = "sha256-FlR7bvQAZZIJaONOGsZUtSuUOvAVeDXJQaEkvXYxp1w=";
19
+ });
20
+ deps = with pkgs; [
21
+ sup-shell.gems.wrappedRuby
22
+ gnupg
23
+ ncurses
24
+ which
25
+ rsync
26
+ libfaketime
27
+ ht
28
+ ];
29
+
30
+ now = "2026-04-21 20:00:00";
31
+ lists.supmua = pkgs.fetchgit {
32
+ name = "supmua-list";
33
+ url = "https://supmua.dev/lists/supmua/0";
34
+ rev = "5bb23abca5490dc0d946312a8dbc3ece92bbfa95";
35
+ hash = "sha256-c25+ZfDOz8oSx95p1Mq7LI35n1F4IFDWog4YZUn644M=";
36
+ deepClone = true;
37
+ };
38
+ lists.sup-devel = pkgs.fetchgit {
39
+ name = "sup-devel-list";
40
+ url = "https://supmua.dev/lists/sup-devel/0";
41
+ rev = "5e44841d194d5bfb581022d5951e0964a1d85edd";
42
+ hash = "sha256-g9tPF97noIVoc3xfWM6D+aNDWOyn2SX967YsO4jabpM=";
43
+ deepClone = true;
44
+ };
45
+ lists.sup-talk = pkgs.fetchgit {
46
+ name = "sup-talk-list";
47
+ url = "https://supmua.dev/lists/sup-talk/0";
48
+ rev = "93f1725cde6bb046a7a086eb1b99342a3371802c";
49
+ hash = "sha256-ksbTPTcE7ueGKWjC+rC1xkiRF4/MpJcSqJhoA735G/Y=";
50
+ deepClone = true;
51
+ };
52
+ lists-as-maildir = builtins.mapAttrs (
53
+ name: pirepo:
54
+ pkgs.stdenv.mkDerivation {
55
+ name = "${name}-as-maildir";
56
+ nativeBuildInputs = with pkgs; [ git ];
57
+ buildCommand = ''
58
+ mkdir -p $out/{cur,new,tmp}
59
+ export GIT_DIR=${pirepo}/.git
60
+ git rev-list HEAD | while read sha ; do
61
+ git show $sha:m >$out/new/$sha:2,S
62
+ done
63
+ '';
64
+ }
65
+ ) lists;
66
+ sup-is-plain-text = ./sup-is-plain-text.msg;
67
+ sup-is-plain-text-applied = ./sup-is-plain-text-applied.msg;
68
+ misc-maildir = pkgs.stdenv.mkDerivation {
69
+ name = "sup-screenshots-misc-maildir";
70
+ nativeBuildInputs = with pkgs; [
71
+ curl
72
+ python3
73
+ ];
74
+ buildCommand = ''
75
+ mkdir -p $out/{cur,new,tmp}
76
+ cp ${sup-is-plain-text} $out/cur/sup-is-plain-text:2,S
77
+ cp ${sup-is-plain-text-applied} $out/cur/sup-is-plain-text-applied:2,S
78
+ '';
79
+ };
80
+
81
+ # Build a fake .sup directory for screenshots.
82
+ sup-base = pkgs.stdenv.mkDerivation {
83
+ name = "sup-base-for-screenshots";
84
+ nativeBuildInputs = deps;
85
+ env = {
86
+ TZ = "UTC";
87
+ USER = "nobody";
88
+ LANG = "C.UTF-8";
89
+ };
90
+ buildCommand = ''
91
+ mkdir -p $out
92
+
93
+ cat >$out/config.yaml <<EOF
94
+ ---
95
+ :accounts:
96
+ :default:
97
+ :name: Sup User
98
+ :email: sup@example.invalid
99
+ :sendmail: /bin/false
100
+ :sync_back_to_maildir: false
101
+ :editor: /bin/false
102
+ :poll_interval: 86400
103
+ EOF
104
+
105
+ cat >$out/sources.yaml <<EOF
106
+ ---
107
+ - !<tag:supmua.org,2006-10-01/Redwood/Maildir>
108
+ uri: maildir://${lists-as-maildir.supmua}
109
+ usual: true
110
+ archived: false
111
+ id: 1
112
+ labels: [supmua]
113
+ - !<tag:supmua.org,2006-10-01/Redwood/Maildir>
114
+ uri: maildir://${lists-as-maildir.sup-devel}
115
+ usual: true
116
+ archived: false
117
+ id: 2
118
+ labels: [sup-devel]
119
+ - !<tag:supmua.org,2006-10-01/Redwood/Maildir>
120
+ uri: maildir://${lists-as-maildir.sup-talk}
121
+ usual: true
122
+ archived: false
123
+ id: 3
124
+ labels: [sup-talk]
125
+ - !<tag:supmua.org,2006-10-01/Redwood/Maildir>
126
+ uri: maildir://${misc-maildir}
127
+ usual: true
128
+ archived: false
129
+ id: 4
130
+ labels: []
131
+ EOF
132
+
133
+ export SUP_BASE=$(readlink -f $out)
134
+ faketime -m "${now}" ruby ${sup}/bin/sup-sync
135
+ '';
136
+ };
137
+
138
+ # For each scene in scenes.yaml, drive sup in ht (a headless terminal)
139
+ # and capture the final screen state.
140
+ screenshots-ansi = pkgs.stdenv.mkDerivation {
141
+ name = "sup-screenshots-ansi";
142
+ nativeBuildInputs = deps;
143
+ env = {
144
+ TZ = "UTC";
145
+ USER = "nobody";
146
+ LANG = "C.UTF-8";
147
+ };
148
+ buildCommand = ''
149
+ faketime -m "${now}" ruby ${./shoot.rb} \
150
+ --sup-base=${sup-base} \
151
+ --sup=${sup}/bin/sup \
152
+ --scenes-yaml=${./scenes.yaml} \
153
+ --out=$out
154
+ '';
155
+ };
156
+
157
+ # Render the ANSI screens in a headless Wayland terminal.
158
+ iosevka = pkgs.iosevka-bin.override { variant = "SS09"; };
159
+ fonts-conf = pkgs.writeText "sup-screenshots-fonts.conf" ''
160
+ <?xml version="1.0"?>
161
+ <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
162
+ <fontconfig>
163
+ <dir>${iosevka}/share/fonts</dir>
164
+ <dir>${pkgs.dejavu_fonts.minimal}/share/fonts</dir>
165
+ <cachedir prefix="xdg">fontconfig</cachedir>
166
+ <config></config>
167
+ </fontconfig>
168
+ '';
169
+ sway-conf = pkgs.writeText "sup-screenshots-sway.conf" ''
170
+ output HEADLESS-1 mode 3840x2160 scale 2
171
+ output HEADLESS-1 background #000000 solid_color
172
+ default_border none
173
+ default_floating_border none
174
+ gaps inner 0
175
+ gaps outer 0
176
+ xwayland disable
177
+ '';
178
+ foot-conf = pkgs.writeText "sup-screenshots-foot.ini" ''
179
+ [main]
180
+ font=Iosevka Term:size=12
181
+ [colors-dark]
182
+ # https://github.com/tinted-theming/tinted-terminal/blob/main/themes/foot/base16-pop.ini
183
+ foreground=d0d0d0
184
+ background=000000
185
+ regular0=000000 # black
186
+ regular1=eb008a # red
187
+ regular2=37b349 # green
188
+ regular3=f8ca12 # yellow
189
+ regular4=0e5a94 # blue
190
+ regular5=b31e8d # magenta
191
+ regular6=00aabb # cyan
192
+ regular7=d0d0d0 # white
193
+ bright0=505050 # bright black
194
+ bright1=eb008a # bright red
195
+ bright2=37b349 # bright green
196
+ bright3=f8ca12 # bright yellow
197
+ bright4=0e5a94 # bright blue
198
+ bright5=b31e8d # bright magenta
199
+ bright6=00aabb # bright cyan
200
+ bright7=ffffff # bright white
201
+ 16=f29333
202
+ 17=7a2d00
203
+ 18=202020
204
+ 19=303030
205
+ 20=b0b0b0
206
+ 21=e0e0e0
207
+ '';
208
+ screenshots = pkgs.stdenv.mkDerivation {
209
+ name = "sup-screenshots";
210
+ nativeBuildInputs = with pkgs; [
211
+ dbus
212
+ foot
213
+ ghostty
214
+ grim
215
+ jq
216
+ sway
217
+ oxipng
218
+ procps
219
+ ];
220
+ env = {
221
+ LANG = "C.UTF-8";
222
+ FONTCONFIG_FILE = fonts-conf;
223
+ WLR_BACKENDS = "headless";
224
+ WLR_RENDERER = "pixman";
225
+ LIBGL_ALWAYS_SOFTWARE = "1";
226
+ WLR_LIBINPUT_NO_DEVICES = "1";
227
+ };
228
+ buildCommand = ''
229
+ export HOME=$(mktemp -d)
230
+ export XDG_RUNTIME_DIR=$HOME/run
231
+ mkdir -p $XDG_RUNTIME_DIR
232
+ export SWAYSOCK=$XDG_RUNTIME_DIR/sway.sock
233
+ dbus-run-session --config-file ${pkgs.dbus}/share/dbus-1/session.conf sway -c ${sway-conf} &
234
+ while ! test -S $SWAYSOCK ; do sleep 0.1 ; done
235
+ export WAYLAND_DISPLAY=wayland-1
236
+
237
+ mkdir -p $out
238
+ for f in ${screenshots-ansi}/* ; do
239
+ rm -f done
240
+ foot -c ${foot-conf} -W 120x28 --hold sh -c "echo -ne '\e[H\e[?25l' ; cat $f ; touch done" &
241
+ foot_pid=$!
242
+ while ! test -f done ; do sleep 0.1 ; done
243
+ geometry=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?) | select(.app_id == "foot").geometry | "\(.x),\(.y) \(.width)x\(.height)"')
244
+ grim -g "$geometry" $out/$(basename ''${f%.ansi}).png
245
+ kill -TERM $foot_pid
246
+ wait $foot_pid || :
247
+ done
248
+
249
+ oxipng -o 2 --strip all $out/*.png
250
+ '';
251
+ };
252
+ in
253
+ screenshots
@@ -0,0 +1,51 @@
1
+ ---
2
+ - name: inbox
3
+ steps:
4
+ - keys: ["N", "N", "N"]
5
+
6
+ - name: search-results
7
+ steps:
8
+ - keys: ["F"]
9
+ wait: 'Search all messages'
10
+ - keys: ["maildir", "Enter"]
11
+ wait: '\[search-results-mode\]'
12
+ - keys: ["N", "N", "N"]
13
+ - keys: ["a", "j", "a", "j", "a", "j", "a", "j", "a", "j", "a", "j", "a", "j", "a", "j", "a", "j", "a", "j", "a", "N", "a", "j", "a", "j", "a", "j", "a", "N", "a", "N", "a", "j", "a", "j", "a", "j", "a", "j", "a", "j", "a", "j", "a"]
14
+ - keys: ["1", "j", "j", "j"]
15
+
16
+ - name: thread-view
17
+ steps:
18
+ - keys: ["j", "j", "j", "j", "j", "j", "j", "j", "j", "j", "N", "k"]
19
+ - keys: ["Enter"]
20
+ wait: '\[thread-view-mode\].*line \d+ of \d+'
21
+ - keys: ["Enter", "Enter", "Enter", "Enter", "Enter"]
22
+ - keys: ["K", "K", "K", "K", "K", "Left", "Left"]
23
+
24
+ - name: reply
25
+ steps:
26
+ - keys: ["j", "j", "j", "j", "j", "j", "j"]
27
+ - keys: ["G"]
28
+ wait: '\[reply-mode\]'
29
+ - keys: ["PageDown", "k", "k", "k"]
30
+
31
+ - name: help
32
+ steps:
33
+ - keys: ["?"]
34
+ wait: '\[help-mode\]'
35
+
36
+ - name: log
37
+ steps:
38
+ - keys: ["F"]
39
+ wait: "Search all messages"
40
+ - keys: ["maildir", "Enter"]
41
+ wait: '\[search-results-mode\]'
42
+ - keys: ["!", "!"]
43
+ - keys: [";", "j", "j", "Enter"]
44
+ wait: '\[log-mode\]'
45
+
46
+ - name: console
47
+ steps:
48
+ - keys: ["~"]
49
+ wait: '\[console-mode\]'
50
+ - keys: ['Index.parse_query "is:unread"', "Enter"]
51
+ - keys: ['Index.num_results_for :label => "supmua"', "Enter"]
@@ -0,0 +1,127 @@
1
+ require 'fileutils'
2
+ require 'json'
3
+ require 'open3'
4
+ require 'optparse'
5
+ require 'shellwords'
6
+ require 'tmpdir'
7
+ require 'yaml'
8
+
9
+ SIZE = "120x28" # terminal grid dimensions
10
+ IDLE = 0.3 # settling time in seconds for the terminal
11
+
12
+ class Session
13
+ def initialize command, env
14
+ ht_command = ["ht", "--size", SIZE,
15
+ "--subscribe", "init,output,snapshot",
16
+ "--", Shellwords.join(command)]
17
+ @stdin, @stdout, @process = Open3.popen2 env, *ht_command
18
+ @stdin.sync = true
19
+ raise "ht did not send init event" unless read_event["type"] == "init"
20
+ end
21
+
22
+ def write command
23
+ @stdin.puts JSON.generate(command)
24
+ end
25
+
26
+ def read_event
27
+ line = @stdout.gets or return nil
28
+ JSON.parse line
29
+ end
30
+
31
+ def send_keys keys
32
+ write :type => "sendKeys", :keys => keys
33
+ end
34
+
35
+ ## Wait until at least IDLE seconds has passed with no more events.
36
+ def settle
37
+ loop do
38
+ return unless IO.select([@stdout], nil, nil, IDLE)
39
+ return unless read_event
40
+ end
41
+ end
42
+
43
+ def snapshot
44
+ write :type => "takeSnapshot"
45
+ loop do
46
+ event = read_event
47
+ return event["data"] if event["type"] == "snapshot"
48
+ end
49
+ end
50
+
51
+ def expect pattern
52
+ settle
53
+ screen = snapshot
54
+ raise "/#{pattern.source}/ not found" unless screen["text"] =~ pattern
55
+ screen
56
+ end
57
+
58
+ def dump_screen
59
+ $stderr.puts "--- screen was ---"
60
+ $stderr.puts snapshot["text"]
61
+ $stderr.puts "------------------"
62
+ rescue
63
+ $stderr.puts "--- no screen ---"
64
+ end
65
+
66
+ def close
67
+ @stdin.close unless @stdin.closed?
68
+ @stdout.read
69
+ @stdout.close
70
+ end
71
+ end
72
+
73
+ options = {}
74
+ OptionParser.new do |parser|
75
+ parser.on "--sup-base PATH"
76
+ parser.on "--sup PATH"
77
+ parser.on "--scenes-yaml PATH"
78
+ parser.on "--out PATH"
79
+ end.parse! into: options
80
+
81
+ FileUtils.mkdir_p options[:out]
82
+
83
+ scenes = YAML.load_file options[:"scenes-yaml"]
84
+ scenes.each do |scene|
85
+ name = scene["name"]
86
+ steps = scene["steps"] || []
87
+
88
+ ## Make a fresh copy of SUP_BASE for this run of sup.
89
+ base = Dir.mktmpdir "sup-screenshots-#{name}-"
90
+ FileUtils.cp_r Dir.glob(File.join(options[:"sup-base"], "*")), base
91
+ FileUtils.chmod_R "u+w", base
92
+
93
+ puts "[#{name}] starting sup"
94
+ session = nil
95
+ begin
96
+ session = Session.new(
97
+ ["ruby", options[:sup], "--no-threads", "--no-initial-poll"],
98
+ {"SUP_BASE" => base, "SUP_LOG_LEVEL" => "debug"})
99
+
100
+ screen = session.expect /\[inbox-mode\]/
101
+
102
+ steps.each do |step|
103
+ keys = step["keys"]
104
+ puts "[#{name}] send #{keys.inspect}"
105
+ session.send_keys keys
106
+
107
+ screen = if step["wait"].nil?
108
+ session.settle
109
+ session.snapshot
110
+ else
111
+ session.expect Regexp.new(step["wait"])
112
+ end
113
+ end
114
+
115
+ ansi = screen["seq"]
116
+ ansi = ansi.gsub "\u009b", "\e[" # map CSI emitted by ht to ESC [
117
+ path = File.join options[:out], "#{name}.ansi"
118
+ File.write path, ansi
119
+ puts "[#{name}] wrote #{path}"
120
+ rescue RuntimeError => e
121
+ $stderr.puts "[#{name}] #{e.message}"
122
+ session.dump_screen if session
123
+ raise
124
+ ensure
125
+ session.close if session
126
+ end
127
+ end
@@ -0,0 +1,83 @@
1
+ Authentication-Results: mail-a.sr.ht; dkim=pass header.d=ddevault.org header.i=@ddevault.org
2
+ Received: from mx.freebitcoin.gay (mx.freebitcoin.gay [92.65.121.143])
3
+ by mail-a.sr.ht (Postfix) with ESMTPS id 13F73200E0
4
+ for <~sircmpwn/public-inbox@lists.sr.ht>; Mon, 20 Apr 2026 07:26:50 +0000 (UTC)
5
+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddevault.org;
6
+ s=_bikeshed; t=1776670002;
7
+ h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
8
+ to:to:cc:mime-version:mime-version:content-type:content-type:
9
+ in-reply-to:in-reply-to:references:references;
10
+ bh=/yTIwruVpbRgzboJc+lUtE3TsCGqQmxSUE8vJiuBYB0=;
11
+ b=TfqhiwTaygLnt3sbmZNT1qMNIcaPYGPyTMRJpNOsfALmwG5g91xf1RVO8BpnSB4D45LZMP
12
+ h26PRpF2bBW8oRYRfaSsMwiSl0T2ucPlH08rIWPNBuq4roZAvPH+Ga6RKp9RcNhSsMMvwh
13
+ 2h9/1KDKFNUA2P/kdRjlifSjaCsnmKc=
14
+ Received: from taiga (mx.freebitcoin.gay [92.65.121.143])
15
+ by mail.freebitcoin.gay (OpenSMTPD) with ESMTPSA id 7314ef4d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO);
16
+ Mon, 20 Apr 2026 09:26:42 +0200 (CEST)
17
+ Received: by taiga (Postfix, from userid 1000)
18
+ id 9EFA3BA002F; Mon, 20 Apr 2026 09:26:49 +0200 (CEST)
19
+ Mime-Version: 1.0
20
+ Content-Type: multipart/signed;
21
+ boundary=a036da96ce29d60f01d793f8b11ad804cb7659b0e414c63118649b669cdc;
22
+ micalg=pgp-sha512; protocol="application/pgp-signature"
23
+ Date: Mon, 20 Apr 2026 09:26:49 +0200
24
+ Message-Id: <DHXSYEQU1SFY.1W0NFHNML13VB@ddevault.org>
25
+ From: "Drew DeVault" <drew@ddevault.org>
26
+ To: "Dan Callaghan" <djc@djc.id.au>, <~sircmpwn/public-inbox@lists.sr.ht>
27
+ Subject: Re: [PATCH] add Sup to the list of plain text certified mail
28
+ clients
29
+ X-Sourcehut-Patchset-Update: APPLIED
30
+ References: <20260411092525.498926-1-djc@djc.id.au>
31
+ In-Reply-To: <20260411092525.498926-1-djc@djc.id.au>
32
+
33
+ --a036da96ce29d60f01d793f8b11ad804cb7659b0e414c63118649b669cdc
34
+ Content-Type: multipart/mixed;
35
+ boundary=1d16b06c6066296315555c6776a0e1d688a41caf8c9cea66a5cdcdcfd42a
36
+
37
+ --1d16b06c6066296315555c6776a0e1d688a41caf8c9cea66a5cdcdcfd42a
38
+ Content-Type: multipart/alternative;
39
+ boundary=a95442b43616d7ee1f8d1e2ae129e5a85862edd92378eb2f25ff009758ef
40
+
41
+ --a95442b43616d7ee1f8d1e2ae129e5a85862edd92378eb2f25ff009758ef
42
+ Content-Transfer-Encoding: quoted-printable
43
+ Content-Disposition: inline
44
+ Content-Type: text/plain; charset=UTF-8
45
+
46
+ Thanks!
47
+
48
+ To git@git.sr.ht:~sircmpwn/useplaintext.email
49
+ e22de97..70ed7d5 master -> master
50
+
51
+ --a95442b43616d7ee1f8d1e2ae129e5a85862edd92378eb2f25ff009758ef--
52
+
53
+ --1d16b06c6066296315555c6776a0e1d688a41caf8c9cea66a5cdcdcfd42a
54
+ Content-Transfer-Encoding: base64
55
+ Content-Disposition: attachment; filename=42F3F1862E3CC4B8.asc
56
+ Content-Type: application/pgp-keys; charset=UTF-8
57
+
58
+ LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptRE1FWjdZOWt4WUpLd1lCQkFI
59
+ YVJ3OEJBUWRBL3BQeTZYK25OTDVUMlFhSktFTTA4eE4vS3o3d0ZUQVpvSDVZCnJpVjl4MW0wSUVS
60
+ eVpYY2dSR1ZXWVhWc2RDQThaSEpsZDBCa1pHVjJZWFZzZEM1dmNtYytpSk1FRXhZS0FEc0MKR3dN
61
+ RkN3a0lCd0lDSWdJR0ZRb0pDQXNDQkJZQ0F3RUNIZ2NDRjRBV0lRU2Z0ZWMzM0NXeW5ZN3NScEZD
62
+ OC9HRwpManpFdUFVQ1o3WTl3d0FLQ1JCQzgvR0dManpFdU1FRUFQOURIKzFMZ3ZUcVpETFo4YmFi
63
+ QjVDZHA1eTBaVytRClR4NzhtaDFMOGpKZDZnRUFzc21nc0ltY3JadjRhZFAyVVc1UlU1QkhDZTlL
64
+ VWR4MER5VjgzUXdsRkFTNE9BUm4KdGoyVEVnb3JCZ0VFQVpkVkFRVUJBUWRBR0FIOWRsYUNPTm9Y
65
+ cG1RZ0hvUWdZSTJ0UytWTTNtelU4STJQeVZZUQoxR1VEQVFnSGlIZ0VHQllLQUNBQ0d3d1dJUVNm
66
+ dGVjMzNDV3luWTdzUnBGQzgvR0dManpFdUFVQ1o3WTkxZ0FLCkNSQkM4L0dHTGp6RXVIY25BUDR5
67
+ ak9pTTB5cWtTVDZ5WHpEVVd6ZTdCOUltMjRGOEhWeCt3TnFjRGFEdGNBRC8KZktRaHowU0NQaWJs
68
+ TzZsYzdNRlV2bGFPejJ2ODdVcFVZUmh6UGRnUXF3az0KPWVtcmIKLS0tLS1FTkQgUEdQIFBVQkxJ
69
+ QyBLRVkgQkxPQ0stLS0tLQo=
70
+ --1d16b06c6066296315555c6776a0e1d688a41caf8c9cea66a5cdcdcfd42a--
71
+
72
+ --a036da96ce29d60f01d793f8b11ad804cb7659b0e414c63118649b669cdc
73
+ Content-Type: application/pgp-signature; name="signature.asc"
74
+
75
+ -----BEGIN PGP SIGNATURE-----
76
+
77
+ iHUEABYKAB0WIQSftec33CWynY7sRpFC8/GGLjzEuAUCaeXVOQAKCRBC8/GGLjzE
78
+ uJRIAPwOx55M404obNqpVNWkeipGH68mQlprxiQqztCT6jG5qgD+LUPSDChxMpmo
79
+ ogLdO5Rb3UDRet4xWy0fjSAxT34AHgA=
80
+ =tPvL
81
+ -----END PGP SIGNATURE-----
82
+
83
+ --a036da96ce29d60f01d793f8b11ad804cb7659b0e414c63118649b669cdc--
@@ -0,0 +1,78 @@
1
+ Authentication-Results: mail-a.sr.ht; dkim=none
2
+ Received: from smtp02.aussiebb.com.au (unknown [121.200.0.93])
3
+ by mail-a.sr.ht (Postfix) with ESMTPS id C7D921FFE2
4
+ for <~sircmpwn/public-inbox@lists.sr.ht>; Sat, 11 Apr 2026 09:26:03 +0000 (UTC)
5
+ Received: from localhost (localhost.localdomain [127.0.0.1])
6
+ by smtp02.aussiebb.com.au (Postfix) with ESMTP id 3E06E101B25
7
+ for <~sircmpwn/public-inbox@lists.sr.ht>; Sat, 11 Apr 2026 19:25:55 +1000 (AEST)
8
+ X-Virus-Scanned: Debian amavis at smtp02.aussiebb.com.au
9
+ Received: from smtp02.aussiebb.com.au ([127.0.0.1])
10
+ by localhost (smtp02.aussiebb.com.au [127.0.0.1]) (amavis, port 10024)
11
+ with ESMTP id DMHmZ0WHyx_y for <~sircmpwn/public-inbox@lists.sr.ht>;
12
+ Sat, 11 Apr 2026 19:25:55 +1000 (AEST)
13
+ Received: by smtp02.aussiebb.com.au (Postfix, from userid 116)
14
+ id 2676A101CFB; Sat, 11 Apr 2026 19:25:55 +1000 (AEST)
15
+ X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on
16
+ smtp02.aussiebb.com.au
17
+ X-Spam-Level: *
18
+ X-Spam-Status: No, score=2.0 required=10.0 tests=DMARC_PASS,FORGED_SPF_HELO,
19
+ KHOP_HELO_FCRDNS,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled
20
+ version=4.0.0
21
+ Received: from djc.id.au (honeycomb.djc.id.au [IPv6:2403:5818:89c3::35])
22
+ (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
23
+ key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
24
+ (No client certificate requested)
25
+ by smtp02.aussiebb.com.au (Postfix) with ESMTPS id 2B9AF101B25
26
+ for <~sircmpwn/public-inbox@lists.sr.ht>; Sat, 11 Apr 2026 19:25:54 +1000 (AEST)
27
+ Received: by djc.id.au (Postfix, from userid 1000)
28
+ id 9B20A3550383; Sat, 11 Apr 2026 19:25:53 +1000 (AEST)
29
+ From: Dan Callaghan <djc@djc.id.au>
30
+ To: ~sircmpwn/public-inbox@lists.sr.ht
31
+ Cc: Dan Callaghan <djc@djc.id.au>
32
+ Subject: [PATCH] add Sup to the list of plain text certified mail clients
33
+ Date: Sat, 11 Apr 2026 19:25:25 +1000
34
+ Message-ID: <20260411092525.498926-1-djc@djc.id.au>
35
+ X-Mailer: git-send-email 2.51.2
36
+ MIME-Version: 1.0
37
+ Content-Transfer-Encoding: 8bit
38
+
39
+ Sup is a mature TUI mail client, originally released in 2008 and still
40
+ actively maintained. It favours displaying text/plain parts, and
41
+ outgoing mails are composed in plain text. It uses traditional reply
42
+ quoting style and encourages bottom posting.
43
+ ---
44
+ es/index.html | 3 +++
45
+ index.html | 3 +++
46
+ 2 files changed, 6 insertions(+)
47
+
48
+ diff --git a/es/index.html b/es/index.html
49
+ index 7697315..f42aee3 100644
50
+ --- a/es/index.html
51
+ +++ b/es/index.html
52
+ @@ -118,6 +118,9 @@ <h2 id="recommended-clients"><a href="#recommended-clients">
53
+ <li>
54
+ <a rel="noopener" href="https://www.squirrelmail.org/">SquirrelMail</a> (Web)
55
+ </li>
56
+ + <li>
57
+ + <a rel="noopener" href="https://supmua.dev/">Sup</a> (TUI)
58
+ + </li>
59
+ <li>
60
+ <a rel="noopener" href="https://github.com/wanderlust/wanderlust">Wanderlust</a> (emacs)
61
+ </li>
62
+ diff --git a/index.html b/index.html
63
+ index e38cb60..3244b16 100644
64
+ --- a/index.html
65
+ +++ b/index.html
66
+ @@ -121,6 +121,9 @@ <h2 id="recommended-clients"><a href="#recommended-clients">
67
+ <li>
68
+ <a rel="noopener" href="https://www.squirrelmail.org/">SquirrelMail</a> (Webmail)
69
+ </li>
70
+ + <li>
71
+ + <a rel="noopener" href="https://supmua.dev/">Sup</a> (TUI)
72
+ + </li>
73
+ <li>
74
+ <a rel="noopener" href="https://github.com/wanderlust/wanderlust">Wanderlust</a> (emacs)
75
+ </li>
76
+ --
77
+ 2.51.2
78
+
data/lib/sup/buffer.rb CHANGED
@@ -151,7 +151,7 @@ EOS
151
151
  @textfields = {}
152
152
  @flash = nil
153
153
  @shelled = @asking = false
154
- @in_x = ENV["TERM"] =~ /(xterm|rxvt|screen)/
154
+ @have_xterm_title = Ncurses.tigetflag("XT") > 0 || ENV["TERM"] =~ /(screen|tmux)/
155
155
  @sigwinch_happened = false
156
156
  @sigwinch_mutex = Mutex.new
157
157
  end
@@ -262,8 +262,7 @@ EOS
262
262
  get_status_and_title @focus_buf # must be called outside of the ncurses lock
263
263
  end
264
264
 
265
- ## http://rtfm.etla.org/xterm/ctlseq.html (see Operating System Controls)
266
- print "\033]0;#{title}\07" if title && @in_x
265
+ emit_xterm_title title if title
267
266
 
268
267
  Ncurses.mutex.lock unless opts[:sync] == false
269
268
 
@@ -292,6 +291,17 @@ EOS
292
291
  Ncurses.mutex.unlock unless opts[:sync] == false
293
292
  end
294
293
 
294
+ def emit_xterm_title title
295
+ return unless @have_xterm_title
296
+ ## Escape terminal control characters.
297
+ title = title.gsub(/[[:cntrl:]]/) { |c| Ncurses.unctrl c.ord }
298
+ ## Screen does not properly handle characters above U+FF in the title.
299
+ ## It truncates them to 8 bits which may cause it to emit control
300
+ ## characters into the terminal title.
301
+ title = title.gsub(/[^\u0000-\u00ff]/, "?") if ENV["TERM"] =~ /screen/
302
+ print "\033]0;#{title}\07"
303
+ end
304
+
295
305
  ## if the named buffer already exists, pops it to the front without
296
306
  ## calling the block. otherwise, gets the mode from the block and
297
307
  ## creates a new buffer. returns two things: the buffer, and a boolean
data/lib/sup/draft.rb CHANGED
@@ -70,10 +70,6 @@ class DraftLoader < Source
70
70
 
71
71
  def fn_for_offset o; File.join(@dir, o.to_s); end
72
72
 
73
- def load_header offset
74
- File.open(fn_for_offset(offset)) { |f| parse_raw_email_header f }
75
- end
76
-
77
73
  def load_message offset
78
74
  raise SourceError, "Draft not found" unless File.exist? fn_for_offset(offset)
79
75
  File.open(fn_for_offset(offset)) do |f|
data/lib/sup/index.rb CHANGED
@@ -406,11 +406,15 @@ EOS
406
406
  query = {}
407
407
 
408
408
  subs = HookManager.run("custom-search", :subs => s) || s
409
+
410
+ subs = "type:mail #{subs}"
411
+
409
412
  begin
410
413
  subs = SearchManager.expand subs
411
414
  rescue SearchManager::ExpansionError => e
412
415
  raise ParseError, e.message
413
416
  end
417
+
414
418
  subs = subs.gsub(/\b(to|from):(\S+)\b/) do
415
419
  field, value = $1, $2
416
420
  email_field, name_field = %w(email name).map { |x| "#{field}_#{x}" }
@@ -674,7 +678,9 @@ EOS
674
678
  neglabels = [:spam, :deleted, :killed].reject { |l| (labels.include? l) || opts.member?("load_#{l}".intern) }
675
679
  pos_terms, neg_terms = [], []
676
680
 
677
- pos_terms << mkterm(:type, 'mail')
681
+ ## workaround for https://trac.xapian.org/ticket/855
682
+ #pos_terms << mkterm(:type, 'mail')
683
+ pos_terms << Q::MatchAll
678
684
  pos_terms.concat(labels.map { |l| mkterm(:label,l) })
679
685
  pos_terms << opts[:qobj] if opts[:qobj]
680
686
  pos_terms << mkterm(:source_id, opts[:source_id]) if opts[:source_id]