On Mon, Jan 12, 2015 at 10:09:41AM -0500, Wietse Venema wrote:
> [email protected]:
> > Hi list,
> >
> > if you run postmap on an alias file by mistake it prints a warning but
> > still overwrites the .db file which is then unusable.
> >
> > Is there any reason why postmap overwrites the .db although it detects
> > that the source file is not in the desired format?
>
> 1) It opens the output database.
> 2) It truncates the output database.
> 3) It reads the input.
Moving the discussion from the apparent symptoms to the solution,
avoid using either "postmap" or "postalias" with the aliases file.
Instead use "newaliases" or "sendmail -bi", after making sure that
"alias_database" is set correctly in main.cf.
Also create a Makefile in /etc/postfix to update indexed tables,
don't do it by hand.
Once you're never explicitly running either "postmap" or "postalias",
mistakes are far less likely.
--
Viktor.