Topic: Automatically create folder

==== Required information ====
- iRedMail version: 08.6.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Ubuntu 12.04
- Related log if you're reporting an issue:

I have noticed that if I created another domain and created users on it, their corresponding mail boxes on the /var/vmail folder will not be created automatically.
For example, if i created test@domain.com, the mailbox should be in /var/vmail/vmail1/domain.com/t/e/s/test-2013.
But this folder will not be created instantly when the user is created in the Web Admin page.
Only until they received an email will their corresponding folder be created.

Is there a way to alter this behavior? I am going to create about 100 email account in 2 domains and I'm going to copy their old email from our previous email server to their roundcube mailboxes. It would be very tedious if I were to create the folders manually.

Thank you


Get fast and professional support from iRedMail developers:


Re: Automatically create folder

Maildir will be created while:

- When user first login, either via POP3 or IMAP
- Email received.

I think you can write a script to read maildir paths from SQL table, then create them with "mkdir -p" manually.

- You have to create sub-directoires, cur, tmp, new.
- Owner of files/directories under /var/vmail/ must be "vmail:vmail", permission "0700".


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee


Re: Automatically create folder

Thanks, zhang. At least it would be easier to just login the user. I'm not quite very good with scripting yet.