Kurt22 wrote on 11.08.2010:
Thanks Daniel, my log have evolued but i have always the problem. I use a mysql db authentification so I have replace your answer by :
local_recipient_maps = mysql:/etc/postfix/mysql-virtual_comptes.cf
with in mysql-virtual_comptes.cf :
hosts = 127.0.0.1 user = xxxx password = xxxx dbname = xxxxx table = users select_field = CONCAT(SUBSTRING_INDEX(username,'@',-1),'/',SUBSTRING_INDEX(username,'@',1),'/') where_field = username
in mail.log :
Aug 11 20:35:22 ns351550 postfix/local[24266]: DA0353BA95: to=contact@akairnet.com, relay=local, delay=0.13, delays=0.12/0/0/0, dsn=5.1.1, status=bounced (unknown user: "contact")
Hmm, first: the sql query for postfix above version 2.2 has changed. The query (new) looks like:
query = SELECT value FROM table WHERE value='%s'
See: http://www.postfix.org/MYSQL_README.html
Depending on your mysql fields you can also use
query = SELECT username FROM users WHERE username='%s'
It's not really needed to works with concat etc.
Your config looks like that you want to use "virtual" users and domains because you use virtual_mailbox_domains and other virtual related config options.
For virtual users and domains you should not list your "virtual" domains in $mydestination. All virtual users should be in your database so that you can use the Dovecot LDA for delivery as you've set with "virtual_transport = dovecot".
I suggest to leave local_recipient_maps at the default value and use "virtual_mailbox_domains", "virtual_alias_maps" and "virtual_transport" instead. You must also change $mydestination because you can not define a domain as virtual and local domain.
If you use a mysql table for local users make sure that the user can be found. You can test this also with
postmap -q contact@your-domain mysql:/etc/postfix/mysql-virtual_comptes.cf
If the query is correct you should get back the correct value. If so, Postfix should be able to deliver the mail.
-- Daniel