Hello everyboy,
I tried to create some listener files which allow to modify the named config based on domains but I got stuck when passing over the array. Perhaps someone may help to fix this - the final listener will be provided to the community.
This is where I am stuck - I created a listener which adds a general list of mx-entries to all domains (see here) but when I try to make this per Domain the array is not working (complete code is attached).
So this works:
Code
- my %additionalMailservers = ( 'mx50' => '50' );# All dns mail-serversmy %mailserverList = %additionalMailservers;if(%mailserverList) { my @formattedEntries = (); push @formattedEntries, '; custom MX DNS entries BEGIN'; # add out-of-zone mail-servers while (my ($name, $priority) = each(%mailserverList)) { push @formattedEntries, '@ IN MX ' . $priority . ' ' . $name; }....
But this does not work:
Code
- my %{$perDomainAdditionalMailservers['testdomain']} = ( 'mx40' => '40' );
- # All dns mail-servers
- my %mailserverList = %{$perDomainAdditionalMailservers['testdomain']};
- if(%mailserverList) {
- my @formattedEntries = ();
- push @formattedEntries, '; custom MX DNS entries BEGIN';
- # add out-of-zone mail-servers
- while (my ($name, $priority) = each(%mailserverList))
- {
- push @formattedEntries, '@ IN MX ' . $priority . ' ' . $name;
- }
- ....
So, perhaps anyone knows how to solve this. Thanks in advance.
Regards Jörg