discourse/spec/integration/sendmail_spec.rb
Chris Alberti 5dd238174d
FIX: Update sendmail config for Mail gem >=2.9.0 compatibility (#39688)
When a site falls back to sendmail, the config appears to be broken
since Mail gem 2.9.0.

We're passing a string when it expects an array of strings.

See
d1d65b370b/lib/mail/network/delivery_methods/sendmail.rb (L53)

This was causing a pile up of digest email job retries, see dev topic
/t/182887

This PR fixes the config and also moves it to a GlobalSetting so I could
write a spec to make sure the default config is valid.
2026-05-01 15:57:17 -05:00

11 lines
434 B
Ruby
Vendored

# frozen_string_literal: true
RSpec.describe "Sendmail Settings Integration" do
it "configures arguments as an Array, not a String (mail gem >= 2.9.0 compatibility)" do
expect(GlobalSetting.sendmail_settings[:arguments]).to be_an(Array)
end
it "does not raise an error when initialising Sendmail with the default settings" do
expect { Mail::Sendmail.new(GlobalSetting.sendmail_settings) }.not_to raise_error
end
end