mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 09:05:23 +08:00
QQ Mail (smtp.qq.com and smtp.exmail.qq.com) is known to cause duplicate email issues with Discourse. The SMTP server does not return proper acknowledgments, causing Discourse to retry sends that already succeeded. This adds a ProblemCheck that displays a warning on the admin dashboard when QQ Mail SMTP is detected, linking to recommended alternatives.
18 lines
395 B
Ruby
Vendored
18 lines
395 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
class ProblemCheck::QqMailSmtp < ProblemCheck
|
|
self.priority = "low"
|
|
|
|
def call
|
|
smtp_address = ActionMailer::Base.smtp_settings[:address].to_s.downcase
|
|
return no_problem if !smtp_address.match?(/\A(?:qq\.com|.+\.qq\.com)\z/)
|
|
|
|
problem
|
|
end
|
|
|
|
private
|
|
|
|
def translation_data
|
|
{ smtp_address: ActionMailer::Base.smtp_settings[:address] }
|
|
end
|
|
end
|