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
1 |
vi /etc/psa/psa.conf |
Changing “PLESK_MAILNAMES_D” to the desired location…
1 2 |
# 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…
1 |
cp -a /var/qmail /var/vmail |
3. And change the maildirs in Dovecot…
1 |
vi /etc/dovecot/conf.d/15-maildir.conf |
Adding the following…
1 2 3 |
# Plesk Maildirs layout. mail_home = /var/vmail/mailnames/%Ld/%Ln mail_location = maildir:/var/vmail/mailnames/%Ld/%Ln/Maildir |
4. Run…
1 |
/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…
1 |
vi /opt/psa/admin/sbin/spamtrain |
You will see line 8…
1 |
maildir="/var/qmail/mailnames" |
Simply change this to…
1 |
maildir="/var/vmail/mailnames" |
6. Now create the Spamassasin Home Directory…
1 2 3 |
cd /var/vmail/popuser mkdir .spamassassin chown -R popuser:popuser .spamassassin |
7. Lastly we need to update the default file in /etc/default/spamassassin to reflect our change…