Error: mail domain hostname.domain.com doesn't exist

I want to create the following email accounts:
[email protected]
[email protected]

But when I try to “Add Mail Domain” with “hostname.domain.com”, I get the error I mentioned in the subject line.

I’ve tried setting “Enforce subdomain ownership” to “No”, but I still get the same error.

I have two mail servers (with different domains), and I get the same error on both.

Cloudflare is handling the DNS, but if I understand correctly, the DNS settings should be configured after creating “mail.hostname.domain.com”.

I imagine I’m missing something silly, because I’ve searched the forum and haven’t found anyone with the same problem. (There are several posts about problems obtaining SSL, but that’s not my situation.)

In a post from a few weeks ago, @sahsanu explained to someone how to create the email accounts and the mail domain, but they didn’t mention having the same error.

Thanks for any help!

Could you please show the output of this command?

Note: the output will be large. You must replace the arguments with the actual data. For this test you can just use USER and DOMAIN.

bash -x v-add-mail-domain USER DOMAIN [ANTISPAM] [ANTIVIRUS] [DKIM] [DKIM_SIZE] [RESTART] [REJECT_SPAM] 2>&1 | tee /tmp/v-add-mail-domain.debug

Hello @sahsanu, thanks for your help, I ran the command :

bash -x v-add-mail-domain user4 hostname.domain.com 2>&1 | tee /tmp/v-add-mail-domain.debug

This is all the output:


* user=user4
* domain=hostname.domain.com
* antispam=yes
* antivirus=yes
* dkim=yes
* dkim_size=2048
* restart=
* reject=no
* source /etc/hestiacp/hestia.conf
  ++ export HESTIA=/usr/local/hestia
  ++ HESTIA=/usr/local/hestia
  ++ \[\[ -f /etc/hestiacp/local.conf \]\]
* source /usr/local/hestia/func/main.sh
  ++ ‘\[’ -z user4 ‘\]’
  ++ HOMEDIR=/home
  ++ BACKUP=/backup
  ++ BACKUP_GZIP=9
  ++ BACKUP_DISK_LIMIT=95
  +++ grep -c ‘^processor’ /proc/cpuinfo
  ++ BACKUP_LA_LIMIT=4
  ++ RRD_STEP=300
  ++ BIN=/usr/local/hestia/bin
  ++ HESTIA_INSTALL_DIR=/usr/local/hestia/install/deb
  ++ HESTIA_COMMON_DIR=/usr/local/hestia/install/common
  +++ date +%d%m%Y%H%M
  ++ HESTIA_BACKUP=/root/hst_backups/170320261608
  ++ HESTIA_PHP=/usr/local/hestia/php/bin/php
  ++ USER_DATA=/usr/local/hestia/data/users/user4
  ++ WEBTPL=/usr/local/hestia/data/templates/web
  ++ MAILTPL=/usr/local/hestia/data/templates/mail
  ++ DNSTPL=/usr/local/hestia/data/templates/dns
  ++ RRD=/usr/local/hestia/web/rrd
  ++ SENDMAIL=/usr/local/hestia/web/inc/mail-wrapper.php
  ++ HESTIA_GIT_REPO=https://raw.githubusercontent.com/hestiacp/hestiacp
  ++ HESTIA_THEMES=/usr/local/hestia/web/css/themes
  ++ HESTIA_THEMES_CUSTOM=/usr/local/hestia/web/css/themes/custom
  +++ basename v-add-mail-domain
  ++ SCRIPT=v-add-mail-domain
  ++ CHECK_RESULT_CALLBACK=
  ++ OK=0
  ++ E_ARGS=1
  ++ E_INVALID=2
  ++ E_NOTEXIST=3
  ++ E_EXISTS=4
  ++ E_SUSPENDED=5
  ++ E_UNSUSPENDED=6
  ++ E_INUSE=7
  ++ E_LIMIT=8
  ++ E_PASSWORD=9
  ++ E_FORBIDEN=10
  ++ E_DISABLED=11
  ++ E_PARSING=12
  ++ E_DISK=13
  ++ E_LA=14
  ++ E_CONNECT=15
  ++ E_FTP=16
  ++ E_DB=17
  ++ E_RRD=18
  ++ E_UPDATE=19
  ++ E_RESTART=20
  ++ ARGS=(“$@”)
  ++ (( I = 1 ))
  ++ (( I <= 2 ))
  ++ \[\[ ‘’ != \\1 \]\]
  ++ ARGUMENTS=’ ‘'‘user4’'’’
  ++ (( I++ ))
  ++ (( I <= 2 ))
  ++ \[\[ ‘’ != \\2 \]\]
  ++ ARGUMENTS=’ ‘'‘user4’'’ ‘'‘hostname.domain.com’'’’
  ++ (( I++ ))
  ++ (( I <= 2 ))
* source /usr/local/hestia/func/domain.sh
* source /usr/local/hestia/func/ip.sh
  ++ REGEX_IPV4=‘^((25\[0-5\]|2\[0-4\]\[0-9\]|\[01\]?\[0-9\]\[0-9\]?)(.|$)){4}$’
