Sendmail smart relay host

A blast from the past!

In the old days, before the rise of modern email services like Gmail and Outlook, sendmail was a popular email transfer agent (MTA) that allowed users to send and receive email. One of the features of sendmail was the ability to use a "smart relay host" to forward email to other mail servers.

A smart relay host is a mail server that can analyze the recipient's email address and determine whether to forward the email to another mail server or deliver it locally. This was useful in situations where a mail server was not directly connected to the recipient's mail server, but could still forward email to a relay host that was closer to the recipient.

Here's an example of how you might configure sendmail to use a smart relay host:

# /etc/sendmail.cf

# Set the relay host
RELAYHOST=smtp.example.com

# Define a smart relay host rule
R$+ C< > $=w

In this example, the RELAYHOST variable is set to smtp.example.com, which is the IP address or hostname of the smart relay host. The R$+ C< > $=w rule tells sendmail to use the smart relay host for all email addresses that match the pattern R$+, which is a regular expression that matches any recipient email address.

When sendmail receives an email message, it will analyze the recipient's email address using the regular expression R$+. If the email address matches the pattern, sendmail will forward the email to the smart relay host specified in the RELAYHOST variable. The smart relay host will then analyze the recipient's email address and determine whether to forward the email to another mail server or deliver it locally.

Smart relay hosts were commonly used in the past to route email through the Internet, especially in situations where a mail server was not directly connected to the recipient's mail server. However, with the rise of modern email services and the widespread use of DNS-based email routing, the need for smart relay hosts has largely disappeared.