Cannot send mail through smtp due to TLS errors
I've updated redmine to 5.0.2 from v3.2.0.
I've kept SMTP settings the same and noticed that I cannot send mails anymore.
The error that keeps appearing is:
Oct 05 13:23:36 acred2p redmine214934: E, [2022-10-05T13:23:36.935478 #215008] ERROR -- : [ActiveJob] [ActionMailer::MailDeliveryJob] [4f9f26ee-e713-460d-97d9-49f5f69d3cba] Email delivery error: SSL_connect returned=1 errno=0 peeraddr=10.x.y.z:25 state=error: unexpected eof while reading
From the logs on the SMTP server it seems that the problem is TLS - mail server admin advised to turn it off.
I've tried the following settings in various configurations and nothing seemed to work:
The bottom 3 lines were added - otherwise the config worked in redmine v3.
SMTP server is working as expected - I can send a mail manually from the redmine server through the terminal.
Any help is appreciated, thanks.
#2 Updated by Dmitry Makurin about 1 month ago
production: email_delivery: delivery_method: :smtp smtp_settings: address: xxxxxxx port: 25 disable_start_tls: true openssl_verify_mode: "none"
After upgrade to redmine 5.0 i have encountered the same issue. Config above managed to fix it without modifying mail gem.
#4 Updated by Gasper C about 1 month ago
I've forked a branch from mail 2.8.0-stable and added jeremy's patch in there, with one fix.
In case it ever helps anyone, just clone this and build the gem.
git clone https://github.com/GChuf/mail/
git checkout 2-8-stable
gem build mail.gemspec
gem install mail -v2.8.0.patch
After that, change the mail version in redmine's Gemfile.
#5 Updated by Pavel Rosický about 1 month ago
FYI there's a breaking change in 2.8 https://github.com/redmine/redmine/blob/master/app/models/mail_handler.rb#L528
has to be changed to
but it may not affect you unless you're a helpdesk user