Hi
things defined in main.cf.local
(see https://docs.software-univention.de/handbuch-5.0.html#mail::serverconfig::maincflocal) should override earlier definitions in main.cf.
Templates that have been changed should not be overwritten during package upgrades but may cause side-effects once new templates are delivered. Thats why we have univention-check-templates
at least to check before running upgrades.
hth,
Dirk