diff --git a/root/etc/e-smith/templates/var/service/qpsmtpd/config/peers/0/30check_spf b/root/etc/e-smith/templates/var/service/qpsmtpd/config/peers/0/30check_spf new file mode 100644 index 0000000..25b28da --- /dev/null +++ b/root/etc/e-smith/templates/var/service/qpsmtpd/config/peers/0/30check_spf @@ -0,0 +1,5 @@ +{ + my $spf = $qpsmtpd{'CheckSPF'} || 'disabled'; + return '' unless ($spf =~ m/^[012]$/); + return "sender_permitted_from spf_deny $spf"; +} diff --git a/root/etc/e-smith/templates/var/service/tinydns/root/data/85Spf b/root/etc/e-smith/templates/var/service/tinydns/root/data/85Spf new file mode 100644 index 0000000..7153f2e --- /dev/null +++ b/root/etc/e-smith/templates/var/service/tinydns/root/data/85Spf @@ -0,0 +1,16 @@ +{ + if (($qpsmtpd{RejectSpoofedLocalDomains} || 'disabled') eq 'enabled'){ + $OUT .= "# SPF entries for local domains\n"; + my $allowed = ''; + foreach my $ip ( split /[;,]/, ($qpsmtpd{AllowedRemoteIP} || '')){ + my $allowed .= 'ip4\072'.$ip.' '; + } + foreach my $domain (get_domains()){ + $OUT .= "'$domain:v=spf1 mx $allowed-all:3600\n"; + $OUT .= ":$domain:99:\041v=spf1 mx $allowed-all:3600\n"; + } + } + else{ + $OUT .= "\n"; + } +}