I have a private network with an email server, basically for an intranet service. I also have a server I want to use as a relay to send and receive mail for the intranet mail server. I've seen many guides using Postfix's relayhost config option to have mail sent out of a server.

I want my relay configured to get mail for my domain and forward it over an SSH tunnel to the mail server on the private network. I also want the private server to send email outbound to the internet. To get started I have a VPS running Debian 9, I just need to know how to configure postfix to do these two things.

The answer to this question would be how to modify the default Postfix configuration to achieve this two-way relay solution.

closed as too broad by dr01, Kiwy, Archemar, Jesse_b, Rui F Ribeiro May 4 '18 at 12:30

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Do you know how does work email delivering sending system ? Do you what a PTR is ? a MUA is ? or a SPF record is ? If you don't please try to learn a bit more about how email works. To have a reliable email delivering system and reliable email receiving system you will have to understand a little bit how this is working. And the answer will most likely not be provide here. – Kiwy May 2 '18 at 9:22
  • I understand email in theory quite well, just not the less known features of Postfix really. – Kaizu May 2 '18 at 9:43