• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Change the default location of mailboxes in Debian Stretch

9musashi

Basic Pleskian
Hello, I have a Debian 9 box with Plesk Onyx Version 17.8.11 Update #11

I follow the guide at How to change the default location of mailboxes in Plesk for Linux?

First, I migrate all my subscription via Plesk Migrator Tool before I move the default mail folder location from /var/qmail/mailnames/ to /mnt/MailStorage/mailnames/

But there are 2 problems I have:

1. At the step 9
Code:
# chcon -R -t mail_spool_t <new_mailnames_directory>
It throws a lot of errors
Code:
chcon: can't apply partial context to unlabeled file

2. And at the step 10 (/etc/passwd) there is no
Code:
popuser:x:30:31:POP3 service user:/var/qmail/popuser:/sbin/nologin
there is only a similar line
Code:
popuser:x:30:31:POP3 service user:/var/qmail/popuser:/bin/false
So what I did was just insert this line
Code:
popuser:x:30:31:POP3 service user:/mnt/MailStorage/mailnames/qmail/popuser:/sbin/nologin
after the above line.

So finally in my /etc/passwd I have these 2 lines
Code:
popuser:x:30:31:POP3 service user:/var/qmail/popuser:/bin/false
popuser:x:30:31:POP3 service user:/mnt/MailStorage/mailnames/qmail/popuser:/sbin/nologin

So far there is no problem, but I'm curious did I miss something because I dont want this mailserver has problem in the future because of misconfiguration. I also think the guide may need update for Debian 9.
 
Last edited:
Hey,

you should only have 1 line for each user in /etc/passwd. Delete the first line w/ old path (/var/qmail).

I don't know about chcon/seLinux, but I'm sure you'll find an explanation as to what the errors mean when you google them.
 
On second thought: Why change the default path anyway?
Assuming your goal is to use another partition for the mailbox storage,
you could just copy the content of /var/qmail to a new partition using rsync, then mount it at /var/qmail.

Code:
# rsync -av -A /var/qmail/ /mnt/MailStorage/
# mount | grep "on /mnt/MailStorage" | awk '{print $1;}' | xargs -I "%" sh -c "blkid | grep %"
The second command might fail on some systems, in that case just run blkid and look for the device name of your partition.
Copy the UUID and edit your /etc/fstab to permanently mount the partition at /var/qmail
Code:
UUID=<UUID-GOES-HERE>    /var/qmail     <FSTYPE>      <OPTIONS> 0 0

The " 0 0" at the end is used to specify backup behavior, adjust as needed.
Set "defaults" as options, add "discard" if it's the partition is on a SSD (comma-separated)
Also make sure to delete or comment (#) any lines already present for your partition (UUID or /mnt/MailStorage)
Re-Mount the partition without reboot:
Code:
# mount -a
 
Hey,

you should only have 1 line for each user in /etc/passwd. Delete the first line w/ old path (/var/qmail).

I don't know about chcon/seLinux, but I'm sure you'll find an explanation as to what the errors mean when you google them.

Thank you. I just delete the first line.

On second thought: Why change the default path anyway?
Assuming your goal is to use another partition for the mailbox storage,
you could just copy the content of /var/qmail to a new partition using rsync, then mount it at /var/qmail.
Very good idea. I ever thought to mount as /var/qmail before but worried about Plesk update will ruin it.

I follow the guide Plesk provided (not mount as /var/qmail) because I think it will be safer solution since Plesk itself recommend me to do that way.

Do you think the next Plesk update will overwrite my current config ?
 
Last edited:
Mounting a partition at /var/qmail won't affect plesk.
You should still stop the mail services before you copy the current content of that folder over to the new partition, so there won't be any inconsistencies during migration.

This usecase is basically what mountpoints in linux were designed to do.
Applications won't even notice they are accessing a new partition instead of a root filesystem subfolder.

The only component of Plesk that should care about mount points is the Hardware Diagnostics extension.
If you use it to show statistics about your disk space usage, you can just re-scan for new hardware so the partition shows up in the statistics.
 
Mounting a partition at /var/qmail won't affect plesk.
You should still stop the mail services before you copy the current content of that folder over to the new partition, so there won't be any inconsistencies during migration.

This usecase is basically what mountpoints in linux were designed to do.
Applications won't even notice they are accessing a new partition instead of a root filesystem subfolder.

The only component of Plesk that should care about mount points is the Hardware Diagnostics extension.
If you use it to show statistics about your disk space usage, you can just re-scan for new hardware so the partition shows up in the statistics.

Thank you for your help. I tried to move back to /var/qmail as Warden also has issue with this setup. Plesk should give more clearer information about move mail storage location - should mount it as the same /var/qmail/mailnames to avoid future problems.
 
Back
Top