diff --git a/func/domain.sh b/func/domain.sh index 713cc52af..fc615e7be 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -412,6 +412,20 @@ update_domain_zone() { VALUE=$(idn --quiet -a -t "$VALUE") fi + # Split long TXT entries into 255 chunks + if [ "$TYPE" = 'TXT' ]; then + txtlength=${#VALUE} + if [ $txtlength -gt 255 ]; then + if [[ ${VALUE:0:1} = '"' ]]; then + txtlength=$(( $txtlength - 2 )) + VALUE=${VALUE:1:txtlength} + fi + VALUE=$(echo $VALUE | fold -w 255 | xargs -I '$' echo -n ' "$"') + VALUE=${VALUE:1} + VALUE="($VALUE)" + fi + fi + if [ "$SUSPENDED" != 'yes' ]; then eval echo -e "\"$fields\""|sed "s/%quote%/'/g" >> $zn_conf fi