# [CLOSED] Virtual mailhosting (postfix+sasl+courier+mysql)

## zgredek

I have configured a sever according to the official guide: 

http://www.gentoo.org/doc/en/virt-mail-howto.xml

The problem is as follows:

 - Everything works just fine with some exceptions, meaning I can send mail to whoever I want, I can receive messages I can alter most of the settings from within mysql.

 - I cannot receive mail if the user is NOT present in the system, so if he's only in the database, not having a shell nor his own home dirctory.

And it's basically everything. Authorization works unexpectedly well, changes (e-mail addresses, aliases) can be changes in the DB, BUT none of the virtual users is able to receive mail, although sending works fine...

It's probably something to do with mail transport, but I'm not sure. 

If someone would be that kind to help me solve this problem I would be extremely grateful  :Wink: Last edited by zgredek on Fri Sep 30, 2005 7:16 am; edited 1 time in total

----------

## zgredek

Anyone?

----------

## Psychoman

Does the virtual user have a home directory in /home/vmail/virtual-domain/virtual-username ?

Did you do a "chown -R vmail: /home/vmail/virtual-domain/virtual-username" after u created the new directory?

I know I had some problems by creating .maildir myself. It's better to use "maildirmake .maildir"

----------

## zgredek

[quote="Psychoman"]

Does the virtual user have a home directory in /home/vmail/virtual-domain/virtual-username ?

Yes.

 *Psychoman wrote:*   

> 
> 
> Did you do a "chown -R vmail: /home/vmail/virtual-domain/virtual-username" after u created the new directory?
> 
> 

 

Of course.

 *Psychoman wrote:*   

> 
> 
> I know I had some problems by creating .maildir myself. It's better to use "maildirmake .maildir"
> 
> 

 

That's exactly what I'm doing...

Sounds as if it should Just Works[tm], right? But it is not...

----------

## Psychoman

What do the logs tell you?

----------

## zgredek

Sorry it took so long to answer...

The only error messages I get are:

```
postfix/trivial-rewrite[31300]: warning: do not list domain DOMAIN.COM in BOTH mydestination and virtual_mailbox_domains
```

```
postfix/virtual[31320]: 2D9FD309088: to=<user@DOMAIN.COM>, relay=virtual, delay=0, status=deferred (mailbox ///home/vmail/DOMAIN.COM/user/.maildir: cannot open file: Is a directory)

postfix/virtual[31324]: 27D7A30907E: to=<user@DOMAIN.COM>, relay=virtual, delay=0, status=deferred (mailbox ///home/vmail/DOMAIN.COM/user/.maildir: cannot open file: Is a directory)
```

```
postfix/smtpd[31347]: sql_select option missing

postfix/smtpd[31347]: auxpropfunc error no mechanism available

postfix/smtpd[31347]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql
```

```
postfix/virtual[31310]: C330B30906D: to=<user@DOMAIN.COM>, relay=virtual, delay=0, status=deferred (mailbox ///home/vmail/DOMAIN.COM/user/.maildir: cannot open file: Is a directory)
```

The mail is NOT being sent, actually it IS, but it's not delivered, probably because of this: '.maildir: cannot open file: Is a directory'. But when I make it file (?) it sais:

```
imapd: chdir /home/vmail/DOMAIN.COM/user/.maildir: Not a directory
```

What's going on?

Thx for help.

EDIT: DOMAIN.COM is the correct domain name.

----------

## zgredek

The problem was caused by wrong entry in database. homedir and maildir fields need to end with a slash (/). Without it they will be neither file nor directory   :Laughing: 

----------

