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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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"