I've set up a postfix server that relays email to another server, this is working fine. I managed this using the relayhost variable.
relayhost = 18.104.22.168
This means all incoming emails are sent to that server, which is good. However, local email sent from the server where postfix is installed, for example using:
$ mail -s "subject example" firstname.lastname@example.org
are also being sent to the relay host, however, I only want this server to use relayhost for incoming email, for outgoing emails it should use itself as smtp. How can I achieve this?