With reference to the title, I have the below goal. i. All mails (system and user triggered) will be using an external smtp server. I know I need to modify main.cfg in postfix. However, I am thinking if there's a way it can be configured from the UI ? Just checking if anyone have attempted to override the auto generated main.cfg with your own predefined value?
The relay server is configured under System > Server Config > Email, you do not modify main.cf for that.
Bad idea. Better undo the manual changes and do it properly in ISPConfig. Otherwise, your server will stop working eventually when your manual config gets overwritten on system changes or updates.
Oops, is there a way I able to restore the original copy of it (in an automatic manner), so that I can configure it in ISPConfig?
You don't need to recover anything and nothing will stop working in the future. I asume you manually added or changed "relayhost=" in /etc/postfix/main.cf? And maybe "relayhost_user=" and "relayhost_password="? Those settings have been overwritten in main.cf by ISPC when you changed the relay setting under System > Server Config > Email