On 2015-01-12 16:09, [email protected] 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.

Do you want it to read the whole input before step 1?
Do you want it to not truncate the database when 1% of inputs is
suspect?
10%?
50%?

        Wietse

example:
postmap  /etc/mail/aliases
postmap: warning: /etc/mail/aliases, line 4: record is in "key: value"


i think it would be possible to write to a temporary file first and move it to the final .db file if there where no errors from the input file.

for those who want to ignore any warnings an --force or --ignore-errors option could be added. or the other way around an option --stop-on-error or something. but i would prefer the first....

regards
the2nd

Reply via email to