mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Allow multiple MX records with different priorities https://www.virtualmin.com/node/24355
This commit is contained in:
@@ -38,6 +38,7 @@ elsif ($in{'type'} eq 'CNAME') {
|
||||
elsif ($in{'type'} eq 'MX') {
|
||||
$in{'value'} =~ /^(\d+)\s+(\S+)$/ && &valname("$2") ||
|
||||
&error(&text('emass_emx', $in{'value'}));
|
||||
$mxpri = $1;
|
||||
}
|
||||
elsif ($in{'type'} eq 'TXT') {
|
||||
$in{'value'} = "\"$in{'value'}\"";
|
||||
@@ -65,8 +66,17 @@ foreach $zi (@zones) {
|
||||
@recs = &read_zone_file($zi->{'file'}, $zi->{'name'});
|
||||
if ($in{'type'} eq 'CNAME' || $in{'clash'}) {
|
||||
# Check if a record with the same name exists
|
||||
($clash) = grep { $_->{'name'} eq $fullname &&
|
||||
$_->{'type'} eq $in{'type'} } @recs;
|
||||
if ($in{'type'} eq 'MX') {
|
||||
# MX has to clash on priority too
|
||||
($clash) = grep { $_->{'name'} eq $fullname &&
|
||||
$_->{'type'} eq $in{'type'} &&
|
||||
$_->{'values'}->[0] == $mxpri } @recs;
|
||||
}
|
||||
else {
|
||||
# Other types clash on name
|
||||
($clash) = grep { $_->{'name'} eq $fullname &&
|
||||
$_->{'type'} eq $in{'type'} } @recs;
|
||||
}
|
||||
if ($clash) {
|
||||
print &text('rmass_eclash',
|
||||
"<tt>".join(" ", @{$clash->{'values'}})."</tt>"),
|
||||
|
||||
Reference in New Issue
Block a user