Disallow > 10 SPF MX domains

This commit is contained in:
Jamie Cameron
2010-12-23 23:46:56 -08:00
parent 22780c3706
commit 5e607dc1f5
2 changed files with 3 additions and 0 deletions

View File

@@ -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

View File

@@ -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) ||