> Le 5 oct. 2015 à 19:01, Viktor Dukhovni a écrit :
>
> On Mon, Oct 05, 2015 at 06:39:12PM +0200, Axel Luttgens wrote:
>
>> As usual, I’ll probably appear quite dumb, but I’ll ask anyway. ;-)
>>
>> Let’s say I have following data in the database (db_sender_login_map):
>>
>> from_address login
>> ============ =====
>> [email protected] jdoe
>> [email protected] emurphy
>>
>> and this one in the hash (sender_login_exceptions):
>>
>> # from_address login
>> [email protected] emurphy
>>
>> The idea being to allow authenticated user emurphy to send emails with
>> enveloppe sender addresses "[email protected]" (the usual case) or
>> "[email protected]" (an exception).
>
> You're confusing keys with values. Postfix maps a sender to a list
> of allowed logins (LHS => RHS). The lookups are by *sender address*.
Basically, my SQL query amounts to:
select login from mytable where from_address = '%s'
and my hash table is similar to the one shown above.
Would that be wrong?
>> With:
>>
>> smtpd_sender_login_maps =
>> sqlite:db_sender_login_map
>> hash:$config_directory/maps/sender_login_exceptions
>>
>> user emurphy may only send with address "[email protected]".
>
> No. Both addresses are valid for emurphy (only).
>
>> With:
>>
>> smtpd_sender_login_maps =
>> hash:$config_directory/maps/sender_login_exceptions
>> sqlite:db_sender_login_map
>>
>> user emurphy may send with either sender address "[email protected]" or
>> sender address "[email protected]".
>
> No, in this example, the order does not matter.
Yes, that’s what I thought too.
But in fact, I *have* to make use of the second ordering (hash then db query)
for having the hash table to be taken into account.
I swear it. ;-)
Axel