Copyright (c) 1997-2002 SuSE GmbH Nuernberg, Germany.
Copyright (c) 2006 SuSE LINUX Products GmbH, Germany.
Author: Florian La Roche
        Werner Fink
Please send feedback to http://www.suse.de/feedback/


simple sendmail configurations:
===============================

sendmail was the default mail transfer agent (MTA) for SUSE Linux.
It decides what to do with email: transfer it over the network,
store it on the local disk or hand it over to other transfer-
programs like UUCP.

/etc/sendmail.cf is the main sendmail configuration file. If you have
a simple setup, you can edit /etc/sysconfig/sendmail and
run /usr/lib/sendmail.d/update to have a working /etc/sendmail.cf.

Before setting up sendmail, you should make sure that the DNS (domain name
system) data is correctly configured. DNS maps hostnames to IP-adresses.
For email you should make sure that your wanted email adresse has a valid
MX (mail exchanger) record in the DNS data. Just use "host my.host.com"
to find out about your DNS data:
	$ host my.host.com
	my.host.com address 192.168.0.14
	my.host.com mail is handled (pri=10) by my.host.com
	my.host.com mail is handled (pri=100) by mail-relay.host.com
If you don't see anything about mail delivery, please ask your responsible
DNS admin.  For dialup connetions all hosts used for mailing, like
the local, the mail hub, the smart, and the mail relay host should
be declared with their IP addresses and the corresponding Full Qualified
Domain Names (FQDN).

These parameters in /etc/sysconfig/sendmail can be used to
configure sendmail:

- SENDMAIL_LOCALHOST="localhost host.domain.com www.domain.com"
  sendmail has to decide what email is delivered locally and what has
  to be send over the network to another host. Per default only email
  to the full hostname (FQDN) is stored in local mail-folders. If you
  need to accept additional email names, just add them here.

  Example: Your computer is known as "host.domain.com" and is also
  WWW server for the additional hostname "www.domain.com". Use the
  following parameters in /etc/sysconfig/mail and /etc/sysconfig/sendmail:
	MAIL_CREATE_CONFIG=yes
	SENDMAIL_LOCALHOST="localhost host.domain.com www.domain.com"

  Sometimes it is usefull to add these additional hostnames into
  the /etc/hosts. E.g. if SENDMAIL_EXPENSIVE (see below) is set to
  yes and dialups should be avoided.

- FROM_HEADER="domain.com" (within /etc/sysconfig/mail)
  If you do not want your outgoing email to have your full hostname
  as sender address, you can specify any other hostname here.

  Example: Your machine is called foo.bar.com and you want your email
  sender address to look like hugo@bar.com, you have the following
  parameter set in /etc/sysconfig/mail:
	FROM_HEADER="bar.com"

- SENDMAIL_ALLMASQUERADE="no"
  Enable this with "yes" to change also the recipient address
  Don't use this feature, if you don't have the full /etc/aliases
  and the full /etc/passwd on your host.

- MASQUERADE_DOMAINS="otherdomain.com"
  Normally, any hosts decided as locally are masqueraded.  If
  this feature is given, only the hosts listed in MASQUERADE_DOMAINS
  are masqueraded.  This is useful if you have several domains with
  disjoint namespaces hosted on the same machine.

- SENDMAIL_SMARTHOST="mail-server.provider.com"
  For all non-local email, sendmail will contact the destination host
  given by DNS. So it will try to establish connections all over the
  internet. If you have a dialup-connection or your machine is not
  running all the time, you should pass all outgoing email to an email-
  server which tries to deliver your email to the destination host.
  (This parameter gives a transport method and also the name of the next
  destination host.)

  Example 1: You have a dialup-connection and your provider has the host
  "mail-server.provider.com" as main mail-server. Use the following
  parameter in /etc/sysconfig/senamil:
	SENDMAIL_SMARTHOST="smtp:mail-server.provider.com"
  Example 2: You are a UUCP site and all (non-local) outgoing email
  should be sent to your UUCP server called "uucp.server.com":
	SENDMAIL_SMARTHOST="uucp-dom:uucp.server.com"

