Control Web Panel
WebPanel => CentOS 7 Problems => Topic started by: Xtended2025 on March 13, 2025, 08:08:19 AM
-
Due to lack of space in centos-root, I am trying to change the location of the mail folder from /var/vmail to /home/vmail.
I used this tutorial:
https://wiki.centos-webpanel.com/move-varvmail-to-another-partition
I also changed in /etc/postfix/main.cf
virtual_mailbox_base = /var/vmail
to
virtual_mailbox_base = /home/vmail
And in /etc/dovecot/dovecot.conf
mail_location = maildir:/var/vmail/%d/%n
to
mail_location = maildir:/home/vmail/%d/%n
I restarted postfix and dovecot but when I try to log in to Roundcube, I get the error:
Cannot connect to imap server
Where am I going wrong?
:(
-
1. Make sure dovecot is up and works.
2. Make sure access permissions and owner of the folder:
/home/vmail
are correct.
3. Check mail logs to investigate the problem:
/var/log/maillog
4. If you decided to move some system folder to another location then I recommend to follow the steps like:
mv /var/vmail /home/
ln -s /home/vmail /var/vmail
-
Instead of mv i've used rsync -av. After that i've double checked and all the files and folders are there and are correct (home/vmail). And have the right permissions (i've used chmod 770 /home/vmail and chown vmail.mail /home/vmail
Maybe I should also restart cwpsrv, apache and nginx?
-
The access permissions 777 or 770 not always are correct. Some applications/system services check access permissions and if they aren't strict enough the service fails for security reasons.
Check the files/folders inside /home/vmail/DOMAIN.COM. The should belong to "USER:vmail".
No, you don't need to restart cwp,nginx,apache.
Check mail and roundube log files. The log files are the best friend for INVESTIGATION. Currently we are guessing where the problem is.
-
Folders inside /home/vmail belongs to vmail:mail and have permission 700
-
I did a test with one of the folders in /home/vmail
chown -R USER:mail /home/vmail/USER.ro
Then from cpanel I created an email address test@USER.ro
I sent an email that I received.
But the email address is still created in /var/vmail/USER.ro and not in /home/vmail/USER.ro ???
-
remove /var/vmail and create a symlink from /var/vmail to /home/vmail:
rm -rf /var/vmail
ln -s /home/vmail /var/vmail
-
The symbolic link is allready made.
ls -l /var/vmail
Output:
lrwxrwxrwx 1 root root 11 Mar 9 22:32 vmail -> /home/vmail/
I allreay moved /var/vmail
The folder /var/vmail contains only 2 clients left, The rest of 10 mail clients are allready moved to /home/vmail
But when i accesed an account Roundcube directly from cPanel (from that 10 account that are allready moved to /home/vmail), it connects to imap but none of the mails are loaded (Inbox empty, Sent, empty)...I should have a lot of e-mails in Inbox and Sent, and phisically exists on /home/vmail/USER
-
The symbolic link is allready made.
The folder /var/vmail contains only 2 clients left, The rest of 10 mail clients are allready moved to /home/vmail
The link doesn't exist. There could be the symlink OR folder. Check it once again.