Config example for multiple domains with different settings
Nicki Messerschmidt, Linksystem Muenchen GmbH
n.messerschmidt at buero.link-m.de
Fri Sep 16 11:36:46 CEST 2016
Christian Rößner schrieb:
> Unfortunately I am on vacation right now, so I will be back on 10th Oct.
I wish you a nice vacation and thanks for answering my mail even on
vacation time. :)
> You can do a lot of dynamic stuff in automx.
>
> If I remember correctly, you can define variables for "follow = someprefix.${sectionname}"
>
> where sectionname is your domain.
>
> [someprefix.example.com]
> backend = static_append
>
> "someprefix" is important here, as you do not want to have this section map a real domain! It is like a placeholder. The structure looks like this:
>
> [DEFAULT]
> ...
>
> [global]
> backend = sql
> result_attrs = user, email_address, thedomain
> ...
> follow = foo.${thedomain}
>
> [foo.example1.com]
> backend = static_append
> ...
>
> [foo.example2.com]
> backend = static_append
> ...
>
> [foo.example3.com]
> backend = static_append
> ...
But that means, that I still have only one datasource. I'd like to query
multiple datasources depending on the domain. Some domains have their
info in a sql database, others are in a xml file, some are static.
I thought I could define a filter on a datasource per domain. Like
[domain.tld]
follow = generic_mail_settings_1
username = `grep $mailaddr data.csv|awk '{print $1}'`
> Maybe something like this. You can combine this with DEFAULT. So put all common setting into DEFAULT. Define a "global" section with you SQL queries and use "follow" with dynamic-var to switch to special backends. Let me know if that worked for you.
For me a backend is the datasource that holds the username, mailaddr
mapping. The settings (hostname, ports, etc.) can be "followed".
> I need to dive deeper into it, when I am back. Or someone else here on the list might be so kind and help you in the meantime :-)
Thanks in advance.
Cheers
Nicki
--
Linksystem Muenchen GmbH We make the Net work
Ludwig-Richter-Str. 29 Tel. 089 / 890 518-0
80687 Muenchen Fax 089 / 890 518-77
info at link-m.de http://www.link-m.de
Handelsregister: Amtsgericht Muenchen, HRB 129182
Geschaeftsfuehrung: Christine Wittig, Mathias Zunterer
PGP Keys: https://www.link-m.de/pgp/
More information about the automx-users
mailing list