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
This commit is contained in:
Jay Pfaffman 2020-09-01 08:08:18 -07:00 committed by GitHub
parent 58e17d7eab
commit 5e66d7d082
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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/)