Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have set-up a mail server with Postfix, and I am currently in the process of creating virtual mailboxes with the help of Postfixadmin. I am using Courier to handle IMAP authentications, and I am having troubles with setting it up properly.

I studied the logs and narrowed down the main problem being IMAP not being able to locate the designated maildirs. That is, the maildirs do not exist.

I am able to solve the problem by manually creating the maildirs that IMAP is expecting, but I dont really see myself having to do this every time I add a mailbox. I would need it to work automatically as soon as I add virtual mailboxes via Postfixadmin.

Am I missing something?

Here are some relevant information:

Postfixadmin uses a MySQL database to look up mailboxes, and the description of the relevant table is as follows:

+------------+--------------+------+-----+---------------------+-------+
| Field      | Type         | Null | Key | Default             | Extra |
+------------+--------------+------+-----+---------------------+-------+
| username   | varchar(255) | NO   | PRI | NULL                |       |
| password   | varchar(255) | NO   |     | NULL                |       |
| name       | varchar(255) | NO   |     | NULL                |       |
| maildir    | varchar(255) | NO   |     | NULL                |       |
| quota      | bigint(20)   | NO   |     | 0                   |       |
| local_part | varchar(255) | NO   |     | NULL                |       |
| domain     | varchar(255) | NO   | MUL | NULL                |       |
| created    | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| modified   | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| active     | tinyint(1)   | NO   |     | 1                   |       |
+------------+--------------+------+-----+---------------------+-------+

And here is a sample record:

username = user@domain.com
password = [hashed password here]
name = User 01
maildir = user@domain.com
quota = 0
local_part = user
domain = domain.com
created = 2012-08-17 07:52:01
modified = 2012-08-17 07:52:01
active = 1

(domain.com is simply a dummy for the purpose of this question. I am using a registered domain with a working MX record.)

Here are the contents of my /etc/courier/authmysqlrc

MYSQL_SERVER 127.0.0.1
MYSQL_USERNAME [omitted]
MYSQL_PASSWORD [omitted]
MYSQL_DATABASE [omitted]
MYSQL_USER_TABLE mailbox
MYSQL_LOGIN_FIELD username
MYSQL_NAME_FIELD name
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD     password
MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD concat(quota,'S')
MYSQL_HOME_FIELD        '/home/vmail'
MYSQL_UID_FIELD '5000'
MYSQL_GID_FIELD '5000'

(I have created the necessary UNIX user ang group for this, with the proper UID:GID of 5000:5000 )

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Solved my problem by removing our domain from mydestinations and allowing Postfixadmin to send a welcome message upon creation. Apparently the mail directories are created when the email arrives, so the sending of welcome message takes care of it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.