Starting from Sitecore 9 you have Rule Based Configuration. @JammyKam explained here very nice: https://jammykam.wordpress.com/2017/10/17/rules-based-configuration/
For EXM in web.config you define EDS role of the server using next configurations:
<!-- SUPPORTED EDS PROVIDERS
Specify the Email Delivery provider that you want this server to use.
The supported providers are:
CustomSmtp
EmailCloud
-->
<add key="eds:define" value="CustomSMTP" />
On the folder \App_Config\Sitecore\EmailExperience\ you have all configuration for EmailCloud(Sparkpost) and for CustomSmtp
For EmailCloud all the settings are defined in 3 files:
\App_Config\Sitecore\EmailExperience\Sitecore.EDS.Providers.SparkPost.config
\App_Config\Sitecore\EmailExperience\Sitecore.EDS.Providers.SparkPost.Sync.config
\App_Config\Sitecore\EmailExperience\Sitecore.EDS.SparkPost.Client.config
For CustomSmtp all settings\properties are defined in the files:
\App_Config\Sitecore\EmailExperience\Sitecore.EDS.Providers.CustomSMTP.config
\App_Config\Sitecore\EmailExperience\Sitecore.EDS.Providers.CustomSMTP.Sync.config
If you add Eds:Role in the patch config file it should not affect any configuration for user/passwpord On the top of the patch config file for customSMTP configuration you need to have Eds role and server role like in below config :
<?xml version="1.0" encoding="utf-8" ?>
<!--
Purpose: This include file configures Email delivery service API.
-->
<configuration xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:eds="http://www.sitecore.net/xmlconfig/eds/" xmlns:exmEnabled="http://www.sitecore.net/xmlconfig/exmEnabled/">
<sitecore exmEnabled:require="yes" role:require="Standalone or ContentManagement or DedicatedDispatch" eds:require="CustomSmtp">
Using yourhostname/sitecore/admin/showconfig.aspx you can see how new patch files are applied into your Sitecore solution.