Can I customize postfix configuration per virtual server?


I have a virtualmin with 2 different virtual servers (different domains, not related to each other).

I want to configure Elastic Email SMTP service to send email using their service, instead of default postfix. According to their guide, I need to add following configs

If you are configuring postfix as a local relay make sure you include the following three lines in your postfix configuration

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:yourusername:your api key
smtp_sasl_security_options = noanonymous

My question is if I enter account api key for 1 domain, it will be used too to send email for the second domain, right? Because postfix configuration is for the whole server. Can I somehow configure this for one virtual server only? And let the other one use default or a different api? Thank you

This is the only way that I personally know of:

There’s a config option for it in the postfix config area. You may have to dig around for config examples.