* source /usr/local/hestia/func/syshealth.sh
* source_conf /usr/local/hestia/conf/hestia.conf
* IFS='= ’
* read -r lhs rhs
* \[\[ ! ANTISPAM_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n ANTISPAM_SYSTEM \]\]
* rhs=‘’'‘spamassassin’'‘’
* rhs=‘’'‘spamassassin’'‘’
* rhs=‘’'‘spamassassin’
* rhs=spamassassin
* declare -g ANTISPAM_SYSTEM=spamassassin
* IFS='= ’
* read -r lhs rhs
* \[\[ ! ANTIVIRUS_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n ANTIVIRUS_SYSTEM \]\]
* rhs=‘’'‘clamav-daemon’'‘’
* rhs=‘’'‘clamav-daemon’'‘’
* rhs=‘’'‘clamav-daemon’
* rhs=clamav-daemon
* declare -g ANTIVIRUS_SYSTEM=clamav-daemon
* IFS='= ’
* read -r lhs rhs
* \[\[ ! API_ALLOWED_IP =\~ ^ \*# \]\]
* \[\[ -n API_ALLOWED_IP \]\]
* rhs=‘’'‘’'‘’
* rhs=‘’'‘’'‘’
* rhs='
* rhs=
* declare -g API_ALLOWED_IP=
* IFS='= ’
* read -r lhs rhs
* \[\[ ! API_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n API_SYSTEM \]\]
* rhs=‘’'‘1’'‘’
* rhs=‘’'‘1’'‘’
* rhs=‘’'‘1’
* rhs=1
* declare -g API_SYSTEM=1
* IFS='= ’
* read -r lhs rhs
* \[\[ ! API =\~ ^ \*# \]\]
* \[\[ -n API \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g API=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! APP_NAME =\~ ^ \*# \]\]
* \[\[ -n APP_NAME \]\]
* rhs=‘’'‘Hestia Control Panel’'‘’
* rhs=‘’'‘Hestia Control Panel’'‘’
* rhs=‘’'‘Hestia Control Panel’
* rhs=‘Hestia Control Panel’
* declare -g ‘APP_NAME=Hestia Control Panel’
* IFS='= ’
* read -r lhs rhs
* \[\[ ! BACKEND_PORT =\~ ^ \*# \]\]
* \[\[ -n BACKEND_PORT \]\]
* rhs=‘’'‘8083’'‘’
* rhs=‘’'‘8083’'‘’
* rhs=‘’'‘8083’
* rhs=8083
* declare -g BACKEND_PORT=8083
* IFS='= ’
* read -r lhs rhs
* \[\[ ! BACKUP_GZIP =\~ ^ \*# \]\]
* \[\[ -n BACKUP_GZIP \]\]
* rhs=‘’'‘4’'‘’
* rhs=‘’'‘4’'‘’
* rhs=‘’'‘4’
* rhs=4
* declare -g BACKUP_GZIP=4
* IFS='= ’
* read -r lhs rhs
* \[\[ ! BACKUP_INCREMENTAL =\~ ^ \*# \]\]
* \[\[ -n BACKUP_INCREMENTAL \]\]
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’
* rhs=no
* declare -g BACKUP_INCREMENTAL=no
* IFS='= ’
* read -r lhs rhs
* \[\[ ! BACKUP_MODE =\~ ^ \*# \]\]
* \[\[ -n BACKUP_MODE \]\]
* rhs=‘’'‘zstd’'‘’
* rhs=‘’'‘zstd’'‘’
* rhs=‘’'‘zstd’
* rhs=zstd
* declare -g BACKUP_MODE=zstd
* IFS='= ’
* read -r lhs rhs
* \[\[ ! BACKUP_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n BACKUP_SYSTEM \]\]
* rhs=‘’'‘local’'‘’
* rhs=‘’'‘local’'‘’
* rhs=‘’'‘local’
* rhs=local
* declare -g BACKUP_SYSTEM=local
* IFS='= ’
* read -r lhs rhs
* \[\[ ! CRON_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n CRON_SYSTEM \]\]
* rhs=‘’'‘cron’'‘’
* rhs=‘’'‘cron’'‘’
* rhs=‘’'‘cron’
* rhs=cron
* declare -g CRON_SYSTEM=cron
* IFS='= ’
* read -r lhs rhs
* \[\[ ! DB_PMA_ALIAS =\~ ^ \*# \]\]
* \[\[ -n DB_PMA_ALIAS \]\]
* rhs=‘’'‘phpmyadmin’'‘’
* rhs=‘’'‘phpmyadmin’'‘’
* rhs=‘’'‘phpmyadmin’
* rhs=phpmyadmin
* declare -g DB_PMA_ALIAS=phpmyadmin
* IFS='= ’
* read -r lhs rhs
* \[\[ ! DB_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n DB_SYSTEM \]\]
* rhs=‘’'‘mysql’'‘’
* rhs=‘’'‘mysql’'‘’
* rhs=‘’'‘mysql’
* rhs=mysql
* declare -g DB_SYSTEM=mysql
* IFS='= ’
* read -r lhs rhs
* \[\[ ! DEBUG_MODE =\~ ^ \*# \]\]
* \[\[ -n DEBUG_MODE \]\]
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’
* rhs=false
* declare -g DEBUG_MODE=false
* IFS='= ’
* read -r lhs rhs
* \[\[ ! DISABLE_IP_CHECK =\~ ^ \*# \]\]
* \[\[ -n DISABLE_IP_CHECK \]\]
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’
* rhs=no
* declare -g DISABLE_IP_CHECK=no
* IFS='= ’
* read -r lhs rhs
* \[\[ ! DISK_QUOTA =\~ ^ \*# \]\]
* \[\[ -n DISK_QUOTA \]\]
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’
* rhs=no
* declare -g DISK_QUOTA=no
* IFS='= ’
* read -r lhs rhs
* \[\[ ! DNS_CLUSTER_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n DNS_CLUSTER_SYSTEM \]\]
* rhs=‘’'‘hestia’'‘’
* rhs=‘’'‘hestia’'‘’
* rhs=‘’'‘hestia’
* rhs=hestia
* declare -g DNS_CLUSTER_SYSTEM=hestia
* IFS='= ’
* read -r lhs rhs
* \[\[ ! DNS_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n DNS_SYSTEM \]\]
* rhs=‘’'‘bind9’'‘’
* rhs=‘’'‘bind9’'‘’
* rhs=‘’'‘bind9’
* rhs=bind9
* declare -g DNS_SYSTEM=bind9
* IFS='= ’
* read -r lhs rhs
* \[\[ ! DOMAINDIR_WRITABLE =\~ ^ \*# \]\]
* \[\[ -n DOMAINDIR_WRITABLE \]\]
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’
* rhs=no
* declare -g DOMAINDIR_WRITABLE=no
* IFS='= ’
* read -r lhs rhs
* \[\[ ! ENFORCE_SUBDOMAIN_OWNERSHIP =\~ ^ \*# \]\]
* \[\[ -n ENFORCE_SUBDOMAIN_OWNERSHIP \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g ENFORCE_SUBDOMAIN_OWNERSHIP=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! FILE_MANAGER =\~ ^ \*# \]\]
* \[\[ -n FILE_MANAGER \]\]
* rhs=‘’'‘true’'‘’
* rhs=‘’'‘true’'‘’
* rhs=‘’'‘true’
* rhs=true
* declare -g FILE_MANAGER=true
* IFS='= ’
* read -r lhs rhs
* \[\[ ! FIREWALL_EXTENSION =\~ ^ \*# \]\]
* \[\[ -n FIREWALL_EXTENSION \]\]
* rhs=‘’'‘fail2ban’'‘’
* rhs=‘’'‘fail2ban’'‘’
* rhs=‘’'‘fail2ban’
* rhs=fail2ban
* declare -g FIREWALL_EXTENSION=fail2ban
* IFS='= ’
* read -r lhs rhs
* \[\[ ! FIREWALL_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n FIREWALL_SYSTEM \]\]
* rhs=‘’'‘iptables’'‘’
* rhs=‘’'‘iptables’'‘’
* rhs=‘’'‘iptables’
* rhs=iptables
* declare -g FIREWALL_SYSTEM=iptables
* IFS='= ’
* read -r lhs rhs
* \[\[ ! FROM_EMAIL =\~ ^ \*# \]\]
* \[\[ -n FROM_EMAIL \]\]
* rhs=‘’'‘’'‘’
* rhs=‘’'‘’'‘’
* rhs='
* rhs=
* declare -g FROM_EMAIL=
* IFS='= ’
* read -r lhs rhs
* \[\[ ! FROM_NAME =\~ ^ \*# \]\]
* \[\[ -n FROM_NAME \]\]
* rhs=‘’'‘’'‘’
* rhs=‘’'‘’'‘’
* rhs='
* rhs=
* declare -g FROM_NAME=
* IFS='= ’
* read -r lhs rhs
* \[\[ ! HIDE_DOCS =\~ ^ \*# \]\]
* \[\[ -n HIDE_DOCS \]\]
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’
* rhs=no
* declare -g HIDE_DOCS=no
* IFS='= ’
* read -r lhs rhs
* \[\[ ! IMAP_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n IMAP_SYSTEM \]\]
* rhs=‘’'‘dovecot’'‘’
* rhs=‘’'‘dovecot’'‘’
* rhs=‘’'‘dovecot’
* rhs=dovecot
* declare -g IMAP_SYSTEM=dovecot
* IFS='= ’
* read -r lhs rhs
* \[\[ ! INACTIVE_SESSION_TIMEOUT =\~ ^ \*# \]\]
* \[\[ -n INACTIVE_SESSION_TIMEOUT \]\]
* rhs=‘’'‘600’'‘’
* rhs=‘’'‘600’'‘’
* rhs=‘’'‘600’
* rhs=600
* declare -g INACTIVE_SESSION_TIMEOUT=600
* IFS='= ’
* read -r lhs rhs
* \[\[ ! LANGUAGE =\~ ^ \*# \]\]
* \[\[ -n LANGUAGE \]\]
* rhs=‘’'‘en’'‘’
* rhs=‘’'‘en’'‘’
* rhs=‘’'‘en’
* rhs=en
* declare -g LANGUAGE=en
* IFS='= ’
* read -r lhs rhs
* \[\[ ! LOGIN_STYLE =\~ ^ \*# \]\]
* \[\[ -n LOGIN_STYLE \]\]
* rhs=‘’'‘default’'‘’
* rhs=‘’'‘default’'‘’
* rhs=‘’'‘default’
* rhs=default
* declare -g LOGIN_STYLE=default
* IFS='= ’
* read -r lhs rhs
* \[\[ ! MAIL_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n MAIL_SYSTEM \]\]
* rhs=‘’'‘exim4’'‘’
* rhs=‘’'‘exim4’'‘’
* rhs=‘’'‘exim4’
* rhs=exim4
* declare -g MAIL_SYSTEM=exim4
* IFS='= ’
* read -r lhs rhs
* \[\[ ! PHPMYADMIN_KEY =\~ ^ \*# \]\]
* \[\[ -n PHPMYADMIN_KEY \]\]
* rhs=‘’'‘’'‘’
* rhs=‘’'‘’'‘’
* rhs='
* rhs=
* declare -g PHPMYADMIN_KEY=
* IFS='= ’
* read -r lhs rhs
* \[\[ ! PLUGIN_APP_INSTALLER =\~ ^ \*# \]\]
* \[\[ -n PLUGIN_APP_INSTALLER \]\]
* rhs=‘’'‘true’'‘’
* rhs=‘’'‘true’'‘’
* rhs=‘’'‘true’
* rhs=true
* declare -g PLUGIN_APP_INSTALLER=true
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_BACKUP_SUSPENDED_USERS =\~ ^ \*# \]\]
* \[\[ -n POLICY_BACKUP_SUSPENDED_USERS \]\]
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’
* rhs=no
* declare -g POLICY_BACKUP_SUSPENDED_USERS=no
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_CSRF_STRICTNESS =\~ ^ \*# \]\]
* \[\[ -n POLICY_CSRF_STRICTNESS \]\]
* rhs=‘’'‘1’'‘’
* rhs=‘’'‘1’'‘’
* rhs=‘’'‘1’
* rhs=1
* declare -g POLICY_CSRF_STRICTNESS=1
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_SYNC_ERROR_DOCUMENTS =\~ ^ \*# \]\]
* \[\[ -n POLICY_SYNC_ERROR_DOCUMENTS \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g POLICY_SYNC_ERROR_DOCUMENTS=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_SYNC_SKELETON =\~ ^ \*# \]\]
* \[\[ -n POLICY_SYNC_SKELETON \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g POLICY_SYNC_SKELETON=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_SYSTEM_ENABLE_BACON =\~ ^ \*# \]\]
* \[\[ -n POLICY_SYSTEM_ENABLE_BACON \]\]
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’
* rhs=false
* declare -g POLICY_SYSTEM_ENABLE_BACON=false
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_SYSTEM_HIDE_ADMIN =\~ ^ \*# \]\]
* \[\[ -n POLICY_SYSTEM_HIDE_ADMIN \]\]
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’
* rhs=no
* declare -g POLICY_SYSTEM_HIDE_ADMIN=no
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_SYSTEM_HIDE_SERVICES =\~ ^ \*# \]\]
* \[\[ -n POLICY_SYSTEM_HIDE_SERVICES \]\]
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’
* rhs=no
* declare -g POLICY_SYSTEM_HIDE_SERVICES=no
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_SYSTEM_PASSWORD_RESET =\~ ^ \*# \]\]
* \[\[ -n POLICY_SYSTEM_PASSWORD_RESET \]\]
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’'‘’
* rhs=‘’'‘no’
* rhs=no
* declare -g POLICY_SYSTEM_PASSWORD_RESET=no
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_SYSTEM_PROTECTED_ADMIN =\~ ^ \*# \]\]
* \[\[ -n POLICY_SYSTEM_PROTECTED_ADMIN \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g POLICY_SYSTEM_PROTECTED_ADMIN=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_USER_CHANGE_THEME =\~ ^ \*# \]\]
* \[\[ -n POLICY_USER_CHANGE_THEME \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g POLICY_USER_CHANGE_THEME=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_USER_DELETE_LOGS =\~ ^ \*# \]\]
* \[\[ -n POLICY_USER_DELETE_LOGS \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g POLICY_USER_DELETE_LOGS=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_USER_EDIT_DETAILS =\~ ^ \*# \]\]
* \[\[ -n POLICY_USER_EDIT_DETAILS \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g POLICY_USER_EDIT_DETAILS=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_USER_EDIT_DNS_TEMPLATES =\~ ^ \*# \]\]
* \[\[ -n POLICY_USER_EDIT_DNS_TEMPLATES \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g POLICY_USER_EDIT_DNS_TEMPLATES=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_USER_EDIT_WEB_TEMPLATES =\~ ^ \*# \]\]
* \[\[ -n POLICY_USER_EDIT_WEB_TEMPLATES \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g POLICY_USER_EDIT_WEB_TEMPLATES=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_USER_VIEW_LOGS =\~ ^ \*# \]\]
* \[\[ -n POLICY_USER_VIEW_LOGS \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g POLICY_USER_VIEW_LOGS=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! POLICY_USER_VIEW_SUSPENDED =\~ ^ \*# \]\]
* \[\[ -n POLICY_USER_VIEW_SUSPENDED \]\]
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’
* rhs=false
* declare -g POLICY_USER_VIEW_SUSPENDED=false
* IFS='= ’
* read -r lhs rhs
* \[\[ ! RELEASE_BRANCH =\~ ^ \*# \]\]
* \[\[ -n RELEASE_BRANCH \]\]
* rhs=‘’'‘release’'‘’
* rhs=‘’'‘release’'‘’
* rhs=‘’'‘release’
* rhs=release
* declare -g RELEASE_BRANCH=release
* IFS='= ’
* read -r lhs rhs
* \[\[ ! ROOT_USER =\~ ^ \*# \]\]
* \[\[ -n ROOT_USER \]\]
* rhs=‘’'‘admin’'‘’
* rhs=‘’'‘admin’'‘’
* rhs=‘’'‘admin’
* rhs=admin
* declare -g ROOT_USER=admin
* IFS='= ’
* read -r lhs rhs
* \[\[ ! SERVER_SMTP_ADDR =\~ ^ \*# \]\]
* \[\[ -n SERVER_SMTP_ADDR \]\]
* rhs=‘’'‘’'‘’
* rhs=‘’'‘’'‘’
* rhs='
* rhs=
* declare -g SERVER_SMTP_ADDR=
* IFS='= ’
* read -r lhs rhs
* \[\[ ! SERVER_SMTP_HOST =\~ ^ \*# \]\]
* \[\[ -n SERVER_SMTP_HOST \]\]
* rhs=‘’'‘’'‘’
* rhs=‘’'‘’'‘’
* rhs='
* rhs=
* declare -g SERVER_SMTP_HOST=
* IFS='= ’
* read -r lhs rhs
* \[\[ ! SERVER_SMTP_PASSWD =\~ ^ \*# \]\]
* \[\[ -n SERVER_SMTP_PASSWD \]\]
* rhs=‘’'‘’'‘’
* rhs=‘’'‘’'‘’
* rhs='
* rhs=
* declare -g SERVER_SMTP_PASSWD=
* IFS='= ’
* read -r lhs rhs
* \[\[ ! SERVER_SMTP_PORT =\~ ^ \*# \]\]
* \[\[ -n SERVER_SMTP_PORT \]\]
* rhs=‘’'‘’'‘’
* rhs=‘’'‘’'‘’
* rhs='
* rhs=
* declare -g SERVER_SMTP_PORT=
* IFS='= ’
* read -r lhs rhs
* \[\[ ! SERVER_SMTP_SECURITY =\~ ^ \*# \]\]
* \[\[ -n SERVER_SMTP_SECURITY \]\]
* rhs=‘’'‘’'‘’
* rhs=‘’'‘’'‘’
* rhs='
* rhs=
* declare -g SERVER_SMTP_SECURITY=
* IFS='= ’
* read -r lhs rhs
* \[\[ ! SERVER_SMTP_USER =\~ ^ \*# \]\]
* \[\[ -n SERVER_SMTP_USER \]\]
* rhs=‘’'‘’'‘’
* rhs=‘’'‘’'‘’
* rhs='
* rhs=
* declare -g SERVER_SMTP_USER=
* IFS='= ’
* read -r lhs rhs
* \[\[ ! STATS_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n STATS_SYSTEM \]\]
* rhs=‘’'‘awstats’'‘’
* rhs=‘’'‘awstats’'‘’
* rhs=‘’'‘awstats’
* rhs=awstats
* declare -g STATS_SYSTEM=awstats
* IFS='= ’
* read -r lhs rhs
* \[\[ ! SUBJECT_EMAIL =\~ ^ \*# \]\]
* \[\[ -n SUBJECT_EMAIL \]\]
* rhs=‘’'‘{{subject}}’'‘’
* rhs=‘’'‘{{subject}}’'‘’
* rhs=‘’'‘{{subject}}’
* rhs=‘{{subject}}’
* declare -g ‘SUBJECT_EMAIL={{subject}}’
* IFS='= ’
* read -r lhs rhs
* \[\[ ! THEME =\~ ^ \*# \]\]
* \[\[ -n THEME \]\]
* rhs=‘’'‘dark’'‘’
* rhs=‘’'‘dark’'‘’
* rhs=‘’'‘dark’
* rhs=dark
* declare -g THEME=dark
* IFS='= ’
* read -r lhs rhs
* \[\[ ! TITLE =\~ ^ \*# \]\]
* \[\[ -n TITLE \]\]
* rhs=‘’'‘{{page}} - {{hostname}} - {{appname}}’'‘’
* rhs=‘’'‘{{page}} - {{hostname}} - {{appname}}’'‘’
* rhs=‘’'‘{{page}} - {{hostname}} - {{appname}}’
* rhs=‘{{page}} - {{hostname}} - {{appname}}’
* declare -g ‘TITLE={{page}} - {{hostname}} - {{appname}}’
* IFS='= ’
* read -r lhs rhs
* \[\[ ! UPDATE_HOSTNAME_SSL =\~ ^ \*# \]\]
* \[\[ -n UPDATE_HOSTNAME_SSL \]\]
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’'‘’
* rhs=‘’'‘yes’
* rhs=yes
* declare -g UPDATE_HOSTNAME_SSL=yes
* IFS='= ’
* read -r lhs rhs
* \[\[ ! UPGRADE_SEND_EMAIL_LOG =\~ ^ \*# \]\]
* \[\[ -n UPGRADE_SEND_EMAIL_LOG \]\]
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’
* rhs=false
* declare -g UPGRADE_SEND_EMAIL_LOG=false
* IFS='= ’
* read -r lhs rhs
* \[\[ ! UPGRADE_SEND_EMAIL =\~ ^ \*# \]\]
* \[\[ -n UPGRADE_SEND_EMAIL \]\]
* rhs=‘’'‘true’'‘’
* rhs=‘’'‘true’'‘’
* rhs=‘’'‘true’
* rhs=true
* declare -g UPGRADE_SEND_EMAIL=true
* IFS='= ’
* read -r lhs rhs
* \[\[ ! USE_SERVER_SMTP =\~ ^ \*# \]\]
* \[\[ -n USE_SERVER_SMTP \]\]
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’
* rhs=false
* declare -g USE_SERVER_SMTP=false
* IFS='= ’
* read -r lhs rhs
* \[\[ ! VERSION =\~ ^ \*# \]\]
* \[\[ -n VERSION \]\]
* rhs=‘’'‘1.9.4’'‘’
* rhs=‘’'‘1.9.4’'‘’
* rhs=‘’'‘1.9.4’
* rhs=1.9.4
* declare -g VERSION=1.9.4
* IFS='= ’
* read -r lhs rhs
* \[\[ ! WEB_BACKEND =\~ ^ \*# \]\]
* \[\[ -n WEB_BACKEND \]\]
* rhs=‘’'‘php-fpm’'‘’
* rhs=‘’'‘php-fpm’'‘’
* rhs=‘’'‘php-fpm’
* rhs=php-fpm
* declare -g WEB_BACKEND=php-fpm
* IFS='= ’
* read -r lhs rhs
* \[\[ ! WEBMAIL_ALIAS =\~ ^ \*# \]\]
* \[\[ -n WEBMAIL_ALIAS \]\]
* rhs=‘’'‘webmail’'‘’
* rhs=‘’'‘webmail’'‘’
* rhs=‘’'‘webmail’
* rhs=webmail
* declare -g WEBMAIL_ALIAS=webmail
* IFS='= ’
* read -r lhs rhs
* \[\[ ! WEBMAIL_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n WEBMAIL_SYSTEM \]\]
* rhs=‘’'‘roundcube’'‘’
* rhs=‘’'‘roundcube’'‘’
* rhs=‘’'‘roundcube’
* rhs=roundcube
* declare -g WEBMAIL_SYSTEM=roundcube
* IFS='= ’
* read -r lhs rhs
* \[\[ ! WEB_PORT =\~ ^ \*# \]\]
* \[\[ -n WEB_PORT \]\]
* rhs=‘’'‘80’'‘’
* rhs=‘’'‘80’'‘’
* rhs=‘’'‘80’
* rhs=80
* declare -g WEB_PORT=80
* IFS='= ’
* read -r lhs rhs
* \[\[ ! WEB_SSL =\~ ^ \*# \]\]
* \[\[ -n WEB_SSL \]\]
* rhs=‘’'‘openssl’'‘’
* rhs=‘’'‘openssl’'‘’
* rhs=‘’'‘openssl’
* rhs=openssl
* declare -g WEB_SSL=openssl
* IFS='= ’
* read -r lhs rhs
* \[\[ ! WEB_SSL_PORT =\~ ^ \*# \]\]
* \[\[ -n WEB_SSL_PORT \]\]
* rhs=‘’'‘443’'‘’
* rhs=‘’'‘443’'‘’
* rhs=‘’'‘443’
* rhs=443
* declare -g WEB_SSL_PORT=443
* IFS='= ’
* read -r lhs rhs
* \[\[ ! WEB_SYSTEM =\~ ^ \*# \]\]
* \[\[ -n WEB_SYSTEM \]\]
* rhs=‘’'‘nginx’'‘’
* rhs=‘’'‘nginx’'‘’
* rhs=‘’'‘nginx’
* rhs=nginx
* declare -g WEB_SYSTEM=nginx
* IFS='= ’
* read -r lhs rhs
* \[\[ ! WEB_TERMINAL =\~ ^ \*# \]\]
* \[\[ -n WEB_TERMINAL \]\]
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’'‘’
* rhs=‘’'‘false’
* rhs=false
* declare -g WEB_TERMINAL=false
* IFS='= ’
* read -r lhs rhs
* \[\[ ! WEB_TERMINAL_PORT =\~ ^ \*# \]\]
* \[\[ -n WEB_TERMINAL_PORT \]\]
* rhs=‘’'‘8085’'‘’
* rhs=‘’'‘8085’'‘’
* rhs=‘’'‘8085’
* rhs=8085
* declare -g WEB_TERMINAL_PORT=8085
* IFS='= ’
* read -r lhs rhs
* ‘\[’ exim4 = exim4 ‘\]’
* MAIL_USER=Debian-exim
* format_domain
* \[\[ hostname.domain.com = *\[!\[:ascii:\]\]* \]\]
* \[\[ hostname.domain.com =\~ \[\[:upper:\]\] \]\]
* \[\[ hostname.domain.com =\~ ^www..\* \]\]
* \[\[ hostname.domain.com =\~ .\*.$ \]\]
* \[\[ hostname.domain.com =\~ ^. \]\]
  ++ echo hostname.domain.com
  ++ sed ‘s/^[ \\t]*//;s/\[ \\t\]*$//’
* domain=hostname.domain.com
* format_domain_idn
* ‘\[’ -z ‘’ ‘\]’
* domain_idn=hostname.domain.com
* \[\[ hostname.domain.com = *\[!\[:ascii:\]\]* \]\]
  ++ idn2 --quiet -d hostname.domain.com
* domain_utf=hostname.domain.com
* check_args 2 2 ‘USER DOMAIN \[ANTISPAM\] \[ANTIVIRUS\] \[DKIM\] \[DKIM_SIZE\] \[RESTART\] \[REJECT_SPAM\]’
* ‘\[’ 2 -gt 2 ‘\]’
* is_format_valid user domain antispam antivirus dkim dkim_size restart reject
* for arg_name in $\*
* eval ‘arg=$user’
  ++ arg=user4
* ‘\[’ -n user4 ‘\]’
* case $arg_name in
* is_user_format_valid user4 user
* ‘\[’ 5 -eq 1 ‘\]’
* ‘\[’ -n ‘’ ‘\]’
* \[\[ user4 =\~ ^[\[:alnum:\]]\[-|.|\_\[:alnum:\]\]{0,28}\[\[:alnum:\]\]$ \]\]
* ‘\[’ user4 ‘!=’ user4 ‘\]’
* \[\[ ‘’ == \\t\\r\\u\\e \]\]
* for arg_name in $\*
* eval ‘arg=$domain’
  ++ arg=hostname.domain.com
* ‘\[’ -n hostname.domain.com ‘\]’
* case $arg_name in
* is_domain_format_valid hostname.domain.com
* object_name=domain
* exclude=‘\[!|@|#|$|^|&|\*|(|)|+|=|{|}|:|,|<|>|?|\_|/||"|’'‘|;|%|\`| \]’
* \[\[ hostname.domain.com =\~ \[!|@|#|$|^|&|\*|(|)|+|=|{|}|:|,|<|>|?|\_|/||"|'|;|%|\`| \] \]\]
* \[\[ hostname.domain.com =\~ ^[0-9]+$ \]\]
* \[\[ hostname.domain.com =\~ .. \]\]
  ++ printf ‘\\t’
* \[\[ hostname.domain.com =\~          \]\]
* \[\[ hostname.domain.com = \\w\\w\\w \]\]
* is_no_new_line_format hostname.domain.com
  ++ echo hostname.domain.com
  ++ head -n1
* test=hostname.domain.com
* \[\[ hostname.domain.com != \\s\\r\\v\\a\\u.\\h\\o\\l\\i\\d\\a\\y\\p\\a\\r\\k\\s.\\i\\n\\f\\o \]\]
* for arg_name in $\*
* eval ‘arg=$antispam’
  ++ arg=yes
* ‘\[’ -n yes ‘\]’
* case $arg_name in
* is_boolean_format_valid yes antispam
* ‘\[’ yes ‘!=’ yes ‘\]’
* for arg_name in $\*
* eval ‘arg=$antivirus’
  ++ arg=yes
* ‘\[’ -n yes ‘\]’
* case $arg_name in
* is_boolean_format_valid yes antivirus
* ‘\[’ yes ‘!=’ yes ‘\]’
* for arg_name in $\*
* eval ‘arg=$dkim’
  ++ arg=yes
* ‘\[’ -n yes ‘\]’
* case $arg_name in
* is_boolean_format_valid yes dkim
* ‘\[’ yes ‘!=’ yes ‘\]’
* for arg_name in $\*
* eval ‘arg=$dkim_size’
  ++ arg=2048
* ‘\[’ -n 2048 ‘\]’
* case $arg_name in
* is_int_format_valid 2048
* \[\[ 2048 =\~ ^[0-9]+$ \]\]
* for arg_name in $\*
* eval ‘arg=$restart’
  ++ arg=
* ‘\[’ -n ‘’ ‘\]’
* for arg_name in $\*
* eval ‘arg=$reject’
  ++ arg=no
* ‘\[’ -n no ‘\]’
* case $arg_name in
* is_boolean_format_valid no reject
* ‘\[’ no ‘!=’ yes ‘\]’
* ‘\[’ no ‘!=’ no ‘\]’
* is_system_enabled exim4 MAIL_SYSTEM
* ‘\[’ -z exim4 ‘\]’
* ‘\[’ exim4 = no ‘\]’
* is_object_valid user USER user4
* ‘\[’ USER = USER ‘\]’
  ++ readlink -f /usr/local/hestia/data/users/user4
* tstpath=/usr/local/hestia/data/users/user4
  ++ dirname /usr/local/hestia/data/users/user4
  ++ readlink -f /usr/local/hestia/data/users
* ‘\[’ /usr/local/hestia/data/users ‘!=’ /usr/local/hestia/data/users ‘\]’
* ‘\[’ ‘!’ -d /usr/local/hestia/data/users/user4 ‘\]’
* is_object_unsuspended user USER user4
* ‘\[’ USER = USER ‘\]’
  ++ grep ‘SUSPENDED=’'‘yes’'‘’
  ++ cat /usr/local/hestia/data/users/user4/user.conf
* spnd=
* ‘\[’ -n ‘’ ‘\]’
  ++ /usr/local/hestia/bin/v-list-mail-domain user4 hostname.domain.com plain
  ++ cut -f 1
* ‘\[’ ‘Error: mail domain hostname.domain.com doesn’''t exist ’ ‘!=’ hostname.domain.com ‘\]’
* is_domain_new mail hostname.domain.com
* type=mail
* for object in ${2//,/ }
* ‘\[’ -n nginx ‘\]’
* is_web_domain_new hostname.domain.com mail
  ++ grep -F -H ‘DOMAIN=’'‘hostname.domain.com’'‘’ /usr/local/hestia/data/users/admin/web.conf /usr/local/hestia/data/users/user4/web.conf
* web=‘/usr/local/hestia/data/users/admin/web.conf:DOMAIN=’'‘hostname.domain.com’'’ IP=‘'‘12.34.56.78’'’ IP6=‘'’‘'’ FASTCGI_DURATION=‘'’‘'’ FASTCGI_CACHE=‘'’‘'’ CUSTOM_PHPROOT=‘'’‘'’ CUSTOM_DOCROOT=‘'’‘'’ ALIAS=‘'’‘'’ TPL=‘'‘default’'’ SSL=‘'‘yes’'’ SSL_HSTS=‘'‘yes’'’ SSL_FORCE=‘'‘yes’'’ SSL_HOME=‘'‘same’'’ LETSENCRYPT=‘'‘yes’'’ FTP_USER=‘'’‘'’ FTP_PATH=‘'’‘'’ FTP_MD5=‘'’‘'’ BACKEND=‘'‘default’'’ PROXY=‘'‘default’'’ PROXY_EXT=‘'’‘'’ STATS=‘'’‘'’ STATS_USER=‘'’‘'’ AUTH_HASH=‘'’‘'’ AUTH_USER=‘'’‘'’ REDIRECT_CODE=‘'’‘'’ REDIRECT=‘'’‘'’ STATS_CRYPT=‘'’‘'’ U_DISK=‘'‘1’'’ U_BANDWIDTH=‘'‘0’'’ SUSPENDED=‘'‘no’'’ TIME=‘'‘07:05:39’'’ DATE=‘'‘2023-11-25’'’’
* ‘\[’ -n ‘/usr/local/hestia/data/users/admin/web.conf:DOMAIN=’'‘hostname.domain.com’'’ IP=‘'‘12.34.56.78’'’ IP6=‘'’‘'’ FASTCGI_DURATION=‘'’‘'’ FASTCGI_CACHE=‘'’‘'’ CUSTOM_PHPROOT=‘'’‘'’ CUSTOM_DOCROOT=‘'’‘'’ ALIAS=‘'’‘'’ TPL=‘'‘default’'’ SSL=‘'‘yes’'’ SSL_HSTS=‘'‘yes’'’ SSL_FORCE=‘'‘yes’'’ SSL_HOME=‘'‘same’'’ LETSENCRYPT=‘'‘yes’'’ FTP_USER=‘'’‘'’ FTP_PATH=‘'’‘'’ FTP_MD5=‘'’‘'’ BACKEND=‘'‘default’'’ PROXY=‘'‘default’'’ PROXY_EXT=‘'’‘'’ STATS=‘'’‘'’ STATS_USER=‘'’‘'’ AUTH_HASH=‘'’‘'’ AUTH_USER=‘'’‘'’ REDIRECT_CODE=‘'’‘'’ REDIRECT=‘'’‘'’ STATS_CRYPT=‘'’‘'’ U_DISK=‘'‘1’'’ U_BANDWIDTH=‘'‘0’'’ SUSPENDED=‘'‘no’'’ TIME=‘'‘07:05:39’'’ DATE=‘'‘2023-11-25’'’’ ‘\]’
* ‘\[’ mail == web ‘\]’
  ++ echo ‘/usr/local/hestia/data/users/admin/web.conf:DOMAIN=’'‘hostname.domain.com’'’ IP=‘'‘12.34.56.78’'’ IP6=‘'’‘'’ FASTCGI_DURATION=‘'’‘'’ FASTCGI_CACHE=‘'’‘'’ CUSTOM_PHPROOT=‘'’‘'’ CUSTOM_DOCROOT=‘'’‘'’ ALIAS=‘'’‘'’ TPL=‘'‘default’'’ SSL=‘'‘yes’'’ SSL_HSTS=‘'‘yes’'’ SSL_FORCE=‘'‘yes’'’ SSL_HOME=‘'‘same’'’ LETSENCRYPT=‘'‘yes’'’ FTP_USER=‘'’‘'’ FTP_PATH=‘'’‘'’ FTP_MD5=‘'’‘'’ BACKEND=‘'‘default’'’ PROXY=‘'‘default’'’ PROXY_EXT=‘'’‘'’ STATS=‘'’‘'’ STATS_USER=‘'’‘'’ AUTH_HASH=‘'’‘'’ AUTH_USER=‘'’‘'’ REDIRECT_CODE=‘'’‘'’ REDIRECT=‘'’‘'’ STATS_CRYPT=‘'’‘'’ U_DISK=‘'‘1’'’ U_BANDWIDTH=‘'‘0’'’ SUSPENDED=‘'‘no’'’ TIME=‘'‘07:05:39’'’ DATE=‘'‘2023-11-25’'’’
  ++ cut -f 7 -d /
* web_user=admin
* ‘\[’ admin ‘!=’ user4 ‘\]’
* check_result 4 ‘Web domain hostname.domain.com exists’
* ‘\[’ 4 -ne 0 ‘\]’
* local err_code=4
* \[\[ -n ‘’ \]\]
* echo ‘Error: Web domain hostname.domain.com exists’
  Error: Web domain hostname.domain.com exists
* log_event 4 ’ ‘'‘user4’'’ ‘'‘hostname.domain.com’'’’
* ‘\[’ -z ‘’ ‘\]’
  ++ date ‘+%F %T’
  ++ basename v-add-mail-domain
* LOG_TIME=‘2026-03-17 16:08:47 v-add-mail-domain’
* ‘\[’ 4 -eq 0 ‘\]’
* echo ‘2026-03-17 16:08:47 v-add-mail-domain  ‘'‘user4’'’ ‘'‘hostname.domain.com’'’ \[Error 4\]’
* exit 4

Move web domain hostname.domain.com to user4 and then add the mail domain or create the mail domain for hostname.domain.com using the admin user.

2 Likes

Hi @sahsanu, thanks!

  1. Creating the mail domain “hostname.domain.com” with the user “admin” didn’t work; it returned the same error as before.

  2. What did work successfully was moving “hostname.domain.com” to “user4,” and then i was able to successfully create mail domain for “hostname.domain.com.”

(Note for anyone who encounters the same problem: for me, “user4” is the user who owns "domain.com”)

Have a good day!
I owe you a beer.

2 Likes