"User's Directory Already Exists" Error When Creating an Email Account ====================================================================== .. contents:: How the Issue Manifests ----------------------- When creating a new email account in SiteWorx, the action fails with an error stating "User's directory already exists" in the GUI. .. image:: /images/troubleshoot-userdir-exists.png There is also an error like this in ``~iworx/var/log/iworx.log``: .. code-block:: 2021-06-18 16:21:31.00690 [b8lndq-3rtn-33jt-WEB] [INFO] : vadduser barfed :( : /xhr.php 2021-06-18 16:21:31.00699 [b8lndq-3rtn-33jt-WEB] [INFO] : Error: User's directory already exists : /xhr.php Common Causes of the Issue -------------------------- - `Incorrect Vpopmail Permissions`_ - `Misconfigured Mail Directory`_ - `Incorrect SiteWorx Permissions`_ - `Account Over Quota`_ - `Incorrect or Missing vchkpw or vpopmail User/Group Settings`_ Troubleshooting Steps --------------------- Incorrect Vpopmail Permissions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The most common cause of this issue is incorrect permissions somewhere under the ``/var/vpopmail`` directory, most likely with a script under ``/var/vpopmail/bin``. As it can be tedious to try to locate and resolve each specific permissions issue, it is often easier to simply reinstall vpopmail, as that will regenerate the associated files with the correct permissions. #. Log in to the server at the CLI as root, either via SSH or from the terminal #. At the CLI, run the following to reinstall vpopmail: .. code-block:: yum reinstall vpopmail Misconfigured Mail Directory ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``vadduser`` can fail if items are missing from either the SiteWorx account's mail directory under ``/home/{unixuser}/var/{domain.com}/mail`` or an email account's directory, located under ``/home/{unixuser}/var/{domain.com}/mail/{user}/Maildir``, replacing ``{unixuser}``, ``{domain.com}``, and ``{user}`` with the corresponding informaion. #. Log in to the server at the CLI as root, either via SSH or from the terminal #. At the CLI, navigate to ``/home/{unixuser}/var/{domain.com}/mail``. The following is an example of a directory with the correct files intact, with example email boxes for ``postmaster`` and ``user``: .. code-block:: [root@server ~]# cd /home/domainco/var/domain.com/mail/ [root@server mail]# ls -la total 4 drwx--s--x 5 vpopmail domainco 95 Nov 1 12:56 . drwx--x--x 12 iworx iworx 174 Nov 1 11:26 .. -rw------- 1 vpopmail domainco 0 Nov 1 11:26 .bounceon drwxrws--- 2 vpopmail iworx 6 Nov 1 11:26 .filterrules -rw------- 1 vpopmail domainco 58 Nov 1 11:26 .qmail-default drwx------ 3 vpopmail domainco 21 Nov 1 11:26 postmaster drwx--x--x 3 vpopmail domainco 37 Nov 1 12:56 user [root@server mail]# #. If the default files exist in the ``mail`` directory, navigate to ``/home/{unixuser}/var/{domain.com}/mail/{user}/Maildir`` for each user, to check the directory structure. The following is an example of a directory with the correct files intact, for the email box ``user``: .. code-block:: [root@server user]# cd /home/domainco/var/domain.com/mail/user/Maildir/ [root@server Maildir]# ls -la total 16 drwx------ 7 vpopmail domainco 217 Nov 1 12:56 . drwx--x--x 3 vpopmail domainco 37 Nov 1 12:56 .. drwx------ 5 vpopmail root 108 Nov 1 12:56 .Learn Ham drwx------ 5 vpopmail root 108 Nov 1 12:56 .Learn Spam drwx------ 2 vpopmail domainco 6 Nov 1 11:27 cur -rw------- 1 vpopmail vchkpw 51 Nov 1 12:56 dovecot-uidlist -rw------- 1 vpopmail vchkpw 8 Nov 1 12:56 dovecot-uidvalidity -r--r--r-- 1 vpopmail vchkpw 0 Nov 1 12:56 dovecot-uidvalidity.63614fc4 -rw------- 1 vpopmail vchkpw 236 Nov 1 12:56 dovecot.index.log -rw------- 1 vpopmail vchkpw 492 Nov 1 12:56 dovecot.list.index.log drwx------ 2 vpopmail domainco 6 Nov 1 11:27 new drwx------ 2 vpopmail domainco 6 Nov 1 11:27 tmp [root@server Maildir]# Incorrect SiteWorx Permissions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect permissions for files and directories located under a SiteWorx account's ``var`` directory can can cause ``vadduser`` to fail when attempting to create a new email box. Information on how to run the SiteWorx permissions fix tool can be found :doc:`here `. Account Over Quota ^^^^^^^^^^^^^^^^^^ If a SiteWorx account is over its storage quota, new email boxes cannot be added. #. Log into NodeWorx from the browser (https://ip.ad.dr.ess:2443/nodeworx) #. Navigate to **SiteWorx > Accounts** #. Quota information for each SiteWorx account can be found in the **Storage** column .. image:: /images/nw-siteworx-accounts.png :alt: siteworx accounts page Incorrect or Missing vchkpw or vpopmail User/Group Settings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #. Log in to the server at the CLI as root, either via SSH or from the terminal #. At the CLI, use ``grep`` to check the listing for ``vchkpw`` in ``/etc/group``. The following is an example of the correct group information: .. code-block:: [root@server ~]# grep vchkpw /etc/group vchkpw:x:104:iworx,iworx-horde [root@server ~]# #. Use ``grep`` to check the listing for ``vpopmail`` in ``/etc/passwd``. The following is an example of the correct user information: .. code-block:: [root@server ~]# grep vpopmail /etc/passwd vpopmail:x:108:104:interworx-unix-users:/home/vpopmail:/bin/true [root@server ~]#