Postfix relay access denied when sending to external email

I have one problem. I am trying to create custom SMTP server, using POSTFIX. I connect to server using openssl s_client -starttls smtp -connect mx.mydomain.com:587 After entering “rcpt to:” I get error “Relay access denied” 250 SMTPUTF8 mail from: test@mydomain.com 250 2.1.0 Ok rcpt to: myEmail@gmail.com 454 4.7.1 <myEmail@gmail.com>: Relay access denied This is the…

How to tell postfix to relay outbound mail to another local instance

I have two postfix instances on the same machine (Ubuntu 18.04) managed with postfix-multi. One instance accepts incoming mail from MUAs and from other mailservers on the internet. Mail is delivered to mailboxes with virtual_mailbox_maps and aliases are defined in virtual_alias_maps and also virtual_mailbox_domains is configured. What I want to do: if a mail is…