File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -390,8 +390,12 @@ function getRelayData(url) {
390390 } catch {
391391 urlparts = { } ;
392392 }
393+ let hostname = urlparts . hostname || '' ;
394+ if ( / ^ \[ [ ^ \] ] + \] $ / . test ( hostname ) ) {
395+ hostname = hostname . slice ( 1 , - 1 ) ;
396+ }
393397 let targetMx = {
394- host : urlparts . hostname ,
398+ host : hostname ,
395399 port : urlparts . port || 25 ,
396400 auth :
397401 urlparts . username || urlparts . password
@@ -401,8 +405,8 @@ function getRelayData(url) {
401405 }
402406 : false ,
403407 secure : urlparts . protocol === 'smtps:' ,
404- A : [ ] . concat ( net . isIPv4 ( urlparts . hostname ) ? urlparts . hostname : [ ] ) ,
405- AAAA : [ ] . concat ( net . isIPv6 ( urlparts . hostname ) ? urlparts . hostname : [ ] )
408+ A : [ ] . concat ( net . isIPv4 ( hostname ) ? hostname : [ ] ) ,
409+ AAAA : [ ] . concat ( net . isIPv6 ( hostname ) ? hostname : [ ] )
406410 } ;
407411 let data = {
408412 mx : [
You can’t perform that action at this time.
0 commit comments