Thursday, 7 October 2010

Configure Solaris 10 for mail relaying

We have a number of devices on our network that can send email alerts. It makes sense to have a central server that can act as a mail relay. We have a Solaris 10 server "sol10" that comes bundled with sendmail, but this is not configured to act as a mail relay.

In order to make the Solaris server relay messages to another host involves editing the /etc/mail/ file and setting the value:

# "Smart" relay host (may be null)

Obviously replace "" with the FQDN of your real mail server that you want to send email through. Restart sendmail by running:

svcadm restart /network/smtp

This setting will allow mail that originates on "sol10" to be sent out, but does not help when you want other devices on your network to use sol10 as it's relay. The answer was surprisingly easy:

Create a new file /etc/mail/relay-domains. In this file, put the networks you want sol10 to accept email from. For example, if you have devices on the, and networks and want to use sol10 as the relay, enter the following lines in /etc/mail/relay-domains:


Once done, restart sendmail again (same command as above), configure your clients to use the Solaris server as their SMTP server and check the output in /var/log/syslog while you send a test message.

No comments: