diff --git a/func/rebuild.sh b/func/rebuild.sh index e753de9e6..e333fed6a 100644 --- a/func/rebuild.sh +++ b/func/rebuild.sh @@ -477,6 +477,14 @@ rebuild_mail_domain_conf() { p=$(cat $pub|grep -v ' KEY---'|tr -d '\n') slct="\"k=rsa\; p=$p\"" $BIN/v-add-dns-record $user $domain $record TXT "$slct" + + if [ "$($BIN/v-list-dns-records $user $domain plain|grep -c '@ MX 10 mx.yandex.ru.')" = "1" ]; then + record='mail._domainkey' + slct=$(host -t TXT mail._domainkey.$domain dns1.yandex.net|grep v\=DKIM1|cut -d\" -f2) + if [ -n "$slct" ]; then + $BIN/v-add-dns-record $user $domain $record TXT "\"$slct\"" + fi + fi fi fi