postfix : Configure outgoing relay server

Update /etc/postfix/main.cf and add the name of your outgoing/relaying mailhost as “relayhost”. Ensure that the relay server is accepting your email first.

e.g. if the outgoing relay is mailhost.xyzserver.com sendmail configuration should look like following.

# INTERNET OR INTRANET

# The relayhost parameter specifies the default host to send mail to
# when no entry is matched in the optional transport(5) table. When
# no relayhost is given, mail is routed directly to the destination.
#
# On an intranet, specify the organizational domain name. If your
# internal DNS uses no MX records, specify the name of the intranet
# gateway host instead.
#
# In the case of SMTP, specify a domain, host, host:port, [host]:port,
# [address] or [address]:port; the form [host] turns off MX lookups.
#
# If you're connected via UUCP, see also the default_transport parameter.
#
#relayhost = $mydomain
#relayhost = [gateway.my.domain]
#relayhost = [mailserver.isp.tld]
#relayhost = uucphost
#relayhost = [an.ip.add.ress]
relayhost = mailhost.xyzserver.com

After that restart postscript.

service postscript restart

 

Sendmail : Configure outgoing relay server

Edit following in /etc/mail/sendmail.cf and add the name of your outgoing/relaying mailhost. Ensure that the relay server is accepting your email first.

# "Smart" relay host (may be null)
DS

e.g. if the outgoing relay is mailhost.xyzserver.com sendmail configuration should look like following.

# "Smart" relay host (may be null)
DS mailhost.xyzserver.com

After that restart the sendmail.

/etc/init.d/sendmail stop
/etc/init.d/sendmail start