File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,8 +177,8 @@ def resolve_mx_records_for_domain
177177 # @param endpoint [SMTPClient::Endpoint]
178178 # @return [Boolean]
179179 def connect_to_endpoint ( endpoint , allow_ssl : true )
180- if @source_ip_address && @source_ip_address . ipv6 . blank? && endpoint . ipv6?
181- # Don't try to use IPv6 if the IP address we're sending from doesn't support it.
180+ if ( @source_ip_address && @source_ip_address . ipv6 . blank? && endpoint . ipv6? ) || Postal :: Config . smtp . disable_ipv6
181+ # Don't try to use IPv6 if the IP address we're sending from doesn't support it or if it's disabled in the config .
182182 return false
183183 end
184184
Original file line number Diff line number Diff line change @@ -418,6 +418,11 @@ module Postal
418418 description "The e-mail to use as the from address outgoing emails from Postal"
419419 default "postal@example.com"
420420 end
421+
422+ boolean :disable_ipv6 do
423+ description "Disalbles sending emails via IPv6, only IPv4 will be used"
424+ default false
425+ end
421426 end
422427
423428 group :rails do
You can’t perform that action at this time.
0 commit comments