* Patrick Ben Koetter <[email protected]>: > Mabi, > > * mabi <[email protected]>: > > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ > > On Wednesday, August 5, 2020 12:18 AM, Patrick Ben Koetter <[email protected]> > > wrote: > > > > > for any domain/recipient that amavis should feel responsible for add its > > > name > > > to @local_domains_maps or let amavis read it from a file, e.g. > > > /etc/postfix/relay_domains: > > > > > > @local_domains_maps = ( > > > ".$mydomain", > > > read_hash('/etc/postfix/relay_domains') > > > ); > > > > This "read_hash" function is quite useful but in my specific case I have > > this information stored in a PostgreSQL database table. So I was wondering > > if there is some kind of function like "read_sql" which can get the my > > domains from a specific column/table/database in SQL?
Another, maybe simplier idea: - Create a trigger in your DB that fires anytime you INSERT/UPDATE/DELETE entries in the domain table - Let the trigger call a script that dumps the domains into a file - Use read_hash to read that file p@rick > > amavis supports reading from an SQL or LDAP service. It will automatically > consider any recipient, found in these sources to be $local e.g. a recipient > it is responsible for. See also section "SQL LOOKUPS" in > https://www.ijs.si/software/amavisd/README.lookups.txt. > > Take a look at https://www.ijs.si/software/amavisd/README.sql.txt to find out > how to configure amavis to do SQL lookups. > > amavis comes with its own SQL schema. Either you follow that or you modify the > SELECT statements as configured with %sql_clause in the amavisd "binary". > > p@rick > > > -- > [*] sys4 AG > > https://sys4.de, +49 (89) 30 90 46 64 > Schleißheimer Straße 26/MG,80333 München > > Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 > Vorstand: Patrick Ben Koetter, Marc Schiffbauer, Wolfgang Stief > Aufsichtsratsvorsitzender: Florian Kirstein > -- [*] sys4 AG https://sys4.de, +49 (89) 30 90 46 64 Schleißheimer Straße 26/MG,80333 München Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Marc Schiffbauer, Wolfgang Stief Aufsichtsratsvorsitzender: Florian Kirstein
