Mail Accounts were not listed and accessible after installing mail server manually

Hi,

I have a HestiaCP server where I previously excluded the mail server, it’s used to be a staging server. Now, I’ve tried installing the mail server by editing the installer script, and it seems mostly successful. I can see the mail tab and the mail server configuration, and it’s even handling mail queues, though the mail port is currently blocked. I’m planning to use a relay instead of the server itself.

However, I’m encountering an issue. After creating a mail domain and a mail account, I can’t access the mail account page. It keeps redirecting me back to the mail accounts list within the mail domain page, and I don’t see the account I just created, even though the account counter in the mail menu tab is increasing. I suspect I may have missed a step when editing the installer related to how mail data is stored in the database, but I haven’t been able to pinpoint the problem.

Any help or clues would be greatly appreciated to resolve this issue. Otherwise, I’m considering backing up and reinstalling HestiaCP, though I’d prefer to avoid that.

Here’s the edited script,

Hi @niznet,

Sorry, I don’t have the time or the desire to check the script, there are too many lines to compare.

Can you show the output of these commands? Replace YourUser and example.net by the actual data.

v-list-mail-domains YourUser json
v-list-mail-domain YourUser example.net json
v-list-mail-accounts YourUser example.net json
1 Like

Hi,

I ran these three commands, the first two worked fine, but the last one gave me an error saying “no such file/directory.” I believe this is because when we created the user, the mail directory wasn’t generated yet, as there was no mail server at that time. So when the mail accounts were created, there was no place to store the data. I manually created the directory and recreated the mail domain and accounts, and I can finally see the account page now!


Basically, I just needed to add the missing mail.conf file (if mail support isn’t set up yet) and create the mail directory to get everything working again.

Thanks for the help! Is there anything else I should check to make sure it’s working as intended? It seems fine to me.

Though, I’m facing another issue now, when accessing webmail, it redirects me infinitely due to SSL. Could this be related to the configuration template?

Great!

If I can’t see the error I don’t know what’s going on, but if you think the problem are the templates, execute this command to copy again the mail templates and rebuild the mail domains.

v-update-mail-templates yes

I found more issue when debugging the template issue, there’s no /mail and /conf/mail directory inside /home/user directory.

Tried to create the both directory manually, but I’m unable to create /home/user/conf/mail, getting error say mkdir: cannot create directory ‘mail’: Operation not permitted.

Here’s the output:

root@de:/home/user/conf# v-update-mail-templates yes
mkdir: cannot create directory ‘/home/user/conf/mail’: Operation not permitted
touch: cannot touch '/home/user/conf/mail/domain.com/accounts': No such file or directory
touch: cannot touch '/home/user/conf/mail/domain.com/aliases': No such file or directory
touch: cannot touch '/home/user/conf/mail/domain.com/passwd': No such file or directory
touch: cannot touch '/home/user/conf/mail/domain.com/fwd_only': No such file or directory
touch: cannot touch '/home/user/conf/mail/domain.com/limits': No such file or directory
/usr/local/hestia/func/rebuild.sh: line 632: /home/user/conf/mail/domain.com/ip: No such file or directory
touch: cannot touch '/home/user/conf/mail/domain.com/antispam': No such file or directory
touch: cannot touch '/home/user/conf/mail/domain.com/antivirus': No such file or directory
touch: cannot touch '/home/user/conf/mail/domain.com/reject_spam': No such file or directory
cp: cannot create regular file '/home/user/conf/mail/domain.com/dkim.pem': No such file or directory
/usr/local/hestia/func/rebuild.sh: line 706: /home/user/conf/mail/domain.com/passwd: No such file or directory
/usr/local/hestia/func/rebuild.sh: line 708: /home/user/conf/mail/domain.com/accounts: No such file or directory
sed: can't read /home/user/conf/mail/domain.com/limits: No such file or directory
/usr/local/hestia/func/rebuild.sh: line 722: /home/user/conf/mail/domain.com/limits: No such file or directory
chmod: cannot access '/home/user/conf/mail/domain.com': No such file or directory
chmod: cannot access '/home/user/conf/mail/domain.com/*': No such file or directory
chmod: cannot operate on dangling symlink '/etc/exim4/domains/domain.com'
chown: cannot access '/home/user/conf/mail/domain.com': No such file or directory
chown: cannot access '/home/user/conf/mail/domain.com/passwd': No such file or directory
chown: cannot access '/home/user/conf/mail/domain.com/accounts': No such file or directory
mkdir: cannot create directory ‘/home/user/conf/mail’: Operation not permitted
/usr/local/hestia/func/domain.sh: line 835: /home/user/conf/mail/domain.com/nginx.conf: No such file or directory
grep: /home/user/conf/mail/domain.com/nginx.conf: No such file or directory
chown: cannot access '/home/user/conf/mail/domain.com/nginx.conf': No such file or directory
chmod: cannot access '/home/user/conf/mail/domain.com/nginx.conf': No such file or directory
find: ‘/home/user/conf/mail/’: No such file or directory
------------
root@de:/home/user/conf# nginx -t
nginx: [emerg] open() "/etc/nginx/conf.d/domains/webmail.domain.com.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:129
nginx: configuration file /etc/nginx/nginx.conf test failed

Use these commands:

v-rebuild-users
v-update-mail-templates yes
1 Like

Thank you! That solve the issue

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.