You're right! I think unionmap is useful if there is a mix with mysql maps and 
pcre maps, or other mixed maps.

I modified my sender-login-maps.cf to include UNION with both of the queries.

Thanks again, Viktor.

Regards

-----Message d'origine-----
De : owner-postfix-us...@postfix.org <owner-postfix-us...@postfix.org> De la 
part de Viktor Dukhovni
Envoyé : lundi 29 mars 2021 08:37
À : postfix-users@postfix.org
Objet : Re: Mysql virtual + unionmap

On Mon, Mar 29, 2021 at 08:23:40AM +0200, DEPRÉ Gaëtan - NGServers.com wrote:

> I modified the files master.cf & main.cf as you adviced. 
> 
> The command postmap -q y...@mydomain.dom "$(postconf -Phx 
> smtps/inet/smtpd_sender_login_maps)"
> returns me the two users that are able to send email from.
> 
> Everything, is working, the problem was the invert with 'owned' & 'owner'.

Congrats.  I should perhaps note that with SQL you hardly need a
unionmap:

    query = SELECT email as user FROM virtual_users WHERE email='%s' UNION
            SELECT owned as user FROM virtual_delegation WHERE owner='%s'

-- 
    Viktor.

Reply via email to