- SENDMAIL_NOCANONIFY=no
  sendmail will look at all email hostnames and replace them by their
  full hostnames. If you only have a dialup-connection and you always
  use full hostnames for sending email, you can disable this "canonification"
  of the hostname:
	SENDMAIL_NOCANONIFY=yes

- NODNS=no
  If set to yes sendmail is mostly not able to do DNS-queries.  This
  requires a well configured /etc/hosts to help sendmail to do its job.
  People using dial on demand should try out SENDMAIL_NOCANONIFY without
  this option. With this option the file /etc/mail/service-nodns.switch
  is used. Whereas /etc/mail/service.switch is the regular file.
  For dial-up users please try out DIALUP=yes and SENDMAIL_EXPENSIVE=yes,
  beside this you should combine NODNS=yes always with a smart host
  configured in /etc/hosts and provided with SENDMAIL_SMARTHOST.

- SENDMAIL_EXPENSIVE=no
  sendmail will immediately try to deliver your email to the next
  destination host. With SENDMAIL_EXPENSIVE=yes all email that should
  be sent with smtp to the next host will be kept in your local
  mail-queue.

- DIALUP=no
  set to yes sendmail tries to deliver local mails in defer (postpone)
  mode. This also sets some entries to avoid dialups. This requires
  a correct FQDN for the local host.
  
- SENDMAIL_GENERICS_DOMAIN=""
  this list will cause certain addresses originating locally (i.e. that
  are unqualified) or domains to be looked up in a map and turned into
  another ("generic") form, which can change both the domain name and
  the user name.  These domains can additional to the local domains be
  changed in /etc/mail/genericstable

- SENDMAIL_ARGS="-L sendmail -Am -bd -q30m -om"
  You normally have sendmail runing with these standard parameters:
  "-q30m" will look every 30 minutes to re-try sending failed email.
  "-bd" will start sendmail in daemon mode and sendmail will accept
  email over the network from other hosts.
  Dialup-hosts might leave out "-q30m" and run "sendmail -q" e.g.
  in the evening as cron-job or as part of your dialup scripts
  (Read the comment on SENDMAIL_CLIENT_ARGS).

    SENDMAIL_ARGS="-L sendmail -Am -bd -q30m -om" (default setting)
    SENDMAIL_ARGS="-L sendmail -Am -bd -q2h -om"  (email delivery every 2 hours)
    SENDMAIL_ARGS="-L sendmail -Am -bd -om"       (no queue runs at all)

