Remove \n from dkim txt output

Some DNS providers (like cloudflare) do not allow in dkim txt record \n char. Fix is removing new line symbols (\n).
This commit is contained in:
Olgerdas
2019-03-27 19:35:10 +02:00
committed by GitHub
parent 2bde9c6e47
commit a420465b39

View File

@@ -67,7 +67,7 @@ is_object_valid 'mail' 'DOMAIN' "$domain"
# Parsing domain keys
if [ -e "$USER_DATA/mail/$domain.pub" ]; then
pub=$(cat $USER_DATA/mail/$domain.pub |grep -v "KEY-----")
pub=$(cat $USER_DATA/mail/$domain.pub |grep -v "KEY-----" |tr -d "\n\r")
pub=$(echo "$pub" |sed ':a;N;$!ba;s/\n/\\n/g')
else
pub="DKIM-SUPPORT-IS-NOT-ACTIVATED"