You are on page 1of 3

7/23/2017 How to configure a Sendmail Smart Host - Red Hat Customer Portal

How to configure a Sendmail Smart Host


SOLUTION VERIFIED - Updated May 31 2017 at 12:08 AM - English

Environment
Red Hat Enterprise Linux 3
Red Hat Enterprise Linux 4
Red Hat Enterprise Linux 5
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 7
Sendmail

Issue
How to configure a Sendmail smart host
How to forward all emails destined for remote recipients to a centralized mail server
How to configure a relay host in Sendmail

Resolution
To configure a Sendmail Smart Host, follow these steps:

1. The /etc/mail/sendmail.mc file contains the following line:

Raw

dnl define(`SMART_HOST',`smtp.your.provider')dnl

Remove dnl ("delete through newline") from the beginning of the line :

Raw

define(`SMART_HOST',`smtp.your.provider') dnl

2. Now substitute smtp.your.provider with the address of the SMTP relay server. There are four
possible formats:

hostname - If MX record is present, it is used, otherwise DNS is looked up normally.

For example:

Raw

define(`SMART_HOST',`redhat.com')
https://access.redhat.com/solutions/10658 1/3
7/23/2017 How to configure a Sendmail Smart Host - Red Hat Customer Portal
define(`SMART_HOST',`redhat.com')

[hostname] - DNS is looked up normally, MX record is ignored. Use this if the MX record is
different from the hostname, and you do not want to use it.

For example:

Raw

define(`SMART_HOST',`[redhat.com]')

[IPv4 address] - The provided IPv4 address is used.

For example:

Raw

define(`SMART_HOST',`[192.0.2.4]')

[IPv6 address] - The provided IPv6 address is used.

For example:

Raw

define(`SMART_HOST',`[IPv6:2002:c0a8:51d2::23f4]')

3. Install the sendmail-cf package:

Raw

# yum install sendmail-cf

4. Generate a new sendmail.cf file. This happens automatically(only in RHEL7) when


the sendmail service is restarted:

Rebuild sendmail.cf manually with the following command:

Raw

# make -C /etc/mail
# service sendmail restart
https://access.redhat.com/solutions/10658 2/3
7/23/2017 How to configure a Sendmail Smart Host - Red Hat Customer Portal
# service sendmail restart

OR

Raw

# systemctl restart sendmail

https://access.redhat.com/solutions/10658 3/3

You might also like