6 次代码提交

作者 SHA1 备注 提交日期
  Luke Smith 42993e8ba8
Merge pull request #308 from tfasano1/master 11 个月前
  tfasano1 e58b2bf426
exit when records aren't setup 11 个月前
  tfasano1 3dd706e5a8
Add checks with helpful debug information 11 个月前
  tfasano1 bda1580088
add ipv6 mechanism 11 个月前
  tfasano1 0aa7a8df38
Update emailwiz.sh 11 个月前
  tfasano1 e4ae00cd69
Add spf arg to lower gmail false positive spam 11 个月前
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. +7
    -1
      emailwiz.sh

+ 7
- 1
emailwiz.sh 查看文件

@@ -23,6 +23,12 @@ subdom=${MAIL_SUBDOM:-mail}
maildomain="$subdom.$domain"
certdir="/etc/letsencrypt/live/$maildomain"

# Preliminary record checks
ipv4=$(host "$domain" | grep -m1 -Eo '([0-9]+\.){3}[0-9]+')
[ -z "$ipv4" ] && echo "\033[0;31mPlease point your domain ("$domain") to your server's ipv4 address." && exit 1
ipv6=$(host "$domain" | grep "IPv6" | awk '{print $NF}')
[ -z "$ipv6" ] && echo "\033[0;31mPlease point your domain ("$domain") to your server's ipv6 address." && exit 1

# Open required mail ports, and 80, for Certbot.
for port in 80 993 465 25 587; do
ufw allow "$port" 2>/dev/null
@@ -350,7 +356,7 @@ done
pval="$(tr -d '\n' <"/etc/postfix/dkim/$domain/$subdom.txt" | sed "s/k=rsa.* \"p=/k=rsa; p=/;s/\"\s*\"//;s/\"\s*).*//" | grep -o 'p=.*')"
dkimentry="$subdom._domainkey.$domain TXT v=DKIM1; k=rsa; $pval"
dmarcentry="_dmarc.$domain TXT v=DMARC1; p=reject; rua=mailto:dmarc@$domain; fo=1"
spfentry="$domain TXT v=spf1 mx a:$maildomain -all"
spfentry="$domain TXT v=spf1 mx a:$maildomain ip4:$ipv4 ip6:$ipv6 -all"
mxentry="$domain MX 10 $maildomain 300"

useradd -m -G mail dmarc


正在加载...
取消
保存