Can't achieve alias working with SQL

Samuel compte-dovecot at ingescom.com
Tue May 19 13:00:41 UTC 2015


Hi,

Le 19/05/2015 14:54, Jorge Bastos a écrit :
> Hi Samuel,
>
>> On a fresh install of Jessie, I achieve to make dovecot/postfix working
>> with SQL, but I still can't send email to alias for wich one I get :
>> "Unknown user"
>>
>> After debug enable in dovecot, I see that the user_query SQL , just
>> query for the "users" table and not the "forward" table so the final
>> alias user is not known.
>>
>> But when I check postfix for alias, it seems ok :
>>
>> root at cluster-dovecot:/etc/dovecot# postmap -q contact2 at XXXXXXXX.com
>> mysql:alias_maps contact at XXXXXXXXXX.com
>>
>> So what do I missed for alias working with dovecot ?
>>
> I had similar question on how to make it working, and it ended up being:
>
> virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf

Finally I achieved making alias to work by changing the user_query:

#FROM users WHERE username = '%n' AND domain = '%d'

TO :

FROM users WHERE username = '%n' AND domain = '%d' or email=(select 
destination from forwards where source='%u');

But I don't know if that's the right way.

Wanting for any suggestion ....

Samuel.




More information about the dovecot mailing list