Tag Archives: Plesk

Moving Plesks Mail Directory

This is an update to a kb article at Plesk KB6312 on How to move the Plesk Mail Directory.
I will use the example folder /var/vmail

1. Edit psa.conf

# nano /etc/psa/psa.conf

Changing “PLESK_MAILNAMES_D” to the desired location…

# Location of qmail maildirs
PLESK_MAILNAMES_D /var/vmail/mailnames

2. Then run the following command which will create the new folder and copy the contents of the qmail directory to the new directory…

# cp -a /var/qmail /var/vmail

3. And change the maildirs in Dovecot…

# nano /etc/dovecot/conf.d/15-maildir.conf

Adding the following…

# Plesk Maildirs layout.
mail_home = /var/vmail/mailnames/%Ld/%Ln
mail_location = maildir:/var/vmail/mailnames/%Ld/%Ln/Maildir

4. Run…

# /opt/psa/admin/bin/mchk --with-spam

This will update the following configuration files

/etc/postfix/main.cf
/etc/postfix/master.cf
/etc/default/spamassassin

with the correct paths to your new Maildir.

5. We need to edit the spamtrain script…

# nano /opt/psa/admin/sbin/spamtrain

You will see line 8…

maildir="/var/qmail/mailnames"

Simply change this to…

maildir="/var/vmail/mailnames"

6. Now create the Spamassasin Home Directory…

# cd /var/vmail/popuser
# mkdir .spamassassin
# chown -R popuser:popuser .spamassassin

And restart Postfix and SpamAssassin..

# service posfix restart && service spamassassin restart

Bind Fails to Start

If you are running Plesk on a Ubuntu server and Bind fails to start the likely cause is AppArmor not being configured for Plesk’s chrooted environment.
All you have to do is add the path to the usr.sbin.named file.

1. Locate the file…

# nano /etc/apparmor.d/local/usr.sbin.named

2. Add the following path to the file…

/var/named/run-root/** rw,
/var/named/run-root/usr/lib/**/libgost.so rm,

including the comma.

3. Now restart AppArmor…

# service apparmor restart

4. Now you can start Bind…

# service bind9 start

I hope that helps some people.

Note: We used the /etc/apparmor.d/local/usr.sbin.named file to make sure our addition is permanent, and the package manager doesn’t over write it.