- SENDMAIL_CLIENT_ARGS="-L sendmail-client -Ac -qp1m"
  This is used to start the sendmail client daemon which runs as user
  mail and look at /var/spool/clientmqueue/ for any mail which should
  put to port 25 (smtp port) of localhost on which the master sendmail
  is listen. Note: if there is no master sendmail running all mails
  stored by the MTAs (Mail Transfer Agents) like pine or mutt using
  `sendmail -oi' will stored in /var/spool/clientmqueue/ for ever.
  For more informations see /usr/share/doc/packages/sendmail/SECURITY.

sendmail.cf supports some more external database files. The default
configuration uses /etc/aliases, /etc/mail/mailertable,
/etc/mail/genericstable and /etc/mail/virtusertable.
These files are normal text files that are converted with "makemap"
to the real database files (ending in .db). /usr/lib/sendmail.d/update
will automatically call "makemap" if you have changed one of these files.)

For all outgoing email, sendmail will use the destination hostname
and look into /etc/mail/mailertable to see how this email should
be transported to the next destination. Please read that file for
some examples on email-routing.

If your email is stored locally, then it is normally stored in your
mail-folder in /var/spool/mail/<login-name>.

If sendmail cannot imediately deliver email (e.g. because of network
problems), it will store it in the queue directory /var/spool/mqueue.
Per default sendmail will re-try to deliver the email every 30 minutes.


background information about general email things:
==================================================

Our sendmail package is configured to use /usr/bin/procmail for local
email delivery into /var/spool/mail. So please read "man procmailrc",
"man procmailex" and "man procmail" for more infos about this very fine
program.

The SMTP protocol is used to transfer emails over the network to another
host. SMTP exchanges the sender and the recipient of the email and then
the complete email with header and body. These sender/recipient addresses
are called "envelope from" and "envelope to". sendmail will base all
email delivery decisions on the envelope information and not on the
information given in the email header. Please note this small difference
and also see that the "From:" line in the email header is not used for
further email delivery. (If you have a ".forward" file that forwards
your email to a new destination, the "From:" line in your email header will
remain unchanged, but the envelope information is changed to your new
address.)
Once the email is stored in your mail-folder in /var/spool/mail, the
information about envelope addresses is lost. This is the reason, why
you cannot use POP to fetch email for a complete domain as POP reads
a normal mail-folder without any envelope information.

Here is a simple model about what DNS does. It is not really the truth,
but is a quit good model to learn about the difficulties with configuring
email. All IP packets are routed by their IP adresses. Whenever you give
any program a hostname, this will first be translated by a DNS server or
by /etc/hosts into an IP address.
DNS uses two translation tables. One is used for normal hostname lookups
like e.g. "telnet host.com" and one is used only for email. So "telnet"
might open a connection to a different host than sending email to that
address. This is the reason you should never configure sendmail to use
/etc/hosts for hostname translations. Please take the trouble of setting
up a DNS server if you want to deliver email to several machines.
If you really don't want to do that, use /etc/mail/mailertable to specify
a destination IP address for each host without valid DNS data.

Here is a bit more detailed information about DNS tables:
- One table is used to give you a mapping from all IP addresses to a
  hostname. This is called a "reverse mapping" as you normally only
  want to get an IP address from a hostname.
- You have tables that translate a hostname into one or more IP adresses.
  These are called "a(ddress) records".
- You can have entries pointing to other a-records. These are called
  alias names or "CNAME" by DNS. (The alias names point to the canonical
  name, CNAME.)


background information for more complex sendmail configurations:
================================================================

If you want to create your own /etc/sendmail.cf, you can set
MAIL_CREATE_CONFIG=no in /etc/sysconfig/mail .

/usr/share/sendmail contains m4 macro files that are often used to
generate a sendmail.cf file. (This is also done by /usr/lib/sendmail.d/update
for the simple configurations with /etc/sysconfig/sendmail and
/etc/sysconfig/mail.)
/etc/mail/linux.mc is a sample file with lots of comments about
possible configurations. Change it to your local needs and call

  m4 /etc/mail/linux.mc > /etc/sendmail.cf

To generate the submit.cf, the configuration of the sendmail
client, the /etc/mail/linux.submit.mc is the valid start point.
Change it to your local needs and call

  m4 /etc/mail/linux.submit.mc > /etc/mail/submit.cf

Please look at the available docu files in /usr/share/sendmail and
/usr/doc/packages/sendmail. Maybe also look at http://www.sendmail.org/.
I really recommend reading the sendmail book by O'Reilly for complex
email setups. This readme is much too small to learn you everything
about email :-)


anti-spam support in this sendmail package:
===========================================

Read /etc/mail/linux.mc carefully.  Check the following pages for the
newest information about anti-spam measures:

- http://www.sendmail.org/antispam.html
- http://spam.abuse.net/
- http://maps.vix.com/rbl/
- http://www.informatik.uni-kiel.de/%7Eca/email/check.html

You can do the following things against email spam:
- Stop relaying email for non-local hosts so your site is not mis-used
  to deliver spam email to other hosts.
- Refuse to deliver email to local users from a list of well-known
  spam-sites.
- Refuse email all emails that do not have a valid MX record.
  Use a "temporary failure, please try again" so that email is not lost
  if we cannot get the DNS data due to network problems.

