Upgrading conf file

Jim Levie jim at ENTROPHY-FREE.NET
Tue Oct 8 18:43:49 IST 2002

On Tue, 2002-10-08 at 11:52, Julian Field wrote:
> It's generally acknowledged by everyone that copying over all your old
> settings into a new mailscanner.conf file is a pain to do. The alternative
> is that you have to accept that you will be using my default values for any
> new configuration options.
> So, does someone fancy writing a script to automate it?
> The spec goes something like this:
> Run through the old config file, remembering all the settings.
> Then run through the new one, over-writing the setting for every variable
> that is in the new file too.

I've already got this. Right now it's a bit site specific, but it
wouldn't take much work to generalize it.

What it does right now is to:

1) Create a new /opt/MailScanner-M.mm-s directory and populate it with
things from the MailScanner tar extract's bin & etc directory.

2) Gets everything except mailscanner.conf from from the previous
version as found in /opt/MailScanner/etc and copies that to the new

3) Parses the old mailscanner.conf file and the new file, replacing
assignments in the new file that are different in the old.

4) Lists out any config options (and which version they apply to) that
don't have a one-to-one correspondence between the two conf files. those
have to dealt with manually.

There's obviously some major assumptions made here that other things in
the etc dir besides mailscanner.conf don't significantly change between
releases. Since a lot of that gets edited on a site by site basis it is
going to be different than what's in the distro. One thing that would
make the process easier to automate would be for every file in etc to
have a version ID at the beginning. That version ID wouldn't change
unless the contents of the file differ in the new release. Then I could
check the old version ID against the new and flag those that need manual
The instructions said to use Windows 98 or better, so I installed RedHat
   Jim Levie                                 email:
jim at entrophy-free.net

More information about the MailScanner mailing list