How to set up an SMTP Relay Server

7,314

1) Can I set up Y to appear as an "SMTP server" that just relays the emails/requests sent to it from X, to my actual SMTP server?

Yes, edit Y /etc/postfix/main.cf and configure:

mynetworks = 10.0.0.0/8

To accept email only from X (Set the X IP range here)

relayhost = [1.2.3.4]

To do relay (Set the SMTP IP address here)

2) Can I do so with just the IP addresses of the servers? This is for an LAN network and I don't have any domain names nor host names, only IPs.

Indeed, as you can see above.

3) Does anyone have a clear guide/example of how this can be done? I'm not familiar with SMTP Relaying nor Postfix, so I would appreciate verbose explanations.

I agree postfix is a very good option. There are tons of nice postfix guides. Check http://www.postfix.org/BASIC_CONFIGURATION_README.html

Share:
7,314

Related videos on Youtube

Anfernee
Author by

Anfernee

Love science and technology with an interest in how things work.

Updated on September 18, 2022

Comments

  • Anfernee
    Anfernee over 1 year

    I have 2 servers (X and Y) and an SMTP server for sending emails. X needs to send an email using the SMTP server, however it cannot resolve the host for the SMTP server. This is inevitable and I need a way around it (I can't do any DNS modifications). However, Y is able to connect to the SMTP server and X can connect to Y.

    So then:

    1) Can I set up Y to appear as an "SMTP server" that just relays the emails/requests sent to it from X, to my actual SMTP server?

    2) Can I do so with just the IP addresses of the servers? This is for an LAN network and I don't have any domain names nor host names, only IPs.

    3) Does anyone have a clear guide/example of how this can be done? I'm not familiar with SMTP Relaying nor Postfix, so I would appreciate verbose explanations.

    I believe Postfix can do this, however, I did not come across any guides for my scenario. I'm open to other tools.

    Both servers are Linux (Redhat/Centos).

  • Ra_
    Ra_ about 8 years
    Yes, again edit /etc/postfix/main.cf and sdet interface: inet_interfaces = <YOUR_INTERFACE_ADDR>. listen port: <YOUR_LISTEN_PORT> inet n - n - - smtpd Yes, you have to open the addresses/ports you are listening.