From 5e66d7d08254bbb251eea2bcaca2ba3e0d021923 Mon Sep 17 00:00:00 2001 From: Jay Pfaffman Date: Tue, 1 Sep 2020 08:08:18 -0700 Subject: [PATCH] FIX: emails.rake use authentication (#10572) It looks like support got added for DISCOURSE_SMTP_AUTHENTICATION in Discourse, but not in this rake task (or perhaps it's always been broken?). N.B.: I have not tested this code, but it reportedly works and looks safe to me. https://meta.discourse.org/t/smtp-unrecognized-authentication-type-with-office-365/145830/6?u=pfaffman --- lib/tasks/emails.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/emails.rake b/lib/tasks/emails.rake index 4180658e640..45194afbfd4 100644 --- a/lib/tasks/emails.rake +++ b/lib/tasks/emails.rake @@ -86,7 +86,7 @@ task 'emails:test', [:email] => [:environment] do |_, args| # s.auth_login(smtp[:user_name], smtp[:password]) #end - Net::SMTP.start(smtp[:address], smtp[:port], 'localhost', smtp[:user_name], smtp[:password]) + Net::SMTP.start(smtp[:address], smtp[:port], 'localhost', smtp[:user_name], smtp[:password], smtp[:authentication]) rescue Exception => e if e.to_s.match(/execution expired/)