G
G
gremlintv22019-05-07 19:07:10
Email
gremlintv2, 2019-05-07 19:07:10

How to set up smtp server on postfix using smtp.gmail.com as relay?

Hello
At the moment I have the following scheme for sending email:

mydomain.com( server1 ) -> smtp.gmail.com -> client

When requesting to recover a password, the client receives the IP address of the sender (which is the application server) in the body of the letter. Therefore, in order to anonymize the server with the application, I see the need to configure an smtp proxy. To do this, I want to set up the following scheme:
mydomain.com( server1 ) -> smtp.myproxy.com postfix relay( server2 ) -> smtp.gmail.com  -> client

Those. so that smtp.gmail.com is upstream postfix.
I set up the relay . Local sending from server2 works.
How now to raise an SMTP server on Postfix listening to all addresses (0.0.0.0) under a certain domain?
I apologize for the noob questions, I'm just swimming in the subject of mail servers because I have no practice
Thank you
Part of the answer:
In the file:
cat /etc/postfix/main.cf
added:
inet_interfaces = all
mynetworks = 1.1.1.1/32,127.0.0.1/32

Now I can send mail remotely with the command:
mailx -S smtp=<postfix-server-ip> -r <sender-email> -s subfff -v <receiver-email>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gremlintv2, 2019-05-07
@gremlintv2

Answer:
In file:
added:

inet_interfaces = all
mynetworks = 1.1.1.1/32,127.0.0.1/32

Now I can send mail remotely with the command:
mailx -S smtp=<postfix-server-ip> -r <sender-email> -s subfff -v <receiver-email>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question