1+ #! /usr/bin/env bash
12# Internal variables
23HOMEDIR=' /home'
34BACKUP=' /backup'
@@ -448,6 +449,7 @@ sync_cron_jobs() {
448449 rm -f $crontab
449450 if [ " $CRON_REPORTS " = ' yes' ]; then
450451 echo " MAILTO=$CONTACT " > $crontab
452+ echo ' CONTENT_TYPE="text/plain; charset=utf-8"' >> $crontab
451453 fi
452454 while read line; do
453455 eval $line
@@ -465,12 +467,12 @@ sync_cron_jobs() {
465467is_user_format_valid () {
466468 if [ ${# 1} -eq 1 ]; then
467469 if ! [[ " $1 " =~ ^^[[:alnum:]]$ ]]; then
468- echo " invalid $2 format :: $1 "
470+ check_result $E_INVALID " invalid $2 format :: $1 "
469471 fi
470472 else
471473 if ! [[ " $1 " =~ ^[[:alnum:]][-| \. | _[:alnum:]]{0,28}[[:alnum:]]$ ]]
472474 then
473- echo " invalid $2 format :: $1 "
475+ check_result $E_INVALID " invalid $2 format :: $1 "
474476 fi
475477 fi
476478}
@@ -588,7 +590,7 @@ is_dbuser_format_valid() {
588590
589591# DNS record type validator
590592is_dns_type_format_valid () {
591- known_dnstype=' A,AAAA,NS,CNAME,MX,TXT,SRV,DNSKEY,KEY,IPSECKEY,PTR,SPF'
593+ known_dnstype=' A,AAAA,NS,CNAME,MX,TXT,SRV,DNSKEY,KEY,IPSECKEY,PTR,SPF,TLSA '
592594 if [ -z " $( echo $known_dnstype | grep -w $1 ) " ]; then
593595 check_result $E_INVALID " invalid dns record type format :: $1 "
594596 fi
@@ -611,7 +613,7 @@ is_dns_record_format_valid() {
611613
612614# Email format validator
613615is_email_format_valid () {
614- if [[ ! " $1 " =~ " @ " ]] ; then
616+ if [[ ! " $1 " =~ ^[A-Za-z0-9._%+-]+@[[:alnum:].-]+ \. [A-Za-z]{2,63}$ ]] ; then
615617 check_result $E_INVALID " invalid email format :: $1 "
616618 fi
617619}
0 commit comments