From e439d418232801ab9cf8ceae488669322f215a39 Mon Sep 17 00:00:00 2001 From: kinolaev Date: Thu, 9 Jan 2014 18:44:30 +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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/v-add-mail-domain b/bin/v-add-mail-domain index 43aaac7cd..e765cc4f5 100755 --- a/bin/v-add-mail-domain +++ b/bin/v-add-mail-domain @@ -82,6 +82,14 @@ if [ "$dkim" = 'yes' ]; 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 fi