I'm moving from Ubuntu to CentOS 7 Previously, on Ubuntu, installing amavisd would lead to etc/amavis/conf.d that contained: 01-debian 05-domain_id 05-node_id 15-av_scanners 15-content_filter_mode 20-debian_defaults 21-ubuntu_defaults 25-amavis_helpers 30-template_localization 40-policy_banks 50-user However installing amavisd on centos leads to a spaghetti config file (i.e. /etc/amavisd/amavisd.conf and nothing else) For obvious reasons I want to avoid spaghetti config, not only is it poor practice, but also nigh on impossible to maintain properly without breaking stuff. Assuming it is possible, how would I go about changing the Centos "dump" based config into a more sensible one where local site customisations are clearly deliniated ?
I'm forwarding the answer from my colleague: release notes: - provide two new subroutines available for calling from config files: include_config_files() and include_optional_config_files(), each take a list of filenames as arguments, and reads & evaluates them just like normal configuration files specified on a command line (option -c or a default amavisd.conf). This provides a simplified and uniform mechanism for 'including' additional configuration files, which formerly could be invoked through a perl do() function. The only difference between include_config_files and include_optional_config_files is that the former aborts if some specified file does not exist, while the later silently ignores specified but missing files. Both/each subroutine may be called multiple times, recursion is allowed (but some sanity limit to recursion is provided); based on a suggestion by Gary V. Example line in amavisd.conf: include_config_files('/etc/amavisd-custom.conf'); ... or, uncomment the Debian/Ubuntu specific call to find_config_files in amavisd: # default location of the config file if none specified if (!@config_files) { @config_files = ( '/etc/amavisd.conf' ); # # Debian/Ubuntu specific: # @config_files Amavis::Util::find_config_files('/usr/share/amavis/conf.d', # '/etc/amavis/conf.d'); } Cheers, Barbara On 01/04/2017 01:50 PM, Tim Smith wrote:> I'm moving from Ubuntu to CentOS 7 > > Previously, on Ubuntu, installing amavisd would lead to > etc/amavis/conf.d that contained: > 01-debian > 05-domain_id > 05-node_id > 15-av_scanners > 15-content_filter_mode > 20-debian_defaults > 21-ubuntu_defaults > 25-amavis_helpers > 30-template_localization > 40-policy_banks > 50-user > > However installing amavisd on centos leads to a spaghetti config file > (i.e. /etc/amavisd/amavisd.conf and nothing else) > > For obvious reasons I want to avoid spaghetti config, not only is it > poor practice, but also nigh on impossible to maintain properly > without breaking stuff. > > Assuming it is possible, how would I go about changing the Centos > "dump" based config into a more sensible one where local site > customisations are clearly deliniated ? > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos
Hi Barbara, Thank you for that, very useful. So, if I'm not mistaken, it sounds like the underlying suggestion is that I could just delete /etc/amavisd/amavisd.conf and replace it with a the contents of /etc/amavis/conf.d/ from elsewhere. Tim On 4 January 2017 at 13:24, Barbara Kra?ovec <barbara.krasovec at ijs.si> wrote:> I'm forwarding the answer from my colleague: > > release notes: > > - provide two new subroutines available for calling from config files: > include_config_files() and include_optional_config_files(), each take > a list of filenames as arguments, and reads & evaluates them just like > normal configuration files specified on a command line (option -c > or a default amavisd.conf). This provides a simplified and uniform > mechanism for 'including' additional configuration files, which formerly > could be invoked through a perl do() function. The only difference > between include_config_files and include_optional_config_files is that > the former aborts if some specified file does not exist, while the later > silently ignores specified but missing files. Both/each subroutine > may be called multiple times, recursion is allowed (but some sanity > limit to recursion is provided); based on a suggestion by Gary V. > > Example line in amavisd.conf: > include_config_files('/etc/amavisd-custom.conf'); > > > > ... or, uncomment the Debian/Ubuntu specific call to find_config_files > in amavisd: > > # default location of the config file if none specified > if (!@config_files) { > @config_files = ( '/etc/amavisd.conf' ); > # # Debian/Ubuntu specific: > # @config_files > Amavis::Util::find_config_files('/usr/share/amavis/conf.d', > # '/etc/amavis/conf.d'); > } > > > Cheers, > Barbara > > On 01/04/2017 01:50 PM, Tim Smith wrote: >> I'm moving from Ubuntu to CentOS 7 >> >> Previously, on Ubuntu, installing amavisd would lead to >> etc/amavis/conf.d that contained: >> 01-debian >> 05-domain_id >> 05-node_id >> 15-av_scanners >> 15-content_filter_mode >> 20-debian_defaults >> 21-ubuntu_defaults >> 25-amavis_helpers >> 30-template_localization >> 40-policy_banks >> 50-user >> >> However installing amavisd on centos leads to a spaghetti config file >> (i.e. /etc/amavisd/amavisd.conf and nothing else) >> >> For obvious reasons I want to avoid spaghetti config, not only is it >> poor practice, but also nigh on impossible to maintain properly >> without breaking stuff. >> >> Assuming it is possible, how would I go about changing the Centos >> "dump" based config into a more sensible one where local site >> customisations are clearly deliniated ? >> _______________________________________________ >> CentOS mailing list >> CentOS at centos.org >> https://lists.centos.org/mailman/listinfo/centos > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos