<chapter id="mailadmin-1"><title>Mail
Services (Tasks)</title><highlights><para>This chapter describes how to
set up and administer mail services.
If you are not familiar with administering
mail services, read <olink targetptr="mailintro-1" remap="internal">Chapter&nbsp;12,
Mail Services (Overview)</olink> for
an introduction to the components
of mail services. This chapter also
provides a description of a typical
mail service configuration, as shown
in <olink targetptr="mailintro-fig-18" remap="internal">Figure
12&ndash;1</olink>. The following
list can help you find groups of related
procedures that are covered in this
chapter.</para><itemizedlist><listitem><para><olink targetptr="mailadmin-270" remap="internal">Task Map
for Mail Services</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-263" remap="internal">Setting
Up Mail Services (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-260" remap="internal">Administering
Mail Alias Files (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-262" remap="internal">Administering
the Queue Directories (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-264" remap="internal">Administering
.forward Files (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-265" remap="internal">Troubleshooting
Procedures and Tips for Mail Services
(Task Map)</olink></para>
</listitem>
</itemizedlist><para>See <olink targetptr="mailrefer-1" remap="internal">Chapter&nbsp;14, Mail Services (Reference)</olink> for a more detailed description
of the components of mail services.
This chapter also describes the mail
service programs and files, the mail
routing process, the interactions
of <command>sendmail</command> with
name services, and the features in
version 8.13 of <command>sendmail</command> that
are not fully described in the <olink targetdoc="refman1m" targetptr="sendmail-1m" remap="external"><citerefentry><refentrytitle>sendmail</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</highlights><sect1 id="mailadmin-270"><title>Task
Map for Mail Services</title><para>The following table refers
you to other task maps that focus
on a specific group of procedures.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="33*"/><colspec colname="colspec1" colwidth="33*"/><colspec colname="colspec2" colwidth="33*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Setting up mail services</para>
</entry><entry><para>Use these procedures to set
up each component of your mail service.
Learn how to set up a mail server,
a mail client, a mail host, a mail
gateway, and a virtual host. Learn
how to use DNS with <command>sendmail</command>.</para>
</entry><entry><para><olink targetptr="mailadmin-263" remap="internal">Setting
Up Mail Services (Task Map)</olink></para>
</entry>
</row><row><entry><para>Building a <command>sendmail</command> configuration
file</para>
</entry><entry><para>Use this procedure to modify
your <filename>sendmail.cf</filename> file.
See an example of how to enable domain
masquerading.</para>
</entry><entry><para><olink targetptr="mailadmin-43" remap="internal">Building
the sendmail.cf Configuration File</olink></para>
</entry>
</row><row><entry><para>Setting SMTP to use Transport
Layer Security (TLS)</para>
</entry><entry><para>Use this procedure to enable
SMTP to have secure connections with
TLS.</para>
</entry><entry><para><olink targetptr="ganav" remap="internal">Setting
SMTP to Use TLS</olink></para>
</entry>
</row><row><entry><para>Managing mail delivery with
an alternate configuration</para>
</entry><entry><para>Use this procedure to prevent
mail delivery problems that can occur
if the master daemon is disabled.</para>
</entry><entry><para><olink targetptr="mailadmin-377" remap="internal">Managing
Mail Delivery by Using an Alternate
Configuration</olink></para>
</entry>
</row><row><entry><para>Administering mail alias files</para>
</entry><entry><para>Use these procedures to provide
aliasing on your network. Learn how
to manage entries in NIS+ tables.
Also, learn how to set up an NIS map,
a local mail alias, a keyed map file,
and a postmaster alias.</para>
</entry><entry><para><olink targetptr="mailadmin-260" remap="internal">Administering
Mail Alias Files (Task Map)</olink></para>
</entry>
</row><row><entry><para>Administering the mail queue</para>
</entry><entry><para>Use these procedures to provide
smooth queue processing. Learn how
to display and move the mail queue,
force mail queue processing, and run
a subset of the mail queue. Also,
learn how to run the old mail queue.</para>
</entry><entry><para><olink targetptr="mailadmin-262" remap="internal">Administering
the Queue Directories (Task Map)</olink></para>
</entry>
</row><row><entry><para>Administering <filename>.forward</filename> files</para>
</entry><entry><para>Use these procedures to disable <filename>.forward</filename> files or change
the search path of the <filename>.forward</filename> file. Also, learn how
to permit users to use the <filename>.forward</filename> file by creating and populating <filename>/etc/shells</filename>.</para>
</entry><entry><para><olink targetptr="mailadmin-264" remap="internal">Administering
.forward Files (Task Map)</olink></para>
</entry>
</row><row><entry><para>Troubleshooting procedures and
tips for mail services</para>
</entry><entry><para>Use these procedures and tips
to resolve problems with your mail
service. Learn how to test the mail
configuration, check mail aliases,
test the <command>sendmail</command> rule
sets, verify connections to other
systems, and log messages. Also, learn
where to look for other mail diagnostic
information.</para>
</entry><entry><para><olink targetptr="mailadmin-265" remap="internal">Troubleshooting
Procedures and Tips for Mail Services
(Task Map)</olink></para>
</entry>
</row><row><entry><para>Resolving error messages</para>
</entry><entry><para>Use the information in this
section to resolve some mail-related
error messages.</para>
</entry><entry><para><olink targetptr="mailadmin-219" remap="internal">Resolving
Error Messages</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="mailadmin-2"><title>Planning
Your Mail System</title><para>The following list describes
some concerns that should be part
of your planning process.</para><itemizedlist><listitem><para>Determine the type
of mail configuration that meets your
requirements. This section describes
two basic types of mail configuration
and briefly lists what you need to
set up each configuration. If you
need to set up a new mail system or
if you are expanding an existing one,
you might find this section useful. <olink targetptr="mailadmin-3" remap="internal">Local Mail
Only</olink> describes the first configuration
type, and <olink targetptr="mailadmin-7" remap="internal">Local Mail and a Remote Connection</olink> describes
the second type.</para>
</listitem><listitem><para>As necessary, choose
the systems that are to act as mail
servers, mail hosts, and mail gateways.</para>
</listitem><listitem><para>Make a list of all
the mail clients for which you are
providing service and include the
location of their mailboxes. This
list can help you when you are ready
to create mail aliases for your users.</para>
</listitem><listitem><para>Decide how to update
aliases and forward mail messages.
You might set up an <literal>aliases</literal> mailbox
as a place for users to send requests
for mail forwarding. Users could also
use this mailbox to send requests
for changes to their default mail
alias. If your system uses NIS or
NIS+, you can administer mail forwarding,
rather than requiring users to manage
mail forwarding. <olink targetptr="mailadmin-260" remap="internal">Administering
Mail Alias Files (Task Map)</olink> provides
a list of tasks that are related to
aliasing. <olink targetptr="mailadmin-264" remap="internal">Administering
.forward Files (Task Map)</olink> provides
a list of tasks that are related to
managing <filename>.forward</filename> files.</para>
</listitem>
</itemizedlist><para>After you have completed the
planning process, set up the systems
on your site to perform the functions
that are described in <olink targetptr="mailadmin-263" remap="internal">Setting
Up Mail Services (Task Map)</olink>.
For other task information, refer
to <olink targetptr="mailadmin-270" remap="internal">Task
Map for Mail Services</olink>.</para><sect2 id="mailadmin-3"><title>Local
Mail Only</title><para>The simplest mail configuration,
as shown in <olink targetptr="mailadmin-fig-4" remap="internal">Figure
13&ndash;1</olink>, is two or more
workstations that are connected to
one mail host. Mail is completely
local. All the clients store mail
on their local disks, and the clients
act as mail servers. Mail addresses
are parsed by using the <filename>/etc/mail/aliases</filename> files.</para><figure id="mailadmin-fig-4"><title>Local
Mail Configuration</title><mediaobject><imageobject><imagedata entityref="fig37.epsi"/>
</imageobject><textobject><simpara>Diagram shows
the dependencies of a mail host to
mail clients.</simpara>
</textobject>
</mediaobject>
</figure><para>To set up this kind of mail
configuration, you need the following.</para><itemizedlist><listitem><para>The default <filename>/etc/mail/sendmail.cf</filename> file, which requires no
editing, on each mail client system.</para>
</listitem><listitem><para>A server that is designated
as the mail host. If you are running
NIS or NIS+, you can make this designation
by adding <literal>mailhost.</literal><replaceable>domain-name</replaceable><literal></literal> to
the <filename>/etc/hosts</filename> file
on the mail host. If you are running
another name service, such as DNS
or LDAP, you must provide additional
information in the <filename>/etc/hosts</filename> file.
See <olink targetptr="mailadmin-29" remap="internal">How
to Set Up a Mail Host</olink>.</para>
</listitem><listitem><para>If you are using a
name service other than NIS or NIS+,
you need matching <filename>/etc/mail/aliases</filename> files on any system that
has a local mailbox.</para>
</listitem><listitem><para>Enough space in <filename>/var/mail</filename> on each mail
client system to hold the mailboxes.</para>
</listitem>
</itemizedlist><para>For task information about setting
up your mail service, refer to <olink targetptr="mailadmin-13" remap="internal">Setting Up
Mail Services</olink>. If you are
looking for a particular procedure
that is related to setting up your
mail service, refer to <olink targetptr="mailadmin-263" remap="internal">Setting
Up Mail Services (Task Map)</olink>.</para>
</sect2><sect2 id="mailadmin-7"><title>Local
Mail and a Remote Connection</title><para>The most common mail configuration
in a small network is shown in <olink targetptr="mailadmin-fig-8" remap="internal">Figure
13&ndash;2</olink>. One system includes
the mail server, the mail host, and
the mail gateway that provides the
remote connection. Mail is distributed
by using the <filename>/etc/mail/aliases</filename> files
on the mail gateway. No name service
is required.</para><figure id="mailadmin-fig-8"><title>Local
Mail Configuration With a UUCP Connection</title><mediaobject><imageobject><imagedata entityref="fig38.epsi"/>
</imageobject><textobject><simpara>Diagram shows
the dependencies of mail clients to
a mail gateway.</simpara>
</textobject>
</mediaobject>
</figure><para>In this configuration,
you can assume that the mail clients
mount their mail files from <filename>/var/mail</filename> on the mail host. To set
up this kind of mail configuration,
you need the following.</para><itemizedlist><listitem><para>The default <filename>/etc/mail/sendmail.cf</filename> file on each mail client
system. This file does not require
any editing.</para>
</listitem><listitem><para>A server that is designated
as the mail host. If you are running
NIS or NIS+, you can make this designation
by adding <literal>mailhost.</literal><replaceable>domain-name</replaceable><literal></literal> to
the <filename>/etc/hosts</filename> file
on the mail host. If you are running
another name service, such as DNS
or LDAP, you must provide additional
information in the <filename>/etc/hosts</filename> file.
See <olink targetptr="mailadmin-29" remap="internal">How
to Set Up a Mail Host</olink>.</para>
</listitem><listitem><para>If you are using a
name service other than NIS or NIS+,
you need matching <filename>/etc/mail/aliases</filename> files on any system that
has a local mailbox.</para>
</listitem><listitem><para>Enough space in <filename>/var/mail</filename> on the mail server
to hold the client mailboxes.</para>
</listitem>
</itemizedlist><para>For task information about setting
up your mail service, refer to <olink targetptr="mailadmin-13" remap="internal">Setting Up
Mail Services</olink>. If you are
looking for a particular procedure
that is related to setting up your
mail service, refer to <olink targetptr="mailadmin-263" remap="internal">Setting
Up Mail Services (Task Map)</olink>.</para>
</sect2>
</sect1><sect1 id="mailadmin-263"><title>Setting
Up Mail Services (Task Map)</title><para>The following table describes
the procedures for setting up mail
services.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec3" colwidth="33*"/><colspec colname="colspec4" colwidth="33*"/><colspec colname="colspec5" colwidth="33*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Setting up a mail server</para>
</entry><entry><para>Steps to enable a server to
route mail</para>
</entry><entry><para><olink targetptr="mailadmin-15" remap="internal">How
to Set Up a Mail Server</olink></para>
</entry>
</row><row><entry><para>Setting up a mail client</para>
</entry><entry><para>Steps to enable a user to receive
mail</para>
</entry><entry><para><olink targetptr="mailadmin-20" remap="internal">How
to Set Up a Mail Client</olink></para>
</entry>
</row><row><entry><para>Setting up a mail host</para>
</entry><entry><para>Steps to establish a mail host
that can resolve email addresses</para>
</entry><entry><para><olink targetptr="mailadmin-29" remap="internal">How
to Set Up a Mail Host</olink></para>
</entry>
</row><row><entry><para>Setting up a mail gateway</para>
</entry><entry><para>Steps to manage communication
with networks outside your domain</para>
</entry><entry><para><olink targetptr="mailadmin-37" remap="internal">How
to Set Up a Mail Gateway</olink></para>
</entry>
</row><row><entry><para>Using DNS with <command>sendmail</command></para>
</entry><entry><para>Steps to enable DNS host lookups</para>
</entry><entry><para><olink targetptr="mailadmin-122" remap="internal">How
to Use DNS With sendmail</olink></para>
</entry>
</row><row><entry><para>Setting up a virtual host</para>
</entry><entry><para>Steps to assign more than one
IP address to a host</para>
</entry><entry><para><olink targetptr="mailadmin-268" remap="internal">Setting
Up a Virtual Host</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="mailadmin-13"><title>Setting
Up Mail Services</title><para>You can readily set up a mail
service if your site does not provide
connections to email services outside
your company or if your company is
in a single domain.</para><para>Mail requires two types of configurations
for local mail. Refer to <olink targetptr="mailadmin-fig-4" remap="internal">Figure
13&ndash;1</olink> in <olink targetptr="mailadmin-3" remap="internal">Local Mail
Only</olink> for a representation
of these configurations. Mail requires
two more configurations for communication
with networks outside your domain.
Refer to <olink targetptr="mailintro-fig-18" remap="internal">Figure
12&ndash;1</olink> in <olink targetptr="mailintro-17" remap="internal">Overview
of the Hardware Components</olink> or <olink targetptr="mailadmin-fig-8" remap="internal">Figure
13&ndash;2</olink> in <olink targetptr="mailadmin-7" remap="internal">Local Mail
and a Remote Connection</olink> for
a representation of these configurations.
You can combine these configurations
on the same system or provide these
configurations on separate systems.
For example, if your mail host and
mail server functions are on the same
system, follow the directions in this
section for setting up that system
as a mail host. Then, follow the directions
in this section for setting up the
same system as a mail server.</para><note><para>The following procedures
for setting up a mail server and mail
client apply when mailboxes are NFS
mounted. However, mailboxes typically
are maintained in locally mounted <command>/var/mail</command> directories, which
eliminates the need for the following
procedures.</para>
</note><itemizedlist><para>Refer to the following:</para><listitem><para><olink targetptr="mailadmin-15" remap="internal">How to Set
Up a Mail Server</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-20" remap="internal">How to Set
Up a Mail Client</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-29" remap="internal">How to Set
Up a Mail Host</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-37" remap="internal">How to Set
Up a Mail Gateway</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-122" remap="internal">How to Use
DNS With sendmail</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-268" remap="internal">Setting
Up a Virtual Host</olink></para>
</listitem>
</itemizedlist><task id="mailadmin-15"><title>How
to Set Up a Mail Server</title><tasksummary><para>No special steps are required
to set up a mail server that is only
serving mail for local users. The
user must have an entry in the password
file or in the namespace. Also, for
mail to be delivered, the user should
have a local home directory for checking
the <filename>~/.forward</filename> file.
For this reason, home directory servers
are often set up as the mail server. <olink targetptr="mailrefer-68" remap="internal">Hardware
Components</olink> in <olink targetptr="mailrefer-1" remap="internal">Chapter&nbsp;14,
Mail Services (Reference)</olink> provides
more information about the mail server.</para><para>The mail server can route mail
for many mail clients. This type of
mail server must have adequate spooling
space for client mailboxes.</para><note><para>The <command>mail.local</command> program
automatically creates mailboxes in
the <filename>/var/mail</filename> directory
the first time a message is delivered.
You do not need to create individual
mailboxes for your mail clients.</para><para>For clients to access their
mailboxes, the <filename>/var/mail</filename> directory
should be available for remote mounting.
Alternately, a service such as Post
Office Protocol (POP) or Internet
Message Access Protocol (IMAP) should
be available from the server. The
following task shows you how to set
up a mail server by using the <filename>/var/mail</filename> directory. To provide
configuration guidelines for POP or
IMAP is beyond the scope of this document.</para>
</note><para>For the following task, ensure
that the <filename>/etc/dfs/dfstab</filename> file
shows that the <filename>/var/mail</filename> directory
is exported.</para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-273"><para>Stop <command>sendmail</command>.</para><screen># <userinput>svcadm -t disable network/smtp:sendmail</userinput></screen>
</step><step id="mailadmin-step-17"><para>Check if the <filename>/var/mail</filename> directory is available
for remote access.</para><screen># <userinput>share</userinput></screen><para>If the <filename>/var/mail</filename> directory
is listed, proceed to step 5.</para><para>If the <filename>/var/mail</filename> directory
is not listed or if no list appears,
continue with the appropriate substep.</para><substeps><step performance="optional" id="mailadmin-step-230"><para>If no
list appears, start NFS services.</para><para>Follow the procedure, <olink targetptr="rfsadmin-57" remap="internal">How to Set
Up Automatic File-System Sharing</olink>,
to use the <filename>/var/mail</filename> directory
to start NFS services.</para>
</step><step performance="optional" id="mailadmin-step-231"><para>If the <filename>/var/mail</filename> directory is
not included in the list, add the
directory to <filename>/etc/dfs/dfstab</filename>.</para><para>Add the following command
line to the <filename>/etc/dfs/dfstab</filename> file.</para><screen><userinput>share -F nfs -o rw /var/mail</userinput></screen>
</step>
</substeps>
</step><step id="mailadmin-step-19"><para>Make
the file system available for mounting.</para><screen># <userinput>shareall</userinput></screen>
</step><step id="mailadmin-step-274"><para>Ensure
that your name service has been started.</para><substeps><step performance="optional" id="mailadmin-step-232"><para>If you
are running NIS, use this command.</para><screen># <userinput>ypwhich</userinput></screen><para>For more information, refer
to the <olink targetdoc="refman1" targetptr="ypwhich-1" remap="external"><citerefentry><refentrytitle>ypwhich</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para>
</step><step performance="optional" id="mailadmin-step-233"><para>If you
are running NIS+, use this command.</para><screen># <userinput>nisls</userinput></screen><para>For more information, refer
to the <olink targetdoc="refman1" targetptr="nisls-1" remap="external"><citerefentry><refentrytitle>nisls</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para>
</step><step performance="optional" id="mailadmin-step-234"><para>If you
are running DNS, use this command.</para><screen># <userinput>nslookup <replaceable>hostname</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>hostname</replaceable></term><listitem><para>Use your host name.</para>
</listitem>
</varlistentry>
</variablelist><para>For more information, refer
to the <olink targetdoc="refman1m" targetptr="nslookup-1m" remap="external"><citerefentry><refentrytitle>nslookup</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</step><step performance="optional" id="mailadmin-step-235"><para>If you
are running LDAP, use this command.</para><screen># <userinput>ldaplist</userinput></screen><para>For more information, refer
to the <olink targetdoc="refman1" targetptr="ldaplist-1" remap="external"><citerefentry><refentrytitle>ldaplist</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para>
</step>
</substeps>
</step><step id="mailadmin-step-276"><para>Restart <command>sendmail</command>.</para><screen># <userinput>svcadm enable network/smtp:sendmail</userinput></screen>
</step>
</procedure>
</task><task id="mailadmin-20"><title>How
to Set Up a Mail Client</title><tasksummary><para>A mail client is a user
of mail services with a mailbox on
a mail server. Additionally, the mail
client has a mail alias in the <filename>/etc/mail/aliases</filename> file
that points to the location of the
mailbox.</para><note><para>You can also perform the
task of setting up a mail client by
using a service such as Post Office
Protocol (POP) or Internet Message
Access Protocol (IMAP). However, to
provide configuration guidelines for
POP or IMAP is beyond the scope of
this document.</para>
</note>
</tasksummary><procedure><step id="mailadmin-step-22"><para>Become
superuser on the mail client's system
or assume an equivalent role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-277"><para>Stop <command>sendmail</command>.</para><screen># <userinput>svcadm -t disable network/smtp:sendmail</userinput></screen>
</step><step id="mailadmin-step-23"><para>Ensure that a <filename>/var/mail</filename> mount point exists on
the mail client's system.   </para><para>The mount point should have
been created during the installation
process. You can use <command>ls</command> to
ensure that the file system exists.
The following example shows the response
that you receive if the file system
has not been created.</para><screen># <userinput>ls -l /var/mail</userinput>
/var/mail not found</screen>
</step><step id="mailadmin-step-278"><para>Ensure
that no files are in the <filename>/var/mail</filename> directory.</para><para>If
mail files do exist in this directory,
you should move them so that they
are not covered when the <filename>/var/mail</filename> directory is mounted from
the server.</para>
</step><step id="mailadmin-step-24"><para>Mount the <filename>/var/mail</filename> directory from the mail
server. </para><para>You can mount the mail
directory automatically or at boot
time.  </para><substeps performance="optional"><step performance="optional" id="mailadmin-step-25"><para>Mount <filename>/var/mail</filename> automatically.</para><para>Add an entry such as the
following to the <filename>/etc/auto_direct</filename> file.</para><screen>/var/mail -rw,hard,actimeo=0 <replaceable>server</replaceable>:/var/mail</screen><variablelist><varlistentry><term><replaceable>server</replaceable></term><listitem><para>Use the assigned server
name.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step performance="optional" id="mailadmin-step-26"><para>Mount <filename>/var/mail</filename> at boot time.</para><para>Add the following entry to the <filename>/etc/vfstab</filename> file. This
entry permits the <filename>/var/mail</filename> directory
on the mail server that is specified
to mount the local <filename>/var/mail</filename> directory.</para><screen><replaceable>server</replaceable>:/var/mail - /var/mail nfs - no rw,hard,actimeo=0</screen><para>The client's mailbox is automatically
mounted whenever the system is rebooted.
If you are not rebooting the system,
type the following command to mount
the client mailbox.</para><screen># <userinput>mountall</userinput></screen><caution><para>For mailbox locking
and mailbox access to work properly,
you must include the <option role="nodash">actimeo=0</option> option
when mounting mail from an NFS server.</para>
</caution>
</step>
</substeps>
</step><step id="mailadmin-step-27"><para>Update <filename>/etc/hosts</filename>.</para><para>Edit
the <filename>/etc/hosts</filename> file
and add an entry for the mail server.
This step is not required if you are
using a name service. </para><screen># <userinput>cat /etc/hosts</userinput>
#
# Internet host table
#
..
<replaceable>IP-address</replaceable>     <replaceable>mailhost</replaceable>  mailhost  mailhost.<replaceable>example.com</replaceable></screen><variablelist><varlistentry><term><replaceable>IP-address</replaceable></term><listitem><para>Use the assigned IP
addresses.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>example.com</replaceable></term><listitem><para>Use the assigned domain.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>mailhost</replaceable></term><listitem><para>Use the assigned mailhost.</para>
</listitem>
</varlistentry>
</variablelist><para>For more information, refer
to the <olink targetdoc="refman4" targetptr="hosts-4" remap="external"><citerefentry><refentrytitle>hosts</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page.</para>
</step><step id="mailadmin-step-28"><para>Add
an entry for the client to one of
the alias files.</para><para>Refer
to <olink targetptr="mailadmin-260" remap="internal">Administering
Mail Alias Files (Task Map)</olink> for
a task map about administering mail
alias files. Note that the <command>mail.local</command> program automatically creates
mailboxes in the <filename>/var/mail</filename> directory
the first time a message is delivered.
You do not need to create individual
mailboxes for your mail clients.</para>
</step><step id="mailadmin-step-211"><para>Restart <command>sendmail</command>.</para><screen># <userinput>svcadm enable network/smtp:sendmail</userinput></screen>
</step>
</procedure>
</task><task id="mailadmin-29"><title>How
to Set Up a Mail Host</title><tasksummary><para>A mail host resolves email
addresses and reroutes mail within
your domain. A good candidate for
a mail host is a system that provides
your network with a remote connection
or connects your network to a parent
domain. The following procedure shows
you how to set up a mail host.</para>
</tasksummary><procedure><step id="mailadmin-step-31"><para>Become
superuser on the mail host system
or assume an equivalent role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-279"><para>Stop <command>sendmail</command>.</para><screen># <userinput>svcadm -t disable network/smtp:sendmail</userinput></screen>
</step><step id="mailadmin-step-32"><para>Verify
the host-name configuration.</para><para>Run the <filename>check-hostname</filename> script to verify that <command>sendmail</command> can identify the
fully qualified host name for this
server.</para><screen>% <userinput>/usr/sbin/check-hostname</userinput>
hostname phoenix OK: fully qualified as phoenix.example.com</screen><para>If this script is not successful
in identifying the fully qualified
host name, you need to add the fully
qualified host name as the first alias
for the host in <filename>/etc/hosts</filename>. </para>
</step><step id="mailadmin-step-33"><para>Update
the <filename>/etc/hosts</filename> file.</para><para>Choose the step that
is appropriate for you.</para><substeps performance="optional"><step performance="optional" id="mailadmin-step-226"><para>If you
are using NIS or NIS+, edit the <filename>/etc/hosts</filename> file on the
system that is to be the new mail
host. </para><para>Add the word <literal>mailhost</literal> and <literal>mailhost.</literal><replaceable>domain</replaceable><literal></literal> after
the IP address and system name of
the mail host system.</para><screen><replaceable>IP-address</replaceable> <replaceable>mailhost</replaceable> mailhost mailhost.<replaceable>domain</replaceable> loghost</screen><variablelist><varlistentry><term><replaceable>IP-address</replaceable></term><listitem><para>Use the assigned IP
address.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>mailhost</replaceable></term><listitem><para>Use the system name
of the mail host system.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>domain</replaceable></term><listitem><para>Use the expanded domain
name.</para>
</listitem>
</varlistentry>
</variablelist><para>The system is now designated
as a mail host. The <replaceable>domain</replaceable> should
be identical to the string that is
given as the subdomain name in the
output of the following command.</para><screen>% <userinput>/usr/lib/sendmail -bt -d0 &lt;/dev/null</userinput>
Version 8.13.1+Sun
 Compiled with: LDAPMAP MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7
                NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS
                NISPLUS QUEUE SCANF SMTP USERDB XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = phoenix
  (canonical domain name) $j = phoenix.example.com
         (subdomain name) $m = example.com
              (node name) $k = phoenix
========================================================</screen><para>See the following example of
how the <filename>hosts</filename> file
should look after these changes.</para><screen># <userinput>cat /etc/hosts</userinput>
#
# Internet host table
#
172.31.255.255   localhost        
192.168.255.255  phoenix mailhost mailhost.example.com loghost</screen>
</step><step performance="optional" id="mailadmin-step-326"><para>If you
are not using NIS or NIS+, edit the <filename>/etc/hosts</filename> file on each
system in the network. Create the
following entry.</para><screen><replaceable>IP-address</replaceable> <replaceable>mailhost</replaceable> mailhost <replaceable>mailhost</replaceable>.<replaceable>domain</replaceable> loghost</screen>
</step>
</substeps>
</step><step id="mailadmin-step-36"><para>Restart <command>sendmail</command>.</para><screen># <userinput>svcadm enable network/smtp:sendmail</userinput></screen>
</step><step id="mailadmin-step-280"><para>Test
your mail configuration.</para><para>See <olink targetptr="mailadmin-181" remap="internal">How to Test
the Mail Configuration</olink> for
instructions.</para><note><para>For further information
about mail hosts, refer to <olink targetptr="mailrefer-68" remap="internal">Hardware
Components</olink> in <olink targetptr="mailrefer-1" remap="internal">Chapter&nbsp;14,
Mail Services (Reference)</olink>.</para>
</note>
</step>
</procedure>
</task><task id="mailadmin-37"><title>How
to Set Up a Mail Gateway</title><tasksummary><para>A mail gateway manages
communication with networks outside
your domain. The mailer on the sending
mail gateway can match the mailer
on the receiving system.</para><para>A good candidate for a mail
gateway is a system that is attached
to Ethernet and phone lines. Another
good candidate is a system that is
configured as a router to the Internet.
You can configure the mail host or
another system as the mail gateway.
You might choose to configure more
than one mail gateway for your domain.
If you have UNIX-to-UNIX Copy Program
(UUCP) connections, you should configure
the system (or systems) with UUCP
connections as the mail gateway.</para>
</tasksummary><procedure><step id="mailadmin-step-39"><para>Become
superuser on the mail gateway or assume
an equivalent role.</para><para>Roles
contain authorizations and privileged
commands. For more information about
roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-281"><para>Stop <command>sendmail</command>.</para><screen># <userinput>svcadm -t disable network/smtp:sendmail</userinput></screen>
</step><step id="mailadmin-step-41"><para>Verify
the host-name configuration.</para><para>Run the <filename>check-hostname</filename> script to verify that <command>sendmail</command> can identify the
fully qualified host name for this
server.</para><screen># <userinput>/usr/sbin/check-hostname</userinput>
hostname phoenix OK: fully qualified as phoenix.example.com</screen><para>If this script is not successful
in identifying the fully qualified
host name, you need to add the fully
qualified host name as the first alias
for the host in <filename>/etc/hosts</filename>.
If you need help with this step, refer
to <olink targetptr="mailadmin-step-33" remap="internal">Step&nbsp;4</olink> of <olink targetptr="mailadmin-29" remap="internal">How to Set
Up a Mail Host</olink>. </para>
</step><step id="mailadmin-step-283"><para>Ensure
that your name service has been started.</para><substeps><step performance="optional" id="mailadmin-step-236"><para>If you
are running NIS, use this command.</para><screen># <userinput>ypwhich</userinput></screen><para>For more information, refer
to the <olink targetdoc="refman1" targetptr="ypwhich-1" remap="external"><citerefentry><refentrytitle>ypwhich</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para>
</step><step performance="optional" id="mailadmin-step-237"><para>If you
are running NIS+, use this command.</para><screen># <userinput>nisls</userinput></screen><para>For more information, refer
to the <olink targetdoc="refman1" targetptr="nisls-1" remap="external"><citerefentry><refentrytitle>nisls</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para>
</step><step performance="optional" id="mailadmin-step-238"><para>If you
are running DNS, use this command.</para><screen># <userinput>nslookup <replaceable>hostname</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>hostname</replaceable></term><listitem><para>Use your host name.</para>
</listitem>
</varlistentry>
</variablelist><para>For more information, refer
to the <olink targetdoc="refman1m" targetptr="nslookup-1m" remap="external"><citerefentry><refentrytitle>nslookup</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</step><step performance="optional" id="mailadmin-step-239"><para>If you
are running LDAP, use this command.</para><screen># <userinput>ldaplist</userinput></screen><para>For more information, refer
to the <olink targetdoc="refman1" targetptr="ldaplist-1" remap="external"><citerefentry><refentrytitle>ldaplist</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para>
</step>
</substeps>
</step><step id="mailadmin-step-42"><para>Restart <command>sendmail</command>.</para><screen># <userinput>svcadm enable network/smtp:sendmail</userinput></screen>
</step><step id="mailadmin-step-282"><para>Test
your mail configuration.</para><para>See <olink targetptr="mailadmin-181" remap="internal">How to Test
the Mail Configuration</olink> for
instructions.</para><note><para>For more information about
the mail gateway, refer to <olink targetptr="mailrefer-68" remap="internal">Hardware
Components</olink> in <olink targetptr="mailrefer-1" remap="internal">Chapter&nbsp;14,
Mail Services (Reference)</olink>.</para>
</note>
</step>
</procedure>
</task><task id="mailadmin-122"><title>How
to Use DNS With <command>sendmail</command></title><tasksummary><para>The DNS name service does
not support aliases for individuals.
This name service does support aliases
for hosts or domains that use Mail
Exchanger (MX) records and <literal>CNAME</literal> records. You can specify
host names, domain names, or both
names in the DNS database. For more
information about <command>sendmail</command> and
DNS, see <olink targetptr="mailrefer-24" remap="internal">Interactions of sendmail With Name
Services</olink> in <olink targetptr="mailrefer-1" remap="internal">Chapter&nbsp;14,
Mail Services (Reference)</olink>,
or see the <olink targetdoc="sysadv5" remap="external"><citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink>. </para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-125"><para>Enable
DNS host lookups (NIS+ only).</para><para>Edit the <filename>/etc/nsswitch.conf</filename> file and remove the <literal>#</literal> from the <literal>hosts</literal> definition
that includes the  <option role="nodash">dns</option> flag. The host entry
must include the <filename>dns</filename> flag,
as the following example shows, in
order for the DNS host aliases to
be used. </para><screen># <userinput>grep hosts /etc/nsswitch.conf</userinput>
#hosts:     nisplus [NOTFOUND=return] files
hosts:      dns nisplus [NOTFOUND=return] files</screen>
</step><step id="mailadmin-step-126"><para>Check
for a <literal>mailhost</literal> and <literal>mailhost.</literal><replaceable>domain</replaceable> entry.</para><para>Use <command>nslookup</command> to
ensure that an entry exists for <literal>mailhost</literal> and <literal>mailhost.</literal><replaceable>domain</replaceable><literal></literal> in
the DNS database. For more information,
refer to the <olink targetdoc="refman1m" targetptr="nslookup-1m" remap="external"><citerefentry><refentrytitle>nslookup</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</step>
</procedure>
</task><sect2 id="mailadmin-268"><title>Setting
Up a Virtual Host</title><para>If you need to assign
more than one IP address to a host,
see this Web site: <ulink url="http://www.sendmail.org/virtual-hosting.html" type="url">http://www.sendmail.org/virtual-hosting.html</ulink>. This site provides complete
instructions about how to use <command>sendmail</command> to set up a virtual host.
However, in the &ldquo;Sendmail Configuration&rdquo;
section, do not perform step 3b, as
shown in the following.</para><screen># <userinput>cd sendmail-VERSION/cf/cf</userinput>
# <userinput>./Build mailserver.cf</userinput>
# <userinput>cp mailserver.cf /etc/mail/sendmail.cf</userinput></screen><para>Instead, for the Solaris operating
system, perform the following steps.</para><screen># <userinput>cd /etc/mail/cf/cf</userinput>
# <userinput>/usr/ccs/bin/make</userinput> <replaceable>mailserver</replaceable><userinput>.cf</userinput>
# <userinput>cp</userinput> <replaceable>mailserver</replaceable><userinput>.cf /etc/mail/sendmail.cf</userinput></screen><variablelist><varlistentry><term><replaceable>mailserver</replaceable></term><listitem><para>Use the name of the <filename>.cf</filename> file.</para>
</listitem>
</varlistentry>
</variablelist><para><olink targetptr="mailadmin-43" remap="internal">Building
the sendmail.cf Configuration File</olink> outlines
the same three steps as part of the
build process.</para><para>After you have generated your <filename>/etc/mail/sendmail.cf</filename> file,
you can continue with the next steps
to create a virtual user table.</para>
</sect2>
</sect1><sect1 id="mailadmin-43"><title>Building
the <filename>sendmail.cf</filename> Configuration
File</title><para><olink targetptr="mailadmin-44" remap="internal">How
to Build a New sendmail.cf File</olink> shows
you how to build the configuration
file. Although you can still use older
versions of <filename>sendmail.cf</filename> files,
the best practice is to use the new
format.</para><para>For more details, refer
to the following.</para><itemizedlist><listitem><para><filename>/etc/mail/cf/README</filename> provides a complete description
of the configuration process.</para>
</listitem><listitem><para><ulink url="http://www.sendmail.org" type="url">http://www.sendmail.org</ulink> provides
online information about <command>sendmail</command> configuration.</para>
</listitem><listitem><para><olink targetptr="mailrefer-51" remap="internal">Versions
of the Configuration File</olink> and <olink targetptr="mailrefer-80" remap="internal">sendmail
Configuration File</olink>, in <olink targetptr="mailrefer-1" remap="internal">Chapter&nbsp;14,
Mail Services (Reference)</olink>,
provide some guidance.</para>
</listitem><listitem><para><olink targetptr="mailrefer-114" remap="internal">Additional
and Revised m4 Configuration Macros
From Version 8.12 of sendmail</olink> is
also helpful.</para>
</listitem>
</itemizedlist><task id="mailadmin-44"><title>How
to Build a New <command>sendmail.cf</command> File</title><tasksummary><para>The following procedure shows
you how to build a new configuration
file.</para><note><para><filename>/usr/lib/mail/cf/main-v7sun.mc</filename> is now <filename>/etc/mail/cf/cf/main.mc</filename>.</para>
</note>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-284"><para>Stop <command>sendmail</command>.</para><screen># <userinput>svcadm -t disable network/smtp:sendmail</userinput></screen>
</step><step id="mailadmin-step-46"><para>Make
a copy of the configuration files
that you are changing.</para><screen># <userinput>cd /etc/mail/cf/cf</userinput>
# <userinput>cp sendmail.mc</userinput> <replaceable>myhost</replaceable><userinput>.mc</userinput></screen><variablelist><varlistentry><term><replaceable>myhost</replaceable></term><listitem><para>Select a new name
for your <filename>.mc</filename> file.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="mailadmin-step-47"><para>Edit
the new configuration files (for example, <replaceable>myhost</replaceable><literal>.mc</literal>),
as necessary. </para><para>For example,
add the following command line to
enable domain masquerading.</para><screen># <userinput>cat <replaceable>myhost</replaceable>.mc</userinput>
..
MASQUERADE_AS(`<replaceable>host.domain</replaceable>')</screen><variablelist><varlistentry><term><replaceable>host.domain</replaceable></term><listitem><para>Use the desired host
name and domain name.</para>
</listitem>
</varlistentry>
</variablelist><para>In this example, <command>MASQUERADE_AS</command> causes sent mail to be
labeled as originating from <replaceable>host.domain</replaceable>, rather
than <literal>$j</literal>.</para>
</step><step id="mailadmin-step-48"><para>Build
the configuration file by using <command>m4</command>.</para><screen># <userinput>/usr/ccs/bin/make</userinput> <replaceable>myhost</replaceable><userinput>.cf</userinput></screen>
</step><step id="mailadmin-step-49"><para>Test
the new configuration file by using
the <option>C</option> option to specify
the new file.</para><screen># <userinput>/usr/lib/sendmail -C</userinput> <replaceable>myhost</replaceable><userinput>.cf -v testaddr &lt;/dev/null</userinput></screen><para>While this command displays
messages, it sends a message to <literal>testaddr</literal>. Only outgoing
mail can be tested without restarting
the <command>sendmail</command> service
on the system. For systems that are
not handling mail yet, use the full
testing procedure in <olink targetptr="mailadmin-181" remap="internal">How to Test
the Mail Configuration</olink>.</para>
</step><step performance="required" id="mailadmin-step-50"><para>Install
the new configuration file after making
a copy of the original.</para><screen># <userinput>cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.save</userinput>
# <userinput>cp</userinput> <replaceable>myhost</replaceable><userinput>.cf /etc/mail/sendmail.cf</userinput></screen>
</step><step id="mailadmin-step-51"><para>Restart
the <command>sendmail</command> service.</para><screen># <userinput>svcadm enable network/smtp:sendmail</userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="ganav"><title>Setting SMTP
to Use TLS</title><para>Starting in the Solaris 10 1/06
release, SMTP can use Transport Layer
Security (TLS) in version 8.13 of <command>sendmail</command>. This service to
SMTP servers and clients provides
private, authenticated communications
over the Internet, as well as protection
from eavesdroppers and attackers.
Note that this service is not enabled
by default. </para><task id="fxcty"><title>How to Set
SMTP to Use TLS</title><tasksummary><para>The following procedure uses
sample data to show you how to set
up the certificates that enable <command>sendmail</command> to use TLS. For
more information, see <olink targetptr="fvbrb" remap="internal">Support for Running
SMTP With TLS in Version 8.13 of sendmail</olink>.</para>
</tasksummary><procedure><step><para>Become superuser or assume
an equivalent role.</para><para>Roles
contain authorizations and privileged
commands. For more information about
roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step><para>Stop <command>sendmail</command>.</para><screen># <userinput>svcadm -t disable network/smtp:sendmail</userinput></screen>
</step><step><para>Set up the certificates
that enable <command>sendmail</command> to
use TLS.</para><substeps><step><para>Complete the following:</para><screen># <userinput>cd /etc/mail</userinput>
# <userinput>mkdir -p certs/CA</userinput>
# <userinput>cd certs/CA</userinput>
# <userinput>mkdir certs crl newcerts private</userinput>
# <userinput>echo "01" > serial</userinput>
# <userinput>cp /dev/null index.txt</userinput>
# <userinput>cp /etc/sfw/openssl/openssl.cnf .</userinput></screen>
</step><step><para>Use your preferred text
editor to change the <literal>dir</literal> value
in the <filename>openssl.cnf</filename> file
from <filename>/etc/sfw/openssl</filename> to <filename>/etc/mail/certs/CA</filename>.</para>
</step><step><para>Use the <command>openssl</command> command-line
tool to implement TLS.</para><para>Note
that the following command line generates
interactive text.</para><screen># <userinput>openssl req -new -x509 -keyout private/cakey.pem -out cacert.pem -days 365 \
-config openssl.cnf</userinput>
Generating a 1024 bit RSA private key
.....................................++++++
.....................................++++++
writing new private key to 'private/cakey.pem'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) []:<userinput>US</userinput>
State or Province Name (full name) []:<userinput>California</userinput>
Locality Name (eg, city) []:<userinput>Menlo Park</userinput>
Organization Name (eg, company) [Unconfigured OpenSSL Installation]:<userinput>Sun Microsystems</userinput>
Organizational Unit Name (eg, section) []:<userinput>Solaris</userinput>
Common Name (eg, YOUR name) []:<userinput>somehost.somedomain.example.com</userinput>
Email Address []:<userinput>someuser@example.com</userinput></screen><variablelist><varlistentry><term><literal>req</literal></term><listitem><para>This command creates
and processes certificate requests.</para>
</listitem>
</varlistentry><varlistentry><term><option>new</option></term><listitem><para>This <command>req</command> option
generates a new certificate request.</para>
</listitem>
</varlistentry><varlistentry><term><option>x509</option></term><listitem><para>This <command>req</command> option
creates a self-signed certificate.</para>
</listitem>
</varlistentry><varlistentry><term><option>keyout</option> <filename>private/cakey.pem</filename></term><listitem><para>This <command>req</command> option
enables you to assign <filename>private/cakey.pem</filename> as the file name for your
newly created private key.</para>
</listitem>
</varlistentry><varlistentry><term><option>out</option> <filename>cacert.pem</filename></term><listitem><para>This <command>req</command> option
enables you to assign <filename>cacert.pem</filename> as your output file.</para>
</listitem>
</varlistentry><varlistentry><term><option>days</option> <literal>365</literal></term><listitem><para>This <command>req</command> option
enables you to certify the certificate
for <literal>365</literal> days. The
default value is <literal>30</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><option>config</option> <filename>openssl.cnf</filename></term><listitem><para>This <command>req</command> option
enables you to specify <filename>openssl.cnf</filename> as the configuration file.</para>
</listitem>
</varlistentry>
</variablelist><itemizedlist><para>Note that this command requires
that you provide the following:</para><listitem><para><literal>Country Name</literal>,
such as <literal>US</literal>.</para>
</listitem><listitem><para><literal>State or
Province Name</literal>, such as <literal>California</literal>.</para>
</listitem><listitem><para><literal>Locality
Name</literal>, such as <literal>Menlo
Park</literal>.</para>
</listitem><listitem><para><literal>Organization
Name</literal>, such as <literal>Sun
Microsystems</literal>.</para>
</listitem><listitem><para><literal>Organizational
Unit Name</literal>, such as <literal>Solaris</literal>.</para>
</listitem><listitem><para><literal>Common Name</literal>,
which is the machine's fully qualified
host name. For more information, see
the <olink targetdoc="refman1m" targetptr="check-hostname-1m" remap="external"><citerefentry><refentrytitle>check-hostname</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</listitem><listitem><para><literal>Email Address</literal>,
such as <literal>someuser@example.com</literal>.</para>
</listitem>
</itemizedlist>
</step>
</substeps>
</step><step performance="optional"><para>If
you need a new secure connection,
make a new certificate and sign the
new certificate with the certificate
authority.</para><substeps><step><para>Make a new certificate.</para><screen># <userinput>cd /etc/mail/certs/CA</userinput>
# <userinput>openssl req -nodes -new -x509 -keyout newreq.pem -out newreq.pem -days 365 \
-config openssl.cnf</userinput>
Generating a 1024 bit RSA private key
..............++++++
..............++++++
writing new private key to 'newreq.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) []:<userinput>US</userinput>
State or Province Name (full name) []:<userinput>California</userinput>
Locality Name (eg, city) []:<userinput>Menlo Park</userinput>
Organization Name (eg, company) [Unconfigured OpenSSL Installation]:<userinput>Sun Microsystems</userinput>
Organizational Unit Name (eg, section) []:<userinput>Solaris</userinput>
Common Name (eg, YOUR name) []:<userinput>somehost.somedomain.example.com</userinput>
Email Address []:<userinput>someuser@example.com</userinput></screen><para>This command requires that you
provide the same information that
you provided in step 3c.</para><para>Note
that in this example, the certificate
and private key are in the file <filename>newreq.pem</filename>.</para>
</step><step><para>Sign the new certificate
with the certificate authority.</para><screen># <userinput>cd /etc/mail/certs/CA</userinput>
# <userinput>openssl x509 -x509toreq -in newreq.pem -signkey newreq.pem -out tmp.pem</userinput>
Getting request Private Key
Generating certificate request
# <userinput>openssl ca -config openssl.cnf -policy policy_anything -out newcert.pem -infiles tmp.pem</userinput>
Using configuration from openssl.cnf
Enter pass phrase for /etc/mail/certs/CA/private/cakey.pem:
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Jun 23 18:44:38 2005 GMT
            Not After : Jun 23 18:44:38 2006 GMT
        Subject:
            countryName               = US
            stateOrProvinceName       = California
            localityName              = Menlo Park
            organizationName          = Sun Microsystems
            organizationalUnitName    = Solaris
            commonName                = somehost.somedomain.example.com
            emailAddress              = someuser@example.com
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier: 
                93:D4:1F:C3:36:50:C5:97:D7:5E:01:E4:E3:4B:5D:0B:1F:96:9C:E2
            X509v3 Authority Key Identifier: 
                keyid:99:47:F7:17:CF:52:2A:74:A2:C0:13:38:20:6B:F1:B3:89:84:CC:68
                DirName:/C=US/ST=California/L=Menlo Park/O=Sun Microsystems/OU=Solaris/\
                CN=someuser@example.com/emailAddress=someuser@example.com
                serial:00

Certificate is to be certified until Jun 23 18:44:38 2006 GMT (365 days)
Sign the certificate? [y/n]:<userinput>y</userinput>


1 out of 1 certificate requests certified, commit? [y/n]<userinput>y</userinput>
Write out database with 1 new entries
Data Base Updated
# <userinput>rm -f tmp.pem</userinput></screen><para>In this example the file <filename>newreq.pem</filename> contains the
unsigned certificate and private key.
The file <filename>newcert.pem</filename> contains
the signed certificate.</para><variablelist><varlistentry><term><command>x509</command> utility</term><listitem><para>Displays certificate
information, converts certificates
to various forms, and signs certificate
requests</para>
</listitem>
</varlistentry><varlistentry><term><command>ca</command> application</term><listitem><para>Used to sign certificate
requests in a variety of forms and
to generate CRLs (certificate revocation
lists)</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</substeps>
</step><step><para>Enable <command>sendmail</command> to
use the certificates by adding the
following lines to your <filename>.mc</filename> file.</para><screen><userinput>define(`confCACERT_PATH', `/etc/mail/certs')dnl
define(`confCACERT', `/etc/mail/certs/CAcert.pem')dnl
define(`confSERVER_CERT', `/etc/mail/certs/MYcert.pem')dnl
define(`confSERVER_KEY', `/etc/mail/certs/MYkey.pem')dnl
define(`confCLIENT_CERT', `/etc/mail/certs/MYcert.pem')dnl
define(`confCLIENT_KEY', `/etc/mail/certs/MYkey.pem')dnl</userinput></screen><para>For more information, see <olink targetptr="fvbqb" remap="internal">Configuration File
Options for Running SMTP With TLS</olink>.</para>
</step><step><para>Rebuild and install your <filename>sendmail.cf</filename> file in your <filename>/etc/mail</filename> directory.</para><para>For detailed instructions, see <olink targetptr="mailadmin-43" remap="internal">Building
the sendmail.cf Configuration File</olink>.</para>
</step><step><para>Create symbolic links
from the files you created with <command>openssl</command> to the files you
defined in your <filename>.mc</filename> file.</para><screen># <userinput>cd /etc/mail/certs</userinput>
# <userinput>ln -s CA/cacert.pem CAcert.pem</userinput>
# <userinput>ln -s CA/newcert.pem MYcert.pem</userinput>
# <userinput>ln -s CA/newreq.pem MYkey.pem</userinput></screen>
</step><step><para>For added security, deny
read permission to group and others
for <filename>MYkey.pem</filename>.</para><screen># <userinput>chmod go-r MYkey.pem</userinput></screen>
</step><step><para>Use a symbolic link to
install CA certs in the directory
assigned to <filename>confCACERT_PATH</filename>.</para><screen># <userinput>C=CAcert.pem</userinput>
# <userinput>ln -s $C `openssl x509 -noout -hash &lt; $C`.0</userinput></screen>
</step><step><para>For secure mail with other
hosts, install their host certificates.</para><substeps><step><para>Copy the file defined
by the other host's <literal>confCACERT</literal> option
to <filename>/etc/mail/certs/<replaceable>host.domain</replaceable>.cert.pem</filename>.</para><para>Replace <replaceable>host.domain</replaceable> with the other host's
fully qualified host name.</para>
</step><step><para>Use a symbolic link to
install CA certs in the directory
assigned to <filename>confCACERT_PATH</filename>.</para><screen># <userinput>C=</userinput><replaceable>host.domain</replaceable><userinput>.cert.pem</userinput>
# <userinput>ln -s $C `openssl x509 -noout -hash &lt; $C`.0</userinput></screen><para>Replace <replaceable>host.domain</replaceable> with
the other host's fully qualified host
name.</para>
</step>
</substeps>
</step><step><para>Restart <command>sendmail</command>.</para><screen># <userinput>svcadm enable network/smtp:sendmail</userinput></screen>
</step>
</procedure><example id="fxjdn"><title><literal>Received:</literal> Mail
Header</title><para>The following is an example
of a <literal>Received:</literal> header
for secure mail with TLS.</para><screen>Received: from his.example.com ([IPv6:2001:db8:3c4d:15::1a2f:1a2b])
        by her.example.com (8.13.4+Sun/8.13.4) with ESMTP id j2TNUB8i242496
        (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
        for &lt;janepc@her.example.com>; Tue, 29 Mar 2005 15:30:11 -0800 (PST)
Received: from her.example.com (her.city.example.com [192.168.0.0])
        by his.example.com (8.13.4+Sun/8.13.4) with ESMTP id j2TNU7cl571102
        version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
        for &lt;janepc@her.example.com>; Tue, 29 Mar 2005 15:30:07 -0800 (PST)</screen><para>Note that the value for <literal>verify</literal> is <literal>OK</literal>,
which means that the authentication
was successful. For more information,
see <olink targetptr="fvbqm" remap="internal">Macros
for Running SMTP With TLS</olink>.</para>
</example><taskrelated role="see-also"><itemizedlist><para>The following OpenSSL man pages:</para><listitem><para><ulink url="http://www.openssl.org/docs/apps/openssl.html" type="text_url">openssl(1)</ulink>.</para>
</listitem><listitem><para><ulink url="http://www.openssl.org/docs/apps/req.html" type="text_url">req(1)</ulink>.</para>
</listitem><listitem><para><ulink url="http://www.openssl.org/docs/apps/x509.html" type="text_url">x509(1)</ulink>.</para>
</listitem><listitem><para><ulink url="http://www.openssl.org/docs/apps/ca.html" type="text_url">ca(1)</ulink>.</para>
</listitem>
</itemizedlist>
</taskrelated>
</task>
</sect1><sect1 id="mailadmin-377"><title>Managing
Mail Delivery by Using an Alternate
Configuration</title><para>To facilitate the transport
of inbound mail and outbound mail,
the new default configuration of <command>sendmail</command> uses a daemon and
a client queue runner. If you have
disabled your daemon, you should perform
the following task. For a detailed
explanation, refer to <olink targetptr="mailrefer-106" remap="internal">submit.cf
Configuration File From Version 8.12
of sendmail</olink>.</para><task id="mailadmin-378"><title>How
to Manage Mail Delivery by Using an
Alternate Configuration of <filename>sendmail.cf</filename></title><tasksummary><para>In the default configuration
of <command>sendmail</command>, the
client queue runner must be able to
submit mail to the daemon on the local
SMTP port. If the daemon is not listening
on the SMTP port, the mail remains
in the queue. To avoid this problem,
perform the following task. For more
information about the daemon and client
queue runner and to understand why
you might have to use this alternate
configuration, refer to <olink targetptr="mailrefer-106" remap="internal">submit.cf
Configuration File From Version 8.12
of sendmail</olink>.</para><para>This procedure ensures that
your daemon runs only to accept connections
from the local host.</para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-1284"><para>Stop <command>sendmail</command>.</para><screen># <userinput>svcadm -t disable network/smtp:sendmail</userinput></screen>
</step><step id="mailadmin-step-1046"><para>Make
a copy of the configuration file that
you are changing.</para><screen># <userinput>cd /etc/mail/cf/cf</userinput>
# <userinput>cp sendmail.mc</userinput> <replaceable>myhost</replaceable><userinput>.mc</userinput></screen><variablelist><varlistentry><term><replaceable>myhost</replaceable></term><listitem><para>Select a new name
for your <filename>.mc</filename> file.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="mailadmin-step-1047"><para>Edit
the new configuration file (for example, <replaceable>myhost</replaceable><literal>.mc</literal>). </para><para>Add the following line
before the <function>MAILER</function> lines.</para><screen># <userinput>cat <replaceable>myhost</replaceable>.mc</userinput>
..
<userinput>FEATURE(`no_default_msa')dnl</userinput>
<userinput>DAEMON_OPTIONS(`NAME=NoMTA4, Family=inet, Addr=127.0.0.1')dnl</userinput>
<userinput>DAEMON_OPTIONS(`Name=MSA4, Family=inet, Addr=127.0.0.1, Port=587, M=E')dnl</userinput></screen><note><para>Use these configuration
macros on machines that only have
configured addresses for IPv4.</para>
</note><substeps><step performance="optional"><para>If
your host has an IPv6 local host address
that is enabled, edit the new configuration
file as follows.</para><para>Add the
following lines before the <function>MAILER</function> lines.</para><screen># <userinput>cat <replaceable>myhost</replaceable>.mc</userinput>
..
<userinput>FEATURE(`no_default_msa')dnl</userinput>
<userinput>DAEMON_OPTIONS(`NAME=NoMTA4, Family=inet, Addr=127.0.0.1')dnl</userinput>
<userinput>DAEMON_OPTIONS(`Name=MSA4, Family=inet, Addr=127.0.0.1, Port=587, M=E')dnl</userinput>
<userinput>DAEMON_OPTIONS(`NAME=NoMTA6, Family=inet6, Addr=::1')dnl</userinput>
<userinput>DAEMON_OPTIONS(`Name=MSA6, Family=inet6, Addr=::1, Port=587, M=E')dnl</userinput></screen><caution><para>To add these configuration
macros, you must have configured addresses
for IPv4 and IPv6.</para>
</caution>
</step><step performance="optional" id="mailadmin-step-392"><para>To see
if your host has an IPv6 local host
address that is enabled, run the following
command.</para><screen># /usr/sbin/ifconfig -a</screen><para>If IPv6 is enabled, you should
see output that is similar to the
following.</para><screen>lo0: flags=2000849&lt;UP,LOOPBACK,RUNNING,MULTICAST,IPv6> mtu 8252 index 1
              inet6 ::1/128</screen>
</step>
</substeps>
</step><step id="mailadmin-step-1048"><para>Build
the configuration file by using <command>m4</command>.</para><screen># <userinput>/usr/ccs/bin/make</userinput> <replaceable>myhost</replaceable><userinput>.cf</userinput></screen>
</step><step performance="required" id="mailadmin-step-1050"><para>Install
the new configuration file after making
a copy of the original.</para><screen># <userinput>cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.save</userinput>
# <userinput>cp</userinput> <replaceable>myhost</replaceable><userinput>.cf /etc/mail/sendmail.cf</userinput></screen>
</step><step id="mailadmin-step-1051"><para>Restart
the <command>sendmail</command> service.</para><screen># <userinput>svcadm enable network/smtp:sendmail</userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="mailadmin-260"><title>Administering
Mail Alias Files (Task Map)</title><para>The following table describes
the procedures for administering mail
alias files. For more information
about this topic, refer to <olink targetptr="mailrefer-33" remap="internal">Mail Alias
Files</olink> in <olink targetptr="mailrefer-1" remap="internal">Chapter&nbsp;14,
Mail Services (Reference)</olink>.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="25*"/><colspec colname="colspec1" colwidth="25*"/><colspec colname="colspec2" colwidth="25*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Managing alias entries in an
NIS+ <literal>mail_aliases</literal> table</para>
</entry><entry><para>If your name service is NIS+,
use these procedures to manage the
contents of your <literal>mail_aliases</literal> table.</para><para>Initiate an NIS+ <literal>mail_aliases</literal> table.</para>
</entry><entry><para><olink targetptr="mailadmin-345" remap="internal">How
to Initiate an NIS+ mail_aliases Table</olink></para>
</entry>
</row><row><entry>
</entry><entry><para>List the contents of the NIS+ <literal>mail_aliases</literal> table.</para><para>This procedure includes examples
of how to list individual entries
and how to list partial matches.</para>
</entry><entry><para><olink targetptr="mailadmin-327" remap="internal">How
to List the Contents of the NIS+ mail_aliases
Table</olink></para>
</entry>
</row><row><entry>
</entry><entry><para>Add aliases to the NIS+ <literal>mail_aliases</literal> table from the command
line.</para>
</entry><entry><para><olink targetptr="mailadmin-330" remap="internal">How
to Add Aliases to the NIS+ mail_aliases
Table From the Command Line</olink></para>
</entry>
</row><row><entry>
</entry><entry><para>Add entries by editing an NIS+ <literal>mail_aliases</literal> table.</para>
</entry><entry><para><olink targetptr="mailadmin-331" remap="internal">How
to Add Entries by Editing an NIS+
mail_aliases Table</olink></para>
</entry>
</row><row><entry>
</entry><entry><para>Edit entries in an NIS+ <literal>mail_aliases</literal> table.</para><para>This procedure includes an example
of how to delete an entry.</para>
</entry><entry><para><olink targetptr="mailadmin-332" remap="internal">How
to Edit Entries in an NIS+ mail_aliases
Table</olink></para>
</entry>
</row><row><entry><para>Setting up an NIS <literal>mail.aliases</literal> map</para>
</entry><entry><para>If your name service is NIS,
follow these instructions to facilitate
aliasing with a <literal>mail.aliases</literal> map.</para>
</entry><entry><para><olink targetptr="mailadmin-93" remap="internal">How
to Set Up an NIS mail.aliases Map</olink></para>
</entry>
</row><row><entry><para>Setting up a local mail alias
file</para>
</entry><entry><para>If you are not using a name
service (such as NIS or NIS+), follow
these instructions to facilitate aliasing
with the <filename>/etc/mail/aliases</filename> file.</para>
</entry><entry><para><olink targetptr="mailadmin-106" remap="internal">How
to Set Up a Local Mail Alias File</olink></para>
</entry>
</row><row><entry><para>Creating a keyed map file</para>
</entry><entry><para>Use these steps to facilitate
aliasing with a keyed map file.</para>
</entry><entry><para><olink targetptr="mailadmin-118" remap="internal">How
to Create a Keyed Map File</olink></para>
</entry>
</row><row><entry><para>Setting up the <literal>postmaster</literal> alias</para>
</entry><entry><para>Use the procedures in this section
to manage the <literal>postmaster</literal> alias.
You must have this alias.</para>
</entry><entry><para><olink targetptr="mailadmin-127" remap="internal">Managing
the postmaster Alias</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="mailadmin-52"><title>Administering
Mail Alias Files</title><para>Mail aliases must be unique
within the domain. This section provides
the procedures for administering mail
alias files. Alternately, you can
use the Mailing List feature in the
Solaris Management Console to perform
these tasks on the aliases database.</para><para>In addition, you can create
database files for the local mail
host by using <command>makemap</command>.
Refer to the <olink targetdoc="refman1m" targetptr="makemap-1m" remap="external"><citerefentry><refentrytitle>makemap</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page. The use of these database files
does not provide all of the advantages
of using a name service such as NIS
or NIS+. However, you should be able
to retrieve the data from these local
database files faster because no network
lookups are involved. For more information,
refer to <olink targetptr="mailrefer-24" remap="internal">Interactions of sendmail With Name
Services</olink> and <olink targetptr="mailrefer-33" remap="internal">Mail Alias
Files</olink> in <olink targetptr="mailrefer-1" remap="internal">Chapter&nbsp;14,
Mail Services (Reference)</olink>.</para><itemizedlist><para>Choose from the following procedures:</para><listitem><para><olink targetptr="mailadmin-345" remap="internal">How to Initiate
an NIS+ mail_aliases Table</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-327" remap="internal">How to List
the Contents of the NIS+ mail_aliases
Table</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-330" remap="internal">How to Add
Aliases to the NIS+ mail_aliases Table
From the Command Line</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-331" remap="internal">How to Add
Entries by Editing an NIS+ mail_aliases
Table</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-332" remap="internal">How to Edit
Entries in an NIS+ mail_aliases Table</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-93" remap="internal">How to Set
Up an NIS mail.aliases Map</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-106" remap="internal">How to Set
Up a Local Mail Alias File</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-118" remap="internal">How to Create
a Keyed Map File</olink></para>
</listitem>
</itemizedlist><task id="mailadmin-345"><title>How
to Initiate an NIS+ <literal>mail_aliases</literal> Table</title><tasksummary><para>You can use the <command>aliasadm</command> command to manage entries
in an NIS+ table. To create a table,
follow these instructions. For more
information, refer to the <olink targetdoc="refman1m" targetptr="aliasadm-1m" remap="external"><citerefentry><refentrytitle>aliasadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</tasksummary><procedure><step id="mailadmin-step-228"><para>Either
be a member of the NIS+ group that
owns the table, or become <filename>root</filename> on
the mail server, or assume an equivalent
role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-347"><para>Initiate
an NIS+ table.</para><screen># <userinput>aliasadm -I</userinput></screen>
</step><step id="mailadmin-step-348"><para>Add
entries to the table.</para><itemizedlist><listitem><para>To add two or three
aliases, refer to <olink targetptr="mailadmin-330" remap="internal">How to Add
Aliases to the NIS+ mail_aliases Table
From the Command Line</olink>.</para>
</listitem><listitem><para>To add more than two
or three aliases, refer to <olink targetptr="mailadmin-331" remap="internal">How to Add
Entries by Editing an NIS+ mail_aliases
Table</olink>.</para>
</listitem>
</itemizedlist>
</step>
</procedure>
</task><task id="mailadmin-327"><title>How
to List the Contents of the NIS+ <literal>mail_aliases</literal> Table</title><tasksummary><para>To see a complete list
of the contents of the table, follow
these instructions.</para>
</tasksummary><procedure><step id="mailadmin-step-343"><para>Either
be a member of the NIS+ group that
owns the table, or become <filename>root</filename> on
the mail server, or assume an equivalent
role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-344"><para>List
all of the entries in alphabetical
order by alias.</para><screen># <userinput>aliasadm -1</userinput></screen><para>For more information, refer
to the <olink targetdoc="refman1m" targetptr="aliasadm-1m" remap="external"><citerefentry><refentrytitle>aliasadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</step>
</procedure><example id="exlzg"><title>Listing an Individual Entry
From the NIS+ <literal>mail_aliases</literal> Table</title><para>Alternately, you can use
the <command>aliasadm</command> command
to list individual entries. After
you complete the first step in this
procedure, type the following:</para><screen># <userinput>aliasadm -m ignatz</userinput>
ignatz: ignatz@saturn # Alias for Iggy Ignatz</screen><para>The command matches only the
complete alias name, not partial strings.
You cannot use metacharacters, such
as <literal>*</literal> and <literal>?</literal>,
with <command>aliasadm</command> <option>m</option>.</para>
</example><example id="exlyy"><title>Listing Partial Matches From
the NIS+ <literal>mail_aliases</literal> Table</title><para>Also, you can use the <command>aliasadm</command> command to list
partial matches. After you complete
the first step in this procedure,
type the following:</para><screen># <userinput>aliasadm -l | grep</userinput> <replaceable>partial-string</replaceable></screen><para>Replace <replaceable>partial-string</replaceable> with the desired string
for your search.</para>
</example>
</task><task id="mailadmin-330"><title>How
to Add Aliases to the NIS+ <literal>mail_aliases</literal> Table From the Command
Line</title><tasksummary><para>To add two or three aliases
to the table, follow the following
instructions. If you are adding more
than two or three aliases, see <olink targetptr="mailadmin-331" remap="internal">How to Add
Entries by Editing an NIS+ mail_aliases
Table</olink>.</para>
</tasksummary><procedure><step id="mailadmin-step-308"><para>Compile
a list of each of your mail clients,
the locations of their mailboxes,
and the names of the mail server systems.</para>
</step><step id="mailadmin-step-223"><para>Either
be a member of the NIS+ group that
owns the table, or become <filename>root</filename> on
the mail server, or assume an equivalent
role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step performance="optional" id="mailadmin-step-63"><para>If necessary,
initiate an NIS+ table.</para><para>If
you are creating a completely new
NIS+ <filename>mail_aliases</filename> table,
you must first initiate the table.
To complete this task, refer to <olink targetptr="mailadmin-345" remap="internal">How to Initiate
an NIS+ mail_aliases Table</olink>.</para>
</step><step id="mailadmin-step-68"><para>Add
aliases to the table.</para><para>See
this example of a typical entry.</para><screen># <userinput>aliasadm -a iggy iggy.ignatz@saturn "Iggy Ignatz"</userinput></screen><para>The following list describes
the input from the preceding example.</para><variablelist><varlistentry><term><option>a</option></term><listitem><para>The option for adding
an alias</para>
</listitem>
</varlistentry><varlistentry><term><literal>iggy</literal></term><listitem><para>The short form of
the alias name</para>
</listitem>
</varlistentry><varlistentry><term><literal>iggy.ignatz@saturn</literal></term><listitem><para>The expanded alias
name</para>
</listitem>
</varlistentry><varlistentry><term><literal>"Iggy
Ignatz"</literal></term><listitem><para>The name for the alias
in quotation marks</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="mailadmin-step-69"><para>Display
the entry that you created and ensure
that the entry is correct.</para><screen># <userinput>aliasadm -m <replaceable>alias</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>alias</replaceable></term><listitem><para>The entry that you
created</para>
</listitem>
</varlistentry>
</variablelist><para>For more information, refer
to the <olink targetdoc="refman1m" targetptr="aliasadm-1m" remap="external"><citerefentry><refentrytitle>aliasadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</step>
</procedure>
</task><task id="mailadmin-331"><title>How
to Add Entries by Editing an NIS+ <literal>mail_aliases</literal> Table</title><tasksummary><para>You can use the <command>aliasadm</command> command to manage entries
in an NIS+ table. To add more than
two or three aliases to the table,
follow these instructions.</para>
</tasksummary><procedure><step id="mailadmin-step-310"><para>Compile
a list of each of your mail clients,
the locations of their mailboxes,
and the names of the mail server systems.</para>
</step><step id="mailadmin-step-224"><para>Either
be a member of the NIS+ group that
owns the table, or become <filename>root</filename> on
the mail server, or assume an equivalent
role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-311"><para>Display
and edit the aliases table.</para><screen># <userinput>aliasadm -e</userinput></screen><para>This command displays the table
and enables you to edit the table.
The editor that  you use has been
set with the <filename>$EDITOR</filename> environment
variable. If this variable is not
set, <command>vi</command> is the
default editor.</para>
</step><step id="mailadmin-step-312"><para>Use
the following format to type each
alias on a separate line.</para><screen><replaceable>alias</replaceable>: <replaceable>expanded-alias</replaceable> # ["<replaceable>option</replaceable>" # "<replaceable>comments</replaceable>"]</screen><variablelist><varlistentry><term><replaceable>alias</replaceable></term><listitem><para>This column is for
the short form of the alias name.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>expanded-alias</replaceable></term><listitem><para>This column is for
the expanded alias name.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>option</replaceable></term><listitem><para>This column is reserved
for future use.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>comments</replaceable></term><listitem><para>This column is used
for comments about the individual
alias, such as a name for the alias.</para>
</listitem>
</varlistentry>
</variablelist><para>If you leave the option column
blank, type an empty pair of quotation
marks <literal>("")</literal> and
add the comments.</para><para>The
order of the entries is not important
to the NIS+ <literal>mail_aliases</literal> table.
The <command>aliasadm -l</command> command
sorts the list and displays the entries
in alphabetical order.</para><para>For
more information, refer to <olink targetptr="mailrefer-33" remap="internal">Mail Alias
Files</olink> and the <olink targetdoc="refman1m" targetptr="aliasadm-1m" remap="external"><citerefentry><refentrytitle>aliasadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</step>
</procedure>
</task><task id="mailadmin-332"><title>How
to Edit Entries in an NIS+ <literal>mail_aliases</literal> Table</title><tasksummary><para>To edit entries in the
table, follow these instructions.</para>
</tasksummary><procedure><step id="mailadmin-step-225"><para>Either
be a member of the NIS+ group that
owns the table, or become <filename>root</filename> on
the mail server, or assume an equivalent
role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-85"><para>Display
the alias entry.</para><screen># <userinput>aliasadm -m <replaceable>alias</replaceable></userinput></screen><para>Replace <replaceable>alias</replaceable> with
the assigned alias name.</para>
</step><step id="mailadmin-step-86"><para>Edit
the alias entry, as necessary.</para><screen># aliasadm -c <replaceable>alias</replaceable> <replaceable>expanded-alias</replaceable> [<replaceable>options</replaceable> <replaceable>comments</replaceable>]</screen><variablelist><varlistentry><term><replaceable>alias</replaceable></term><listitem><para>If necessary, edit
the alias name.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>expanded-alias</replaceable></term><listitem><para>If necessary, edit
the expanded alias name.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>options</replaceable></term><listitem><para>If necessary, edit
the option.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>comments</replaceable></term><listitem><para>If necessary, edit
the comment for this entry.</para>
</listitem>
</varlistentry>
</variablelist><para>For more information, refer
to the <olink targetdoc="refman1m" targetptr="aliasadm-1m" remap="external"><citerefentry><refentrytitle>aliasadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page, as well as <olink targetptr="mailrefer-33" remap="internal">Mail Alias
Files</olink>.</para>
</step><step id="mailadmin-step-87"><para>Display
the entry that you have edited and
ensure that the entry is correct.</para><screen># <userinput>aliasadm -m <replaceable>alias</replaceable></userinput></screen><para>For more information, refer
to the <olink targetdoc="refman1m" targetptr="aliasadm-1m" remap="external"><citerefentry><refentrytitle>aliasadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para>
</step>
</procedure><example id="exlyv"><title>Deleting Entries From an NIS+ <literal>mail_aliases</literal> Table</title><para>To delete entries from
the table, use the following syntax
after you complete the first step
in this procedure:</para><screen># <userinput>aliasadm -d <replaceable>alias</replaceable></userinput></screen><para>Replace <replaceable>alias</replaceable> with
the alias name for the entry that
you are deleting.</para>
</example>
</task><task id="mailadmin-93"><title>How
to Set Up an NIS <literal>mail.aliases</literal> Map</title><tasksummary><para>Use the following procedure
to facilitate aliasing with an NIS <literal>mail.aliases</literal> map.</para>
</tasksummary><procedure><step id="mailadmin-step-96"><para>Compile
a list of each of your mail clients,
the locations of their mailboxes,
and the names of the mail server systems.</para>
</step><step id="mailadmin-step-97"><para>Become <filename>root</filename> on the NIS master
server or assume an equivalent role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-98"><para>Edit
the <filename>/etc/mail/aliases</filename> file,
and make the following entries.</para><substeps><step id="mailadmin-step-99"><para>Add
an entry for each mail client.</para><screen># <userinput>cat /etc/mail/aliases</userinput>
..
<replaceable>alias</replaceable>:<replaceable>expanded-alias</replaceable></screen><variablelist><varlistentry><term><replaceable>alias</replaceable></term><listitem><para>Use the short alias
name.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>expanded-alias</replaceable></term><listitem><para>Use the expanded alias
name (<literal>user@host.domain.com</literal>).</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="mailadmin-step-349"><para>Ensure
that you have a <literal>Postmaster:
root</literal> entry.</para><screen># <userinput>cat /etc/mail/aliases</userinput>
..
<userinput>Postmaster: root</userinput></screen>
</step><step id="mailadmin-step-100"><para>Add
an alias for <filename>root</filename>.
Use the mail address of the person
who is designated as the postmaster.</para><screen># <userinput>cat /etc/mail/aliases</userinput>
..
root: <replaceable>user@host.domain.com</replaceable></screen><variablelist><varlistentry><term><replaceable>user@host.domain.com</replaceable></term><listitem><para>Use the assigned address
of the designated postmaster.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</substeps>
</step><step id="mailadmin-step-103"><para>Ensure
that the NIS master server is running
a name service to resolve the host
names on each mail server.</para>
</step><step id="mailadmin-step-104"><para>Change
to the <filename>/var/yp</filename> directory.</para><screen># <userinput>cd /var/yp</userinput></screen>
</step><step id="mailadmin-step-105"><para>Apply
the <command>make</command> command.</para><screen># <userinput>make</userinput></screen><para>The changes in the <filename>/etc/hosts</filename> and <filename>/etc/mail/aliases</filename> files are propagated to
NIS slave systems. The changes are
active in only a few minutes, at most.</para>
</step>
</procedure>
</task><task id="mailadmin-106"><title>How
to Set Up a Local Mail Alias File</title><tasksummary><para>Use the following procedure
to resolve aliases with a local mail
alias file.</para>
</tasksummary><procedure><step id="mailadmin-step-109"><para>Compile
a list of each of your users and the
locations of their mailboxes.</para>
</step><step id="mailadmin-step-110"><para>Become <filename>root</filename> on the mail server
or assume an equivalent role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-111"><para>Edit
the <filename>/etc/mail/aliases</filename> file
and make the following entries.</para><substeps><step id="mailadmin-step-112"><para>Add
an entry for each user.</para><screen><replaceable>user1</replaceable>: <replaceable>user2@host.domain</replaceable></screen><variablelist><varlistentry><term><replaceable>user1</replaceable></term><listitem><para>Use the new alias
name.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>user2@host.domain</replaceable></term><listitem><para>Use the actual address
for the new alias.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="mailadmin-step-113"><para>Ensure
that you have a <literal>Postmaster:
root</literal> entry.</para><screen># <userinput>cat /etc/mail/aliases</userinput>
..
<userinput>Postmaster: root</userinput></screen>
</step><step id="mailadmin-step-114"><para>Add
an alias for <filename>root</filename>.
Use the mail address of the person
who is designated as the postmaster.</para><screen># <userinput>cat /etc/mail/aliases</userinput>
..
root: <replaceable>user@host.domain.com</replaceable></screen><variablelist><varlistentry><term><replaceable>user@host.domain.com</replaceable></term><listitem><para>Use the assigned address
of the designated postmaster.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</substeps>
</step><step id="mailadmin-step-116"><para>Rebuild
the alias database.</para><screen># <userinput>newaliases</userinput></screen><para>The configuration of the <option role="nodash">AliasFile</option> option
in <filename>/etc/mail/sendmail.cf</filename> determines
whether  this command  generates in
binary form either the single file, <filename>/etc/mail/aliases.db</filename>, or
the pair of files, <filename>/etc/mail/aliases.dir</filename> and <filename>/etc/mail/aliases.pag</filename>.</para>
</step><step id="mailadmin-step-117"><para>Perform
one of the following steps to copy
the file or files that were generated.</para><substeps><step performance="optional" id="mailadmin-step-229"><para>Copy the <filename>/etc/mail/aliases</filename>, the <filename>/etc/mail/aliases.dir</filename>, and the<filename>/etc/mail/aliases.pag</filename> files to each of the other
systems.</para><para>You can copy
the three files by using the <command>rcp</command> or <command>rdist</command> commands.
Refer to the <olink targetdoc="refman1" targetptr="rcp-1" remap="external"><citerefentry><refentrytitle>rcp</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page or the <olink targetdoc="refman1" targetptr="rdist-1" remap="external"><citerefentry><refentrytitle>rdist</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page for more information. Alternately,
you can create a script for this purpose.</para><para>When you copy these files,
you do not need to run the <command>newaliases</command> command on each of the
other systems. However, remember that
you must update all the <filename>/etc/mail/aliases</filename> files each time you add
or remove a mail client.</para>
</step><step performance="optional" id="mailadmin-step-361"><para>Copy the <filename>/etc/mail/aliases</filename> and the <filename>/etc/mail/aliases.db</filename> files to each of the other
systems.</para><para>You can copy
these files by using the <command>rcp</command> or <command>rdist</command> commands. Refer to
the <olink targetdoc="refman1" targetptr="rcp-1" remap="external"><citerefentry><refentrytitle>rcp</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page or the <olink targetdoc="refman1" targetptr="rdist-1" remap="external"><citerefentry><refentrytitle>rdist</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page for more information. Alternately,
you can create a script for this purpose.</para><para>When you copy these files,
you do not need to run the <command>newaliases</command> command on each of the
other systems. However, remember that
you must update all the <filename>/etc/mail/aliases</filename> files each time you add
or remove a mail client.</para>
</step>
</substeps>
</step>
</procedure>
</task><task id="mailadmin-118"><title>How
to Create a Keyed Map File</title><tasksummary><para>To create a keyed map file,
follow these instructions.</para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-120"><para>Create an input file.</para><para>Entries can have the following
syntax.</para><screen><replaceable>old-name@newdomain.com</replaceable>   <replaceable>new-name@newdomain.com</replaceable>
<replaceable>old-name@olddomain.com</replaceable>    error:nouser No such user here
@<replaceable>olddomain.com</replaceable>          %1@<replaceable>newdomain.com</replaceable></screen><variablelist><varlistentry><term><replaceable>old_name@newdomain.com</replaceable></term><listitem><para>Use the user name
that was previously assigned with
the domain that is newly assigned.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>new_name@newdomain.com</replaceable></term><listitem><para>Use the address that
is newly assigned.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>old_name@olddomain.com</replaceable></term><listitem><para>Use the user name
that was previously assigned with
the domain that was previously assigned.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>olddomain.com</replaceable></term><listitem><para>Use the domain that
was previously assigned.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>newdomain.com</replaceable></term><listitem><para>Use the domain that
is newly assigned.</para>
</listitem>
</varlistentry>
</variablelist><para>The first entry redirects mail
to a new alias. The next entry creates
a message when an incorrect alias
is used. The last entry redirects
all incoming mail from <literal>olddomain</literal> to <literal>newdomain</literal>.</para>
</step><step id="mailadmin-step-121"><para>Create
the database file.</para><screen># /usr/sbin/makemap <replaceable>maptype</replaceable> <replaceable>newmap</replaceable> &lt; <replaceable>newmap</replaceable></screen><variablelist><varlistentry><term><replaceable>maptype</replaceable></term><listitem><para>Select a database
type, such as <literal>dbm</literal>, <literal>btree</literal>, or <literal>hash</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>newmap</replaceable></term><listitem><para>Use the name of the
input file and the first part of the
name of the database file. If the <literal>dbm</literal> database type is selected,
then the database files are created
by using a <literal>.pag</literal> and
a <literal>.dir</literal> suffix.
For the other two database types,
the file name is followed by <literal>.db</literal>.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure>
</task><sect2 id="mailadmin-127"><title>Managing
the <literal>postmaster</literal> Alias</title><para>Every system must be able
to send mail to a <filename>postmaster</filename> mailbox.
You can create an NIS or NIS+ alias
for <literal>postmaster</literal>,
or you can create the alias in each
local <filename>/etc/mail/aliases</filename> file.
Refer to these procedures.</para><itemizedlist><listitem><para><olink targetptr="mailadmin-proc-320" remap="internal">How
to Create a postmaster Alias in Each
Local /etc/mail/aliases File</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-proc-323" remap="internal">How
to Create a Separate Mailbox for postmaster</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-proc-324" remap="internal">How
to Add the postmaster Mailbox to the
Aliases in the /etc/mail/aliases File</olink></para>
</listitem>
</itemizedlist><task id="mailadmin-proc-320"><title>How
to Create a <literal>postmaster</literal> Alias
in Each Local <filename>/etc/mail/aliases</filename> File</title><tasksummary><para>If you are creating the <literal>postmaster</literal> alias in each local <filename>/etc/mail/aliases</filename> file,
follow these instructions.</para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-227"><para>View
the <filename>/etc/mail/aliases</filename> entry.</para><screen># <userinput>cat /etc/mail/aliases</userinput>
# Following alias is required by the mail protocol, RFC 2821
# Set it to the address of a HUMAN who deals with this system's
# mail problems.
Postmaster: root</screen>
</step><step id="mailadmin-step-321"><para>Edit
each system's <filename>/etc/mail/aliases</filename> file.</para><para>Change <filename>root</filename> to the mail address
of the person who is designated as
the postmaster.</para><screen>Postmaster: <replaceable>mail-address</replaceable></screen><variablelist><varlistentry><term><replaceable>mail-address</replaceable></term><listitem><para>Use the assigned address
for the person who is designated as
the postmaster.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step performance="optional" id="mailadmin-step-322"><para>Create
a separate mailbox for the postmaster.</para><para>You can create a separate mailbox
for the postmaster to keep postmaster
mail separate from personal mail.
If you create a separate mailbox,
use the mailbox address instead of
the postmaster's personal mail address
when you edit the <filename>/etc/mail/aliases</filename> files. For details, refer
to <olink targetptr="mailadmin-proc-323" remap="internal">How to Create a Separate Mailbox for
postmaster</olink>.</para>
</step>
</procedure>
</task><task id="mailadmin-proc-323"><title>How
to Create a Separate Mailbox for <literal>postmaster</literal></title><tasksummary><para>If you are creating a
separate mailbox for <literal>postmaster</literal>,
follow these instructions.</para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-130"><para>Create
a user account for the person who
is designated as <command>postmaster</command>.
Put an asterisk (<command>*</command>)
in the password field.</para><para>For
details about adding a user account,
refer to <olink targetdoc="sysadv1" targetptr="usersetup-92366" remap="external">Chapter 5, <citetitle remap="chapter">Managing User Accounts and Groups (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-131"><para>After
mail has been delivered, enable the <filename>mail</filename> program to read and
write to the mailbox name.</para><screen># <userinput>mail -f <replaceable>postmaster</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>postmaster</replaceable></term><listitem><para>Use the assigned address.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure>
</task><task id="mailadmin-proc-324"><title>How
to Add the <literal>postmaster</literal> Mailbox
to the Aliases in the <filename>/etc/mail/aliases</filename> File</title><tasksummary><para>If you are adding a <literal>postmaster</literal> mailbox to the aliases
in the <filename>/etc/mail/aliases</filename> file,
follow these instructions.</para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-134"><para>Add
an alias for <filename>root</filename>.
Use the mail address of the person
who is designated as the postmaster.</para><screen># <userinput>cat /etc/mail/aliases</userinput>
..
root: <replaceable>user@host.domain.com</replaceable></screen><variablelist><varlistentry><term><replaceable>user@host.domain.com</replaceable></term><listitem><para>Use the assigned address
of the person who is designated as
postmaster.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="mailadmin-step-136"><para>On
the postmaster's local system, create
an entry in the <filename>/etc/mail/aliases</filename> file that defines the
name of the alias. <filename>sysadmin</filename> is
an example. Also, include the path
to the local mailbox.</para><screen># <userinput>cat /etc/mail/aliases</userinput>
..
<replaceable>sysadmin</replaceable>: <replaceable>/usr/somewhere/somefile</replaceable></screen><variablelist><varlistentry><term><replaceable>sysadmin</replaceable></term><listitem><para>Create a name for
a new alias.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>/usr/somewhere/somefile</replaceable></term><listitem><para>Use the path to the
local mailbox.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="mailadmin-step-137"><para>Rebuild
the alias database.</para><screen># <userinput>newaliases</userinput></screen>
</step>
</procedure>
</task>
</sect2>
</sect1><sect1 id="mailadmin-262"><title>Administering
the Queue Directories (Task Map)</title><para>The following table describes
the procedures for administering the
mail queue.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec6" colwidth="33*"/><colspec colname="colspec7" colwidth="33*"/><colspec colname="colspec8" colwidth="33*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Displaying the contents of the
mail queue, <filename>/var/spool/mqueue</filename></para>
</entry><entry><para>Use this procedure to see how
many messages are in the queue and
how fast the messages are being cleared
from the queue.</para>
</entry><entry><para><olink targetptr="eyhyo" remap="internal">How
to Display the Contents of the Mail
Queue, /var/spool/mqueue</olink></para>
</entry>
</row><row><entry><para>Forcing mail queue processing
for the mail queue, <filename>/var/spool/mqueue</filename></para>
</entry><entry><para>Use this procedure to process
messages to a system that previously
was unable to receive messages.</para>
</entry><entry><para><olink targetptr="mailadmin-142" remap="internal">How
to Force Mail Queue Processing in
the Mail Queue, /var/spool/mqueue</olink></para>
</entry>
</row><row><entry><para>Running a subset of the mail
queue, <filename>/var/spool/mqueue</filename></para>
</entry><entry><para>Use this procedure to force
a substring of an address, such as
a host name, to be processed. Also,
use this procedure to force a particular
message out of the queue.</para>
</entry><entry><para><olink targetptr="mailadmin-145" remap="internal">How
to Run a Subset of the Mail Queue,
/var/spool/mqueue</olink></para>
</entry>
</row><row><entry><para>Moving the mail queue, <filename>/var/spool/mqueue</filename></para>
</entry><entry><para>Use this procedure to move the
mail queue.</para>
</entry><entry><para><olink targetptr="mailadmin-148" remap="internal">How
to Move the Mail Queue, /var/spool/mqueue</olink></para>
</entry>
</row><row><entry><para>Running the old mail queue, <filename>/var/spool/omqueue</filename></para>
</entry><entry><para>Use this procedure to run an
old mail queue.</para>
</entry><entry><para><olink targetptr="mailadmin-156" remap="internal">How
to Run the Old Mail Queue, /var/spool/omqueue</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="mailadmin-138"><title>Administering
the Queue Directories</title><para>This section describes some
helpful tasks for queue administration.
For information about the client-only
queue, refer to <olink targetptr="mailrefer-106" remap="internal">submit.cf
Configuration File From Version 8.12
of sendmail</olink>. For other related
information, you can refer to <olink targetptr="mailrefer-119" remap="internal">Additional
Queue Features From Version 8.12 of
sendmail</olink>. </para><itemizedlist><para>Refer to the following:</para><listitem><para><olink targetptr="eyhyo" remap="internal">How to Display the Contents of the
Mail Queue, /var/spool/mqueue</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-142" remap="internal">How to Force
Mail Queue Processing in the Mail
Queue, /var/spool/mqueue</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-145" remap="internal">How to Run
a Subset of the Mail Queue, /var/spool/mqueue</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-148" remap="internal">How to Move
the Mail Queue, /var/spool/mqueue</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-156" remap="internal">How to Run
the Old Mail Queue, /var/spool/omqueue</olink></para>
</listitem>
</itemizedlist><task id="eyhyo"><title>How to Display
the Contents of the Mail Queue, <filename>/var/spool/mqueue</filename></title><procedure remap="single-step"><step><para>Show how many messages
are in the queue and how fast they
are being cleared from the queue.</para><para>Type the following:</para><screen># <userinput>/usr/bin/mailq | more</userinput></screen><para>This command provides the following
information.</para><itemizedlist><listitem><para>The queue IDs</para>
</listitem><listitem><para>The size of the message</para>
</listitem><listitem><para>The date that the
message entered the queue</para>
</listitem><listitem><para>The message status</para>
</listitem><listitem><para>The sender and the
recipients</para>
</listitem>
</itemizedlist><para>Additionally, this command now
checks for the authorization attribute, <literal>solaris.admin.mail.mailq</literal>.
If the check is successful, the equivalent
of specifying the <option>bp</option> flag
with <command>sendmail</command> is
executed. If the check fails, an error
message is printed. By default, this
authorization attribute is enabled
for all users. The authorization attribute
can be disabled by modifying the user
entry in <command>prof_attr</command>.
For more information, refer to the
man pages for <olink targetdoc="refman4" targetptr="prof-attr-4" remap="external"><citerefentry><refentrytitle>prof_attr</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> and <olink targetdoc="refman1" targetptr="mailq-1" remap="external"><citerefentry><refentrytitle>mailq</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>.</para>
</step>
</procedure>
</task><task id="mailadmin-142"><title>How
to Force Mail Queue Processing in
the Mail Queue, <filename>/var/spool/mqueue</filename></title><tasksummary><para>Use this procedure, for
example, to process messages to a
system that was previously unable
to receive messages.</para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-144"><para>Force
queue processing and display the progress
of the jobs as the queue is cleared.</para><screen># <userinput>/usr/lib/sendmail -q -v</userinput> </screen>
</step>
</procedure>
</task><task id="mailadmin-145"><title>How
to Run a Subset of the Mail Queue, <filename>/var/spool/mqueue</filename></title><tasksummary><para>Use this procedure, for
example, to force a substring of an
address, such as a host name, to be
processed. Also, use this procedure
to force a particular message from
the queue.</para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-147"><para>Run
a subset of the mail queue at any
time with <option>qR</option><replaceable>string</replaceable>.</para><screen># <userinput>/usr/lib/sendmail -qR</userinput><replaceable>string</replaceable></screen><variablelist><varlistentry><term><replaceable>string</replaceable></term><listitem><para>Use a recipient's
alias or a substring of <replaceable>user@host.domain</replaceable>, such as a host name.</para>
</listitem>
</varlistentry>
</variablelist><para>Alternately, you can run a subset
of the mail queue with <option>qI</option><replaceable>nnnnn</replaceable>.</para><screen># <userinput>/usr/lib/sendmail -qI</userinput><replaceable>nnnnn</replaceable></screen><variablelist><varlistentry><term><replaceable>nnnnn</replaceable></term><listitem><para>Use a queue ID.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure>
</task><task id="mailadmin-148"><title>How
to Move the Mail Queue, <filename>/var/spool/mqueue</filename></title><tasksummary><para>If you are moving the
mail queue, follow these instructions.</para>
</tasksummary><procedure><step id="mailadmin-step-150"><para>Become <filename>root</filename> on the mail host or
assume an equivalent role.</para><para>Roles
contain authorizations and privileged
commands. For more information about
roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-151"><para>Kill
the <command>sendmail</command> daemon. </para><screen># <userinput>svcadm disable network/smtp:sendmail</userinput></screen><para>Now <command>sendmail</command> is
no longer processing the queue directory.</para>
</step><step id="mailadmin-step-152"><para>Change
to the <filename>/var/spool</filename> directory.</para><screen># <userinput>cd /var/spool</userinput></screen>
</step><step id="mailadmin-step-153"><para>Move
the directory, <literal>mqueue</literal>,
and all its contents to the <filename>omqueue</filename> directory. Then create
a new empty directory that is named <filename>mqueue</filename>.</para><screen># <userinput>mv mqueue omqueue; mkdir mqueue</userinput></screen>
</step><step id="mailadmin-step-154"><para>Set
the permissions of the directory to
read/write/execute by owner, and read/execute
by group. Also, set the owner and
group to <literal>daemon</literal>.</para><screen># <userinput>chmod 750 mqueue; chown root:bin mqueue</userinput></screen>
</step><step id="mailadmin-step-155"><para>Start <command>sendmail</command>.</para><screen># <userinput>svcadm enable network/smtp:sendmail</userinput></screen>
</step>
</procedure>
</task><task id="mailadmin-156"><title>How
to Run the Old Mail Queue, <filename>/var/spool/omqueue</filename></title><tasksummary><para>To run an old mail queue,
follow these instructions.</para>
</tasksummary><procedure><step id="mailadmin-step-374"><para>Become <filename>root</filename> or assume an equivalent
role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-158"><para>Run
the old mail queue.</para><screen># <userinput>/usr/lib/sendmail -oQ/var/spool/omqueue -q</userinput></screen><para>The <option>oQ</option> flag
specifies an alternate queue directory.
The <option>q</option> flag says to
run every job in the queue. Use the <option>v</option> flag if you are displaying
the verbose output on the screen.</para>
</step><step id="mailadmin-step-159"><para>Remove
the empty directory.</para><screen># <userinput>rmdir /var/spool/omqueue</userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="mailadmin-264"><title>Administering <filename>.forward</filename> Files (Task Map)</title><para>The following table describes
the procedures for administering <filename>.forward</filename> files. For more
information, refer to <olink targetptr="mailrefer-39" remap="internal">.forward
Files</olink> in <olink targetptr="mailrefer-1" remap="internal">Chapter&nbsp;14,
Mail Services (Reference)</olink>.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Disabling <filename>.forward</filename> files</para>
</entry><entry><para>Use this procedure if, for example,
you want to prevent automated forwarding.</para>
</entry><entry><para><olink targetptr="mailadmin-161" remap="internal">How
to Disable .forward Files</olink></para>
</entry>
</row><row><entry><para>Changing the <filename>.forward</filename> file
search path</para>
</entry><entry><para>Use this procedure if, for example,
you want to move all <filename>.forward</filename> files
into a common directory.</para>
</entry><entry><para><olink targetptr="mailadmin-167" remap="internal">How
to Change the .forward&ndash;File
Search Path</olink></para>
</entry>
</row><row><entry><para>Creating and populating <filename>/etc/shells</filename></para>
</entry><entry><para>Use this procedure to enable
users to use the <filename>.forward</filename> file
to forward mail to a program or to
a file.</para>
</entry><entry><para><olink targetptr="mailadmin-173" remap="internal">How
to Create and Populate /etc/shells</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="mailadmin-160"><title>Administering <filename>.forward</filename> Files</title><para>This section contains several
procedures that are related to <filename>.forward</filename> file administration.
Because these files can be edited
by users, the files can cause problems.
For more information, refer to <olink targetptr="mailrefer-39" remap="internal">.forward
Files</olink> in <olink targetptr="mailrefer-1" remap="internal">Chapter&nbsp;14,
Mail Services (Reference)</olink>.</para><itemizedlist><para>Refer to the following:</para><listitem><para><olink targetptr="mailadmin-161" remap="internal">How to Disable
.forward Files</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-167" remap="internal">How to Change
the .forward&ndash;File Search Path</olink></para>
</listitem><listitem><para><olink targetptr="mailadmin-173" remap="internal">How to Create
and Populate /etc/shells</olink></para>
</listitem>
</itemizedlist><task id="mailadmin-161"><title>How
to Disable <filename>.forward</filename> Files</title><tasksummary><para>This procedure, which
prevents automated forwarding, disables
the <filename>.forward</filename> file
for a particular host.</para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-164"><para>Make
a copy of <filename>/etc/mail/cf/domain/solaris-generic.m4</filename> or your site-specific
domain m4 file.</para><screen># <userinput>cd /etc/mail/cf/domain</userinput>
# <userinput>cp solaris-generic.m4</userinput> <replaceable>mydomain</replaceable><userinput>.m4</userinput></screen><variablelist><varlistentry><term><replaceable>mydomain</replaceable></term><listitem><para>Use the file name of your
choice.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="mailadmin-step-165"><para>Add the following line
to the file that you just created.</para><screen><userinput>define(`confFORWARD_PATH',`')dnl</userinput></screen><para>If a value for <option role="nodash">confFORWARD_PATH</option> already
exists in the <filename>m4</filename> file,
replace the value with this null value.</para>
</step><step id="mailadmin-step-166"><para>Build
and install a new configuration file.</para><para>If you need help with this step,
refer to <olink targetptr="mailadmin-44" remap="internal">How to Build a New sendmail.cf File</olink>.</para><note><para>When you edit the <filename>.mc</filename> file, remember to change <literal>DOMAIN(`solaris-generic')</literal> to <literal>DOMAIN(`</literal><replaceable>mydomain</replaceable><literal>')</literal>.</para>
</note>
</step>
</procedure>
</task><task id="mailadmin-167"><title>How
to Change the <filename>.forward</filename>&ndash;File
Search Path</title><tasksummary><para>If, for example, you want
to put all <filename>.forward</filename> files
in a common directory, follow these
instructions.</para>
</tasksummary><procedure>&rolestepA;<step id="mailadmin-step-170"><para>Make
a copy of <filename>/etc/mail/cf/domain/solaris-generic.m4</filename> or your site-specific
domain m4 file.</para><screen># <userinput>cd /etc/mail/cf/domain</userinput>
# <userinput>cp solaris-generic.m4</userinput> <replaceable>mydomain</replaceable><userinput>.m4</userinput></screen><variablelist><varlistentry><term><replaceable>mydomain</replaceable></term><listitem><para>Use the file name of your
choice.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="mailadmin-step-171"><para>Add
the following line to the file that
you just created.</para><screen>define(`confFORWARD_PATH',`$z/.forward:/var/forward/$u')dnl</screen><para>If a value for <option role="nodash">confFORWARD_PATH</option> already
exists in the <filename>m4</filename> file,
replace the value with this new value.</para>
</step><step id="mailadmin-step-172"><para>Build
and install a new configuration file.</para><para>If you need help with this step,
refer to <olink targetptr="mailadmin-44" remap="internal">How to Build a New sendmail.cf File</olink>.</para><note><para>When you edit the <filename>.mc</filename> file, remember to change <literal>DOMAIN(`solaris-generic')</literal> to <literal>DOMAIN(`</literal><replaceable>mydomain</replaceable><literal>')</literal>.</para>
</note>
</step>
</procedure>
</task><task id="mailadmin-173"><title>How
to Create and Populate <filename>/etc/shells</filename></title><tasksummary><para>This file is not included
in the standard release. You must
add the file  if users are to be allowed
to use <filename>.forward</filename> files
to forward mail to a program or to
a file. You can create the file manually
by using <command>grep</command> to
identify all of the shells that are
listed in your password file. You
can then type the shells into the
file. However, the following procedure,
which employs a script that can be
downloaded, is easier to use.</para>
</tasksummary><procedure><step id="mailadmin-step-175"><para>Download
the script.</para><para><ulink url="http://www.sendmail.org/vendor/sun/gen-etc-shells.html" type="url">http://www.sendmail.org/vendor/sun/gen-etc-shells.html</ulink></para>
</step><step id="mailadmin-step-176"><para>Become <filename>root</filename> or assume an equivalent
role.</para><para>Roles contain authorizations
and privileged commands. For more
information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.
To configure a role with the Primary
Administrator profile, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="mailadmin-step-177"><para>To
generate a list of shells, run the <filename>gen-etc-shells</filename> script.</para><screen># <userinput>./gen-etc-shells.sh > /tmp/shells</userinput></screen><para>This script uses the <command>getent</command> command to collect the
names of shells that are included
in the password file sources that
are listed in <filename>/etc/nsswitch.conf</filename>.</para>
</step><step id="mailadmin-step-178"><para>Inspect
and edit the list of shells in <filename>/tmp/shells</filename>.</para><para>With
the editor of your choice, remove
any shells that you are not including.</para>
</step><step id="mailadmin-step-179"><para>Move
the file to <filename>/etc/shells</filename>.</para><screen># <userinput>mv /tmp/shells /etc/shells</userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="mailadmin-265"><title>Troubleshooting
Procedures and Tips for Mail Services
(Task Map)</title><para>The following table describes
troubleshooting procedures and tips
for mail services.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Testing mail configuration</para>
</entry><entry><para>Steps for testing changes to
the <command>sendmail</command> configuration
file</para>
</entry><entry><para><olink targetptr="mailadmin-181" remap="internal">How
to Test the Mail Configuration</olink></para>
</entry>
</row><row><entry><para>Checking mail aliases</para>
</entry><entry><para>A step to confirm that mail
can or cannot be delivered to a specified
recipient</para>
</entry><entry><para><olink targetptr="mailadmin-192" remap="internal">How
to Check Mail Aliases</olink></para>
</entry>
</row><row><entry><para>Testing the rule sets</para>
</entry><entry><para>Steps for checking the input
and returns of the <command>sendmail</command> rule
sets</para>
</entry><entry><para><olink targetptr="mailadmin-195" remap="internal">How
to Test the sendmail Rule Sets</olink></para>
</entry>
</row><row><entry><para>Verifying connections to other
systems</para>
</entry><entry><para>Tips for verifying connections
to other systems</para>
</entry><entry><para><olink targetptr="mailadmin-200" remap="internal">How
to Verify Connections to Other Systems</olink></para>
</entry>
</row><row><entry><para>Logging messages by using the <filename>syslogd</filename> program</para>
</entry><entry><para>Tips for gathering error message
information</para>
</entry><entry><para><olink targetptr="mailadmin-201" remap="internal">Logging
Error Messages</olink></para>
</entry>
</row><row><entry><para>Checking other sources for diagnostic
information</para>
</entry><entry><para>Tips for getting diagnostic
information from other sources</para>
</entry><entry><para><olink targetptr="mailadmin-203" remap="internal">Other
Sources for Mail Diagnostic Information</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="mailadmin-180"><title>Troubleshooting
Procedures and Tips for Mail Services</title><para>This section provides some procedures
and tips that you can use for troubleshooting
problems with mail services.</para><task id="mailadmin-181"><title>How
to Test the Mail Configuration</title><tasksummary><para>To test the changes that
you make to your configuration file,
follow these instructions.</para>
</tasksummary><procedure><step id="mailadmin-step-183"><para>Restart <command>sendmail</command> on any system that
has a revised configuration file. </para><screen># <userinput>svcadm refresh network/smtp:sendmail</userinput></screen>
</step><step id="mailadmin-step-184"><para>Send
test messages from each system.</para><screen># <userinput>/usr/lib/sendmail -v</userinput> <replaceable>names</replaceable> <userinput>&lt;/dev/null</userinput></screen><variablelist><varlistentry><term><replaceable>names</replaceable></term><listitem><para>Specify a recipient's
email address.</para>
</listitem>
</varlistentry>
</variablelist><para>This command sends a null message
to the specified recipient and displays
the message activity on your monitor.</para>
</step><step id="mailadmin-step-350"><para>Send
mail to yourself or other people on
the local system by addressing the
message to a regular user name. </para>
</step><step performance="optional" id="mailadmin-step-351"><para>If you are connected to
a network, send mail in three directions
to someone on another system. </para><itemizedlist><listitem><para>From the main system
to a client system</para>
</listitem><listitem><para>From a client system
to the main system</para>
</listitem><listitem><para>From a client system
to another client system</para>
</listitem>
</itemizedlist>
</step><step performance="optional" id="mailadmin-step-352"><para>If you have a mail gateway,
send mail from the mail host to another
domain to ensure that the relay mailer
and host are configured properly. </para>
</step><step performance="optional" id="mailadmin-step-353"><para>If you have set up a UUCP
connection on your phone line to another
host, send mail to someone at that
host. Have that person send mail back
or call you when the message is received. </para>
</step><step id="mailadmin-step-354"><para>Ask
someone to send mail to you over the
UUCP connection.</para><para>The <command>sendmail</command> program cannot
detect whether the message is delivered
because the program passes the message
to UUCP for delivery.</para>
</step><step id="mailadmin-step-355"><para>From different systems,
send a message to <filename>postmaster</filename> and
ensure that the message is delivered
to your postmaster's mailbox. </para>
</step>
</procedure>
</task><sect2 id="mailadmin-192"><title>How
to Check Mail Aliases</title><para>The following example shows
you how to verify an alias.</para><screen>% <userinput>mconnect</userinput>
connecting to host localhost (127.0.0.1), port 25
connection open
220 your.domain.com ESMTP Sendmail 8.13.6+Sun/8.13.6; Tue, 12 Sep 2004 13:34:13 -0800 (PST)
<userinput>expn sandy</userinput>
250 2.1.5 &lt;sandy@phoenix.example.com>
<userinput>quit</userinput>
221 2.0.0 your.domain.com closing connection
% </screen><para>In this example, the <command>mconnect</command> program opened a connection
to a mail  server on a local host
and enabled you to test that connection.
The program runs interactively, so
you can issue various diagnostic commands.
For a complete description, see the <olink targetdoc="refman1" targetptr="mconnect-1" remap="external"><citerefentry><refentrytitle>mconnect</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page. The entry, <command>expn</command> <literal>sandy</literal>, provided the expanded
address, <literal>sandy@phoenix.example.com</literal>. Thus, you have verified
that mail can be delivered when using
the alias <literal>sandy</literal>.</para><para>Remember to avoid loops
and inconsistent databases when both
local and domain-wide aliases are
used. Be especially careful to avoid
the creation of alias loops when you
move a user from one system to another
system.  </para>
</sect2><task id="mailadmin-195"><title>How
to Test the <command>sendmail</command> Rule
Sets</title><tasksummary><para>To check the input and
returns of the <command>sendmail</command> rule
sets, follow these instructions.</para>
</tasksummary><procedure><step id="mailadmin-step-197"><para>Change
to address test mode.</para><screen># <userinput>/usr/lib/sendmail -bt</userinput></screen>
</step><step id="mailadmin-step-198"><para>Test
a mail address.</para><para>Provide
the following numbers and address
at the last prompt (<literal>></literal>).</para><screen>> <userinput>3,0 <replaceable>mail-address</replaceable></userinput></screen><variablelist><varlistentry><term><replaceable>mail-address</replaceable></term><listitem><para>Use the mail address
that you are testing.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="mailadmin-step-199"><para>End
the session.</para><para>Press Control-d.</para>
</step>
</procedure><example id="mailadmin-ex-240"><title>Address Test Mode Output</title><para>The following is an example
of the output from the address test
mode.</para><screen>% <userinput>/usr/lib/sendmail -bt</userinput>
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter &lt;ruleset> &lt;address>
> <userinput>3,0 sandy@phoenix</userinput>
canonify           input: sandy @ phoenix
Canonify2          input: sandy &lt; @ phoenix >
Canonify2        returns: sandy &lt; @ phoenix . example . com . >
canonify         returns: sandy &lt; @ phoenix . example . com . >
parse              input: sandy &lt; @ phoenix . example . com . >
Parse0             input: sandy &lt; @ phoenix . example . com . >
Parse0           returns: sandy &lt; @ phoenix . example . com . >
ParseLocal         input: sandy &lt; @ phoenix . example . com . >
ParseLocal       returns: sandy &lt; @ phoenix . example . com . >
Parse1             input: sandy &lt; @ phoenix . example . com . >
MailerToTriple     input: &lt; mailhost . phoenix . example . com > 
     sandy &lt; @ phoenix . example . com . >
MailerToTriple   returns: $# relay $@ mailhost . phoenix . example . com 
     $: sandy &lt; @ phoenix . example . com . >
Parse1           returns: $# relay $@ mailhost . phoenix . example . com 
     $: sandy &lt; @ phoenix . example . com . >
parse            returns: $# relay $@ mailhost . phoenix . example . com 
     $: sandy &lt; @ phoenix . example . com . ></screen>
</example>
</task><sect2 id="mailadmin-200"><title>How
to Verify Connections to Other Systems</title><para>The <filename>mconnect</filename> program
opens a connection to a mail server
on a host that you specify and enables
you to test that connection. The program
runs interactively, so you can issue
various diagnostic commands. See the <olink targetdoc="refman1" targetptr="mconnect-1" remap="external"><citerefentry><refentrytitle>mconnect</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page for a complete description. The
following example verifies that mail
to the user name <literal>sandy</literal> is
deliverable.</para><screen>% <userinput>mconnect phoenix</userinput>

connecting to host phoenix (172.31.255.255), port 25
connection open
220 phoenix.example.com ESMTP Sendmail 8.13.1+Sun/8.13.1; Sat, 4 Sep 2004 3:52:56 -0700
<userinput>expn sandy</userinput>
250 2.1.5 &lt;sandy@phoenix.example.com>
<userinput>quit</userinput></screen><para>If you cannot use <command>mconnect</command> to connect to an <command>SMTP</command> port, check these conditions.</para><itemizedlist><listitem><para>Is the system load
too high?</para>
</listitem><listitem><para>Is the <filename>sendmail</filename> daemon running?</para>
</listitem><listitem><para>Does the system have
the appropriate <filename>/etc/mail/sendmail.cf</filename> file?</para>
</listitem><listitem><para>Is port 25, the port
that <command>sendmail</command> uses,
active?</para>
</listitem>
</itemizedlist>
</sect2><sect2 id="mailadmin-201"><title>Logging
Error Messages</title><para>Your mail service logs most
error messages by using the <filename>syslogd</filename> program. By default, the <filename>syslogd</filename> program sends these
messages to a system that is called <filename>loghost</filename>, which is specified
in the <filename>/etc/hosts</filename> file.
You can define <filename>loghost</filename> to
hold all logs for an entire NIS domain.
If no <filename>loghost</filename> is
specified, error messages from <filename>syslogd</filename> are not reported.</para><para>The <filename>/etc/syslog.conf</filename> file controls where the <filename>syslogd</filename> program forwards
messages. You can change the default
configuration by editing the <filename>/etc/syslog.conf</filename> file. You must restart
the <command>syslog</command> daemon
for any changes to become active.
To gather information about mail,
you can add the following selections
to the file.</para><itemizedlist><listitem><para><literal>mail.alert</literal> &ndash;
Messages about conditions that should
be fixed now</para>
</listitem><listitem><para><literal>mail.crit</literal> &ndash;
Critical messages</para>
</listitem><listitem><para><literal>mail.warning</literal> &ndash;
Warning messages</para>
</listitem><listitem><para><literal>mail.notice</literal> &ndash;
Messages that are not errors, but
might need attention</para>
</listitem><listitem><para><literal>mail.info</literal> &ndash;
Informational messages</para>
</listitem><listitem><para><literal>mail.debug</literal> &ndash;
Debugging messages</para>
</listitem>
</itemizedlist><para>The following entry in the <filename>/etc/syslog.conf</filename> file sends
a copy of all critical, informational,
and debug messages to <filename>/var/log/syslog</filename>.</para><screen>mail.crit;mail.info;mail.debug			/var/log/syslog</screen><para>Each line in the system log
contains a timestamp, the name of
the system that generated the line,
and a message. The <filename>syslog</filename> file
can log a large amount of information.</para><para>The log is arranged in a succession
of levels. At the lowest level, only
unusual occurrences are logged. At
the highest level, even the most mundane
and uninteresting events are recorded.
As a convention, log levels under
10 are considered &ldquo;useful.&rdquo;
Log levels that are higher than 10
are usually used for debugging. See <olink targetdoc="sysadv2" targetptr="eekis" remap="external"><citetitle remap="section">Customizing System Message Logging</citetitle> in <citetitle remap="book">System Administration Guide: Advanced Administration</citetitle></olink> for
information about <command>loghost</command> and
the <command>syslogd</command> program.</para>
</sect2><sect2 id="mailadmin-203"><title>Other
Sources for Mail Diagnostic Information</title><para>For other diagnostic information,
check the following sources.</para><itemizedlist><listitem><para>Look at the <literal>Received</literal> lines in the header of
the message. These lines trace the
route that the message took as the
message was relayed. Remember to consider
time&ndash;zone differences.</para>
</listitem><listitem><para>Look at the messages from <literal>MAILER-DAEMON</literal>. These messages
typically report delivery problems.
 </para>
</listitem><listitem><para>Check the system log
that records delivery problems for
your group of systems. The <command>sendmail</command> program always records
its activities in the system log.
You might want to modify the <filename>crontab</filename> file to run a shell script
nightly. The script searches the log
for <literal>SYSERR</literal> messages
and mails any messages that it finds
to the postmaster.</para>
</listitem><listitem><para>Use the <filename>mailstats</filename> program to test mail types
and determine the number of incoming
messages and outgoing messages.</para>
</listitem>
</itemizedlist>
</sect2>
</sect1><sect1 id="mailadmin-219"><title>Resolving
Error Messages</title><para>This section describes
how you can resolve some <command>sendmail</command>&ndash;related error messages.
You can also refer to <ulink url="http://www.sendmail.org/faq/" type="url">http://www.sendmail.org/faq/</ulink>.</para><para>The following error messages
contain two or more of the following
types of information.</para><itemizedlist><listitem><para><emphasis role="strong">Cause:</emphasis> What might have happened
to cause the message</para>
</listitem><listitem><para><emphasis role="strong">Description:</emphasis> What the user was doing
when the error message occurred</para>
</listitem><listitem><para><emphasis role="strong">Solution:</emphasis> What you can do to fix
the problem or to continue with your
work</para>
</listitem>
</itemizedlist><msgset><simplemsgentry><msgtext><para>451
timeout waiting for input during <replaceable>source</replaceable></para>
</msgtext><msgexplan role="cause"><para>When <command>sendmail</command> reads from any
source that might time out, such as
an SMTP connection, the program sets
a timer to the value of  various <option role="nodash">Timeout</option> options
before reading begins. If the read
is not completed before the timer
expires, this message appears and
reading stops. Usually, this situation
occurs during <literal>RCPT</literal>.
The mail message is then queued for
later delivery.</para>
</msgexplan><msgexplan role="solution"><para>If
you see this message often, increase
the value of various <option role="nodash">Timeout</option> options
in the <filename>/etc/mail/sendmail.cf</filename> file.
If the timer is already set to a large
number, look for hardware problems,
such as poor network cabling or connections.</para>
</msgexplan>
</simplemsgentry><simplemsgentry><msgtext><para>550 <replaceable>hostname</replaceable>... Host unknown</para>
</msgtext><msgexplan role="cause"><para>This <command>sendmail</command> message indicates
that the destination host machine,
which is specified by the portion
of the address after the at sign (@),
was not found during domain name system
(DNS) lookup.</para>
</msgexplan><msgexplan role="solution"><para>Use
the <command>nslookup</command> command
to verify that the destination host
exists in that domain or other domains,
perhaps with a slightly different
spelling. Otherwise, contact the intended
recipient and ask for a proper address.</para>
</msgexplan>
</simplemsgentry><simplemsgentry><msgtext><para>550 <replaceable>username</replaceable>... User unknown</para>
</msgtext><msgexplan role="cause"><para>This <command>sendmail</command> message indicates
that the intended recipient, who is
specified by the portion of the address
before the at sign (@), could not
be located on the destination host
machine.</para>
</msgexplan><msgexplan role="solution"><para>Check
the email address and try again, perhaps
with a slightly different spelling.
If this remedy does not work, contact
the intended recipient and ask for
a proper address.</para>
</msgexplan>
</simplemsgentry><simplemsgentry><msgtext><para>554 <replaceable>hostname</replaceable>... Local configuration
error</para>
</msgtext><msgexplan role="cause"><para>This <command>sendmail</command> message usually
indicates that the local host is trying
to send mail to itself.</para>
</msgexplan><msgexplan role="solution"><para>Check
the value of the <literal>$j</literal> macro
in the <filename>/etc/mail/sendmail.cf</filename> file
to ensure that this value is a fully
qualified domain name.</para>
</msgexplan><msgexplan role="description"><para>When
the sending system provides its host
name to the receiving system in the
SMTP <command>HELO</command> command,
the receiving system compares its
name to the sender's name. If these
names are the same, the receiving
system issues this error message and
closes the connection. The name that
is provided in the <command>HELO</command> command
is the value of the <literal>$j</literal> macro.</para><para>For additional information,
refer to <ulink url="http://www.sendmail.org/faq/section4.html#4.5" type="url">http://www.sendmail.org/faq/section4.html#4.5</ulink>.</para>
</msgexplan>
</simplemsgentry><simplemsgentry><msgtext><para>config
error: mail loops back to myself.</para>
</msgtext><msgexplan role="cause"><para>This
error message occurs if you set up
an MX record and make host <replaceable>bar</replaceable> the mail exchanger
for domain <replaceable>foo</replaceable>.
However, you fail to configure host <replaceable>bar</replaceable> to know that it
is the mail exchanger for domain <replaceable>foo</replaceable>.</para><para>Also,
another possibility is that both the
sending system and the receiving system
are identifying as the same domain.</para>
</msgexplan><msgexplan role="solution"><para>For
instructions, refer to <ulink url="http://www.sendmail.org/faq/section4.html#4.5" type="url">http://www.sendmail.org/faq/section4.html#4.5</ulink>.</para>
</msgexplan>
</simplemsgentry><simplemsgentry><msgtext><para>host
name configuration error</para>
</msgtext><msgexplan role="description"><para>This
is an old <command>sendmail</command> message,
which replaced <literal>I refuse to
talk to myself</literal> and is now
replaced by the <literal>Local configuration
error</literal> message.</para>
</msgexplan><msgexplan role="solution"><para>Follow
the instructions that were provided
for resolving this error message, <literal>554</literal> <replaceable>hostname</replaceable><literal>... Local configuration error</literal>.</para>
</msgexplan>
</simplemsgentry><simplemsgentry><msgtext><para>user
unknown</para>
</msgtext><msgexplan role="cause"><para>When
you try to send mail to a user, the
error  <literal>Username... user unknown</literal> is
displayed.  The user is on the same
system.</para>
</msgexplan><msgexplan role="solution"><para>Check
for a typographical error in the entered
email address. Otherwise, the user
could be aliased to a nonexistent
email address in <filename>/etc/mail/aliases</filename> or in the user's  <filename>.mailrc</filename> file. Also, check for
uppercase characters in the user name.
Preferably, email addresses should
not be case sensitive.</para><para>For
additional information, refer to <ulink url="http://www.sendmail.org/faq/section4.html#4.17" type="url">http://www.sendmail.org/faq/section4.html#4.17</ulink>.</para>
</msgexplan>
</simplemsgentry>
</msgset>
</sect1>
</chapter>