I have a domain
foo.com pointing to my server and have MX entries redirecting to an external (!) mail provider where I can send and receive mails via
email@example.com. Since I am running some applications on my server that should send mail notifications I have installed postfix with the following changes to
mydestination = $myhostname, localhost.$mydomain, $mydomain inet_interfaces = loopback-only smtp_generic_maps = hash:/etc/postfix/generic
And the respective
/etc/postfix/generic looks like this:
firstname.lastname@example.org email@example.com @foo.com firstname.lastname@example.org
Unfortunately it turns out that sending mails locally (either via
email@example.com will of course conflict with the local postfix installation that should not receive the mail and the mail should rather be forwarded to my externally hosted mail server from the provider.
How can I configure the server such that locally sent mails to
firstname.lastname@example.org will in fact reach the external server?