From 422325563ed7258c4a1cac640c34689af5c9a8bc Mon Sep 17 00:00:00 2001 From: kinolaev Date: Thu, 9 Jan 2014 18:46:01 +0300 Subject: [PATCH] Add dkim from yandex dns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Автоматическое добавление DKIM от Яндекс.ПДД --- bin/v-add-mail-domain-dkim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/v-add-mail-domain-dkim b/bin/v-add-mail-domain-dkim index 8c3b2143f..469c48626 100755 --- a/bin/v-add-mail-domain-dkim +++ b/bin/v-add-mail-domain-dkim @@ -69,6 +69,14 @@ if [ "$?" -eq 0 ]; then record='vmail._domainkey' selector="\"k=rsa\; p=$p\"" $BIN/v-add-dns-record $user $domain $record TXT "$selector" + + if [ "$($BIN/v-list-dns-records $user $domain plain|grep -c '@ MX 10 mx.yandex.ru.')" = "1" ]; then + record='mail._domainkey' + selector=$(host -t TXT mail._domainkey.$domain dns1.yandex.net|grep v\=DKIM1|cut -d\" -f2) + if [ -n "$selector" ]; then + $BIN/v-add-dns-record $user $domain $record TXT "\"$selector\"" + fi + fi fi