"How To" Guides for UNIX System Administration

Outgoing Mail Administration

Aliases and Distribution Lists

Aliases and distribution lists can be maintained by updating the /etc/mail/aliases file. After making any changes, rebuild the alias database with this command:

sendmail -bi

Be sure to resolve any warnings or errors, since even warnings can prevent the aliases from being processed.

SMTP Configuration

Outgoing SMTP e-mail is handled by sendmail. The configuration is stored in /etc/sendmail.cf, which may be a symbolic link to /etc/mail/sendmail.cf. Refresh the configuration after making any changes:

refresh -s sendmail
Test Outgoing E-mail

Outgoing e-mail can be tested by creating a test file with the message, including SMTP headers, and then routing it with:

sendmail -t < mymsg.txt

An even more granular test can be performed using telnet:

telnet smtp.ExampleOnly.com 25
HELO client.ExampleOnly.com
MAIL From: First.Last@ExampleOnly.com
RCPT To: Someone.Else@ExampleOnly.com
DATA
To: Someone.Else@ExampleOnly.com
From: First.Last@ExampleOnly.com
Subject: My test message
Here is my message.
.
QUIT

If the RCPT command responds with Relaying denied then the sending host needs to be included as one of the trusted host names specified by the w class (Cw) in the sendmail SMTP configuration or added to the list in the file referenced by the Fw... line there (possibly /etc/mail/local-host-names).

Allow Mail Relay To/From Specific Hosts

To allow mail relay to specific domains on the local host, create a file named local-host-names in the /etc/mail directory containing the list of domains that are hosted on the local machine.

To allow mail relay from specific host names, create a file named relay-domains in the /etc/mail directory containing the list of host names that are allowed to send mail.

Last updated Monday April 16, 2007


Printer-friendly PDF* format:

How To Guides for UNIX System Administration

This Section

You are currently viewing this page in XHTML 1 Style Sheet* format (* see Clicklets for more infomation). This document is also available in XHTML 1*XML*HTML 4*HTML 5 Style Sheet*HTML 5 XML*HTML 5 non-XML* XHTML 2* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.