I do not quite understand this script, but if I am not compretely wrong it assumes that if I want to install into '/usr/mail/dbmail' then '/usr/mail' already exists. This might be a false assumption.
Maybe we should consider using 'mkdir -p /path/' as this will make all missing parent directories as well. It will not touch existing ones. Not reporting this to bugtracker yet since I do not quite follow the code, and can not test now. -HK