sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 67e38b99c44d8d882d3f178095a5968a2ea54dd9
parent 861becad89df65d55ed3cbd001ab36b909154ca0
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sun, 18 May 2025 17:15:36 +1000

refuse to start if sendmail command is not configured

Fixes #524.

Diffstat:
M lib/sup/account.rb | 1 +
M test/test_crypto.rb | 9 +++++++--
M test/unit/test_edit_message_mode.rb | 7 ++++++-
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/lib/sup/account.rb b/lib/sup/account.rb
@@ -51,6 +51,7 @@ class AccountManager
     end
     hash[:alternates] ||= []
     fail "alternative emails are not an array: #{hash[:alternates]}" unless hash[:alternates].kind_of? Array
+    raise ArgumentError, "no sendmail command specified for account" unless hash[:sendmail]
 
     [:name, :signature].each { |x| hash[x] ? hash[x].fix_encoding! : nil }
 
diff --git a/test/test_crypto.rb b/test/test_crypto.rb
@@ -38,8 +38,13 @@ class TestCryptoManager < Minitest::Test
         @path = Dir.mktmpdir
         Redwood::HookManager.init File.join(@path, 'hooks')
 
-        am = {:default=> {name: +"test", email: @from_email.dup, alternates: [@from_email_ecc.dup]}}
-        Redwood::AccountManager.init am
+        account = {
+          :name => +"test",
+          :email => @from_email.dup,
+          :alternates => [@from_email_ecc.dup],
+          :sendmail => "/bin/false",
+        }
+        Redwood::AccountManager.init :default => account
 
         Redwood::CryptoManager.init
     end
diff --git a/test/unit/test_edit_message_mode.rb b/test/unit/test_edit_message_mode.rb
@@ -24,7 +24,12 @@ class TestEditMessageMode < Minitest::Test
     $config = {}
     @path = Dir.mktmpdir
     Redwood::HookManager.init File.join(@path, "hooks")
-    Redwood::AccountManager.init :default => {name: +"test", email: +"sender@example.invalid"}
+    account = {
+      :name => +"test",
+      :email => +"sender@example.invalid",
+      :sendmail => "/bin/false",
+    }
+    Redwood::AccountManager.init :default => account
     Redwood::CryptoManager.instance_variable_set :@instance, DummyCryptoManager.new
   end