If you set mylocaldomain in mydestination or virtual_mailbox_domains of
your main.cf then Postfix should not relay the mail.
I want the mail to be sent.
If you want that
Postfix smtp client sends emails based on sender to different relay
servers then http://www.postfix.org/SASL_README.html would be something
for you
That also doesn't send my problem: I can send mail through a _different_
relay with it.
To sum up what I want to do.
Let's suppose that system-generated mails all will have
@system.example.com domain.
If I send this system-generated mail:
user$ echo test | mail -s test myacco...@yahoo.tld
I would like to have it delivered directly, without any relays (as it
will come as u...@system.example.com).
However, if external users connect to send mail through this Postfix
server, they need to be relayed through a different host.
Say, j...@somedomain.tld sends mail to m...@gmail.tld.
This message should go through a relay server.