Hello!
I will try to explain my steps.
1.) EBox -> Mail -> General,
Smarthost to send mail: you can insert any name for example "not.used.yet".
Smarthost authentication: insert Username & Password, will not be used either, you can insert what you want!
2a.) backup /usr/share/ebox/stubs/mail/main.cf.mas
2b.) edit /usr/share/ebox/stubs/mail/main.cf.mas
I changed the main.cf.mas, try to find the line: relayhost = <% $relay %> and then I changed the following lines to ...
#201012 ---- relayhost = <% $relay %>
% if ($zarafa) {
transport_maps = hash:/etc/postfix/transport
zarafa_destination_recipient_limit = 1
% }
% if ($relay) {
#201012 --- smtp_tls_security_level = may
smtp_tls_security_level = none
smtp_tls_key_file = <% $keyFile %>
smtp_tls_cert_file = <% $certFile %>
#201012 ---
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relayhost
% }
% if ($relayAuth) {
smtp_sasl_auth_enable = yes
#201012 --- smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sender_passwd
smtp_sender_dependent_authentication = yes
% }
3.) create files
/etc/postfix/sender_passwd
/etc/postfix/sender_relayhost
/etc/postfix/sender_canonical
4.) sender_passwd looks like
email1@extern.com extern_smtp_username:extern_smtp_password
email2@extern.xxx extern_smtp_username2:extern_smtp_password2
5.) sender_relayhost looks like
email1@extern.com [extern_smtp_server:extern_smtp_port]
email2@extern.xxx [extern_smtp_server2:extern_smtp_port2]
6.) sender_canonical looks like
name@company.local email1@extern.com
name2@company.local email2@extern.xxx
7.) convert the files with postmap
postmap sender_canonical
postmap sender_relayhost
postmap sender_passwd
8.) change sth at EBox -> Mail -> General for example smarthost authentication and then save the changes, so the edited main.cf.mas is used and postfix is restarted. If you have applied the changes once, and you add a new Email Address you only have to convert the files again and restart postfix.
9.) Be careful: If an update for the mail modul is available, the script can loose all modifications and you have to edit the main.cf.mas again.
No warrenty, but this works for me ...