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

disable SMTP TLS by default and add custom paths for SMTP key/cert

TLS can be enabled by setting 'smtp_server.tls_enabled' to true.
هذا الالتزام موجود في:
Adam Cooke
2017-04-28 15:12:56 +01:00
الأصل 1b58cb853b
التزام caacaa7f92
3 ملفات معدلة مع 13 إضافات و6 حذوفات

عرض الملف

@@ -108,11 +108,11 @@ module Postal
end
def self.smtp_private_key_path
config_root.join('smtp.key')
config.smtp_server.tls_private_key_path || config_root.join('smtp.key')
end
def self.smtp_certificate_path
config_root.join('smtp.cert')
config.smtp_server.tls_certificate_path || config_root.join('smtp.cert')
end
def self.smtp_certificate_data

عرض الملف

@@ -117,9 +117,13 @@ module Postal
end
def starttls
@start_tls = true
@tls = true
"220 Ready to start TLS"
if Postal.config.smtp_server.tls_enabled?
@start_tls = true
@tls = true
"220 Ready to start TLS"
else
"502 TLS not available"
end
end
def ehlo(data)
@@ -127,7 +131,7 @@ module Postal
@helo_name = data.strip.split(' ', 2)[1]
reset
@state = :welcomed
["250-My capabilities are", @tls ? nil : "250-STARTTLS", "250 AUTH CRAM-MD5 PLAIN LOGIN", ]
["250-My capabilities are", Postal.config.smtp_server.tls_enabled? && !@tls ? "250-STARTTLS" : nil, "250 AUTH CRAM-MD5 PLAIN LOGIN", ]
end
def helo(data)