all commands are done on the cli as the zimbra user. So login with ssh and become zimbra user by
su - zimbra
create an file for authentication to amazon:
echo email-smtp.eu-west-1.amazonaws.com awsauthuser:awsauthpass > /opt/zimbra/conf/relay_password
postmap lmdb:/opt/zimbra/conf/relay_password
Configure zimbra to use this username and password:
zmprov mcf zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password
zmprov mcf zimbraMtaSmtpSaslAuthEnable yes
zmprov mcf zimbraMtaSmtpCnameOverridesServername no
zmprov mcf zimbraMtaSmtpTlsSecurityLevel may
zmprov mcf zimbraMtaSmtpSaslSecurityOptions noanonymous
Create a lookup file where you put the domains you want to send via amazon:
echo outlook.com smtp:email-smtp.eu-west-1.amazonaws.com > /opt/zimbra/conf/relay_amazon
postmap lmdb:/opt/zimbra/conf/relay_amazon
Of Course, you can add extra domains to the list above in an editor of your liking. Remember to run the postmap command after every change.
Tell zimbra to use the above mapping:
zmprov mcf zimbraMtaTransportMaps lmdb:/opt/zimbra/conf/relay_amazon,proxy:ldap:/opt/zimbra/conf/ldap-transport.cf
Activate the configuration
zmmtactl reload