I have moved vmail folder in another disk now cant receive emails.

Started by agonx, November 16, 2020, 01:59:02 PM

Previous topic - Next topic

agonx

I have moved vmail folder to another disk and deleted the var/vmail old folder now i can only send emails but can't receive emails on my MailServer.

[Fri Nov 13 09:30:28.031088 2020] [proxy:error] [pid 4495:tid 140144111712000] [client 46.99.20.52:40254] AH00898: Error reading from remote server returned by /webmail/, referer: https://"TEST".de/webmail/?_task=mail&_mbox=INBOX

Nov 16 14:23:35 imap(info@mydomain.com): Warning: autocreate plugin is deprecated, use mailbox { auto } setting instead
Nov 16 14:23:35 imap(info@mydomain.com): Error: Initializing mail storage from mail_location setting failed: mkdir(/var/vmail/mydomain.com/info) failed: Permission denied (euid=101(vmail) egid=12(mail) missing +w perm: /var, dir owned by 0:0 mode=0755)
Nov 16 14:24:28 imap(f.faka@mydomain.de): Warning: autocreate plugin is deprecated, use mailbox { auto } setting instead
Nov 16 14:24:28 imap(f.faka@mydomain.de): Error: Initializing mail storage from mail_location setting failed: mkdir(/var/vmail/mydomain.de/f.faka) failed: Permission denied (euid=101(vmail) egid=12(mail) missing +w perm: /var, dir owned by 0:0 mode=0755)

After deleting the old vmail folder.


How should i map now because now i have vmail folder on /home2/vmail ?

cinique

Why create another thread on same subject.
YOU decided to move the vmail directory, so YOU should be able to read and act upon the error message.
Take responsibility for your actions.  ::)

agonx

FOA
I have removed the other TOPIC, and second, I am a newbie in Centos and in Servers too, I was able to move the folder from this :
https://wiki.centos-webpanel.com/move-varvmail-to-another-partition tutorial and I know how to fix to normal but only if I move back home2/vmail folder to var/vmail but there is no space in the other disc.

Second:
If you can help me do it if you cant don't reply here sir.

best regards :D

cinique

Confirm:
QuoteStep 4: create a symlink from the new location to old location
ln -s /home/vmail /var/vmail
ls -l /home
ls -l /var

This should verify your given error message:
QuoteError: Initializing mail storage from mail_location setting failed: mkdir(/var/vmail/mydomain.com/info) failed: Permission denied (euid=101(vmail) egid=12(mail) missing +w perm: /var, dir owned by 0:0 mode=0755)
Looks to me like you haven't assigned permissions to your newly created vmail directory.
chown -R vmail:mail /var/vmail

At your own peril.

agonx

Hi, cynique

Well after I made these symlink connections, and this comand chown now the emails are working fine.

chown -R vmail:mail /var/vmail

One last question now the new emails that will come will be saved where? In the folder home2/vmail ?

cinique

Quote from: agonx on November 17, 2020, 10:16:32 AM
One last question now the new emails that will come will be saved where? In the folder home2/vmail ?
Blimey! Are you a millennial or younger? (rhetorical.)
Try some test emails - see for yourself.  ::)

BTW, the developers have already been told that /var/vmail is a stupid place to store emails - they should be contained within each user's home directory. That way quotas are appropriate and user/system backups are made easier, amongst other benefits.

Next you'll be running out of space in /var due to mysql databases and/or logs. Trained sysadmins know that it's a good idea to put /var on a separate partition, when dealing with servers. LVM also helps.

Here's an example from one of my test VPSes:
/dev/mapper/system-root    7.8G  5.5G  1.9G  75% /
/dev/vda1                  488M  271M  182M  60% /boot
/dev/mapper/system-home     40G  2.0G   36G   6% /home
/dev/mapper/system-backup  5.0G  2.5G  2.5G  51% /backup
/dev/mapper/system-var     2.9G  1.4G  1.5G  50% /var
/dev/mapper/system-tmp     2.0G  4.5M  2.0G   1% /tmp

agonx

Hahaha,
I will try some emails,

Thank you for your help cynique :)
btw these are my dev folders, I have creat home2 only for the mails to be stored there.

/dev/sda1        79G   57G   19G  75% /home
/dev/sdb1        50G   19G   29G  40% /home2



best regards to you


FreshLondon

Quote from: agonx on November 17, 2020, 01:19:13 PM
btw these are my dev folders, I have creat home2 only for the mails to be stored there.

/dev/sda1        79G   57G   19G  75% /home
/dev/sdb1        50G   19G   29G  40% /home2


Don't forget to set up disc quota on the new disc or the mail won't be inside the users allocated storage quota 👍