postfix email relay configuration - problem

Hello,

We have 2 servers, server A and Server B in same domain. I have already configured the Serevr A to send an email to the internet (outside domain) by opening the port 25 to the internet.

Now I need to send an email to the outside domain from Server B using server A. I have opened the port between these two servers but not to the internet from server B.

Please help me to configure the server B mail settings to send the Email outside the domain through server A

Regards
Sathish G

Add a relayhost to your main.cf in /etc/postfix/ on the server you wish to act as the secondary mail server.

f.ex.


relayhost = [my.cool.smtp.server]:25

Where my.cool.smtp.server is naturally the IP address of your primary SMTP server you wish to relay through.

Your main postfix server must allow relaying through it from the ip/range that your other server is relaying from so make sure mynetworks is properly configured or it’ll refuse relaying.

Or alternatively edit /etc/sysconfig/postfix and change:

POSTFIX_RELAYHOST=“xxx.xxx.xxx.xxx”

To the server you wish to use as a relay target. That way you can use openSUSE’s default configuration and tools to get the job done.

All up to you and how you want to maintain the server.

Thanks Miuku,

I am getting the following error in the main server, could you please help me to fix it

NOQUEUE: reject: RCPT from integritystg.cummins.com[10.152.184.40]: 554 5.7.1 <xxxx@yyyyy.com>: Relay access denied; from=<xxxxxx@server2.com> to=<xxxx@yyyyy.com> proto=ESMTP helo=<cua43276int101.managed.cln>

Thanks,
Sathish G

You need to define, on the main server, in main.cf in the postfix configuration the parameter mynetworks_style and mynetworks that includes the secondary server.

If you have edited the main.cf by hand and not used the openSUSE YAST tool to do this, you will find it near the end of the file;


mynetworks_style = subnet
mynetworks = xxx.xxx.xxx.0/24

This is only suitable as a configuration if you have control of an entire subnet and you wish clients inside it to be able to relay through it - for example 192.168.1.0/24

Google for mynetworks_style and mynetworks postfix to see examples and how to control what hosts can relay through it. Make sure you do not accidentally make it a server everyone can relay through.