0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 09:05:23 +08:00
discourse/app/services/problem_check/qq_mail_smtp.rb
Jake Goldsborough f4a7f213f0 FEATURE: Warn admins when QQ Mail SMTP is configured
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.
2026-01-30 16:39:24 +00:00

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