Configuring Sendmail

Ok, let's now start up the "sendmailconfig" script, and go through the configuration settings: /etc/init.d/sendmail start sendmailconfig.

debian:~# sendmailconfig

Sendmail Configuration
----------------------
By answering the following questions, you can \
                configure sendmail for your
system. Default values are determined either by \
                your existing configuration
or from common usage.

Press [ENTER] 

Mail Name
---------
Your 'mail name' is the hostname portion of \
                the address to be shown on
outgoing news and mail messages (following \
                the username and @ sign).  This
name will be used by other programs besides \
                sendmail; it should be the single,
full domain name (FQDN) from which mail \
                will appear to originate.

Mail name? [example.com] 
            

This is identical to the Exim configuration section in this that we covered previously.

Null Client
-----------
A special configuration known as the "null client" \
                can be created for this
host if all mail should be forwarded to a \
                central hub via a local SMTP-based
network. This may be a suitable configuration \
                if you want to forward all of
your mail to your local Internet service \
                provider (ISP) for delivery.

To enable this option, give the name of the \
                host to which all mail should be
forwarded. Otherwise leave the option \
                empty to disable it.
To remove a prior name, use 'NONE'.

Null client forward host? [] 
            

A "null client" configuration is suitable for a workstation or similar system, which simply needs to redirect all its e-mail to the central mail server on your network. we'll leave this blank for our current configuration.

Smart Host
----------
A "Smart Host" is one that can deliver mail to \
                external machines.  By using
a "Smart Host", we don't need DNS, or good \
                connectivity ourselves.  This is
most likely what you want if you have a \
                dialup link, or sit behind a firewall.

To enable this option, give the name of the \
                host to which all non-local mail
should be forwarded.  Otherwise leave \
                the option empty.
To remove a prior name, use 'NONE'.

Smart Host:? [] 
            

A "smart host" configuration is similar to a "null client", except it also does not require permanent connectivity to the Internet. This is a good choice if you connect to the Internet using a dial-up connection. we'll leave this option blank for our current configuration.

Address Canonification
----------------------
Usually sendmail will canonify all addresses by \
                consulting a name server and
resolving hosts to their fully qualified domain \
                name (FQDN). Under special
circumstances you may want to disable this \
                feature, for example if this
machine acts only as a mail gateway.

Disable address canonification? [N] 
            

We will leave address canonification enabled. This is analogous to Exim's "qualify_domain" option.

SMTP Mailer
-----------
If you plan to exchange mail with other computers, \
                you should enable the
SMTP mailer. Even if you don't plan to exchange \
                mail with other computers,
it is still a good idea to enable this so local \
                programs can use it.

Enable the SMTP mailer? [Y]
            

As recommended, we will enable the SMTP mailer.

Masquerade Envelope
-------------------
If you want mail envelopes (as well as mail \
                headers) to appear to come from
'example.com', you can enable this option.

Masquerade envelopes? [Y] 
            

This is useful if your mail server is called "mail.example.com", but you wish for your outgoing e-mail to appear as if it is coming from "example.com". You will normally want to enable this.

All Masquerade
--------------
If enabled, this feature will cause recipient \
                addresses to also appear to come
from 'example.com'. Normally they get the \
                local hostname.
Although this may be right for ordinary users, \
                it can break local aliases. For
example, if you send to "localalias", the \
                originating sendmail will find that
alias and send to all members, but send \
                the message with
"To: localalias@example.com". Since that \
                alias likely does
not exist, replies will fail. Use this feature \
                ONLY if you can guarantee that
the ENTIRE namespace of 'example.com' \
                supersets all the
local entries. If in doubt, it is safe to leave \
                this option disabled.

All masquerade? [N] 
            

As recommended, we won't enable "all masquerade".

Don't masquerade mail to local users
-----------------------------------
Send mail to local recipients without masquerading.

Daunt masquerade local? [N]
            

we'll also leave local masquerading disabled.

Always Add Domain
-----------------
If enabled, the local host domain is included \
                even on locally delivered mail.
Normally it is not added unless it is \
                already present.

Always add domain? [N]
            

This means that local only e-mail will not have the machine name or domain name appended to it; this is the default behavior, and should be left as is.

Mail Acceptance
---------------
Sendmail is usually configured to accept mail \
                for your mail name
(example.com). However, under special \
                circumstances you
may not wish sendmail to do this, particularly \
                if (and disabling this option
generally requires that) mail for \
                'example.com' is MXed
to another host. If in doubt, it is safe to \
                leave this option enabled.

Accept mail for 'example.com'? [Y]
            

As directed, it is safe to simply leave this option enabled.

Alternate Names
---------------
In addition to the canonical mail name \
                'example.com', you can
add any number of additional alternate \
                names to recognize for receiving mail.
If other hosts are MXed to you for local mail, \
                this is where you should list
them. This list is saved into the file \
                /etc/mail/local-host-names
so it can be changed later as needed.

To answer this question, separate each \
                alternate name with a space, or answer
'NONE' to eliminate all alternate names.

Alternate names? [] 
            

This option is similar to the "local_domains" option in Exim; it specifies a list of domain names which we consider to be "local" to this system; ie, we will accept and attempt to deliver e-mail destined for user@domain. Sendmail keeps a list of these domains in the "/etc/mail/local-host-names" files.

Trusted Users
-------------
Sendmail allows a special group of users to \
                set their envelope "From" address
using the -f option without generating a \
                warning message. If you have
