Skip to content
  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Solutions
    By Role
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    By Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    By Cloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    Partner Program
    Exclusive discounts, benefits and exposure to take your business to the next level
    Become a partner
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    Explore Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    Key Topics
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    Feature Packs
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    Featured Extension
    SocialBee
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • Extension
  • Pricing
  • Extensions
  • Help Center
  • More
    • Careers
    • Events
    • Plesk University
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL

Knowledge Base

 How to change default location of mailboxes in Plesk for Linux

 
almalinuxcentoscloudlinuxdebiandomains

Question

By default, Plesk stores all mailboxes in the directory /var/qmail/mailnames/. How to change this location?

Answer

Warning: Changing the mailboxes location on Plesk servers with Plesk Premium Email installed is currently not supported. Such a possibility will be added in the future.

  1. Find what SMTP and IMAP/POP3 servers are in use: Log in to Plesk and go to Tools & Settings > Mail Server Settings:

    0.png

  2. Connect to the server using SSH.

  3. Stop the SMTP service:

    # service postfix stop

  4. Open the file/etc/psa/psa.conf in a text editor and change the value of the variable PLESK_MAILNAMES_D: specify a new location for mailbox directory:

    # grep PLESK_MAILNAMES_D /etc/psa/psa.conf
    PLESK_MAILNAMES_D /new_directory/mailnames

    Note: Capital letters must not be used in the name of the directory that will be used as the new location for mailboxes.

    Note: To avoid performance degradation, the new location for the mailboxes directory should be located in the local file system - it should not be mounted as a network share, such as NFS.

  5. Copy the current mailboxes directory to the parent directory for the new mailboxes directory:

    # cp -ap /var/qmail/mailnames /new_directory

    For example, if the mailboxes directory is /mnt/mailnames, the command should look like this:

    # cp -ap /var/qmail/mailnames /mnt

    Warning: The directory /var/qmail/mailnames should not be removed. Only domains' directories can be removed or moved out from there if necessary.

  6. Change the configuration of the IMAP/POP3 server:

    • Dovecot:

      1. Create a new custom file to add variables in it:

        # touch /etc/dovecot/conf.d/99-custom_dir.conf

      2. Copy the actual location from the file /etc/dovecot/dovecot.conf:

        # egrep -i mail_home|mail_location /etc/dovecot/dovecot.conf
        mail_home = /var/qmail/mailnames/%Ld/%Ln
        mail_location = maildir:/var/qmail/mailnames/%Ld/%Ln/Maildir

      3. Add those 2 variables in the custom file: /etc/dovecot/conf.d/99-custom_dir.conf. Then change them to the custom location and add :UTF-8 to the end of the second parameter:

        # egrep -i mail_home|mail_location /etc/dovecot/conf.d/99-custom_dir.conf
        mail_home = /new/mailnames/directory/%Ld/%Ln
        mail_location = maildir:/new/mailnames/directory/%Ld/%Ln/Maildir:UTF-8

      4. Restart Dovecot and pc-remote service:

        # service dovecot restart
        # service pc-remote restart

    • Courier-IMAP:
      No need to change configuration, just restart all Courier services:

      # service courier-authdaemon restart
      # service courier-imapd restart
      # service courier-imaps restart
      # service courier-pop3d restart
      # service courier-pop3s restart

  7. After all the steps are done, start SMTP service and reconfigure mail services:

    # service postfix start
    # plesk repair mail -y

  8. Set the new home directory for the user popuser. In the file /etc/passwd, change /var/qmail/ to the new location:

    • For CentOS/RHEL/CloudLinux/AlmaLinux:

      From:

      popuser:x:30:31:POP3 service user:/var/qmail/popuser:/sbin/nologin

      To:

      popuser:x:30:31:POP3 service user:/<new_mailnames_directory>/popuser:/sbin/nologin

    • For Debian/Ubuntu:

      From:

      popuser:x:30:31:POP3 service user:/var/qmail/popuser:/bin/false

      To:

      popuser:x:30:31:POP3 service user:/<new_mailnames_directory>/popuser…

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Exploring Plesk’s Added Value Solutions So Far in 2023

Read More »

Unveiling Sitejet Builder: The Perfect Match for Your Effortless Website Creation Needs

Read More »

Dynamic List vs. Active List: A Comprehensive Comparison – Unveiling the Ultimate Winner!

Read More »
Knowledge Base

Websites on Plesk server are slow or show error 500 or PHP mail cannot be sent: ap_pass_brigade failed

Read More »

Mail delivery does not work: do not list domain in BOTH mydestination and virtual_mailbox_domains

Read More »

Email header analysis reports SPF failed for localhost IP on mail sent from Plesk hosted mailbox: SPF Authentication : SPF Failed for IP – 127.0.0.1

Read More »

Can’t access mail: Warning: Inotify instance limit for user exceeded

Read More »

Hosting Wiki

  • Django
  • Server Redundancy
  • QMAIL
  • Dovecot
  • Sendmail
  • Postfix
  • Linux Containers
  • Google Cloud CDN
  • Bare Metal Server
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • MongoDB
  • Domain
  • Plesk
  • Web Server
  • DNS Server
  • SSH
  • Network Bandwidth
  • Email Autoresponder
  • Mailing Lists
  • Email Alias
  • Email Virus Protection
  • Email Forwarding
  • Webmail
  • IMAP
  • SMTP
  • POP3

Industry
Partners

industry-partner_ALIBABA
industry-partner_GOOGLEPARTNER
industry-partner_MICROSOFT
industry-partner_REDHAT-r2
industry-partner_ALIBABA
industry-partner_AUTOMATTIC
industry-partner_AWS
industry-partner_DIGITALOCEAN
industry-partner_SCALEWAY
Follow us:
Facebook Twitter Linkedin Youtube Github

COMPANY

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY

Blog
Forums 
Plesk University

First defaul

Company

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE​

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS​

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY​

Blog
Forums
Plesk University

Follow us:
Facebook Twitter Linkedin Youtube Github

© 2025 WebPros International GmbH. All rights reserved. Plesk and the Plesk logo are trademarks of WebPros International GmbH.

Managed with love with Plesk WP Toolkit