# virt-mail-howto.xml - virtual users can't receive mails

## the-morpheus

Hello

i installed postfix with this HowTo: http://www.gentoo.org/doc/en/virt-mail-howto.xml

User can send mails with Thunderbird, but the server denies mails all mails which are for virtual users.

```
Aug 22 20:41:59 mydomain postfix/local[3713]: C3D35196A35: to=<user1@mydomain.com>, relay=local, delay=0.09, delays=0.07/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "user1")
```

The mysql connect works:

```
Aug 22 20:41:59 example postfix/smtpd[3702]: maps_find: local_recipient_maps: mysql:/etc/postfix/mysql-virtual-maps.cf(0,lock|fold_fix): user1@mydomain.com = /home/vmail/mydomain.com/user1/.maildir
```

postfix finds the mail dir from the user.

Hope somebody can help me.

mydomain.com is my domain

user1 is the use  :Smile: 

----------

## cach0rr0

need to see your main.cf 

can't say heaps without it.

NB: I've written up a different HOWTO using Cyrus, which may be easier to follow. here

----------

## quereguilla

hi!

i've the same problem... 

that's my postconf -n :

```

alias_maps = mysql:/etc/postfix/mysql-aliases.cf

broken_sasl_auth_clients = yes

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/lib/postfix

data_directory = /var/lib/postfix

debug_peer_level = 4

default_destination_concurrency_limit = 10

home_mailbox = .maildir/

html_directory = /usr/share/doc/postfix-2.8.3-r2/html

inet_interfaces = all

local_destination_concurrency_limit = 2

local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname

local_transport = local

mail_owner = postfix

mailq_path = /usr/bin/mailq

manpage_directory = /usr/share/man

mydestination = mail.mydomain.net, localhost.mydomain.net, localhost, mydomain.net

mydomain = mydomain.net

myhostname = mail.mydomain.net

mynetworks = 64.251.14.0/24, 127.0.0.0/8

newaliases_path = /usr/bin/newaliases

queue_directory = /var/spool/postfix

readme_directory = /usr/share/doc/postfix-2.8.3-r2/readme

relocated_maps = mysql:/etc/postfix/mysql-relocated.cf

sample_directory = /etc/postfix

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

smtp_tls_note_starttls_offer = yes

smtp_use_tls = yes

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain = 

smtpd_sasl_security_options = noanonymous

smtpd_tls_CAfile = /etc/postfix/cacert.pem

smtpd_tls_cert_file = /etc/postfix/newcert.pem

smtpd_tls_key_file = /etc/postfix/newkey.pem

smtpd_tls_loglevel = 3

smtpd_tls_received_header = yes

smtpd_tls_session_cache_timeout = 3600s

smtpd_use_tls = yes

tls_random_source = dev:/dev/urandom

unknown_local_recipient_reject_code = 550

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf

virtual_gid_maps = static:1003

virtual_mailbox_base = /

virtual_mailbox_domains = virt-domain.com

virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf

virtual_minimum_uid = 1000

virtual_transport = virtual

virtual_uid_maps = static:1003

```

and that's the relevant logs:

```

Aug 30 16:15:24 darkmoon postfix/smtpd[30998]: resolve_clnt: `' -> `user@mydomain.net' -> transp=`local' host=`mydomain.net' rcpt=`user@mydomain.net' flags= class=local

Aug 30 16:15:24 darkmoon postfix/smtpd[30998]: maps_find: local_recipient_maps: mysql:/etc/postfix/mysql-virtual-maps.cf(0,lock|fold_fix): user@mydomain.net = /home/vmail/mydomain.net/user/.maildir/

Aug 30 16:15:24 darkmoon postfix/smtpd[30998]: mail_addr_find: user@mydomain.net -> /home/vmail/mydomain.net/user/.maildir/

Aug 30 16:15:25 darkmoon postfix/local[31007]: F14A0188042: to=<user@mydomain.net>, relay=local, delay=0.18, delays=0.16/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)

Aug 30 16:15:25 darkmoon postfix/qmgr[30764]: F14A0188042: removed
```

postfix says that the mail is delivered to maildir and removed from the queue, but the mail isn't in the maildir that indicates the logs.

Where are that mails?

how can i trace what's happenning?

----------

## quereguilla

i've found my problem... i had to put mydomain in main.cf : virtual_mailbox_domains

but... 

why? Is not enough to put it in the table "transport" of the database ?

----------

## cach0rr0

it will make a fair bit more sense if you look at 'man local' and 'man virtual'

virtual domains are handled by the 'virtual' transport

local domains are handled by the 'local' transport

You've even specified as much by having this set: 

```

local_transport = local

```

----------

## quereguilla

 *cach0rr0 wrote:*   

> it will make a fair bit more sense if you look at 'man local' and 'man virtual'
> 
> virtual domains are handled by the 'virtual' transport
> 
> local domains are handled by the 'local' transport
> ...

 

yeah, i know... but in the guide http://www.gentoo.org/doc/en/virt-mail-howto.xml there is a table of the database to put which domain is local and which domain is virtual... and that isn't working because you need to put in the virtual_mailbox_domains of the main.cf wich domain is virtual to be handled like a virtual domain (virtual transport i mean).

do you understand my question now?

excuse me my english...

----------