software such as Majordomo installed, you \
                will want to include the usernames
from such software here. Note that "root", \
                "daemon", and "uucp" are included
automatically and do not need to be specified. \
                This list is saved into the
file /etc/mail/trusted-users so it can be \
                changed later as needed.

To answer this question, separate each \
                username with a space, or answer
'NONE' to eliminate all usernames.

Trusted users? [] 
            

Leave this as the default, unless you have a specific reason to add a trusted user here. You will normally not need to do this, unless you are running mailing list software such as Majordomo.

Redirect Feature
----------------
If enabled, this feature will allow you to \
                alias old names to
<new-address>.REDIRECT, causing \
                sendmail to return mail to the sender with
an error but indicating the recipient's new address.

Enable redirect option? [N]
            

This is a nice option to enable if you have a large userbase with a high rate of turnover. we'll leave this option disabled for now though.

UUCP Addresses
--------------
Sendmail can be configured to be smart \
                about UUCP addresses, or it can do
nothing special with UUCP addresses at all. \
                If you care about UUCP, you will
need to do some additional configuration, \
                perhaps outside of this script.

*** NOTE *** If you use a smart host or do \
                any kind of forwarding (ie
LUSER_RELAY and LOCAL_RELAY), it is \
                important that you say "Yes"
here to prevent a multi-level relay hole - \
                unless you know for *SURE* that
your smart-host does not deal with UUCP addresses.

(Be safe and just say Y)

Enable UUCP addressing? [Y] 
            

UUCP (Unix to Unix Copy Protocol) was the method used for transfering e-mail between Unix systems before the advent of the Internet. It is still very useful for handling e-mail for systems which do not have a permanent Internet connection. It's recommended that you leave this setting on.

Sticky Host
-----------
If enabled, mail sent to 'user@example.com' is \
                marked as
"sticky" -- that is, the local addresses aren't \
                matched against UDB and don't
go through ruleset 5. This is used if you want \
                a setup where 'user' is not
necessarily the same as 'user@example.com', \
                e.g., to make
a distinct domain-wide namespace. \
                If in doubt, it is safe to leave this
option disabled.

Enable sticky host option? [N]
            

As recommended, you can leave this option disabled.

DNS
---
If you are directly connected to the Internet and \
                have access to a domain
name server, you should enable this option.

Enable DNS? [Y]
            

If you are configuring a dial-up system, you can disable this option; otherwise, you should always have it enabled.

Best MX is Local
----------------
If enabled, this option will cause sendmail to accept \
                mail as though locally
addressed for any host that lists this machine as the \
                best possible MX record.
This generates additional DNS traffic, but should be \
                OK for low-to-medium
traffic hosts. N.B.: This feature is fundamentally \
                incompatible with wildcard
MX records. If you have a wildcard MX record that \
                matches your domain, you
cannot use this feature.

Assume best MX is local? [N]
            

We will leave this disabled for now.

Mailertable
-----------
If enabled, this option causes sendmail to read \
                mail routing rules from
the text file /etc/mail/mailertable.  This is needed \
                for unusual mailers like
ifmail and fax programs.
More information is in \
                /usr/share/doc/sendmail-doc/op/op.txt.gz.

Enable the mailertable feature? [N]
            

You should peruse the documentation found in "/usr/share/doc/sendmail-doc/op/op.txt.gz" to get an idea of what you can do here; but we can leave this disabled for now.

Sendmail Restricted Shell
-------------------------
If enabled, this option causes sendmail to use the \
                sendmail restricted shell
program (smrsh) instead of /bin/sh for mailing to \
                programs. This improves your
ability to control what gets run via email; only \
                those programs which appear
in a special directory can be run. If you enable \
                this option, please carefully
read the smrsh(8) man page for further information.

Use the Sendmail Restricted Shell (smrsh)? [Y]
            

This is a desired security option for Sendmail, and should be enabled unless you have a very specific reason not to do so.

Mailer Name
-----------
You can change the name used for internally \
                generated outgoing messages.
Usually this is 'MAILER-DAEMON' but it would \
                not be unreasonable to change
it to something such as 'postmaster'.

Mailer name? [MAILER-DAEMON]
            

Leave this as "MAILER-DAEMON".

Me Too
------
Sendmail normally excludes the sender address \
                from group expansion.  Enabling
this option will cause the sender to be included.

Enable me too option? [N]
            

This option is self-explanatory; you can simply leave it at the default.

Message Timeouts
----------------
Sendmail will issue a warning message to the \
                sender if it can't deliver a
message within a reasonable amount of time. \
                It will also send a failure
notification and give up trying to deliver the \
                message if it can't deliver it
after an unreasonable amount of time.

You can configure the message timeouts after \
                which warning and failure
notifications are sent. Sendmail's defaults are 4 \
                hours and 5 days (4h/5d),
respectively, but many people feel warnings after \
                only 4 hours are premature.

Message timeouts? [4h/5d]
            

You can leave the values at the default, unless you are wanting to tweak your mail system.

Configuration Complete
----------------------
Advanced configuration, such as alternate mailers, \
                the use of mailertables,
Bitnet domains, and UUCP domains can be \
                accomplished by manually editing the
/etc/mail/sendmail.mc configuration file and rerunning
'/usr/sbin/sendmailconfig' to generate the \
                appropriate /etc/mail/sendmail.cf
file. (Local changes made at the end of /etc/mail/sendmail.mc
will be preserved by '/usr/sbin/sendmailconfig'.)