You need to create a TLS certificate for use in the Messaging Gateway, either for web browsing (HTTPS) or email (SMTP). What name do you use?
When creating a TLS certificate for a receiving server, the value that needs to exist in the Subject Alternative Name (SAN) or Common Name (CN) field of the certifiate is any Fully Qualified Domain Name (FQDN) or IP that is used to connect to the server.
For example, if you opened a browser (client) and used the URL https://www.example.com/, then the process would use DNS to resolve an IP for the FQDN www.example.com (server) and your system would connect to that IP and start the HTTPS (TLS) handshake. During the handshake, your browser would request the TLS certificate from the receiving server and validate that the name used in the entered URL is listed in the certificate's SAN (or CN) fields. If a match is found, then the certificate validation passes, otherwise this would not be considered a valid server for the entered URL.
It is important to note that the receiving server's hostname does not affect the above process. The TLS certificate validation process only confirms that the entered name (in the URL) validates as a name authorized in the certificate.
For SMTP, there is no way to enter a URL to specify where the sending mail server (client) connects to. In general, the SMTP process determines the receiving mail server name as follows:
In summary, the name that needs to exist in the certificate SAN or common name is the FQDN that is resolved from the recipient email address, typically through an MX record lookup in DNS. The recipient mail server host name or other related network names are not relevant to this process. In this way, several servers that are associated with an MX record can all use the same certificate data.