1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

fix: raise an error if MX lookup times out during sending

This avoids potentially sending mail to the A record when an MX query times out.

closes #2833
هذا الالتزام موجود في:
Adam Cooke
2024-03-01 21:36:07 +00:00
الأصل 77e818a472
التزام fadca88f45
7 ملفات معدلة مع 231 إضافات و33 حذوفات

عرض الملف

@@ -162,7 +162,7 @@ class SMTPSender < BaseSender
#
# @return [Array<String>]
def resolve_mx_records_for_domain
hostnames = DNSResolver.local.mx(@domain).map(&:last)
hostnames = DNSResolver.local.mx(@domain, raise_timeout_errors: true).map(&:last)
return [SMTPClient::Server.new(@domain)] if hostnames.empty?
hostnames.map { |hostname| SMTPClient::Server.new(hostname) }