On Sat, Jan 11, 2020 at 10:25:42AM +0100, azu...@pobox.sk wrote: > is it possible to specify multiple tables for check_sender_access used > in smtpd_sender_restrictions? Few examples i tried (none worked): > > smtpd_sender_restrictions = > reject_non_fqdn_sender > check_sasl_access hash:/etc/postfix/sasl_access > hash:/etc/postfix/sasl_access_2 > reject_sender_login_mismatch > [...] > > Use case: One table is used for hand editing, one is generated by script.
You can use a Makefile to combine the two files into a third file, which becomes the map source, and then "postmap" that and use a single lookup table. Postfix has "pipemap" for chained lookups and "unionmap" for returning multiple results, but no explicit "stackmap" for returning a result from the first table in a list that has a matching key, because many lookup features implicitly support that via parameters named "..._maps". An explicit "stackmap" feature could be implemented, but it is not clear it would be particularly useful. As Wietse noted, with access(5) you can mostly get the same effect by specifying two checks one in each table, except that when a DUNNO answer is found in the first table, the second table is still checked, (OK and REJECT are final). If you consolidate the tables into one, you avoid a second lookup (when neither match) and the memory cost of having a second table. -- Viktor.