From 5e607dc1f569bc6962d9fb9bb3a8c701e464b3eb Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Thu, 23 Dec 2010 23:46:56 -0800 Subject: [PATCH] Disallow > 10 SPF MX domains --- bind8/lang/en | 1 + bind8/save_record.cgi | 2 ++ 2 files changed, 3 insertions(+) diff --git a/bind8/lang/en b/bind8/lang/en index de9238e19..170f7105a 100644 --- a/bind8/lang/en +++ b/bind8/lang/en @@ -276,6 +276,7 @@ edit_dok=Yes, Delete It edit_eptr='$1' is not a valid reverse address record hostname edit_espfa='$1' is not a valid host to allow sending from edit_espfmx='$1' is not a valid domain name to allow MX sending from +edit_espfmxmax=You are not allowed to have more than 10 domains to allow MX sending from edit_espfip='$1' is not a valid IP address or IP/prefix to allow sending from edit_espfip6='$1' is not a valid IPv6 address or IPv6/prefix to allow sending from edit_espfinclude='$1' is not a valid additional domain from which mail is sent diff --git a/bind8/save_record.cgi b/bind8/save_record.cgi index d1c17e7ff..65bcf50aa 100755 --- a/bind8/save_record.cgi +++ b/bind8/save_record.cgi @@ -294,6 +294,8 @@ else { foreach my $mx (@{$spf->{'mx:'}}) { &valname($mx) || &error(&text('edit_espfmx', $mx)); } + @{$spf->{'mx:'}} <= 10 || + &error(&text('edit_espfmxmax', 10)); $spf->{'ip4:'} = [ split(/\s+/, $in{'spfip4s'}) ]; foreach my $ip (@{$spf->{'ip4:'}}) { &check_ipaddress($ip) ||