[Solved] Failed to create user directories

Case:

  1. Setup Mail-in-a-Box on a brand new Ubuntu 14.04.5 Server for Domain (e.g.) mailinabox.email
  2. System not live as email server mailinabox.email (no Mail-in-a-box System) is running on another machine atm.
  3. Setup went well. Of course currently only available at the direct IP (e.g.) 45.454.544.54.
  4. Login at https://45.454.544.54/admin works perfectly with the first admin created during the setup.

Problem:

When trying to create a new mail user on the admin GUI, it works and the email address (e.g.) xy@mailinabox.email shows up under the section “existing mail users”. This can be repeated and many users can be created. Although what it does not do: It does not create the user directory under the path home/user-data/mail/mailboxes/mailinabox.email/. In fact, it does not create it anywhere. But in the GUI, even with logout/login, they are shown perfectly. No permissions etc. has been modified. In fact, Ubuntu has not been touched manually. Permission for “mailboxes” is on 753 (seems OK) and the users seem to be written in “users.sqlite”.

Any help? Thank ya.

Addendum: “curl -s https://mailinabox.email/setup.sh | sudo bash” (and going to the process again) did not helped.

When you log in on the new account, does that work? If so, are the directories created afterwards?

I can login through the user panel into https://45.454.544.54/admin with the user that has been created at the setup. There is also a folder in home/user-data/mail/mailboxes/mailinabox.email/. with that username (e.g. admin123) and the dovecot files. When i try to open a connection to it, it connects, but is unable to verify account name and password. The connection i tried are:

username: admin123@mailinabox.email password: xy account type: IMAP incoming ms: 45.454.544.54 outgoing ms: 45.454.544.54
username: admin123 password: xy account type: IMAP incoming ms: 45.454.544.54 outgoing ms: 45.454.544.54

I am aware that my Box is currently not running on the Domainname that the E-Mailserver should run, but on a bare IP. I need to setup the Box before i can transfer the Domainname etc because i need to transfer the mail directories from an old running server to the new one before i go life with the Box. But did set up the new Box with the Domainname that will be on the box. -> Mail-in-a-Box running on 45.454.544.54 with the (not yet active) domainname mailinabox.email installed. However, this should imho not block the possibility in some way to create new users, or am I wrong?

Update:

If I create a user in the terminal directly (API method) with the following command:

curl -X POST -d “email=testexample@mailinabox.email” -d “password=test” https://mailinabox.email/admin/mail/users/add --insecure --user xy

then the host can not be resolved. That makes sense. If i use the command:

curl -X POST -d “email=testexample@mailinabox.email” -d “password=test” https://45.454.544.54/admin/mail/users/add --insecure --user xy

then the user gets created and shows up in the webGUI.

However, still the user Directory in home/user-data/mail/mailboxes/mailinabox.email/. is not created.

It makes no sense and I have no idea why the user directories dont get created. I have set up the whole ubuntu again and installed mail-in-a-box on this fresh ubuntu again, and even the admin user (created while mail-in-a-box Setup) does this time has no user Directory. In fact this time the mailboxes-directory is completely empty.

Are you experiencing an actual problem or you just really like directories?

@JoshData See initial message under “Problem”. And yes, the problem exists and Mail-in-a-box seems to not create the user directories, which leads to the case that no mailusers can be created and used. although shown in the admin GUI.

I can only imagine that in the script somewhere, when the hostname not routes to itself (dns wise), a warning appears (stdout/stderr) and the rest of the execution is stopped. that would be a bug actually.

Are you getting an error message when sending mail?

@JoshData Thank you for your fast reply. Please read my posts under this subject. We are not even close to sending E-Mails; by it’s very nature when users can not be created (and their directories do not exist at all anyway), no E-Mails can be sent.Or am I missing something? It’s a problem that’s showing up in the setup-stage.

You’re making things up. Go try sending an email.

@JoshData outbound mails get rejected, as domain is not pointed to box yet (see above) - this is an expected behavior. (“450 sender address rejected domain not found)”

when i do a login on webmail (45.454.544.54/mail) (roundcube login page shown correctly) it follows a blank page (45.454.544.54/mail/?_task=login) but then the user directory (completely empty) gets created for the user i tried to login through webmail.

ps used echo “test” | mail -s test email@somewhere.com and viewed mail.log

Completely blank, like an empty browser window? If so, you should check the roundcube error log:

tail /var/log/roundcubemail/errors

@JoshData Yes, completely blank. While I do not have a solid case atm, I can imagine that things already break during the setup process (see other topic “Unable to resolve host during setup”). That could also be the reason why the user directories do not get created correctly.

Error log: (…)

Could not resolve host: box.mailinabox.email
(i am accessing webmail through the bare IP at https://45.454.544.54/mail)

PHP Fatal Error: Uncaught exeption / (…) with message "unable to connect to “https://box.mailinabox.email:443/cloud/remote.php” (…) etc etc.

PHP Fatal Error: Uncaught exeption / (…) with message "unable to connect to “https://box.mailinabox.email:443/cloud/remote.php” (…)

This is the cause of the problem using Roundcube webmail. It’s from the carddav plugin which is querying ownCloud (or Nextcloud, starting in the next release) for contacts. Since your DNS isn’t fully set up, it can’t reach ownCloud/Nextcloud because it’s configured to find ownCloud/Nextcloud using the domain name the box is meant to be running at. Which you haven’t finished setting up. (You might be able to get around this by disabling the carddav plugin in the Roundcube configuration file.)

Your earlier mail test (echo "test" | mail -s test email@somewhere.com) probably failed because you didn’t supply the right command line parameters for a valid test — it’s missing an envelope header address. To test sending an email, please follow the mail instructions in the control panel rather than making something up.

So, there are no unexplained errors with your box so far. As far as what you’ve reported so far, there’s no reason to think your box isn’t operating correctly.

@JoshData Can you please shortly let me know how the directories for the mailbox users at home/user-data/mail/mailboxes/hostname.com/. gets created? And how and when the directory with the Hostname itself gets (or should get) created? Thanks so much.

Those directories are managed by the Dovecot LMTP service, if I recall right.

In some scenarios where you need to transfer user folders from a live mail server running with the same domain you want to set up the new Mail-in-a-Box, creating the user folders beforehand (before you take the running “old” Mail server down) on the new Box is a necessity. It seems that then you are running into a whole bunch of scenarios (see above): Mail-in-a-Box is not able to create user directories through Admin GUI (or API) when you are not connected with the server to the Net and you do not have your DNS fully set up (unable to resolve host). This affects a smooth mail server transition. [“Solved”]

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.