Having trouble setting up mail

I’m testing Hestia for the first time ever. Currently messing around on my test server. And seems like I made a bunch of mistakes which I don’t know how to fix :joy:

Server is running on Debian 13.

  1. I set up my main domain, added LE SSL successfully (new.domain.com)

  2. Created mail domain and added DNS records for mail.new.domain.com (A) and webmail.new.domain.com (CNAME points to mail. )

  3. when I try to create SSL for mail domain it fails with error

    Error: Let’s Encrypt validation status 400 (mail.new.domain.com). Details: 403:“IP: Invalid response from http://mail.new.domain.com/.well-known/acme-challenge/ABCD: 404”

  4. I checked the forums for various fixes. Suspending/unsuspending the domain then retrying didn’t help. Trying to issue ssl via command line also didn’t help. Then I saw that Roundcube needs webmail.\* so I went to add that cname, and then realised that Roundcube isn’t installed.. v-add-sys-roundcube didn’t work because mysql isn’t installed D:

  5. Then I realised my mistake - I did not check any DBs during install :joy: (I used command builder at Install | Hestia Control Panel )

So now I’m scratching my head. I’m not entirely sure if Roundcube is needed at all in the process of issuing that SSL, but I think I’d like to have it after all (my mistake not figuring out that it would need some DB). But also if I go to the failed acme challenge link it does give me 404, so it might be an entirely separate problem?

I’d appreciate some directions.

Show the output of these commands (replace YourUser and YourDomain with the actual user and domain):

cat /home/YourUser/conf/mail/YourDomain/nginx.conf
cat /home/YourUser/conf/mail/YourDomain/nginx.conf_letsencrypt

To be able to debug it, it’s important to know the actual domain.

alright, it’s a temporary one anyway: new.dreamdb.com

so, nginx.conf doesn’t exist under the mail folder (there is one in the web folder), and nginx.conf_letsencrypt looks like this:

location ~ "^/\.well-known/acme-challenge/(.*)$" {
    default_type text/plain;
    return 200 "$1.8BfNKg5NNTiEMSB0sCl0ULiqiObNVBX621tbWL3pIzw";
}

Your mail domain is not serving the acme challenge.

Mmmmm, show the output of this command:

For the below commands, replace YourUser with the actual user.

ls -la /home/YourUser/conf/mail/new.dreamdb.com/

Also, these ones:

v-list-mail-domains YourUser json
v-list-sys-config json | jq -r '.[].WEBMAIL_SYSTEM'

dir:

drwxrwx--x 2 Debian-exim mail 4096 Nov  5 15:00 .
drwxr-xr-x 3 root        root 4096 Nov  5 13:56 ..
-rw-rw---- 1 Debian-exim mail    0 Nov  5 15:00 accounts
-rw-rw---- 1 Debian-exim mail    0 Nov  5 15:00 aliases
-rw-rw---- 1 Debian-exim mail 1704 Nov  5 15:00 dkim.pem
-rw-rw---- 1 Debian-exim mail    0 Nov  5 15:00 fwd_only
-rw-rw---- 1 Debian-exim mail   13 Nov  5 15:00 ip
-rw-rw---- 1 Debian-exim mail    0 Nov  5 15:00 limits
-rw-rw---- 1 Debian-exim mail  147 Nov  5 16:22 nginx.conf_letsencrypt
lrwxrwxrwx 1 Debian-exim mail   60 Nov  5 13:59 nginx.ssl.conf_letsencrypt -> /home/USER/conf/mail/new.dreamdb.com/nginx.conf_letsencrypt
-rw-rw---- 1 dovecot     mail    0 Nov  5 15:00 passwd

v-list-mail-domains User json:

{
    "new.dreamdb.com": {
        "ANTIVIRUS": "no",
        "ANTISPAM": "no",
        "REJECT": "no",
        "RATE_LIMIT": "200",
        "DKIM": "yes",
        "CATCHALL": "",
        "ACCOUNTS": "1",
        "U_DISK": "0",
        "SSL": "no",
        "SUSPENDED": "no",
        "TIME": "13:56:11",
        "DATE": "2026-11-05",
        "WEBMAIL_ALIAS": "",
        "WEBMAIL": ""
    }
}

v-list-sys-config json | jq -r '.\[\].WEBMAIL_SYSTEM' returns an empty line.

v.rebuild-mail-domain YourUser new.dreamdb.com yes
ls -la /home/YourUser/conf/mail/new.dreamdb.com/

If the rebuild doesn’t work, maybe you should install mysql and roundcube but using the Hestia way.

Right, I already tried the rebuild once, and that’s how I found out that I needed Roundcube. Just tried it again, it fails with:
Error: roundcube type is invalid

How do I install it + mysql using the Hestia way? I saw a similar much older thread on here but the link for the install script was dead, so I couldn’t try it.

Execute this script to install MariaDB:

EDIT the script is not ready yet, I need to fix it. I’ve fixed the script and can be used now.

curl -fsSLm30 https://7j.gg/instmdb | sudo bash -s --

If you get no errors:

v-add-sys-roundcube

I forgot that you are using Debian 13, if you get an error like ERROR: installto.sh failed is because Debian 13 updated recently rsync to be strict with the use of symlinks and the Roundcube’s script installto.sh uses it.

Hestia 1.10.6 will fix it but meanwhile.

cd /usr/local/hestia/bin
mv v-add-sys-roundcube v-add-sys-roundcube.bak
curl -fsSLm30 https://raw.githubusercontent.com/hestiacp/hestiacp/refs/heads/main/bin/v-add-sys-roundcube -o v-add-sys-roundcube
chmod +x v-add-sys-roundcube
sed -i 's/1\.7\.4/1.7.3/' /var/lib/roundcube/program/include/iniset.php
v-add-sys-roundcube

Thank you so much for the help!

I think everything went well without the additional edits:

  1. the script has installed MariaDB successfully.
  2. I added Roundcube with the normal v-add-sys-roundcube.
  3. Tried to rebuild the mail domain again. I saw that nginx and apache configs were added to the folder.
  4. Went to poke the panel and successfully added SSL!
  5. There was another issue after that: Roundcube opened but threw an “Oops something went wrong”, so I snooped around the logs and saw that it was missing Pdo\Mysql, so I installed specifically php8.5-mysql. After that the login page finally showed, yippee.

I tried sending an email to gmail, and of course it bounced back, because I didn’t add any extra DNS records, so I’m going to wrestle with that for now, we’ll see if something new comes up.

Sorry, I forgot to add it to the script, I’ll add it.

Glad you get it working now.