1N/A
1N/A SENDMAIL CONFIGURATION FILES
1N/A
1N/AThis document describes the sendmail configuration files. It
1N/Aexplains how to create a sendmail.cf file for use with sendmail.
1N/AIt also describes how to set options for sendmail which are explained
1N/Ain the Sendmail Installation and Operation guide, which can be found
1N/Aon-line at http://www.sendmail.org/%7Eca/email/doc8.12/op.html .
1N/ARecall this URL throughout this document when references to
1N/Adoc/op/op.* are made.
1N/A
1N/ATable of Content:
1N/A
1N/AINTRODUCTION AND EXAMPLE
1N/AA BRIEF INTRODUCTION TO M4
1N/AFILE LOCATIONS
1N/AOSTYPE
1N/ADOMAINS
1N/AMAILERS
1N/AFEATURES
1N/AHACKS
1N/ASITE CONFIGURATION
1N/AUSING UUCP MAILERS
1N/ATWEAKING RULESETS
1N/AMASQUERADING AND RELAYING
1N/AUSING LDAP FOR ALIASES, MAPS, AND CLASSES
1N/ALDAP ROUTING
1N/AANTI-SPAM CONFIGURATION CONTROL
1N/ACONNECTION CONTROL
1N/ASTARTTLS
1N/AADDING NEW MAILERS OR RULESETS
1N/AADDING NEW MAIL FILTERS
1N/AQUEUE GROUP DEFINITIONS
1N/ANON-SMTP BASED CONFIGURATIONS
1N/AWHO AM I?
1N/AACCEPTING MAIL FOR MULTIPLE NAMES
1N/AUSING MAILERTABLES
1N/AUSING USERDB TO MAP FULL NAMES
1N/AMISCELLANEOUS SPECIAL FEATURES
1N/ASECURITY NOTES
1N/ATWEAKING CONFIGURATION OPTIONS
1N/AMESSAGE SUBMISSION PROGRAM
1N/AFORMAT OF FILES AND MAPS
1N/ADIRECTORY LAYOUT
1N/AADMINISTRATIVE DETAILS
1N/A
1N/A
1N/A+--------------------------+
1N/A| INTRODUCTION AND EXAMPLE |
1N/A+--------------------------+
1N/A
1N/AConfiguration files are contained in the subdirectory "cf", with a
1N/Asuffix ".mc". They must be run through "m4" to produce a ".cf" file.
1N/AYou must pre-load "cf.m4":
1N/A
1N/A m4 ${CFDIR}/m4/cf.m4 config.mc > config.cf
1N/A
1N/AAlternatively, you can simply:
1N/A
1N/A cd ${CFDIR}/cf
1N/A /usr/bin/make config.cf
1N/A
1N/Awhere ${CFDIR} is the root of the cf directory and config.mc is the
1N/Aname of your configuration file. If you are running a version of M4
1N/Athat understands the __file__ builtin (versions of GNU m4 >= 0.75 do
1N/Athis, but the versions distributed with 4.4BSD and derivatives do not)
1N/Aor the -I flag (ditto), then ${CFDIR} can be in an arbitrary directory.
1N/AFor "traditional" versions, ${CFDIR} ***MUST*** be "..", or you MUST
1N/Ause -D_CF_DIR_=/path/to/cf/dir/ -- note the trailing slash! For example:
1N/A
1N/A m4 -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 config.mc > config.cf
1N/A
1N/ALet's examine a typical .mc file:
1N/A
1N/A divert(-1)
1N/A #
1N/A # Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
1N/A # All rights reserved.
1N/A # Copyright (c) 1983 Eric P. Allman. All rights reserved.
1N/A # Copyright (c) 1988, 1993
1N/A # The Regents of the University of California. All rights reserved.
1N/A #
1N/A # By using this file, you agree to the terms and conditions set
1N/A # forth in the LICENSE file which can be found at the top level of
1N/A # the sendmail distribution.
1N/A #
1N/A
1N/A #
1N/A # This is a Berkeley-specific configuration file for HP-UX 9.x.
1N/A # It applies only to the Computer Science Division at Berkeley,
1N/A # and should not be used elsewhere. It is provided on the sendmail
1N/A # distribution as a sample only. To create your own configuration
1N/A # file, create an appropriate domain file in ../domain, change the
1N/A # `DOMAIN' macro below to reference that file, and copy the result
1N/A # to a name of your own choosing.
1N/A #
1N/A divert(0)
1N/A
1N/AThe divert(-1) will delete the crud in the resulting output file.
1N/AThe copyright notice can be replaced by whatever your lawyers require;
1N/Aour lawyers require the one that is included in these files. A copyleft
1N/Ais a copyright by another name. The divert(0) restores regular output.
1N/A
1N/A VERSIONID(`<SCCS or RCS version id>')
1N/A
1N/AVERSIONID is a macro that stuffs the version information into the
1N/Aresulting file. You could use SCCS, RCS, CVS, something else, or
1N/Aomit it completely. This is not the same as the version id included
1N/Ain SMTP greeting messages -- this is defined in m4/version.m4.
1N/A
1N/A OSTYPE(`hpux9')dnl
1N/A
1N/AYou must specify an OSTYPE to properly configure things such as the
1N/Apathname of the help and status files, the flags needed for the local
1N/Amailer, and other important things. If you omit it, you will get an
1N/Aerror when you try to build the configuration. Look at the ostype
1N/Adirectory for the list of known operating system types.
1N/A
1N/A DOMAIN(`CS.Berkeley.EDU')dnl
1N/A
1N/AThis example is specific to the Computer Science Division at Berkeley.
1N/AYou can use "DOMAIN(`generic')" to get a sufficiently bland definition
1N/Athat may well work for you, or you can create a customized domain
1N/Adefinition appropriate for your environment.
1N/A
1N/A MAILER(`local')
1N/A MAILER(`smtp')
1N/A
1N/AThese describe the mailers used at the default CS site. The local
1N/Amailer is always included automatically. Beware: MAILER declarations
1N/Ashould only be followed by LOCAL_* sections. The general rules are
1N/Athat the order should be:
1N/A
1N/A VERSIONID
1N/A OSTYPE
1N/A DOMAIN
1N/A FEATURE
1N/A local macro definitions
1N/A MAILER
1N/A LOCAL_CONFIG
1N/A LOCAL_RULE_*
1N/A LOCAL_RULESETS
1N/A
1N/AThere are a few exceptions to this rule. Local macro definitions which
1N/Ainfluence a FEATURE() should be done before that feature. For example,
1N/Aa define(`PROCMAIL_MAILER_PATH', ...) should be done before
1N/AFEATURE(`local_procmail').
1N/A
1N/A
1N/A+----------------------------+
1N/A| A BRIEF INTRODUCTION TO M4 |
1N/A+----------------------------+
1N/A
1N/ASendmail uses the M4 macro processor to ``compile'' the configuration
1N/Afiles. The most important thing to know is that M4 is stream-based,
1N/Athat is, it doesn't understand about lines. For this reason, in some
1N/Aplaces you may see the word ``dnl'', which stands for ``delete
1N/Athrough newline''; essentially, it deletes all characters starting
1N/Aat the ``dnl'' up to and including the next newline character. In
1N/Amost cases sendmail uses this only to avoid lots of unnecessary
1N/Ablank lines in the output.
1N/A
1N/AOther important directives are define(A, B) which defines the macro
1N/A``A'' to have value ``B''. Macros are expanded as they are read, so
1N/Aone normally quotes both values to prevent expansion. For example,
1N/A
1N/A define(`SMART_HOST', `smart.foo.com')
1N/A
1N/AOne word of warning: M4 macros are expanded even in lines that appear
1N/Ato be comments. For example, if you have
1N/A
1N/A # See FEATURE(`foo') above
1N/A
1N/Ait will not do what you expect, because the FEATURE(`foo') will be
1N/Aexpanded. This also applies to
1N/A
1N/A # And then define the $X macro to be the return address
1N/A
1N/Abecause ``define'' is an M4 keyword. If you want to use them, surround
1N/Athem with directed quotes, `like this'.
1N/A
1N/ASince m4 uses single quotes (opening "`" and closing "'") to quote
1N/Aarguments, those quotes can't be used in arguments. For example,
1N/Ait is not possible to define a rejection message containing a single
1N/Aquote. Usually there are simple workarounds by changing those
1N/Amessages; in the worst case it might be ok to change the value
1N/Adirectly in the generated .cf file, which however is not advised.
1N/A
1N/A+----------------+
1N/A| FILE LOCATIONS |
1N/A+----------------+
1N/A
1N/Asendmail 8.9 has introduced a new configuration directory for sendmail
1N/Arelated files, /etc/mail. The new files available for sendmail 8.9 --
1N/Athe class {R} /etc/mail/relay-domains and the access database
1N/A/etc/mail/access -- take advantage of this new directory. Beginning with
1N/A8.10, all files will use this directory by default (some options may be
1N/Aset by OSTYPE() files). This new directory should help to restore
1N/Auniformity to sendmail's file locations.
1N/A
1N/ABelow is a table of some of the common changes:
1N/A
1N/AOld filename New filename
1N/A------------ ------------
1N/A/etc/bitdomain /etc/mail/bitdomain
1N/A/etc/domaintable /etc/mail/domaintable
1N/A/etc/genericstable /etc/mail/genericstable
1N/A/etc/uudomain /etc/mail/uudomain
1N/A/etc/virtusertable /etc/mail/virtusertable
1N/A/etc/userdb /etc/mail/userdb
1N/A
1N/A/etc/aliases /etc/mail/aliases
1N/A/etc/sendmail/aliases /etc/mail/aliases
1N/A/etc/ucbmail/aliases /etc/mail/aliases
1N/A/usr/adm/sendmail/aliases /etc/mail/aliases
1N/A/usr/lib/aliases /etc/mail/aliases
1N/A/usr/lib/mail/aliases /etc/mail/aliases
1N/A/usr/ucblib/aliases /etc/mail/aliases
1N/A
1N/A/etc/sendmail.cw /etc/mail/local-host-names
1N/A/etc/mail/sendmail.cw /etc/mail/local-host-names
1N/A/etc/sendmail/sendmail.cw /etc/mail/local-host-names
1N/A
1N/A/etc/sendmail.ct /etc/mail/trusted-users
1N/A
1N/A/etc/sendmail.oE /etc/mail/error-header
1N/A
1N/A/etc/sendmail.hf /etc/mail/helpfile
1N/A/etc/mail/sendmail.hf /etc/mail/helpfile
1N/A/usr/ucblib/sendmail.hf /etc/mail/helpfile
1N/A/etc/ucbmail/sendmail.hf /etc/mail/helpfile
1N/A/usr/lib/sendmail.hf /etc/mail/helpfile
1N/A/usr/share/lib/sendmail.hf /etc/mail/helpfile
1N/A/usr/share/misc/sendmail.hf /etc/mail/helpfile
1N/A/share/misc/sendmail.hf /etc/mail/helpfile
1N/A
1N/A/etc/service.switch /etc/mail/service.switch
1N/A
1N/A/etc/sendmail.st /etc/mail/statistics
1N/A/etc/mail/sendmail.st /etc/mail/statistics
1N/A/etc/mailer/sendmail.st /etc/mail/statistics
1N/A/etc/sendmail/sendmail.st /etc/mail/statistics
1N/A/usr/lib/sendmail.st /etc/mail/statistics
1N/A/usr/ucblib/sendmail.st /etc/mail/statistics
1N/A
1N/ANote that all of these paths actually use a new m4 macro MAIL_SETTINGS_DIR
1N/Ato create the pathnames. The default value of this variable is
1N/A`/etc/mail/'. If you set this macro to a different value, you MUST include
1N/Aa trailing slash.
1N/A
1N/ANotice: all filenames used in a .mc (or .cf) file should be absolute
1N/A(starting at the root, i.e., with '/'). Relative filenames most
1N/Alikely cause surprises during operations (unless otherwise noted).
1N/A
1N/A
1N/A+--------+
1N/A| OSTYPE |
1N/A+--------+
1N/A
1N/AYou MUST define an operating system environment, or the configuration
1N/Afile build will puke. There are several environments available; look
1N/Aat the "ostype" directory for the current list. This macro changes
1N/Athings like the location of the alias file and queue directory. Some
1N/Aof these files are identical to one another.
1N/A
1N/AIt is IMPERATIVE that the OSTYPE occur before any MAILER definitions.
1N/AIn general, the OSTYPE macro should go immediately after any version
1N/Ainformation, and MAILER definitions should always go last.
1N/A
1N/AOperating system definitions are usually easy to write. They may define
1N/Athe following variables (everything defaults, so an ostype file may be
1N/Aempty). Unfortunately, the list of configuration-supported systems is
1N/Anot as broad as the list of source-supported systems, since many of
1N/Athe source contributors do not include corresponding ostype files.
1N/A
1N/AALIAS_FILE [/etc/mail/aliases] The location of the text version
1N/A of the alias file(s). It can be a comma-separated
1N/A list of names (but be sure you quote values with
1N/A commas in them -- for example, use
1N/A define(`ALIAS_FILE', `a,b')
1N/A to get "a" and "b" both listed as alias files;
1N/A otherwise the define() primitive only sees "a").
1N/AHELP_FILE [/etc/mail/helpfile] The name of the file
1N/A containing information printed in response to
1N/A the SMTP HELP command.
1N/AQUEUE_DIR [/var/spool/mqueue] The directory containing
1N/A queue files. To use multiple queues, supply
1N/A a value ending with an asterisk. For
1N/A example, /var/spool/mqueue/qd* will use all of the
1N/A directories or symbolic links to directories
1N/A beginning with 'qd' in /var/spool/mqueue as queue
1N/A directories. The names 'qf', 'df', and 'xf' are
1N/A reserved as specific subdirectories for the
1N/A corresponding queue file types as explained in
1N/A doc/op/op.me. See also QUEUE GROUP DEFINITIONS.
1N/AMSP_QUEUE_DIR [/var/spool/clientmqueue] The directory containing
1N/A queue files for the MSP (Mail Submission Program).
1N/ASTATUS_FILE [/etc/mail/statistics] The file containing status
1N/A information.
1N/ALOCAL_MAILER_PATH [/bin/mail] The program used to deliver local mail.
1N/ALOCAL_MAILER_FLAGS [Prmn9] The flags used by the local mailer. The
1N/A flags lsDFMAw5:/|@q are always included.
1N/ALOCAL_MAILER_ARGS [mail -d $u] The arguments passed to deliver local
1N/A mail.
1N/ALOCAL_MAILER_MAX [undefined] If defined, the maximum size of local
1N/A mail that you are willing to accept.
1N/ALOCAL_MAILER_MAXMSGS [undefined] If defined, the maximum number of
1N/A messages to deliver in a single connection. Only
1N/A useful for LMTP local mailers.
1N/ALOCAL_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data
1N/A that ARRIVE from an address that resolves to the
1N/A local mailer and which are converted to MIME will be
1N/A labeled with this character set.
1N/ALOCAL_MAILER_EOL [undefined] If defined, the string to use as the
1N/A end of line for the local mailer.
1N/ALOCAL_MAILER_DSN_DIAGNOSTIC_CODE
1N/A [X-Unix] The DSN Diagnostic-Code value for the
1N/A local mailer. This should be changed with care.
1N/ALOCAL_SHELL_PATH [/bin/sh] The shell used to deliver piped email.
1N/ALOCAL_SHELL_FLAGS [eu9] The flags used by the shell mailer. The
1N/A flags lsDFM are always included.
1N/ALOCAL_SHELL_ARGS [sh -c $u] The arguments passed to deliver "prog"
1N/A mail.
1N/ALOCAL_SHELL_DIR [$z:/] The directory search path in which the
1N/A shell should run.
1N/ALOCAL_MAILER_QGRP [undefined] The queue group for the local mailer.
1N/ASMTP_MAILER_FLAGS [undefined] Flags added to SMTP mailer. Default
1N/A flags are `mDFMuX' for all SMTP-based mailers; the
1N/A "esmtp" mailer adds `a'; "smtp8" adds `8'; and
1N/A "dsmtp" adds `%'.
1N/ARELAY_MAILER_FLAGS [undefined] Flags added to the relay mailer. Default
1N/A flags are `mDFMuX' for all SMTP-based mailers; the
1N/A relay mailer adds `a8'. If this is not defined,
1N/A then SMTP_MAILER_FLAGS is used.
1N/ASMTP_MAILER_MAX [undefined] The maximum size of messages that will
1N/A be transported using the smtp, smtp8, esmtp, or dsmtp
1N/A mailers.
1N/ASMTP_MAILER_MAXMSGS [undefined] If defined, the maximum number of
1N/A messages to deliver in a single connection for the
1N/A smtp, smtp8, esmtp, or dsmtp mailers.
1N/ASMTP_MAILER_MAXRCPTS [undefined] If defined, the maximum number of
1N/A recipients to deliver in a single connection for the
1N/A smtp, smtp8, esmtp, or dsmtp mailers.
1N/ASMTP_MAILER_ARGS [TCP $h] The arguments passed to the smtp mailer.
1N/A About the only reason you would want to change this
1N/A would be to change the default port.
1N/AESMTP_MAILER_ARGS [TCP $h] The arguments passed to the esmtp mailer.
1N/ASMTP8_MAILER_ARGS [TCP $h] The arguments passed to the smtp8 mailer.
1N/ADSMTP_MAILER_ARGS [TCP $h] The arguments passed to the dsmtp mailer.
1N/ARELAY_MAILER_ARGS [TCP $h] The arguments passed to the relay mailer.
1N/ASMTP_MAILER_QGRP [undefined] The queue group for the smtp mailer.
1N/AESMTP_MAILER_QGRP [undefined] The queue group for the esmtp mailer.
1N/ASMTP8_MAILER_QGRP [undefined] The queue group for the smtp8 mailer.
1N/ADSMTP_MAILER_QGRP [undefined] The queue group for the dsmtp mailer.
1N/ARELAY_MAILER_QGRP [undefined] The queue group for the relay mailer.
1N/ARELAY_MAILER_MAXMSGS [undefined] If defined, the maximum number of
1N/A messages to deliver in a single connection for the
1N/A relay mailer.
1N/ASMTP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data
1N/A that ARRIVE from an address that resolves to one of
1N/A the SMTP mailers and which are converted to MIME will
1N/A be labeled with this character set.
1N/ASMTP_MAILER_LL [990] The maximum line length for SMTP mailers
1N/A (except the relay mailer).
1N/ARELAY_MAILER_LL [2040] The maximum line length for the relay mailer.
1N/AUUCP_MAILER_PATH [/usr/bin/uux] The program used to send UUCP mail.
1N/AUUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer. Default
1N/A flags are `DFMhuU' (and `m' for uucp-new mailer,
1N/A minus `U' for uucp-dom mailer).
1N/AUUCP_MAILER_ARGS [uux - -r -z -a$g -gC $h!rmail ($u)] The arguments
1N/A passed to the UUCP mailer.
1N/AUUCP_MAILER_MAX [100000] The maximum size message accepted for
1N/A transmission by the UUCP mailers.
1N/AUUCP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data
1N/A that ARRIVE from an address that resolves to one of
1N/A the UUCP mailers and which are converted to MIME will
1N/A be labeled with this character set.
1N/AUUCP_MAILER_QGRP [undefined] The queue group for the UUCP mailers.
1N/APROCMAIL_MAILER_PATH [/usr/local/bin/procmail] The path to the procmail
1N/A program. This is also used by
1N/A FEATURE(`local_procmail').
1N/APROCMAIL_MAILER_FLAGS [SPhnu9] Flags added to Procmail mailer. Flags
1N/A DFM are always set. This is NOT used by
1N/A FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS
1N/A instead.
1N/APROCMAIL_MAILER_ARGS [procmail -Y -m $h $f $u] The arguments passed to
1N/A the Procmail mailer. This is NOT used by
1N/A FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS
1N/A instead.
1N/APROCMAIL_MAILER_MAX [undefined] If set, the maximum size message that
1N/A will be accepted by the procmail mailer.
1N/APROCMAIL_MAILER_QGRP [undefined] The queue group for the procmail mailer.
1N/AconfEBINDIR [/usr/libexec] The directory for executables.
1N/A Currently used for FEATURE(`local_lmtp') and
1N/A FEATURE(`smrsh').
1N/ALOCAL_PROG_QGRP [undefined] The queue group for the prog mailer.
1N/A
1N/ANote: to tweak Name_MAILER_FLAGS use the macro MODIFY_MAILER_FLAGS:
1N/AMODIFY_MAILER_FLAGS(`Name', `change') where Name is the first part
1N/Aof the macro Name_MAILER_FLAGS (note: that means Name is entirely in
1N/Aupper case) and change can be: flags that should be used directly
1N/A(thus overriding the default value), or if it starts with `+' (`-')
1N/Athen those flags are added to (removed from) the default value.
1N/AExample:
1N/A
1N/A MODIFY_MAILER_FLAGS(`LOCAL', `+e')
1N/A
1N/Awill add the flag `e' to LOCAL_MAILER_FLAGS. Notice: there are
1N/Aseveral smtp mailers all of which are manipulated individually.
1N/ASee the section MAILERS for the available mailer names.
1N/AWARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS
1N/Aunconditionally, i.e., without respecting any definitions in an
1N/AOSTYPE setting.
1N/A
1N/A
1N/A+---------+
1N/A| DOMAINS |
1N/A+---------+
1N/A
1N/AYou will probably want to collect domain-dependent defines into one
1N/Afile, referenced by the DOMAIN macro. For example, the Berkeley
1N/Adomain file includes definitions for several internal distinguished
1N/Ahosts:
1N/A
1N/AUUCP_RELAY The host that will accept UUCP-addressed email.
1N/A If not defined, all UUCP sites must be directly
1N/A connected.
1N/ABITNET_RELAY The host that will accept BITNET-addressed email.
1N/A If not defined, the .BITNET pseudo-domain won't work.
1N/ADECNET_RELAY The host that will accept DECNET-addressed email.
1N/A If not defined, the .DECNET pseudo-domain and addresses
1N/A of the form node::user will not work.
1N/AFAX_RELAY The host that will accept mail to the .FAX pseudo-domain.
1N/A The "fax" mailer overrides this value.
1N/ALOCAL_RELAY The site that will handle unqualified names -- that
1N/A is, names without an @domain extension.
1N/A Normally MAIL_HUB is preferred for this function.
1N/A LOCAL_RELAY is mostly useful in conjunction with
1N/A FEATURE(`stickyhost') -- see the discussion of
1N/A stickyhost below. If not set, they are assumed to
1N/A belong on this machine. This allows you to have a
1N/A central site to store a company- or department-wide
1N/A alias database. This only works at small sites,
1N/A and only with some user agents.
1N/ALUSER_RELAY The site that will handle lusers -- that is, apparently
1N/A local names that aren't local accounts or aliases. To
1N/A specify a local user instead of a site, set this to
1N/A ``local:username''.
1N/A
1N/AAny of these can be either ``mailer:hostname'' (in which case the
1N/Amailer is the internal mailer name, such as ``uucp-new'' and the hostname
1N/Ais the name of the host as appropriate for that mailer) or just a
1N/A``hostname'', in which case a default mailer type (usually ``relay'',
1N/Aa variant on SMTP) is used. WARNING: if you have a wildcard MX
1N/Arecord matching your domain, you probably want to define these to
1N/Ahave a trailing dot so that you won't get the mail diverted back
1N/Ato yourself.
1N/A
1N/AThe domain file can also be used to define a domain name, if needed
1N/A(using "DD<domain>") and set certain site-wide features. If all hosts
1N/Aat your site masquerade behind one email name, you could also use
1N/AMASQUERADE_AS here.
1N/A
1N/AYou do not have to define a domain -- in particular, if you are a
1N/Asingle machine sitting off somewhere, it is probably more work than
1N/Ait's worth. This is just a mechanism for combining "domain dependent
1N/Aknowledge" into one place.
1N/A
1N/A
1N/A+---------+
1N/A| MAILERS |
1N/A+---------+
1N/A
1N/AThere are fewer mailers supported in this version than the previous
1N/Aversion, owing mostly to a simpler world. As a general rule, put the
1N/AMAILER definitions last in your .mc file.
1N/A
1N/Alocal The local and prog mailers. You will almost always
1N/A need these; the only exception is if you relay ALL
1N/A your mail to another site. This mailer is included
1N/A automatically.
1N/A
1N/Asmtp The Simple Mail Transport Protocol mailer. This does
1N/A not hide hosts behind a gateway or another other
1N/A such hack; it assumes a world where everyone is
1N/A running the name server. This file actually defines
1N/A five mailers: "smtp" for regular (old-style) SMTP to
1N/A other servers, "esmtp" for extended SMTP to other
1N/A servers, "smtp8" to do SMTP to other servers without
1N/A converting 8-bit data to MIME (essentially, this is
1N/A your statement that you know the other end is 8-bit
1N/A clean even if it doesn't say so), "dsmtp" to do on
1N/A demand delivery, and "relay" for transmission to the
1N/A RELAY_HOST, LUSER_RELAY, or MAIL_HUB.
1N/A
1N/Auucp The UNIX-to-UNIX Copy Program mailer. Actually, this
1N/A defines two mailers, "uucp-old" (a.k.a. "uucp") and
1N/A "uucp-new" (a.k.a. "suucp"). The latter is for when you
1N/A know that the UUCP mailer at the other end can handle
1N/A multiple recipients in one transfer. If the smtp mailer
1N/A is included in your configuration, two other mailers
1N/A ("uucp-dom" and "uucp-uudom") are also defined [warning: you
1N/A MUST specify MAILER(`smtp') before MAILER(`uucp')]. When you
1N/A include the uucp mailer, sendmail looks for all names in
1N/A class {U} and sends them to the uucp-old mailer; all
1N/A names in class {Y} are sent to uucp-new; and all
1N/A names in class {Z} are sent to uucp-uudom. Note that
1N/A this is a function of what version of rmail runs on
1N/A the receiving end, and hence may be out of your control.
1N/A See the section below describing UUCP mailers in more
1N/A detail.
1N/A
1N/Aprocmail An interface to procmail (does not come with sendmail).
1N/A This is designed to be used in mailertables. For example,
1N/A a common question is "how do I forward all mail for a given
1N/A domain to a single person?". If you have this mailer
1N/A defined, you could set up a mailertable reading:
1N/A
1N/A host.com procmail:/etc/procmailrcs/host.com
1N/A
1N/A with the file /etc/procmailrcs/host.com reading:
1N/A
1N/A :0 # forward mail for host.com
1N/A ! -oi -f $1 person@other.host
1N/A
1N/A This would arrange for (anything)@host.com to be sent
1N/A to person@other.host. In a procmail script, $1 is the
1N/A name of the sender and $2 is the name of the recipient.
1N/A If you use this with FEATURE(`local_procmail'), the FEATURE
1N/A should be listed first.
1N/A
1N/A Of course there are other ways to solve this particular
1N/A problem, e.g., a catch-all entry in a virtusertable.
1N/A
1N/AThe local mailer accepts addresses of the form "user+detail", where
1N/Athe "+detail" is not used for mailbox matching but is available
1N/Ato certain local mail programs (in particular, see
1N/AFEATURE(`local_procmail')). For example, "eric", "eric+sendmail", and
1N/A"eric+sww" all indicate the same user, but additional arguments <null>,
1N/A"sendmail", and "sww" may be provided for use in sorting mail.
1N/A
1N/A
1N/A+----------+
1N/A| FEATURES |
1N/A+----------+
1N/A
1N/ASpecial features can be requested using the "FEATURE" macro. For
1N/Aexample, the .mc line:
1N/A
1N/A FEATURE(`use_cw_file')
1N/A
1N/Atells sendmail that you want to have it read an /etc/mail/local-host-names
1N/Afile to get values for class {w}. A FEATURE may contain up to 9
1N/Aoptional parameters -- for example:
1N/A
1N/A FEATURE(`mailertable', `dbm /usr/lib/mailertable')
1N/A
1N/AThe default database map type for the table features can be set with
1N/A
1N/A define(`DATABASE_MAP_TYPE', `dbm')
1N/A
1N/Awhich would set it to use ndbm databases. The default is the Berkeley DB
1N/Ahash database format. Note that you must still declare a database map type
1N/Aif you specify an argument to a FEATURE. DATABASE_MAP_TYPE is only used
1N/Aif no argument is given for the FEATURE. It must be specified before any
1N/Afeature that uses a map.
1N/A
1N/AAlso, features which can take a map definition as an argument can also take
1N/Athe special keyword `LDAP'. If that keyword is used, the map will use the
1N/ALDAP definition described in the ``USING LDAP FOR ALIASES, MAPS, AND
1N/ACLASSES'' section below.
1N/A
1N/AAvailable features are:
1N/A
1N/Ause_cw_file Read the file /etc/mail/local-host-names file to get
1N/A alternate names for this host. This might be used if you
1N/A were on a host that MXed for a dynamic set of other hosts.
1N/A If the set is static, just including the line "Cw<name1>
1N/A <name2> ..." (where the names are fully qualified domain
1N/A names) is probably superior. The actual filename can be
1N/A overridden by redefining confCW_FILE.
1N/A
1N/Ause_ct_file Read the file /etc/mail/trusted-users file to get the
1N/A names of users that will be ``trusted'', that is, able to
1N/A set their envelope from address using -f without generating
1N/A a warning message. The actual filename can be overridden
1N/A by redefining confCT_FILE.
1N/A
1N/Aredirect Reject all mail addressed to "address.REDIRECT" with
1N/A a ``551 User has moved; please try <address>'' message.
1N/A If this is set, you can alias people who have left
1N/A to their new address with ".REDIRECT" appended.
1N/A
1N/Anouucp Don't route UUCP addresses. This feature takes one
1N/A parameter:
1N/A `reject': reject addresses which have "!" in the local
1N/A part unless it originates from a system
1N/A that is allowed to relay.
1N/A `nospecial': don't do anything special with "!".
1N/A Warnings: 1. See the notice in the anti-spam section.
1N/A 2. don't remove "!" from OperatorChars if `reject' is
1N/A given as parameter.
1N/A
1N/Anocanonify Don't pass addresses to $[ ... $] for canonification
1N/A by default, i.e., host/domain names are considered canonical,
1N/A except for unqualified names, which must not be used in this
1N/A mode (violation of the standard). It can be changed by
1N/A setting the DaemonPortOptions modifiers (M=). That is,
1N/A FEATURE(`nocanonify') will be overridden by setting the
1N/A 'c' flag. Conversely, if FEATURE(`nocanonify') is not used,
1N/A it can be emulated by setting the 'C' flag
1N/A (DaemonPortOptions=Modifiers=C). This would generally only
1N/A be used by sites that only act as mail gateways or which have
1N/A user agents that do full canonification themselves. You may
1N/A also want to use
1N/A "define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')" to turn off
1N/A the usual resolver options that do a similar thing.
1N/A
1N/A An exception list for FEATURE(`nocanonify') can be
1N/A specified with CANONIFY_DOMAIN or CANONIFY_DOMAIN_FILE,
1N/A i.e., a list of domains which are nevertheless passed to
1N/A $[ ... $] for canonification. This is useful to turn on
1N/A canonification for local domains, e.g., use
1N/A CANONIFY_DOMAIN(`my.domain my') to canonify addresses
1N/A which end in "my.domain" or "my".
1N/A Another way to require canonification in the local
1N/A domain is CANONIFY_DOMAIN(`$=m').
1N/A
1N/A A trailing dot is added to addresses with more than
1N/A one component in it such that other features which
1N/A expect a trailing dot (e.g., virtusertable) will
1N/A still work.
1N/A
1N/A If `canonify_hosts' is specified as parameter, i.e.,
1N/A FEATURE(`nocanonify', `canonify_hosts'), then
1N/A addresses which have only a hostname, e.g.,
1N/A <user@host>, will be canonified (and hopefully fully
1N/A qualified), too.
1N/A
1N/Astickyhost This feature is sometimes used with LOCAL_RELAY,
1N/A although it can be used for a different effect with
1N/A MAIL_HUB.
1N/A
1N/A When used without MAIL_HUB, email sent to
1N/A "user@local.host" are marked as "sticky" -- that
1N/A is, the local addresses aren't matched against UDB,
1N/A don't go through ruleset 5, and are not forwarded to
1N/A the LOCAL_RELAY (if defined).
1N/A
1N/A With MAIL_HUB, mail addressed to "user@local.host"
1N/A is forwarded to the mail hub, with the envelope
1N/A address still remaining "user@local.host".
1N/A Without stickyhost, the envelope would be changed
1N/A to "user@mail_hub", in order to protect against
1N/A mailing loops.
1N/A
1N/Amailertable Include a "mailer table" which can be used to override
1N/A routing for particular domains (which are not in class {w},
1N/A i.e. local host names). The argument of the FEATURE may be
1N/A the key definition. If none is specified, the definition
1N/A used is:
1N/A
1N/A hash /etc/mail/mailertable
1N/A
1N/A Keys in this database are fully qualified domain names
1N/A or partial domains preceded by a dot -- for example,
1N/A "vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU". As a
1N/A special case of the latter, "." matches any domain not
1N/A covered by other keys. Values must be of the form:
1N/A mailer:domain
1N/A where "mailer" is the internal mailer name, and "domain"
1N/A is where to send the message. These maps are not
1N/A reflected into the message header. As a special case,
1N/A the forms:
1N/A local:user
1N/A will forward to the indicated user using the local mailer,
1N/A local:
1N/A will forward to the original user in the e-mail address
1N/A using the local mailer, and
1N/A error:code message
1N/A error:D.S.N:code message
1N/A will give an error message with the indicated SMTP reply
1N/A code and message, where D.S.N is an RFC 1893 compliant
1N/A error code.
1N/A
1N/Adomaintable Include a "domain table" which can be used to provide
1N/A domain name mapping. Use of this should really be
1N/A limited to your own domains. It may be useful if you
1N/A change names (e.g., your company changes names from
1N/A oldname.com to newname.com). The argument of the
1N/A FEATURE may be the key definition. If none is specified,
1N/A the definition used is:
1N/A
1N/A hash /etc/mail/domaintable
1N/A
1N/A The key in this table is the domain name; the value is
1N/A the new (fully qualified) domain. Anything in the
1N/A domaintable is reflected into headers; that is, this
1N/A is done in ruleset 3.
1N/A
1N/Abitdomain Look up bitnet hosts in a table to try to turn them into
1N/A internet addresses. The table can be built using the
1N/A bitdomain program contributed by John Gardiner Myers.
1N/A The argument of the FEATURE may be the key definition; if
1N/A none is specified, the definition used is:
1N/A
1N/A hash /etc/mail/bitdomain
1N/A
1N/A Keys are the bitnet hostname; values are the corresponding
1N/A internet hostname.
1N/A
1N/Auucpdomain Similar feature for UUCP hosts. The default map definition
1N/A is:
1N/A
1N/A hash /etc/mail/uudomain
1N/A
1N/A At the moment there is no automagic tool to build this
1N/A database.
1N/A
1N/Aalways_add_domain
1N/A Include the local host domain even on locally delivered
1N/A mail. Normally it is not added on unqualified names.
1N/A However, if you use a shared message store but do not use
1N/A the same user name space everywhere, you may need the host
1N/A name on local names. An optional argument specifies
1N/A another domain to be added than the local.
1N/A
1N/Aallmasquerade If masquerading is enabled (using MASQUERADE_AS), this
1N/A feature will cause recipient addresses to also masquerade
1N/A as being from the masquerade host. Normally they get
1N/A the local hostname. Although this may be right for
1N/A ordinary users, it can break local aliases. For example,
1N/A if you send to "localalias", the originating sendmail will
1N/A find that alias and send to all members, but send the
1N/A message with "To: localalias@masqueradehost". Since that
1N/A alias likely does not exist, replies will fail. Use this
1N/A feature ONLY if you can guarantee that the ENTIRE
1N/A namespace on your masquerade host supersets all the
1N/A local entries.
1N/A
1N/Alimited_masquerade
1N/A Normally, any hosts listed in class {w} are masqueraded. If
1N/A this feature is given, only the hosts listed in class {M} (see
1N/A below: MASQUERADE_DOMAIN) are masqueraded. This is useful
1N/A if you have several domains with disjoint namespaces hosted
1N/A on the same machine.
1N/A
1N/Amasquerade_entire_domain
1N/A If masquerading is enabled (using MASQUERADE_AS) and
1N/A MASQUERADE_DOMAIN (see below) is set, this feature will
1N/A cause addresses to be rewritten such that the masquerading
1N/A domains are actually entire domains to be hidden. All
1N/A hosts within the masquerading domains will be rewritten
1N/A to the masquerade name (used in MASQUERADE_AS). For example,
1N/A if you have:
1N/A
1N/A MASQUERADE_AS(`masq.com')
1N/A MASQUERADE_DOMAIN(`foo.org')
1N/A MASQUERADE_DOMAIN(`bar.com')
1N/A
1N/A then *foo.org and *bar.com are converted to masq.com. Without
1N/A this feature, only foo.org and bar.com are masqueraded.
1N/A
1N/A NOTE: only domains within your jurisdiction and
1N/A current hierarchy should be masqueraded using this.
1N/A
1N/Alocal_no_masquerade
1N/A This feature prevents the local mailer from masquerading even
1N/A if MASQUERADE_AS is used. MASQUERADE_AS will only have effect
1N/A on addresses of mail going outside the local domain.
1N/A
1N/Amasquerade_envelope
1N/A If masquerading is enabled (using MASQUERADE_AS) or the
1N/A genericstable is in use, this feature will cause envelope
1N/A addresses to also masquerade as being from the masquerade
1N/A host. Normally only the header addresses are masqueraded.
1N/A
1N/Agenericstable This feature will cause unqualified addresses (i.e., without
1N/A a domain) and addresses with a domain listed in class {G}
1N/A to be looked up in a map and turned into another ("generic")
1N/A form, which can change both the domain name and the user name.
1N/A Notice: if you use an MSP (as it is default starting with
1N/A 8.12), the MTA will only receive qualified addresses from the
1N/A MSP (as required by the RFCs). Hence you need to add your
1N/A domain to class {G}. This feature is similar to the userdb
1N/A functionality. The same types of addresses as for
1N/A masquerading are looked up, i.e., only header sender
1N/A addresses unless the allmasquerade and/or masquerade_envelope
1N/A features are given. Qualified addresses must have the domain
1N/A part in class {G}; entries can be added to this class by the
1N/A macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE (analogously
1N/A to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below).
1N/A
1N/A The argument of FEATURE(`genericstable') may be the map
1N/A definition; the default map definition is:
1N/A
1N/A hash /etc/mail/genericstable
1N/A
1N/A The key for this table is either the full address, the domain
1N/A (with a leading @; the localpart is passed as first argument)
1N/A or the unqualified username (tried in the order mentioned);
1N/A the value is the new user address. If the new user address
1N/A does not include a domain, it will be qualified in the standard
1N/A manner, i.e., using $j or the masquerade name. Note that the
1N/A address being looked up must be fully qualified. For local
1N/A mail, it is necessary to use FEATURE(`always_add_domain')
1N/A for the addresses to be qualified.
1N/A The "+detail" of an address is passed as %1, so entries like
1N/A
1N/A old+*@foo.org new+%1@example.com
1N/A gen+*@foo.org %1@example.com
1N/A
1N/A and other forms are possible.
1N/A
1N/Agenerics_entire_domain
1N/A If the genericstable is enabled and GENERICS_DOMAIN or
1N/A GENERICS_DOMAIN_FILE is used, this feature will cause
1N/A addresses to be searched in the map if their domain
1N/A parts are subdomains of elements in class {G}.
1N/A
1N/Avirtusertable A domain-specific form of aliasing, allowing multiple
1N/A virtual domains to be hosted on one machine. For example,
1N/A if the virtuser table contains:
1N/A
1N/A info@foo.com foo-info
1N/A info@bar.com bar-info
1N/A joe@bar.com error:nouser 550 No such user here
1N/A jax@bar.com error:5.7.0:550 Address invalid
1N/A @baz.org jane@example.net
1N/A
1N/A then mail addressed to info@foo.com will be sent to the
1N/A address foo-info, mail addressed to info@bar.com will be
1N/A delivered to bar-info, and mail addressed to anyone at baz.org
1N/A will be sent to jane@example.net, mail to joe@bar.com will
1N/A be rejected with the specified error message, and mail to
1N/A jax@bar.com will also have a RFC 1893 compliant error code
1N/A 5.7.0.
1N/A
1N/A The username from the original address is passed
1N/A as %1 allowing:
1N/A
1N/A @foo.org %1@example.com
1N/A
1N/A meaning someone@foo.org will be sent to someone@example.com.
1N/A Additionally, if the local part consists of "user+detail"
1N/A then "detail" is passed as %2 and "+detail" is passed as %3
1N/A when a match against user+* is attempted, so entries like
1N/A
1N/A old+*@foo.org new+%2@example.com
1N/A gen+*@foo.org %2@example.com
1N/A +*@foo.org %1%3@example.com
1N/A X++@foo.org Z%3@example.com
1N/A @bar.org %1%3
1N/A
1N/A and other forms are possible. Note: to preserve "+detail"
1N/A for a default case (@domain) %1%3 must be used as RHS.
1N/A There are two wildcards after "+": "+" matches only a non-empty
1N/A detail, "*" matches also empty details, e.g., user+@foo.org
1N/A matches +*@foo.org but not ++@foo.org. This can be used
1N/A to ensure that the parameters %2 and %3 are not empty.
1N/A
1N/A All the host names on the left hand side (foo.com, bar.com,
1N/A and baz.org) must be in class {w} or class {VirtHost}. The
1N/A latter can be defined by the macros VIRTUSER_DOMAIN or
1N/A VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
1N/A MASQUERADE_DOMAIN_FILE, see below). If VIRTUSER_DOMAIN or
1N/A VIRTUSER_DOMAIN_FILE is used, then the entries of class
1N/A {VirtHost} are added to class {R}, i.e., relaying is allowed
1N/A to (and from) those domains, which by default includes also
1N/A all subdomains (see relay_hosts_only). The default map
1N/A definition is:
1N/A
1N/A hash /etc/mail/virtusertable
1N/A
1N/A A new definition can be specified as the second argument of
1N/A the FEATURE macro, such as
1N/A
1N/A FEATURE(`virtusertable', `dbm /etc/mail/virtusers')
1N/A
1N/Avirtuser_entire_domain
1N/A If the virtusertable is enabled and VIRTUSER_DOMAIN or
1N/A VIRTUSER_DOMAIN_FILE is used, this feature will cause
1N/A addresses to be searched in the map if their domain
1N/A parts are subdomains of elements in class {VirtHost}.
1N/A
1N/Aldap_routing Implement LDAP-based e-mail recipient routing according to
1N/A the Internet Draft draft-lachman-laser-ldap-mail-routing-01.
1N/A This provides a method to re-route addresses with a
1N/A domain portion in class {LDAPRoute} to either a
1N/A different mail host or a different address. Hosts can
1N/A be added to this class using LDAPROUTE_DOMAIN and
1N/A LDAPROUTE_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
1N/A MASQUERADE_DOMAIN_FILE, see below).
1N/A
1N/A See the LDAP ROUTING section below for more information.
1N/A
1N/Anullclient This is a special case -- it creates a configuration file
1N/A containing nothing but support for forwarding all mail to a
1N/A central hub via a local SMTP-based network. The argument
1N/A is the name of that hub.
1N/A
1N/A The only other feature that should be used in conjunction
1N/A with this one is FEATURE(`nocanonify'). No mailers
1N/A should be defined. No aliasing or forwarding is done.
1N/A
1N/Alocal_lmtp Use an LMTP capable local mailer. The argument to this
1N/A feature is the pathname of an LMTP capable mailer. By
1N/A default, mail.local is used. This is expected to be the
1N/A mail.local which came with the 8.9 distribution which is
1N/A LMTP capable. The path to mail.local is set by the
1N/A confEBINDIR m4 variable -- making the default
1N/A LOCAL_MAILER_PATH /usr/libexec/mail.local.
1N/A If a different LMTP capable mailer is used, its pathname
1N/A can be specified as second parameter and the arguments
1N/A passed to it (A=) as third parameter, e.g.,
1N/A
1N/A FEATURE(`local_lmtp', `/usr/local/bin/lmtp', `lmtp')
1N/A
1N/A WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
1N/A i.e., without respecting any definitions in an OSTYPE setting.
1N/A
1N/Alocal_procmail Use procmail or another delivery agent as the local mailer.
1N/A The argument to this feature is the pathname of the
1N/A delivery agent, which defaults to PROCMAIL_MAILER_PATH.
1N/A Note that this does NOT use PROCMAIL_MAILER_FLAGS or
1N/A PROCMAIL_MAILER_ARGS for the local mailer; tweak
1N/A LOCAL_MAILER_FLAGS and LOCAL_MAILER_ARGS instead, or
1N/A specify the appropriate parameters. When procmail is used,
1N/A the local mailer can make use of the
1N/A "user+indicator@local.host" syntax; normally the +indicator
1N/A is just tossed, but by default it is passed as the -a
1N/A argument to procmail.
1N/A
1N/A This feature can take up to three arguments:
1N/A
1N/A 1. Path to the mailer program
1N/A [default: /usr/local/bin/procmail]
1N/A 2. Argument vector including name of the program
1N/A [default: procmail -Y -a $h -d $u]
1N/A 3. Flags for the mailer [default: SPfhn9]
1N/A
1N/A Empty arguments cause the defaults to be taken.
1N/A Note that if you are on a system with a broken
1N/A setreuid() call, you may need to add -f $f to the procmail
1N/A argument vector to pass the proper sender to procmail.
1N/A
1N/A For example, this allows it to use the maildrop
1N/A (http://www.flounder.net/~mrsam/maildrop/) mailer instead
1N/A by specifying:
1N/A
1N/A FEATURE(`local_procmail', `/usr/local/bin/maildrop',
1N/A `maildrop -d $u')
1N/A
1N/A or scanmails using:
1N/A
1N/A FEATURE(`local_procmail', `/usr/local/bin/scanmails')
1N/A
1N/A WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally,
1N/A i.e., without respecting any definitions in an OSTYPE setting.
1N/A
1N/Abestmx_is_local Accept mail as though locally addressed for any host that
1N/A lists us as the best possible MX record. This generates
1N/A additional DNS traffic, but should be OK for low to
1N/A medium traffic hosts. The argument may be a set of
1N/A domains, which will limit the feature to only apply to
1N/A these domains -- this will reduce unnecessary DNS
1N/A traffic. THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH
1N/A WILDCARD MX RECORDS!!! If you have a wildcard MX record
1N/A that matches your domain, you cannot use this feature.
1N/A
1N/Asmrsh Use the SendMail Restricted SHell (smrsh) provided
1N/A with the distribution instead of /bin/sh for mailing
1N/A to programs. This improves the ability of the local
1N/A system administrator to control what gets run via
1N/A e-mail. If an argument is provided it is used as the
1N/A pathname to smrsh; otherwise, the path defined by
1N/A confEBINDIR is used for the smrsh binary -- by default,
1N/A /usr/libexec/smrsh is assumed.
1N/A
1N/Apromiscuous_relay
1N/A By default, the sendmail configuration files do not permit
1N/A mail relaying (that is, accepting mail from outside your
1N/A local host (class {w}) and sending it to another host than
1N/A your local host). This option sets your site to allow
1N/A mail relaying from any site to any site. In almost all
1N/A cases, it is better to control relaying more carefully
1N/A with the access map, class {R}, or authentication. Domains
1N/A can be added to class {R} by the macros RELAY_DOMAIN or
1N/A RELAY_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
1N/A MASQUERADE_DOMAIN_FILE, see below).
1N/A
1N/Arelay_entire_domain
1N/A This option allows any host in your domain as defined by
1N/A class {m} to use your server for relaying. Notice: make
1N/A sure that your domain is not just a top level domain,
1N/A e.g., com. This can happen if you give your host a name
1N/A like example.com instead of host.example.com.
1N/A
1N/Arelay_hosts_only
1N/A By default, names that are listed as RELAY in the access
1N/A db and class {R} are treated as domain names, not host names.
1N/A For example, if you specify ``foo.com'', then mail to or
1N/A from foo.com, abc.foo.com, or a.very.deep.domain.foo.com
1N/A will all be accepted for relaying. This feature changes
1N/A the behaviour to lookup individual host names only.
1N/A
1N/Arelay_based_on_MX
1N/A Turns on the ability to allow relaying based on the MX
1N/A records of the host portion of an incoming recipient; that
1N/A is, if an MX record for host foo.com points to your site,
1N/A you will accept and relay mail addressed to foo.com. See
1N/A description below for more information before using this
1N/A feature. Also, see the KNOWNBUGS entry regarding bestmx
1N/A map lookups.
1N/A
1N/A FEATURE(`relay_based_on_MX') does not necessarily allow
1N/A routing of these messages which you expect to be allowed,
1N/A if route address syntax (or %-hack syntax) is used. If
1N/A this is a problem, add entries to the access-table or use
1N/A FEATURE(`loose_relay_check').
1N/A
1N/Arelay_mail_from
1N/A Allows relaying if the mail sender is listed as RELAY in
1N/A the access map. If an optional argument `domain' (this
1N/A is the literal word `domain', not a placeholder) is given,
1N/A relaying can be allowed just based on the domain portion
1N/A of the sender address. This feature should only be used if
1N/A absolutely necessary as the sender address can be easily
1N/A forged. Use of this feature requires the "From:" tag to
1N/A be used for the key in the access map; see the discussion
1N/A of tags and FEATURE(`relay_mail_from') in the section on
1N/A anti-spam configuration control.
1N/A
1N/Arelay_local_from
1N/A Allows relaying if the domain portion of the mail sender
1N/A is a local host. This should only be used if absolutely
1N/A necessary as it opens a window for spammers. Specifically,
1N/A they can send mail to your mail server that claims to be
1N/A from your domain (either directly or via a routed address),
1N/A and you will go ahead and relay it out to arbitrary hosts
1N/A on the Internet.
1N/A
1N/Aaccept_unqualified_senders
1N/A Normally, MAIL FROM: commands in the SMTP session will be
1N/A refused if the connection is a network connection and the
1N/A sender address does not include a domain name. If your
1N/A setup sends local mail unqualified (i.e., MAIL FROM:<joe>),
1N/A you will need to use this feature to accept unqualified
1N/A sender addresses. Setting the DaemonPortOptions modifier
1N/A 'u' overrides the default behavior, i.e., unqualified
1N/A addresses are accepted even without this FEATURE.
1N/A If this FEATURE is not used, the DaemonPortOptions modifier
1N/A 'f' can be used to enforce fully qualified addresses.
1N/A
1N/Aaccept_unresolvable_domains
1N/A Normally, MAIL FROM: commands in the SMTP session will be
1N/A refused if the host part of the argument to MAIL FROM:
1N/A cannot be located in the host name service (e.g., an A or
1N/A MX record in DNS). If you are inside a firewall that has
1N/A only a limited view of the Internet host name space, this
1N/A could cause problems. In this case you probably want to
1N/A use this feature to accept all domains on input, even if
1N/A they are unresolvable.
1N/A
1N/Aaccess_db Turns on the access database feature. The access db gives
1N/A you the ability to allow or refuse to accept mail from
1N/A specified domains for administrative reasons. Moreover,
1N/A it can control the behavior of sendmail in various situations.
1N/A By default, the access database specification is:
1N/A
1N/A hash -T<TMPF> /etc/mail/access
1N/A
1N/A See the anti-spam configuration control section for further
1N/A important information about this feature. Notice:
1N/A "-T<TMPF>" is meant literal, do not replace it by anything.
1N/A
1N/Ablacklist_recipients
1N/A Turns on the ability to block incoming mail for certain
1N/A recipient usernames, hostnames, or addresses. For
1N/A example, you can block incoming mail to user nobody,
1N/A host foo.mydomain.com, or guest@bar.mydomain.com.
1N/A These specifications are put in the access db as
1N/A described in the anti-spam configuration control section
1N/A later in this document.
1N/A
1N/Adelay_checks The rulesets check_mail and check_relay will not be called
1N/A when a client connects or issues a MAIL command, respectively.
1N/A Instead, those rulesets will be called by the check_rcpt
1N/A ruleset; they will be skipped under certain circumstances.
1N/A See "Delay all checks" in the anti-spam configuration control
1N/A section. Note: this feature is incompatible to the versions
1N/A in 8.10 and 8.11.
1N/A
1N/Ause_client_ptr If this feature is enabled then check_relay will override
1N/A its first argument with $&{client_ptr}. This is useful for
1N/A rejections based on the unverified hostname of client,
1N/A which turns on the same behavior as in earlier sendmail
1N/A versions when delay_checks was not in use. See doc/op/op.*
1N/A about check_relay, {client_name}, and {client_ptr}.
1N/A
1N/Adnsbl Turns on rejection, discarding, or quarantining of hosts
1N/A found in a DNS based list. The first argument is used as
1N/A the domain in which blocked hosts are listed. A second
1N/A argument can be used to change the default error message,
1N/A or select one of the operations `discard' and `quarantine'.
1N/A Without that second argument, the error message will be
1N/A
1N/A Rejected: IP-ADDRESS listed at SERVER
1N/A
1N/A where IP-ADDRESS and SERVER are replaced by the appropriate
1N/A information. By default, temporary lookup failures are
1N/A ignored. This behavior can be changed by specifying a
1N/A third argument, which must be either `t' or a full error
1N/A message. See the anti-spam configuration control section for
1N/A an example. The dnsbl feature can be included several times
1N/A to query different DNS based rejection lists. See also
1N/A enhdnsbl for an enhanced version.
1N/A
1N/A Set the DNSBL_MAP mc option to change the default map
1N/A definition from `host'. Set the DNSBL_MAP_OPT mc option
1N/A to add additional options to the map specification used.
1N/A
1N/A Some DNS based rejection lists cause failures if asked
1N/A for AAAA records. If your sendmail version is compiled
1N/A with IPv6 support (NETINET6) and you experience this
1N/A problem, add
1N/A
1N/A define(`DNSBL_MAP', `dns -R A')
1N/A
1N/A before the first use of this feature. Alternatively you
1N/A can use enhdnsbl instead (see below). Moreover, this
1N/A statement can be used to reduce the number of DNS retries,
1N/A e.g.,
1N/A
1N/A define(`DNSBL_MAP', `dns -R A -r2')
1N/A
1N/A See below (EDNSBL_TO) for an explanation.
1N/A
1N/Aenhdnsbl Enhanced version of dnsbl (see above). Further arguments
1N/A (up to 5) can be used to specify specific return values
1N/A from lookups. Temporary lookup failures are ignored unless
1N/A a third argument is given, which must be either `t' or a full
1N/A error message. By default, any successful lookup will
1N/A generate an error. Otherwise the result of the lookup is
1N/A compared with the supplied argument(s), and only if a match
1N/A occurs an error is generated. For example,
1N/A
1N/A FEATURE(`enhdnsbl', `dnsbl.example.com', `', `t', `127.0.0.2.')
1N/A
1N/A will reject the e-mail if the lookup returns the value
1N/A ``127.0.0.2.'', or generate a 451 response if the lookup
1N/A temporarily failed. The arguments can contain metasymbols
1N/A as they are allowed in the LHS of rules. As the example
1N/A shows, the default values are also used if an empty argument,
1N/A i.e., `', is specified. This feature requires that sendmail
1N/A has been compiled with the flag DNSMAP (see sendmail/README).
1N/A
1N/A Set the EDNSBL_TO mc option to change the DNS retry count
1N/A from the default value of 5, this can be very useful when
1N/A a DNS server is not responding, which in turn may cause
1N/A clients to time out (an entry stating
1N/A
1N/A did not issue MAIL/EXPN/VRFY/ETRN
1N/A
1N/A will be logged).
1N/A
1N/Aratecontrol Enable simple ruleset to do connection rate control
1N/A checking. This requires entries in access_db of the form
1N/A
1N/A ClientRate:IP.ADD.RE.SS LIMIT
1N/A
1N/A The RHS specifies the maximum number of connections
1N/A (an integer number) over the time interval defined
1N/A by ConnectionRateWindowSize, where 0 means unlimited.
1N/A
1N/A Take the following example:
1N/A
1N/A ClientRate:10.1.2.3 4
1N/A ClientRate:127.0.0.1 0
1N/A ClientRate: 10
1N/A
1N/A 10.1.2.3 can only make up to 4 connections, the
1N/A general limit it 10, and 127.0.0.1 can make an unlimited
1N/A number of connections per ConnectionRateWindowSize.
1N/A
1N/A See also CONNECTION CONTROL.
1N/A
1N/Aconncontrol Enable a simple check of the number of incoming SMTP
1N/A connections. This requires entries in access_db of the
1N/A form
1N/A
1N/A ClientConn:IP.ADD.RE.SS LIMIT
1N/A
1N/A The RHS specifies the maximum number of open connections
1N/A (an integer number).
1N/A
1N/A Take the following example:
1N/A
1N/A ClientConn:10.1.2.3 4
1N/A ClientConn:127.0.0.1 0
1N/A ClientConn: 10
1N/A
1N/A 10.1.2.3 can only have up to 4 open connections, the
1N/A general limit it 10, and 127.0.0.1 does not have any
1N/A explicit limit.
1N/A
1N/A See also CONNECTION CONTROL.
1N/A
1N/Amtamark Experimental support for "Marking Mail Transfer Agents in
1N/A Reverse DNS with TXT RRs" (MTAMark), see
1N/A draft-stumpf-dns-mtamark-01. Optional arguments are:
1N/A
1N/A 1. Error message, default:
1N/A
1N/A 550 Rejected: $&{client_addr} not listed as MTA
1N/A
1N/A 2. Temporary lookup failures are ignored unless a second
1N/A argument is given, which must be either `t' or a full
1N/A error message.
1N/A
1N/A 3. Lookup prefix, default: _perm._smtp._srv. This should
1N/A not be changed unless the draft changes it.
1N/A
1N/A Example:
1N/A
1N/A FEATURE(`mtamark', `', `t')
1N/A
1N/Alookupdotdomain Look up also .domain in the access map. This allows to
1N/A match only subdomains. It does not work well with
1N/A FEATURE(`relay_hosts_only'), because most lookups for
1N/A subdomains are suppressed by the latter feature.
1N/A
1N/Aloose_relay_check
1N/A Normally, if % addressing is used for a recipient, e.g.
1N/A user%site@othersite, and othersite is in class {R}, the
1N/A check_rcpt ruleset will strip @othersite and recheck
1N/A user@site for relaying. This feature changes that
1N/A behavior. It should not be needed for most installations.
1N/A
1N/Apreserve_luser_host
1N/A Preserve the name of the recipient host if LUSER_RELAY is
1N/A used. Without this option, the domain part of the
1N/A recipient address will be replaced by the host specified as
1N/A LUSER_RELAY. This feature only works if the hostname is
1N/A passed to the mailer (see mailer triple in op.me). Note
1N/A that in the default configuration the local mailer does not
1N/A receive the hostname, i.e., the mailer triple has an empty
1N/A hostname.
1N/A
1N/Apreserve_local_plus_detail
1N/A Preserve the +detail portion of the address when passing
1N/A address to local delivery agent. Disables alias and
1N/A .forward +detail stripping (e.g., given user+detail, only
1N/A that address will be looked up in the alias file; user+* and
1N/A user will not be looked up). Only use if the local
1N/A delivery agent in use supports +detail addressing.
1N/A
1N/Acompat_check Enable ruleset check_compat to look up pairs of addresses
1N/A with the Compat: tag -- Compat:sender<@>recipient -- in the
1N/A access map. Valid values for the RHS include
1N/A DISCARD silently discard recipient
1N/A TEMP: return a temporary error
1N/A ERROR: return a permanent error
1N/A In the last two cases, a 4xy/5xy SMTP reply code should
1N/A follow the colon.
1N/A
1N/Ano_default_msa Don't generate the default MSA daemon, i.e.,
1N/A DAEMON_OPTIONS(`Port=587,Name=MSA,M=E')
1N/A To define a MSA daemon with other parameters, use this
1N/A FEATURE and introduce new settings via DAEMON_OPTIONS().
1N/A
1N/Amsp Defines config file for Message Submission Program.
1N/A See cf/submit.mc for how
1N/A to use it. An optional argument can be used to override
1N/A the default of `[localhost]' to use as host to send all
1N/A e-mails to. Note that MX records will be used if the
1N/A specified hostname is not in square brackets (e.g.,
1N/A [hostname]). If `MSA' is specified as second argument then
1N/A port 587 is used to contact the server. Example:
1N/A
1N/A FEATURE(`msp', `', `MSA')
1N/A
1N/A Some more hints about possible changes can be found below
1N/A in the section MESSAGE SUBMISSION PROGRAM.
1N/A
1N/A Note: Due to many problems, submit.mc uses
1N/A
1N/A FEATURE(`msp', `[127.0.0.1]')
1N/A
1N/A by default. If you have a machine with IPv6 only,
1N/A change it to
1N/A
1N/A FEATURE(`msp', `[IPv6:::1]')
1N/A
1N/A If you want to continue using '[localhost]', (the behavior
1N/A up to 8.12.6), use
1N/A
1N/A FEATURE(`msp')
1N/A
1N/Aqueuegroup A simple example how to select a queue group based
1N/A on the full e-mail address or the domain of the
1N/A recipient. Selection is done via entries in the
1N/A access map using the tag QGRP:, for example:
1N/A
1N/A QGRP:example.com main
1N/A QGRP:friend@some.org others
1N/A QGRP:my.domain local
1N/A
1N/A where "main", "others", and "local" are names of
1N/A queue groups. If an argument is specified, it is used
1N/A as default queue group.
1N/A
1N/A Note: please read the warning in doc/op/op.me about
1N/A queue groups and possible queue manipulations.
1N/A
1N/Agreet_pause Adds the greet_pause ruleset which enables open proxy
1N/A and SMTP slamming protection. The feature can take an
1N/A argument specifying the milliseconds to wait:
1N/A
1N/A FEATURE(`greet_pause', `5000') dnl 5 seconds
1N/A
1N/A If FEATURE(`access_db') is enabled, an access database
1N/A lookup with the GreetPause tag is done using client
1N/A hostname, domain, IP address, or subnet to determine the
1N/A pause time:
1N/A
1N/A GreetPause:my.domain 0
1N/A GreetPause:example.com 5000
1N/A GreetPause:10.1.2 2000
1N/A GreetPause:127.0.0.1 0
1N/A
1N/A When using FEATURE(`access_db'), the optional
1N/A FEATURE(`greet_pause') argument becomes the default if
1N/A nothing is found in the access database. A ruleset called
1N/A Local_greet_pause can be used for local modifications, e.g.,
1N/A
1N/A LOCAL_RULESETS
1N/A SLocal_greet_pause
1N/A R$* $: $&{daemon_flags}
1N/A R$* a $* $# 0
1N/A
1N/Ablock_bad_helo Reject messages from SMTP clients which provide a HELO/EHLO
1N/A argument which is either unqualified, or is one of our own
1N/A names (i.e., the server name instead of the client name).
1N/A This check is performed at RCPT stage and disabled for the
1N/A following cases:
1N/A - authenticated sessions,
1N/A - connections from IP addresses in class $={R}.
1N/A Currently access_db lookups can not be used to
1N/A (selectively) disable this test, moreover,
1N/A FEATURE(`delay_checks')
1N/A is required.
1N/A
1N/Arequire_rdns Reject mail from connecting SMTP clients without proper
1N/A rDNS (reverse DNS), functional gethostbyaddr() resolution.
1N/A Note: this feature will cause false positives, i.e., there
1N/A are legitimate MTAs that do not have proper DNS entries.
1N/A Rejecting mails from those MTAs is a local policy decision.
1N/A
1N/A The basic policy is to reject message with a 5xx error if
1N/A the IP address fails to resolve. However, if this is a
1N/A temporary failure, a 4xx temporary failure is returned.
1N/A If the look-up succeeds, but returns an apparently forged
1N/A value, this is treated as a temporary failure with a 4xx
1N/A error code.
1N/A
1N/A EXCEPTIONS:
1N/A
1N/A Exceptions based on access entries are discussed below.
1N/A Any IP address matched using $=R (the "relay-domains" file)
1N/A is excepted from the rules. Since we have explicitly
1N/A allowed relaying for this host, based on IP address, we
1N/A ignore the rDNS failure.
1N/A
1N/A The philosophical assumption here is that most users do
1N/A not control their rDNS. They should be able to send mail
1N/A through their ISP, whether or not they have valid rDNS.
1N/A The class $=R, roughly speaking, contains those IP addresses
1N/A and address ranges for which we are the ISP, or are acting
1N/A as if the ISP.
1N/A
1N/A If `delay_checks' is in effect (recommended), then any
1N/A sender who has authenticated is also excepted from the
1N/A restrictions. This happens because the rules produced by
1N/A this FEATURE() will not be applied to authenticated senders
1N/A (assuming `delay_checks').
1N/A
1N/A ACCESS MAP ENTRIES:
1N/A
1N/A Entries such as
1N/A Connect:1.2.3.4 OK
1N/A Connect:1.2 RELAY
1N/A will whitelist IP address 1.2.3.4, so that the rDNS
1N/A blocking does apply to that IP address
1N/A
1N/A Entries such as
1N/A Connect:1.2.3.4 REJECT
1N/A will have the effect of forcing a temporary failure for
1N/A that address to be treated as a permanent failure.
1N/A
1N/Abadmx Reject envelope sender addresses (MAIL) whose domain part
1N/A resolves to a "bad" MX record. By default these are
1N/A MX records which resolve to A records that match the
1N/A regular expression:
1N/A
1N/A ^(127\.|10\.|0\.0\.0\.0)
1N/A
1N/A This default regular expression can be overridden by
1N/A specifying an argument, e.g.,
1N/A
1N/A FEATURE(`badmx', `^127\.0\.0\.1')
1N/A
1N/A Note: this feature requires that the sendmail binary
1N/A has been compiled with the options MAP_REGEX and
1N/A DNSMAP.
1N/A
1N/A+--------------------+
1N/A| USING UUCP MAILERS |
1N/A+--------------------+
1N/A
1N/AIt's hard to get UUCP mailers right because of the extremely ad hoc
1N/Anature of UUCP addressing. These config files are really designed
1N/Afor domain-based addressing, even for UUCP sites.
1N/A
1N/AThere are four UUCP mailers available. The choice of which one to
1N/Ause is partly a matter of local preferences and what is running at
1N/Athe other end of your UUCP connection. Unlike good protocols that
1N/Adefine what will go over the wire, UUCP uses the policy that you
1N/Ashould do what is right for the other end; if they change, you have
1N/Ato change. This makes it hard to do the right thing, and discourages
1N/Apeople from updating their software. In general, if you can avoid
1N/AUUCP, please do.
1N/A
1N/AThe major choice is whether to go for a domainized scheme or a
1N/Anon-domainized scheme. This depends entirely on what the other
1N/Aend will recognize. If at all possible, you should encourage the
1N/Aother end to go to a domain-based system -- non-domainized addresses
1N/Adon't work entirely properly.
1N/A
1N/AThe four mailers are:
1N/A
1N/A uucp-old (obsolete name: "uucp")
1N/A This is the oldest, the worst (but the closest to UUCP) way of
1N/A sending messages across UUCP connections. It does bangify
1N/A everything and prepends $U (your UUCP name) to the sender's
1N/A address (which can already be a bang path itself). It can
1N/A only send to one address at a time, so it spends a lot of
1N/A time copying duplicates of messages. Avoid this if at all
1N/A possible.
1N/A
1N/A uucp-new (obsolete name: "suucp")
1N/A The same as above, except that it assumes that in one rmail
1N/A command you can specify several recipients. It still has a
1N/A lot of other problems.
1N/A
1N/A uucp-dom
1N/A This UUCP mailer keeps everything as domain addresses.
1N/A Basically, it uses the SMTP mailer rewriting rules. This mailer
1N/A is only included if MAILER(`smtp') is specified before
1N/A MAILER(`uucp').
1N/A
1N/A Unfortunately, a lot of UUCP mailer transport agents require
1N/A bangified addresses in the envelope, although you can use
1N/A domain-based addresses in the message header. (The envelope
1N/A shows up as the From_ line on UNIX mail.) So....
1N/A
1N/A uucp-uudom
1N/A This is a cross between uucp-new (for the envelope addresses)
1N/A and uucp-dom (for the header addresses). It bangifies the
1N/A envelope sender (From_ line in messages) without adding the
1N/A local hostname, unless there is no host name on the address
1N/A at all (e.g., "wolf") or the host component is a UUCP host name
1N/A instead of a domain name ("somehost!wolf" instead of
1N/A "some.dom.ain!wolf"). This is also included only if MAILER(`smtp')
1N/A is also specified earlier.
1N/A
1N/AExamples:
1N/A
1N/AOn host grasp.insa-lyon.fr (UUCP host name "grasp"), the following
1N/Asummarizes the sender rewriting for various mailers.
1N/A
1N/AMailer sender rewriting in the envelope
1N/A------ ------ -------------------------
1N/Auucp-{old,new} wolf grasp!wolf
1N/Auucp-dom wolf wolf@grasp.insa-lyon.fr
1N/Auucp-uudom wolf grasp.insa-lyon.fr!wolf
1N/A
1N/Auucp-{old,new} wolf@fr.net grasp!fr.net!wolf
1N/Auucp-dom wolf@fr.net wolf@fr.net
1N/Auucp-uudom wolf@fr.net fr.net!wolf
1N/A
1N/Auucp-{old,new} somehost!wolf grasp!somehost!wolf
1N/Auucp-dom somehost!wolf somehost!wolf@grasp.insa-lyon.fr
1N/Auucp-uudom somehost!wolf grasp.insa-lyon.fr!somehost!wolf
1N/A
1N/AIf you are using one of the domainized UUCP mailers, you really want
1N/Ato convert all UUCP addresses to domain format -- otherwise, it will
1N/Ado it for you (and probably not the way you expected). For example,
1N/Aif you have the address foo!bar!baz (and you are not sending to foo),
1N/Athe heuristics will add the @uucp.relay.name or @local.host.name to
1N/Athis address. However, if you map foo to foo.host.name first, it
1N/Awill not add the local hostname. You can do this using the uucpdomain
1N/Afeature.
1N/A
1N/A
1N/A+-------------------+
1N/A| TWEAKING RULESETS |
1N/A+-------------------+
1N/A
1N/AFor more complex configurations, you can define special rules.
1N/AThe macro LOCAL_RULE_3 introduces rules that are used in canonicalizing
1N/Athe names. Any modifications made here are reflected in the header.
1N/A
1N/AA common use is to convert old UUCP addresses to SMTP addresses using
1N/Athe UUCPSMTP macro. For example:
1N/A
1N/A LOCAL_RULE_3
1N/A UUCPSMTP(`decvax', `decvax.dec.com')
1N/A UUCPSMTP(`research', `research.att.com')
1N/A
1N/Awill cause addresses of the form "decvax!user" and "research!user"
1N/Ato be converted to "user@decvax.dec.com" and "user@research.att.com"
1N/Arespectively.
1N/A
1N/AThis could also be used to look up hosts in a database map:
1N/A
1N/A LOCAL_RULE_3
1N/A R$* < @ $+ > $* $: $1 < @ $(hostmap $2 $) > $3
1N/A
1N/AThis map would be defined in the LOCAL_CONFIG portion, as shown below.
1N/A
1N/ASimilarly, LOCAL_RULE_0 can be used to introduce new parsing rules.
1N/AFor example, new rules are needed to parse hostnames that you accept
1N/Avia MX records. For example, you might have:
1N/A
1N/A LOCAL_RULE_0
1N/A R$+ <@ host.dom.ain.> $#uucp $@ cnmat $: $1 < @ host.dom.ain.>
1N/A
1N/AYou would use this if you had installed an MX record for cnmat.Berkeley.EDU
1N/Apointing at this host; this rule catches the message and forwards it on
1N/Ausing UUCP.
1N/A
1N/AYou can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2.
1N/AThese rulesets are normally empty.
1N/A
1N/AA similar macro is LOCAL_CONFIG. This introduces lines added after the
1N/Aboilerplate option setting but before rulesets. Do not declare rulesets in
1N/Athe LOCAL_CONFIG section. It can be used to declare local database maps or
1N/Awhatever. For example:
1N/A
1N/A LOCAL_CONFIG
1N/A Khostmap hash /etc/mail/hostmap
1N/A Kyplocal nis -m hosts.byname
1N/A
1N/A
1N/A+---------------------------+
1N/A| MASQUERADING AND RELAYING |
1N/A+---------------------------+
1N/A
1N/AYou can have your host masquerade as another using
1N/A
1N/A MASQUERADE_AS(`host.domain')
1N/A
1N/AThis causes mail being sent to be labeled as coming from the
1N/Aindicated host.domain, rather than $j. One normally masquerades as
1N/Aone of one's own subdomains (for example, it's unlikely that
1N/ABerkeley would choose to masquerade as an MIT site). This
1N/Abehaviour is modified by a plethora of FEATUREs; in particular, see
1N/Amasquerade_envelope, allmasquerade, limited_masquerade, and
1N/Amasquerade_entire_domain.
1N/A
1N/AThe masquerade name is not normally canonified, so it is important
1N/Athat it be your One True Name, that is, fully qualified and not a
1N/ACNAME. However, if you use a CNAME, the receiving side may canonify
1N/Ait for you, so don't think you can cheat CNAME mapping this way.
1N/A
1N/ANormally the only addresses that are masqueraded are those that come
1N/Afrom this host (that is, are either unqualified or in class {w}, the list
1N/Aof local domain names). You can augment this list, which is realized
1N/Aby class {M} using
1N/A
1N/A MASQUERADE_DOMAIN(`otherhost.domain')
1N/A
1N/AThe effect of this is that although mail to user@otherhost.domain
1N/Awill not be delivered locally, any mail including any user@otherhost.domain
1N/Awill, when relayed, be rewritten to have the MASQUERADE_AS address.
1N/AThis can be a space-separated list of names.
1N/A
1N/AIf these names are in a file, you can use
1N/A
1N/A MASQUERADE_DOMAIN_FILE(`filename')
1N/A
1N/Ato read the list of names from the indicated file (i.e., to add
1N/Aelements to class {M}).
1N/A
1N/ATo exempt hosts or subdomains from being masqueraded, you can use
1N/A
1N/A MASQUERADE_EXCEPTION(`host.domain')
1N/A
1N/AThis can come handy if you want to masquerade a whole domain
1N/Aexcept for one (or a few) host(s). If these names are in a file,
1N/Ayou can use
1N/A
1N/A MASQUERADE_EXCEPTION_FILE(`filename')
1N/A
1N/ANormally only header addresses are masqueraded. If you want to
1N/Amasquerade the envelope as well, use
1N/A
1N/A FEATURE(`masquerade_envelope')
1N/A
1N/AThere are always users that need to be "exposed" -- that is, their
1N/Ainternal site name should be displayed instead of the masquerade name.
1N/ARoot is an example (which has been "exposed" by default prior to 8.10).
1N/AYou can add users to this list using
1N/A
1N/A EXPOSED_USER(`usernames')
1N/A
1N/AThis adds users to class {E}; you could also use
1N/A
1N/A EXPOSED_USER_FILE(`filename')
1N/A
1N/AYou can also arrange to relay all unqualified names (that is, names
1N/Awithout @host) to a relay host. For example, if you have a central
1N/Aemail server, you might relay to that host so that users don't have
1N/Ato have .forward files or aliases. You can do this using
1N/A
1N/A define(`LOCAL_RELAY', `mailer:hostname')
1N/A
1N/AThe ``mailer:'' can be omitted, in which case the mailer defaults to
1N/A"relay". There are some user names that you don't want relayed, perhaps
1N/Abecause of local aliases. A common example is root, which may be
1N/Alocally aliased. You can add entries to this list using
1N/A
1N/A LOCAL_USER(`usernames')
1N/A
1N/AThis adds users to class {L}; you could also use
1N/A
1N/A LOCAL_USER_FILE(`filename')
1N/A
1N/AIf you want all incoming mail sent to a centralized hub, as for a
1N/Ashared /var/spool/mail scheme, use
1N/A
1N/A define(`MAIL_HUB', `mailer:hostname')
1N/A
1N/AAgain, ``mailer:'' defaults to "relay". If you define both LOCAL_RELAY
1N/Aand MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will
1N/Abe sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB.
1N/ANote: there is a (long standing) bug which keeps this combination from
1N/Aworking for addresses of the form user+detail.
1N/ANames in class {L} will be delivered locally, so you MUST have aliases or
1N/A.forward files for them.
1N/A
1N/AFor example, if you are on machine mastodon.CS.Berkeley.EDU and you have
1N/AFEATURE(`stickyhost'), the following combinations of settings will have the
1N/Aindicated effects:
1N/A
1N/Aemail sent to.... eric eric@mastodon.CS.Berkeley.EDU
1N/A
1N/ALOCAL_RELAY set to mail.CS.Berkeley.EDU (delivered locally)
1N/Amail.CS.Berkeley.EDU (no local aliasing) (aliasing done)
1N/A
1N/AMAIL_HUB set to mammoth.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU
1N/Amammoth.CS.Berkeley.EDU (aliasing done) (aliasing done)
1N/A
1N/ABoth LOCAL_RELAY and mail.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU
1N/AMAIL_HUB set as above (no local aliasing) (aliasing done)
1N/A
1N/AIf you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and
1N/AMAIL_HUB act identically, with MAIL_HUB taking precedence.
1N/A
1N/AIf you want all outgoing mail to go to a central relay site, define
1N/ASMART_HOST as well. Briefly:
1N/A
1N/A LOCAL_RELAY applies to unqualified names (e.g., "eric").
1N/A MAIL_HUB applies to names qualified with the name of the
1N/A local host (e.g., "eric@mastodon.CS.Berkeley.EDU").
1N/A SMART_HOST applies to names qualified with other hosts or
1N/A bracketed addresses (e.g., "eric@mastodon.CS.Berkeley.EDU"
1N/A or "eric@[127.0.0.1]").
1N/A
1N/AHowever, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY,
1N/ADECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you
1N/Areally want absolutely everything to go to a single central site you will
1N/Aneed to unset all the other relays -- or better yet, find or build a
1N/Aminimal config file that does this.
1N/A
1N/AFor duplicate suppression to work properly, the host name is best
1N/Aspecified with a terminal dot:
1N/A
1N/A define(`MAIL_HUB', `host.domain.')
1N/A note the trailing dot ---^
1N/A
1N/A
1N/A+-------------------------------------------+
1N/A| USING LDAP FOR ALIASES, MAPS, AND CLASSES |
1N/A+-------------------------------------------+
1N/A
1N/ALDAP can be used for aliases, maps, and classes by either specifying your
1N/Aown LDAP map specification or using the built-in default LDAP map
1N/Aspecification. The built-in default specifications all provide lookups
1N/Awhich match against either the machine's fully qualified hostname (${j}) or
1N/Aa "cluster". The cluster allows you to share LDAP entries among a large
1N/Anumber of machines without having to enter each of the machine names into
1N/Aeach LDAP entry. To set the LDAP cluster name to use for a particular
1N/Amachine or set of machines, set the confLDAP_CLUSTER m4 variable to a
1N/Aunique name. For example:
1N/A
1N/A define(`confLDAP_CLUSTER', `Servers')
1N/A
1N/AHere, the word `Servers' will be the cluster name. As an example, assume
1N/Athat smtp.sendmail.org, etrn.sendmail.org, and mx.sendmail.org all belong
1N/Ato the Servers cluster.
1N/A
1N/ASome of the LDAP LDIF examples below show use of the Servers cluster.
1N/AEvery entry must have either a sendmailMTAHost or sendmailMTACluster
1N/Aattribute or it will be ignored. Be careful as mixing clusters and
1N/Aindividual host records can have surprising results (see the CAUTION
1N/Asections below).
1N/A
1N/ASee the file cf/sendmail.schema for the actual LDAP schemas. Note that
1N/Athis schema (and therefore the lookups and examples below) is experimental
1N/Aat this point as it has had little public review. Therefore, it may change
1N/Ain future versions. Feedback via sendmail-YYYY@support.sendmail.org is
1N/Aencouraged (replace YYYY with the current year, e.g., 2005).
1N/A
1N/A-------
1N/AAliases
1N/A-------
1N/A
1N/AThe ALIAS_FILE (O AliasFile) option can be set to use LDAP for alias
1N/Alookups. To use the default schema, simply use:
1N/A
1N/A define(`ALIAS_FILE', `ldap:')
1N/A
1N/ABy doing so, you will use the default schema which expands to a map
1N/Adeclared as follows:
1N/A
1N/A ldap -k (&(objectClass=sendmailMTAAliasObject)
1N/A (sendmailMTAAliasGrouping=aliases)
1N/A (|(sendmailMTACluster=${sendmailMTACluster})
1N/A (sendmailMTAHost=$j))
1N/A (sendmailMTAKey=%0))
1N/A -v sendmailMTAAliasValue,sendmailMTAAliasSearch:FILTER:sendmailMTAAliasObject,sendmailMTAAliasURL:URL:sendmailMTAAliasObject
1N/A
1N/A
1N/ANOTE: The macros shown above ${sendmailMTACluster} and $j are not actually
1N/Aused when the binary expands the `ldap:' token as the AliasFile option is
1N/Anot actually macro-expanded when read from the sendmail.cf file.
1N/A
1N/AExample LDAP LDIF entries might be:
1N/A
1N/A dn: sendmailMTAKey=sendmail-list, dc=sendmail, dc=org
1N/A objectClass: sendmailMTA
1N/A objectClass: sendmailMTAAlias
1N/A objectClass: sendmailMTAAliasObject
1N/A sendmailMTAAliasGrouping: aliases
1N/A sendmailMTAHost: etrn.sendmail.org
1N/A sendmailMTAKey: sendmail-list
1N/A sendmailMTAAliasValue: ca@example.org
1N/A sendmailMTAAliasValue: eric
1N/A sendmailMTAAliasValue: gshapiro@example.com
1N/A
1N/A dn: sendmailMTAKey=owner-sendmail-list, dc=sendmail, dc=org
1N/A objectClass: sendmailMTA
1N/A objectClass: sendmailMTAAlias
1N/A objectClass: sendmailMTAAliasObject
1N/A sendmailMTAAliasGrouping: aliases
1N/A sendmailMTAHost: etrn.sendmail.org
1N/A sendmailMTAKey: owner-sendmail-list
1N/A sendmailMTAAliasValue: eric
1N/A
1N/A dn: sendmailMTAKey=postmaster, dc=sendmail, dc=org
1N/A objectClass: sendmailMTA
1N/A objectClass: sendmailMTAAlias
1N/A objectClass: sendmailMTAAliasObject
1N/A sendmailMTAAliasGrouping: aliases
1N/A sendmailMTACluster: Servers
1N/A sendmailMTAKey: postmaster
1N/A sendmailMTAAliasValue: eric
1N/A
1N/AHere, the aliases sendmail-list and owner-sendmail-list will be available
1N/Aonly on etrn.sendmail.org but the postmaster alias will be available on
1N/Aevery machine in the Servers cluster (including etrn.sendmail.org).
1N/A
1N/ACAUTION: aliases are additive so that entries like these:
1N/A
1N/A dn: sendmailMTAKey=bob, dc=sendmail, dc=org
1N/A objectClass: sendmailMTA
1N/A objectClass: sendmailMTAAlias
1N/A objectClass: sendmailMTAAliasObject
1N/A sendmailMTAAliasGrouping: aliases
1N/A sendmailMTACluster: Servers
1N/A sendmailMTAKey: bob
1N/A sendmailMTAAliasValue: eric
1N/A
1N/A dn: sendmailMTAKey=bobetrn, dc=sendmail, dc=org
1N/A objectClass: sendmailMTA
1N/A objectClass: sendmailMTAAlias
1N/A objectClass: sendmailMTAAliasObject
1N/A sendmailMTAAliasGrouping: aliases
1N/A sendmailMTAHost: etrn.sendmail.org
1N/A sendmailMTAKey: bob
1N/A sendmailMTAAliasValue: gshapiro
1N/A
1N/Awould mean that on all of the hosts in the cluster, mail to bob would go to
1N/Aeric EXCEPT on etrn.sendmail.org in which case it would go to BOTH eric and
1N/Agshapiro.
1N/A
1N/AIf you prefer not to use the default LDAP schema for your aliases, you can
1N/Aspecify the map parameters when setting ALIAS_FILE. For example:
1N/A
1N/A define(`ALIAS_FILE', `ldap:-k (&(objectClass=mailGroup)(mail=%0)) -v mgrpRFC822MailMember')
1N/A
1N/A----
1N/AMaps
1N/A----
1N/A
1N/AFEATURE()'s which take an optional map definition argument (e.g., access,
1N/Amailertable, virtusertable, etc.) can instead take the special keyword
1N/A`LDAP', e.g.:
1N/A
1N/A FEATURE(`access_db', `LDAP')
1N/A FEATURE(`virtusertable', `LDAP')
1N/A
1N/AWhen this keyword is given, that map will use LDAP lookups consisting of
1N/Athe objectClass sendmailMTAClassObject, the attribute sendmailMTAMapName
1N/Awith the map name, a search attribute of sendmailMTAKey, and the value
1N/Aattribute sendmailMTAMapValue.
1N/A
1N/AThe values for sendmailMTAMapName are:
1N/A
1N/A FEATURE() sendmailMTAMapName
1N/A --------- ------------------
1N/A access_db access
1N/A authinfo authinfo
1N/A bitdomain bitdomain
1N/A domaintable domain
1N/A genericstable generics
1N/A mailertable mailer
1N/A uucpdomain uucpdomain
1N/A virtusertable virtuser
1N/A
1N/AFor example, FEATURE(`mailertable', `LDAP') would use the map definition:
1N/A
1N/A Kmailertable ldap -k (&(objectClass=sendmailMTAMapObject)
1N/A (sendmailMTAMapName=mailer)
1N/A (|(sendmailMTACluster=${sendmailMTACluster})
1N/A (sendmailMTAHost=$j))
1N/A (sendmailMTAKey=%0))
1N/A -1 -v sendmailMTAMapValue,sendmailMTAMapSearch:FILTER:sendmailMTAMapObject,sendmailMTAMapURL:URL:sendmailMTAMapObject
1N/A
1N/AAn example LDAP LDIF entry using this map might be:
1N/A
1N/A dn: sendmailMTAMapName=mailer, dc=sendmail, dc=org
1N/A objectClass: sendmailMTA
1N/A objectClass: sendmailMTAMap
1N/A sendmailMTACluster: Servers
1N/A sendmailMTAMapName: mailer
1N/A
1N/A dn: sendmailMTAKey=example.com, sendmailMTAMapName=mailer, dc=sendmail, dc=org
1N/A objectClass: sendmailMTA
1N/A objectClass: sendmailMTAMap
1N/A objectClass: sendmailMTAMapObject
1N/A sendmailMTAMapName: mailer
1N/A sendmailMTACluster: Servers
1N/A sendmailMTAKey: example.com
1N/A sendmailMTAMapValue: relay:[smtp.example.com]
1N/A
1N/ACAUTION: If your LDAP database contains the record above and *ALSO* a host
1N/Aspecific record such as:
1N/A
1N/A dn: sendmailMTAKey=example.com@etrn, sendmailMTAMapName=mailer, dc=sendmail, dc=org
1N/A objectClass: sendmailMTA
1N/A objectClass: sendmailMTAMap
1N/A objectClass: sendmailMTAMapObject
1N/A sendmailMTAMapName: mailer
1N/A sendmailMTAHost: etrn.sendmail.org
1N/A sendmailMTAKey: example.com
1N/A sendmailMTAMapValue: relay:[mx.example.com]
1N/A
1N/Athen these entries will give unexpected results. When the lookup is done
1N/Aon etrn.sendmail.org, the effect is that there is *NO* match at all as maps
1N/Arequire a single match. Since the host etrn.sendmail.org is also in the
1N/AServers cluster, LDAP would return two answers for the example.com map key
1N/Ain which case sendmail would treat this as no match at all.
1N/A
1N/AIf you prefer not to use the default LDAP schema for your maps, you can
1N/Aspecify the map parameters when using the FEATURE(). For example:
1N/A
1N/A FEATURE(`access_db', `ldap:-1 -k (&(objectClass=mapDatabase)(key=%0)) -v value')
1N/A
1N/A-------
1N/AClasses
1N/A-------
1N/A
1N/ANormally, classes can be filled via files or programs. As of 8.12, they
1N/Acan also be filled via map lookups using a new syntax:
1N/A
1N/A F{ClassName}mapkey@mapclass:mapspec
1N/A
1N/Amapkey is optional and if not provided the map key will be empty. This can
1N/Abe used with LDAP to read classes from LDAP. Note that the lookup is only
1N/Adone when sendmail is initially started. Use the special value `@LDAP' to
1N/Ause the default LDAP schema. For example:
1N/A
1N/A RELAY_DOMAIN_FILE(`@LDAP')
1N/A
1N/Awould put all of the attribute sendmailMTAClassValue values of LDAP records
1N/Awith objectClass sendmailMTAClass and an attribute sendmailMTAClassName of
1N/A'R' into class $={R}. In other words, it is equivalent to the LDAP map
1N/Aspecification:
1N/A
1N/A F{R}@ldap:-k (&(objectClass=sendmailMTAClass)
1N/A (sendmailMTAClassName=R)
1N/A (|(sendmailMTACluster=${sendmailMTACluster})
1N/A (sendmailMTAHost=$j)))
1N/A -v sendmailMTAClassValue,sendmailMTAClassSearch:FILTER:sendmailMTAClass,sendmailMTAClassURL:URL:sendmailMTAClass
1N/A
1N/ANOTE: The macros shown above ${sendmailMTACluster} and $j are not actually
1N/Aused when the binary expands the `@LDAP' token as class declarations are
1N/Anot actually macro-expanded when read from the sendmail.cf file.
1N/A
1N/AThis can be used with class related commands such as RELAY_DOMAIN_FILE(),
1N/AMASQUERADE_DOMAIN_FILE(), etc:
1N/A
1N/A Command sendmailMTAClassName
1N/A ------- --------------------
1N/A CANONIFY_DOMAIN_FILE() Canonify
1N/A EXPOSED_USER_FILE() E
1N/A GENERICS_DOMAIN_FILE() G
1N/A LDAPROUTE_DOMAIN_FILE() LDAPRoute
1N/A LDAPROUTE_EQUIVALENT_FILE() LDAPRouteEquiv
1N/A LOCAL_USER_FILE() L
1N/A MASQUERADE_DOMAIN_FILE() M
1N/A MASQUERADE_EXCEPTION_FILE() N
1N/A RELAY_DOMAIN_FILE() R
1N/A VIRTUSER_DOMAIN_FILE() VirtHost
1N/A
1N/AYou can also add your own as any 'F'ile class of the form:
1N/A
1N/A F{ClassName}@LDAP
1N/A ^^^^^^^^^
1N/Awill use "ClassName" for the sendmailMTAClassName.
1N/A
1N/AAn example LDAP LDIF entry would look like:
1N/A
1N/A dn: sendmailMTAClassName=R, dc=sendmail, dc=org
1N/A objectClass: sendmailMTA
1N/A objectClass: sendmailMTAClass
1N/A sendmailMTACluster: Servers
1N/A sendmailMTAClassName: R
1N/A sendmailMTAClassValue: sendmail.org
1N/A sendmailMTAClassValue: example.com
1N/A sendmailMTAClassValue: 10.56.23
1N/A
1N/ACAUTION: If your LDAP database contains the record above and *ALSO* a host
1N/Aspecific record such as:
1N/A
1N/A dn: sendmailMTAClassName=R@etrn.sendmail.org, dc=sendmail, dc=org
1N/A objectClass: sendmailMTA
1N/A objectClass: sendmailMTAClass
1N/A sendmailMTAHost: etrn.sendmail.org
1N/A sendmailMTAClassName: R
1N/A sendmailMTAClassValue: example.com
1N/A
1N/Athe result will be similar to the aliases caution above. When the lookup
1N/Ais done on etrn.sendmail.org, $={R} would contain all of the entries (from
1N/Aboth the cluster match and the host match). In other words, the effective
1N/Ais additive.
1N/A
1N/AIf you prefer not to use the default LDAP schema for your classes, you can
1N/Aspecify the map parameters when using the class command. For example:
1N/A
1N/A VIRTUSER_DOMAIN_FILE(`@ldap:-k (&(objectClass=virtHosts)(host=*)) -v host')
1N/A
1N/ARemember, macros can not be used in a class declaration as the binary does
1N/Anot expand them.
1N/A
1N/A
1N/A+--------------+
1N/A| LDAP ROUTING |
1N/A+--------------+
1N/A
1N/AFEATURE(`ldap_routing') can be used to implement the IETF Internet Draft
1N/ALDAP Schema for Intranet Mail Routing
1N/A(draft-lachman-laser-ldap-mail-routing-01). This feature enables
1N/ALDAP-based rerouting of a particular address to either a different host
1N/Aor a different address. The LDAP lookup is first attempted on the full
1N/Aaddress (e.g., user@example.com) and then on the domain portion
1N/A(e.g., @example.com). Be sure to setup your domain for LDAP routing using
1N/ALDAPROUTE_DOMAIN(), e.g.:
1N/A
1N/A LDAPROUTE_DOMAIN(`example.com')
1N/A
1N/AAdditionally, you can specify equivalent domains for LDAP routing using
1N/ALDAPROUTE_EQUIVALENT() and LDAPROUTE_EQUIVALENT_FILE(). 'Equivalent'
1N/Ahostnames are mapped to $M (the masqueraded hostname for the server) before
1N/Athe LDAP query. For example, if the mail is addressed to
1N/Auser@host1.example.com, normally the LDAP lookup would only be done for
1N/A'user@host1.example.com' and '@host1.example.com'. However, if
1N/ALDAPROUTE_EQUIVALENT(`host1.example.com') is used, the lookups would also be
1N/Adone on 'user@example.com' and '@example.com' after attempting the
1N/Ahost1.example.com lookups.
1N/A
1N/ABy default, the feature will use the schemas as specified in the draft
1N/Aand will not reject addresses not found by the LDAP lookup. However,
1N/Athis behavior can be changed by giving additional arguments to the FEATURE()
1N/Acommand:
1N/A
1N/A FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>,
1N/A <detail>, <nodomain>, <tempfail>)
1N/A
1N/Awhere <mailHost> is a map definition describing how to lookup an alternative
1N/Amail host for a particular address; <mailRoutingAddress> is a map definition
1N/Adescribing how to lookup an alternative address for a particular address;
1N/Athe <bounce> argument, if present and not the word "passthru", dictates
1N/Athat mail should be bounced if neither a mailHost nor mailRoutingAddress
1N/Ais found, if set to "sendertoo", the sender will be rejected if not
1N/Afound in LDAP; and <detail> indicates what actions to take if the address
1N/Acontains +detail information -- `strip' tries the lookup with the +detail
1N/Aand if no matches are found, strips the +detail and tries the lookup again;
1N/A`preserve', does the same as `strip' but if a mailRoutingAddress match is
1N/Afound, the +detail information is copied to the new address; the <nodomain>
1N/Aargument, if present, will prevent the @domain lookup if the full
1N/Aaddress is not found in LDAP; the <tempfail> argument, if set to
1N/A"tempfail", instructs the rules to give an SMTP 4XX temporary
1N/Aerror if the LDAP server gives the MTA a temporary failure, or if set to
1N/A"queue" (the default), the MTA will locally queue the mail.
1N/A
1N/AThe default <mailHost> map definition is:
1N/A
1N/A ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient)
1N/A (mailLocalAddress=%0))
1N/A
1N/AThe default <mailRoutingAddress> map definition is:
1N/A
1N/A ldap -1 -T<TMPF> -v mailRoutingAddress
1N/A -k (&(objectClass=inetLocalMailRecipient)
1N/A (mailLocalAddress=%0))
1N/A
1N/ANote that neither includes the LDAP server hostname (-h server) or base DN
1N/A(-b o=org,c=COUNTRY), both necessary for LDAP queries. It is presumed that
1N/Ayour .mc file contains a setting for the confLDAP_DEFAULT_SPEC option with
1N/Athese settings. If this is not the case, the map definitions should be
1N/Achanged as described above. The "-T<TMPF>" is required in any user
1N/Aspecified map definition to catch temporary errors.
1N/A
1N/AThe following possibilities exist as a result of an LDAP lookup on an
1N/Aaddress:
1N/A
1N/A mailHost is mailRoutingAddress is Results in
1N/A ----------- --------------------- ----------
1N/A set to a set mail delivered to
1N/A "local" host mailRoutingAddress
1N/A
1N/A set to a not set delivered to
1N/A "local" host original address
1N/A
1N/A set to a set mailRoutingAddress
1N/A remote host relayed to mailHost
1N/A
1N/A set to a not set original address
1N/A remote host relayed to mailHost
1N/A
1N/A not set set mail delivered to
1N/A mailRoutingAddress
1N/A
1N/A not set not set delivered to
1N/A original address *OR*
1N/A bounced as unknown user
1N/A
1N/AThe term "local" host above means the host specified is in class {w}. If
1N/Athe result would mean sending the mail to a different host, that host is
1N/Alooked up in the mailertable before delivery.
1N/A
1N/ANote that the last case depends on whether the third argument is given
1N/Ato the FEATURE() command. The default is to deliver the message to the
1N/Aoriginal address.
1N/A
1N/AThe LDAP entries should be set up with an objectClass of
1N/AinetLocalMailRecipient and the address be listed in a mailLocalAddress
1N/Aattribute. If present, there must be only one mailHost attribute and it
1N/Amust contain a fully qualified host name as its value. Similarly, if
1N/Apresent, there must be only one mailRoutingAddress attribute and it must
1N/Acontain an RFC 822 compliant address. Some example LDAP records (in LDIF
1N/Aformat):
1N/A
1N/A dn: uid=tom, o=example.com, c=US
1N/A objectClass: inetLocalMailRecipient
1N/A mailLocalAddress: tom@example.com
1N/A mailRoutingAddress: thomas@mailhost.example.com
1N/A
1N/AThis would deliver mail for tom@example.com to thomas@mailhost.example.com.
1N/A
1N/A dn: uid=dick, o=example.com, c=US
1N/A objectClass: inetLocalMailRecipient
1N/A mailLocalAddress: dick@example.com
1N/A mailHost: eng.example.com
1N/A
1N/AThis would relay mail for dick@example.com to the same address but redirect
1N/Athe mail to MX records listed for the host eng.example.com (unless the
1N/Amailertable overrides).
1N/A
1N/A dn: uid=harry, o=example.com, c=US
1N/A objectClass: inetLocalMailRecipient
1N/A mailLocalAddress: harry@example.com
1N/A mailHost: mktmail.example.com
1N/A mailRoutingAddress: harry@mkt.example.com
1N/A
1N/AThis would relay mail for harry@example.com to the MX records listed for
1N/Athe host mktmail.example.com using the new address harry@mkt.example.com
1N/Awhen talking to that host.
1N/A
1N/A dn: uid=virtual.example.com, o=example.com, c=US
1N/A objectClass: inetLocalMailRecipient
1N/A mailLocalAddress: @virtual.example.com
1N/A mailHost: server.example.com
1N/A mailRoutingAddress: virtual@example.com
1N/A
1N/AThis would send all mail destined for any username @virtual.example.com to
1N/Athe machine server.example.com's MX servers and deliver to the address
1N/Avirtual@example.com on that relay machine.
1N/A
1N/A
1N/A+---------------------------------+
1N/A| ANTI-SPAM CONFIGURATION CONTROL |
1N/A+---------------------------------+
1N/A
1N/AThe primary anti-spam features available in sendmail are:
1N/A
1N/A* Relaying is denied by default.
1N/A* Better checking on sender information.
1N/A* Access database.
1N/A* Header checks.
1N/A
1N/ARelaying (transmission of messages from a site outside your host (class
1N/A{w}) to another site except yours) is denied by default. Note that this
1N/Achanged in sendmail 8.9; previous versions allowed relaying by default.
1N/AIf you really want to revert to the old behaviour, you will need to use
1N/AFEATURE(`promiscuous_relay'). You can allow certain domains to relay
1N/Athrough your server by adding their domain name or IP address to class
1N/A{R} using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database
1N/A(described below). Note that IPv6 addresses must be prefaced with "IPv6:".
1N/AThe file consists (like any other file based class) of entries listed on
1N/Aseparate lines, e.g.,
1N/A
1N/A sendmail.org
1N/A 128.32
1N/A IPv6:2002:c0a8:02c7
1N/A IPv6:2002:c0a8:51d2::23f4
1N/A host.mydomain.com
1N/A [UNIX:localhost]
1N/A
1N/ANotice: the last entry allows relaying for connections via a UNIX
1N/Asocket to the MTA/MSP. This might be necessary if your configuration
1N/Adoesn't allow relaying by other means in that case, e.g., by having
1N/Alocalhost.$m in class {R} (make sure $m is not just a top level
1N/Adomain).
1N/A
1N/AIf you use
1N/A
1N/A FEATURE(`relay_entire_domain')
1N/A
1N/Athen any host in any of your local domains (that is, class {m})
1N/Awill be relayed (that is, you will accept mail either to or from any
1N/Ahost in your domain).
1N/A
1N/AYou can also allow relaying based on the MX records of the host
1N/Aportion of an incoming recipient address by using
1N/A
1N/A FEATURE(`relay_based_on_MX')
1N/A
1N/AFor example, if your server receives a recipient of user@domain.com
1N/Aand domain.com lists your server in its MX records, the mail will be
1N/Aaccepted for relay to domain.com. This feature may cause problems
1N/Aif MX lookups for the recipient domain are slow or time out. In that
1N/Acase, mail will be temporarily rejected. It is usually better to
1N/Amaintain a list of hosts/domains for which the server acts as relay.
1N/ANote also that this feature will stop spammers from using your host
1N/Ato relay spam but it will not stop outsiders from using your server
1N/Aas a relay for their site (that is, they set up an MX record pointing
1N/Ato your mail server, and you will relay mail addressed to them
1N/Awithout any prior arrangement). Along the same lines,
1N/A
1N/A FEATURE(`relay_local_from')
1N/A
1N/Awill allow relaying if the sender specifies a return path (i.e.
1N/AMAIL FROM:<user@domain>) domain which is a local domain. This is a
1N/Adangerous feature as it will allow spammers to spam using your mail
1N/Aserver by simply specifying a return address of user@your.domain.com.
1N/AIt should not be used unless absolutely necessary.
1N/AA slightly better solution is
1N/A
1N/A FEATURE(`relay_mail_from')
1N/A
1N/Awhich allows relaying if the mail sender is listed as RELAY in the
1N/Aaccess map. If an optional argument `domain' (this is the literal
1N/Aword `domain', not a placeholder) is given, the domain portion of
1N/Athe mail sender is also checked to allowing relaying. This option
1N/Aonly works together with the tag From: for the LHS of the access
1N/Amap entries. This feature allows spammers to abuse your mail server
1N/Aby specifying a return address that you enabled in your access file.
1N/AThis may be harder to figure out for spammers, but it should not
1N/Abe used unless necessary. Instead use STARTTLS to
1N/Aallow relaying for roaming users.
1N/A
1N/A
1N/AIf source routing is used in the recipient address (e.g.,
1N/ARCPT TO:<user%site.com@othersite.com>), sendmail will check
1N/Auser@site.com for relaying if othersite.com is an allowed relay host
1N/Ain either class {R}, class {m} if FEATURE(`relay_entire_domain') is used,
1N/Aor the access database if FEATURE(`access_db') is used. To prevent
1N/Athe address from being stripped down, use:
1N/A
1N/A FEATURE(`loose_relay_check')
1N/A
1N/AIf you think you need to use this feature, you probably do not. This
1N/Ashould only be used for sites which have no control over the addresses
1N/Athat they provide a gateway for. Use this FEATURE with caution as it
1N/Acan allow spammers to relay through your server if not setup properly.
1N/A
1N/ANOTICE: It is possible to relay mail through a system which the anti-relay
1N/Arules do not prevent: the case of a system that does use FEATURE(`nouucp',
1N/A`nospecial') (system A) and relays local messages to a mail hub (e.g., via
1N/ALOCAL_RELAY or LUSER_RELAY) (system B). If system B doesn't use
1N/AFEATURE(`nouucp') at all, addresses of the form
1N/A<example.net!user@local.host> would be relayed to <user@example.net>.
1N/ASystem A doesn't recognize `!' as an address separator and therefore
1N/Aforwards it to the mail hub which in turns relays it because it came from
1N/Aa trusted local host. So if a mailserver allows UUCP (bang-format)
1N/Aaddresses, all systems from which it allows relaying should do the same
1N/Aor reject those addresses.
1N/A
1N/AAs of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has
1N/Aan unresolvable domain (i.e., one that DNS, your local name service,
1N/Aor special case rules in ruleset 3 cannot locate). This also applies
1N/Ato addresses that use domain literals, e.g., <user@[1.2.3.4]>, if the
1N/AIP address can't be mapped to a host name. If you want to continue
1N/Ato accept such domains, e.g., because you are inside a firewall that
1N/Ahas only a limited view of the Internet host name space (note that you
1N/Awill not be able to return mail to them unless you have some "smart
1N/Ahost" forwarder), use
1N/A
1N/A FEATURE(`accept_unresolvable_domains')
1N/A
1N/AAlternatively, you can allow specific addresses by adding them to
1N/Athe access map, e.g.,
1N/A
1N/A From:unresolvable.domain OK
1N/A From:[1.2.3.4] OK
1N/A From:[1.2.4] OK
1N/A
1N/ANotice: domains which are temporarily unresolvable are (temporarily)
1N/Arejected with a 451 reply code. If those domains should be accepted
1N/A(which is discouraged) then you can use
1N/A
1N/A LOCAL_CONFIG
1N/A C{ResOk}TEMP
1N/A
1N/Asendmail will also refuse mail if the MAIL FROM: parameter is not
1N/Afully qualified (i.e., contains a domain as well as a user). If you
1N/Awant to continue to accept such senders, use
1N/A
1N/A FEATURE(`accept_unqualified_senders')
1N/A
1N/ASetting the DaemonPortOptions modifier 'u' overrides the default behavior,
1N/Ai.e., unqualified addresses are accepted even without this FEATURE. If
1N/Athis FEATURE is not used, the DaemonPortOptions modifier 'f' can be used
1N/Ato enforce fully qualified domain names.
1N/A
1N/AAn ``access'' database can be created to accept or reject mail from
1N/Aselected domains. For example, you may choose to reject all mail
1N/Aoriginating from known spammers. To enable such a database, use
1N/A
1N/A FEATURE(`access_db')
1N/A
1N/ANotice: the access database is applied to the envelope addresses
1N/Aand the connection information, not to the header.
1N/A
1N/AThe FEATURE macro can accept as second parameter the key file
1N/Adefinition for the database; for example
1N/A
1N/A FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access_map')
1N/A
1N/ANotice: If a second argument is specified it must contain the option
1N/A`-T<TMPF>' as shown above. The optional parameters may be
1N/A
1N/A `skip' enables SKIP as value part (see below).
1N/A `lookupdotdomain' another way to enable the feature of the
1N/A same name (see above).
1N/A `relaytofulladdress' enable entries of the form
1N/A To:user@example.com RELAY
1N/A to allow relaying to just a specific
1N/A e-mail address instead of an entire domain.
1N/A
1N/ARemember, since /etc/mail/access is a database, after creating the text
1N/Afile as described below, you must use makemap to create the database
1N/Amap. For example:
1N/A
1N/A makemap hash /etc/mail/access < /etc/mail/access
1N/A
1N/AThe table itself uses e-mail addresses, domain names, and network
1N/Anumbers as keys. Note that IPv6 addresses must be prefaced with "IPv6:".
1N/AFor example,
1N/A
1N/A From:spammer@aol.com REJECT
1N/A From:cyberspammer.com REJECT
1N/A Connect:cyberspammer.com REJECT
1N/A Connect:TLD REJECT
1N/A Connect:192.168.212 REJECT
1N/A Connect:IPv6:2002:c0a8:02c7 RELAY
1N/A Connect:IPv6:2002:c0a8:51d2::23f4 REJECT
1N/A
1N/Awould refuse mail from spammer@aol.com, any user from cyberspammer.com
1N/A(or any host within the cyberspammer.com domain), any host in the entire
1N/Atop level domain TLD, 192.168.212.* network, and the IPv6 address
1N/A2002:c0a8:51d2::23f4. It would allow relay for the IPv6 network
1N/A2002:c0a8:02c7::/48.
1N/A
1N/AEntries in the access map should be tagged according to their type.
1N/AThree tags are available:
1N/A
1N/A Connect: connection information (${client_addr}, ${client_name})
1N/A From: envelope sender
1N/A To: envelope recipient
1N/A
1N/ANotice: untagged entries are deprecated.
1N/A
1N/AIf the required item is looked up in a map, it will be tried first
1N/Awith the corresponding tag in front, then (as fallback to enable
1N/Abackward compatibility) without any tag, unless the specific feature
1N/Arequires a tag. For example,
1N/A
1N/A From:spammer@some.dom REJECT
1N/A To:friend.domain RELAY
1N/A Connect:friend.domain OK
1N/A Connect:from.domain RELAY
1N/A From:good@another.dom OK
1N/A From:another.dom REJECT
1N/A
1N/AThis would deny mails from spammer@some.dom but you could still
1N/Asend mail to that address even if FEATURE(`blacklist_recipients')
1N/Ais enabled. Your system will allow relaying to friend.domain, but
1N/Anot from it (unless enabled by other means). Connections from that
1N/Adomain will be allowed even if it ends up in one of the DNS based
1N/Arejection lists. Relaying is enabled from from.domain but not to
1N/Ait (since relaying is based on the connection information for
1N/Aoutgoing relaying, the tag Connect: must be used; for incoming
1N/Arelaying, which is based on the recipient address, To: must be
1N/Aused). The last two entries allow mails from good@another.dom but
1N/Areject mail from all other addresses with another.dom as domain
1N/Apart.
1N/A
1N/A
1N/AThe value part of the map can contain:
1N/A
1N/A OK Accept mail even if other rules in the running
1N/A ruleset would reject it, for example, if the domain
1N/A name is unresolvable. "Accept" does not mean
1N/A "relay", but at most acceptance for local
1N/A recipients. That is, OK allows less than RELAY.
1N/A RELAY Accept mail addressed to the indicated domain
1N/A (or address if `relaytofulladdress' is set) or
1N/A received from the indicated domain for relaying
1N/A through your SMTP server. RELAY also serves as
1N/A an implicit OK for the other checks.
1N/A REJECT Reject the sender or recipient with a general
1N/A purpose message.
1N/A DISCARD Discard the message completely using the
1N/A $#discard mailer. If it is used in check_compat,
1N/A it affects only the designated recipient, not
1N/A the whole message as it does in all other cases.
1N/A This should only be used if really necessary.
1N/A SKIP This can only be used for host/domain names
1N/A and IP addresses/nets. It will abort the current
1N/A search for this entry without accepting or rejecting
1N/A it but causing the default action.
1N/A ### any text where ### is an RFC 821 compliant error code and
1N/A "any text" is a message to return for the command.
1N/A The entire string should be quoted to avoid
1N/A surprises:
1N/A
1N/A "### any text"
1N/A
1N/A Otherwise sendmail formats the text as email
1N/A addresses, e.g., it may remove spaces.
1N/A This type is deprecated, use one of the two
1N/A ERROR: entries below instead.
1N/A ERROR:### any text
1N/A as above, but useful to mark error messages as such.
1N/A If quotes need to be used to avoid modifications
1N/A (see above), they should be placed like this:
1N/A
1N/A ERROR:"### any text"
1N/A
1N/A ERROR:D.S.N:### any text
1N/A where D.S.N is an RFC 1893 compliant error code
1N/A and the rest as above. If quotes need to be used
1N/A to avoid modifications, they should be placed
1N/A like this:
1N/A
1N/A ERROR:D.S.N:"### any text"
1N/A
1N/A QUARANTINE:any text
1N/A Quarantine the message using the given text as the
1N/A quarantining reason.
1N/A
1N/AFor example:
1N/A
1N/A From:cyberspammer.com ERROR:"550 We don't accept mail from spammers"
1N/A From:okay.cyberspammer.com OK
1N/A Connect:sendmail.org RELAY
1N/A To:sendmail.org RELAY
1N/A Connect:128.32 RELAY
1N/A Connect:128.32.2 SKIP
1N/A Connect:IPv6:1:2:3:4:5:6:7 RELAY
1N/A Connect:suspicious.example.com QUARANTINE:Mail from suspicious host
1N/A Connect:[127.0.0.3] OK
1N/A Connect:[IPv6:1:2:3:4:5:6:7:8] OK
1N/A
1N/Awould accept mail from okay.cyberspammer.com, but would reject mail
1N/Afrom all other hosts at cyberspammer.com with the indicated message.
1N/AIt would allow relaying mail from and to any hosts in the sendmail.org
1N/Adomain, and allow relaying from the IPv6 1:2:3:4:5:6:7:* network
1N/Aand from the 128.32.*.* network except for the 128.32.2.* network,
1N/Awhich shows how SKIP is useful to exempt subnets/subdomains. The
1N/Alast two entries are for checks against ${client_name} if the IP
1N/Aaddress doesn't resolve to a hostname (or is considered as "may be
1N/Aforged"). That is, using square brackets means these are host
1N/Anames, not network numbers.
1N/A
1N/AWarning: if you change the RFC 821 compliant error code from the default
1N/Avalue of 550, then you should probably also change the RFC 1893 compliant
1N/Aerror code to match it. For example, if you use
1N/A
1N/A To:user@example.com ERROR:450 mailbox full
1N/A
1N/Athe error returned would be "450 5.0.0 mailbox full" which is wrong.
1N/AUse "ERROR:4.2.2:450 mailbox full" instead.
1N/A
1N/ANote, UUCP users may need to add hostname.UUCP to the access database
1N/Aor class {R}.
1N/A
1N/AIf you also use:
1N/A
1N/A FEATURE(`relay_hosts_only')
1N/A
1N/Athen the above example will allow relaying for sendmail.org, but not
1N/Ahosts within the sendmail.org domain. Note that this will also require
1N/Ahosts listed in class {R} to be fully qualified host names.
1N/A
1N/AYou can also use the access database to block sender addresses based on
1N/Athe username portion of the address. For example:
1N/A
1N/A From:FREE.STEALTH.MAILER@ ERROR:550 Spam not accepted
1N/A
1N/ANote that you must include the @ after the username to signify that
1N/Athis database entry is for checking only the username portion of the
1N/Asender address.
1N/A
1N/AIf you use:
1N/A
1N/A FEATURE(`blacklist_recipients')
1N/A
1N/Athen you can add entries to the map for local users, hosts in your
1N/Adomains, or addresses in your domain which should not receive mail:
1N/A
1N/A To:badlocaluser@ ERROR:550 Mailbox disabled for badlocaluser
1N/A To:host.my.TLD ERROR:550 That host does not accept mail
1N/A To:user@other.my.TLD ERROR:550 Mailbox disabled for this recipient
1N/A
1N/AThis would prevent a recipient of badlocaluser in any of the local
1N/Adomains (class {w}), any user at host.my.TLD, and the single address
1N/Auser@other.my.TLD from receiving mail. Please note: a local username
1N/Amust be now tagged with an @ (this is consistent with the check of
1N/Athe sender address, and hence it is possible to distinguish between
1N/Ahostnames and usernames). Enabling this feature will keep you from
1N/Asending mails to all addresses that have an error message or REJECT
1N/Aas value part in the access map. Taking the example from above:
1N/A
1N/A spammer@aol.com REJECT
1N/A cyberspammer.com REJECT
1N/A
1N/AMail can't be sent to spammer@aol.com or anyone at cyberspammer.com.
1N/AThat's why tagged entries should be used.
1N/A
1N/AThere are several DNS based blacklists which can be found by
1N/Aquerying a search engine. These are databases of spammers
1N/Amaintained in DNS. To use such a database, specify
1N/A
1N/A FEATURE(`dnsbl', `dnsbl.example.com')
1N/A
1N/AThis will cause sendmail to reject mail from any site listed in the
1N/ADNS based blacklist. You must select a DNS based blacklist domain
1N/Ato check by specifying an argument to the FEATURE. The default
1N/Aerror message is
1N/A
1N/A Rejected: IP-ADDRESS listed at SERVER
1N/A
1N/Awhere IP-ADDRESS and SERVER are replaced by the appropriate
1N/Ainformation. A second argument can be used to specify a different
1N/Atext or action. For example,
1N/A
1N/A FEATURE(`dnsbl', `dnsbl.example.com', `quarantine')
1N/A
1N/Awould quarantine the message if the client IP address is listed
1N/Aat `dnsbl.example.com'.
1N/A
1N/ABy default, temporary lookup failures are ignored
1N/Aand hence cause the connection not to be rejected by the DNS based
1N/Arejection list. This behavior can be changed by specifying a third
1N/Aargument, which must be either `t' or a full error message. For
1N/Aexample:
1N/A
1N/A FEATURE(`dnsbl', `dnsbl.example.com', `',
1N/A `"451 Temporary lookup failure for " $&{client_addr} " in dnsbl.example.com"')
1N/A
1N/AIf `t' is used, the error message is:
1N/A
1N/A 451 Temporary lookup failure of IP-ADDRESS at SERVER
1N/A
1N/Awhere IP-ADDRESS and SERVER are replaced by the appropriate
1N/Ainformation.
1N/A
1N/AThis FEATURE can be included several times to query different
1N/ADNS based rejection lists.
1N/A
1N/ANotice: to avoid checking your own local domains against those
1N/Ablacklists, use the access_db feature and add:
1N/A
1N/A Connect:10.1 OK
1N/A Connect:127.0.0.1 RELAY
1N/A
1N/Ato the access map, where 10.1 is your local network. You may
1N/Awant to use "RELAY" instead of "OK" to allow also relaying
1N/Ainstead of just disabling the DNS lookups in the blacklists.
1N/A
1N/A
1N/AThe features described above make use of the check_relay, check_mail,
1N/Aand check_rcpt rulesets. Note that check_relay checks the SMTP
1N/Aclient hostname and IP address when the connection is made to your
1N/Aserver. It does not check if a mail message is being relayed to
1N/Aanother server. That check is done in check_rcpt. If you wish to
1N/Ainclude your own checks, you can put your checks in the rulesets
1N/ALocal_check_relay, Local_check_mail, and Local_check_rcpt. For
1N/Aexample if you wanted to block senders with all numeric usernames
1N/A(i.e. 2312343@bigisp.com), you would use Local_check_mail and the
1N/Aregex map:
1N/A
1N/A LOCAL_CONFIG
1N/A Kallnumbers regex -a@MATCH ^[0-9]+$
1N/A
1N/A LOCAL_RULESETS
1N/A SLocal_check_mail
1N/A # check address against various regex checks
1N/A R$* $: $>Parse0 $>3 $1
1N/A R$+ < @ bigisp.com. > $* $: $(allnumbers $1 $)
1N/A R@MATCH $#error $: 553 Header Error
1N/A
1N/AThese rules are called with the original arguments of the corresponding
1N/Acheck_* ruleset. If the local ruleset returns $#OK, no further checking
1N/Ais done by the features described above and the mail is accepted. If
1N/Athe local ruleset resolves to a mailer (such as $#error or $#discard),
1N/Athe appropriate action is taken. Other results starting with $# are
1N/Ainterpreted by sendmail and may lead to unspecified behavior. Note: do
1N/ANOT create a mailer with the name OK. Return values that do not start
1N/Awith $# are ignored, i.e., normal processing continues.
1N/A
1N/ADelay all checks
1N/A----------------
1N/A
1N/ABy using FEATURE(`delay_checks') the rulesets check_mail and check_relay
1N/Awill not be called when a client connects or issues a MAIL command,
1N/Arespectively. Instead, those rulesets will be called by the check_rcpt
1N/Aruleset; they will be skipped if a sender has been authenticated using
1N/Aa "trusted" mechanism, i.e., one that is defined via TRUST_AUTH_MECH().
1N/AIf check_mail returns an error then the RCPT TO command will be rejected
1N/Awith that error. If it returns some other result starting with $# then
1N/Acheck_relay will be skipped. If the sender address (or a part of it) is
1N/Alisted in the access map and it has a RHS of OK or RELAY, then check_relay
1N/Awill be skipped. This has an interesting side effect: if your domain is
1N/Amy.domain and you have
1N/A
1N/A my.domain RELAY
1N/A
1N/Ain the access map, then any e-mail with a sender address of
1N/A<user@my.domain> will not be rejected by check_relay even though
1N/Ait would match the hostname or IP address. This allows spammers
1N/Ato get around DNS based blacklist by faking the sender address. To
1N/Aavoid this problem you have to use tagged entries:
1N/A
1N/A To:my.domain RELAY
1N/A Connect:my.domain RELAY
1N/A
1N/Aif you need those entries at all (class {R} may take care of them).
1N/A
1N/AFEATURE(`delay_checks') can take an optional argument:
1N/A
1N/A FEATURE(`delay_checks', `friend')
1N/A enables spamfriend test
1N/A FEATURE(`delay_checks', `hater')
1N/A enables spamhater test
1N/A
1N/AIf such an argument is given, the recipient will be looked up in the
1N/Aaccess map (using the tag Spam:). If the argument is `friend', then
1N/Athe default behavior is to apply the other rulesets and make a SPAM
1N/Afriend the exception. The rulesets check_mail and check_relay will be
1N/Askipped only if the recipient address is found and has RHS FRIEND. If
1N/Athe argument is `hater', then the default behavior is to skip the rulesets
1N/Acheck_mail and check_relay and make a SPAM hater the exception. The
1N/Aother two rulesets will be applied only if the recipient address is
1N/Afound and has RHS HATER.
1N/A
1N/AThis allows for simple exceptions from the tests, e.g., by activating
1N/Athe friend option and having
1N/A
1N/A Spam:abuse@ FRIEND
1N/A
1N/Ain the access map, mail to abuse@localdomain will get through (where
1N/A"localdomain" is any domain in class {w}). It is also possible to
1N/Aspecify a full address or an address with +detail:
1N/A
1N/A Spam:abuse@my.domain FRIEND
1N/A Spam:me+abuse@ FRIEND
1N/A Spam:spam.domain FRIEND
1N/A
1N/ANote: The required tag has been changed in 8.12 from To: to Spam:.
1N/AThis change is incompatible to previous versions. However, you can
1N/A(for now) simply add the new entries to the access map, the old
1N/Aones will be ignored. As soon as you removed the old entries from
1N/Athe access map, specify a third parameter (`n') to this feature and
1N/Athe backward compatibility rules will not be in the generated .cf
1N/Afile.
1N/A
1N/AHeader Checks
1N/A-------------
1N/A
1N/AYou can also reject mail on the basis of the contents of headers.
1N/AThis is done by adding a ruleset call to the 'H' header definition command
1N/Ain sendmail.cf. For example, this can be used to check the validity of
1N/Aa Message-ID: header:
1N/A
1N/A LOCAL_CONFIG
1N/A HMessage-Id: $>CheckMessageId
1N/A
1N/A LOCAL_RULESETS
1N/A SCheckMessageId
1N/A R< $+ @ $+ > $@ OK
1N/A R$* $#error $: 553 Header Error
1N/A
1N/AThe alternative format:
1N/A
1N/A HSubject: $>+CheckSubject
1N/A
1N/Athat is, $>+ instead of $>, gives the full Subject: header including
1N/Acomments to the ruleset (comments in parentheses () are stripped
1N/Aby default).
1N/A
1N/AA default ruleset for headers which don't have a specific ruleset
1N/Adefined for them can be given by:
1N/A
1N/A H*: $>CheckHdr
1N/A
1N/ANotice:
1N/A1. All rules act on tokens as explained in doc/op/op.{me,ps,txt}.
1N/AThat may cause problems with simple header checks due to the
1N/Atokenization. It might be simpler to use a regex map and apply it
1N/Ato $&{currHeader}.
1N/A2. There are no default rulesets coming with this distribution of
1N/Asendmail. You can write your own or search the WWW for examples.
1N/A3. When using a default ruleset for headers, the name of the header
1N/Acurrently being checked can be found in the $&{hdr_name} macro.
1N/A
1N/AAfter all of the headers are read, the check_eoh ruleset will be called for
1N/Aany final header-related checks. The ruleset is called with the number of
1N/Aheaders and the size of all of the headers in bytes separated by $|. One
1N/Aexample usage is to reject messages which do not have a Message-Id:
1N/Aheader. However, the Message-Id: header is *NOT* a required header and is
1N/Anot a guaranteed spam indicator. This ruleset is an example and should
1N/Aprobably not be used in production.
1N/A
1N/A LOCAL_CONFIG
1N/A Kstorage macro
1N/A HMessage-Id: $>CheckMessageId
1N/A
1N/A LOCAL_RULESETS
1N/A SCheckMessageId
1N/A # Record the presence of the header
1N/A R$* $: $(storage {MessageIdCheck} $@ OK $) $1
1N/A R< $+ @ $+ > $@ OK
1N/A R$* $#error $: 553 Header Error
1N/A
1N/A Scheck_eoh
1N/A # Check the macro
1N/A R$* $: < $&{MessageIdCheck} >
1N/A # Clear the macro for the next message
1N/A R$* $: $(storage {MessageIdCheck} $) $1
1N/A # Has a Message-Id: header
1N/A R< $+ > $@ OK
1N/A # Allow missing Message-Id: from local mail
1N/A R$* $: < $&{client_name} >
1N/A R< > $@ OK
1N/A R< $=w > $@ OK
1N/A # Otherwise, reject the mail
1N/A R$* $#error $: 553 Header Error
1N/A
1N/A
1N/A+--------------------+
1N/A| CONNECTION CONTROL |
1N/A+--------------------+
1N/A
1N/AThe features ratecontrol and conncontrol allow to establish connection
1N/Alimits per client IP address or net. These features can limit the
1N/Arate of connections (connections per time unit) or the number of
1N/Aincoming SMTP connections, respectively. If enabled, appropriate
1N/Arulesets are called at the end of check_relay, i.e., after DNS
1N/Ablacklists and generic access_db operations. The features require
1N/AFEATURE(`access_db') to be listed earlier in the mc file.
1N/A
1N/ANote: FEATURE(`delay_checks') delays those connection control checks
1N/Aafter a recipient address has been received, hence making these
1N/Aconnection control features less useful. To run the checks as early
1N/Aas possible, specify the parameter `nodelay', e.g.,
1N/A
1N/A FEATURE(`ratecontrol', `nodelay')
1N/A
1N/AIn that case, FEATURE(`delay_checks') has no effect on connection
1N/Acontrol (and it must be specified earlier in the mc file).
1N/A
1N/AAn optional second argument `terminate' specifies whether the
1N/Arulesets should return the error code 421 which will cause
1N/Asendmail to terminate the session with that error if it is
1N/Areturned from check_relay, i.e., not delayed as explained in
1N/Athe previous paragraph. Example:
1N/A
1N/A FEATURE(`ratecontrol', `nodelay', `terminate')
1N/A
1N/A
1N/A+----------+
1N/A| STARTTLS |
1N/A+----------+
1N/A
1N/AIn this text, cert will be used as an abbreviation for X.509 certificate,
1N/ADN (CN) is the distinguished (common) name of a cert, and CA is a
1N/Acertification authority, which signs (issues) certs.
1N/A
1N/AFor STARTTLS to be offered by sendmail you need to set at least
1N/Athese variables (the file names and paths are just examples):
1N/A
1N/A define(`confCACERT_PATH', `/etc/mail/certs/')
1N/A define(`confCACERT', `/etc/mail/certs/CA.cert.pem')
1N/A define(`confSERVER_CERT', `/etc/mail/certs/my.cert.pem')
1N/A define(`confSERVER_KEY', `/etc/mail/certs/my.key.pem')
1N/A
1N/AOn systems which do not have the compile flag HASURANDOM set (see
1N/Asendmail/README) you also must set confRAND_FILE.
1N/A
1N/ASee doc/op/op.{me,ps,txt} for more information about these options,
1N/Aespecially the sections ``Certificates for STARTTLS'' and ``PRNG for
1N/ASTARTTLS''.
1N/A
1N/AMacros related to STARTTLS are:
1N/A
1N/A${cert_issuer} holds the DN of the CA (the cert issuer).
1N/A${cert_subject} holds the DN of the cert (called the cert subject).
1N/A${cn_issuer} holds the CN of the CA (the cert issuer).
1N/A${cn_subject} holds the CN of the cert (called the cert subject).
1N/A${tls_version} the TLS/SSL version used for the connection, e.g., TLSv1,
1N/A TLSv1/SSLv3, SSLv3, SSLv2.
1N/A${cipher} the cipher used for the connection, e.g., EDH-DSS-DES-CBC3-SHA,
1N/A EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA.
1N/A${cipher_bits} the keylength (in bits) of the symmetric encryption algorithm
1N/A used for the connection.
1N/A${verify} holds the result of the verification of the presented cert.
1N/A Possible values are:
1N/A OK verification succeeded.
1N/A NO no cert presented.
1N/A NOT no cert requested.
1N/A FAIL cert presented but could not be verified,
1N/A e.g., the cert of the signing CA is missing.
1N/A NONE STARTTLS has not been performed.
1N/A TEMP temporary error occurred.
1N/A PROTOCOL protocol error occurred (SMTP level).
1N/A SOFTWARE STARTTLS handshake failed.
1N/A${server_name} the name of the server of the current outgoing SMTP
1N/A connection.
1N/A${server_addr} the address of the server of the current outgoing SMTP
1N/A connection.
1N/A
1N/ARelaying
1N/A--------
1N/A
1N/ASMTP STARTTLS can allow relaying for remote SMTP clients which have
1N/Asuccessfully authenticated themselves. If the verification of the cert
1N/Afailed (${verify} != OK), relaying is subject to the usual rules.
1N/AOtherwise the DN of the issuer is looked up in the access map using the
1N/Atag CERTISSUER. If the resulting value is RELAY, relaying is allowed.
1N/AIf it is SUBJECT, the DN of the cert subject is looked up next in the
1N/Aaccess map using the tag CERTSUBJECT. If the value is RELAY, relaying
1N/Ais allowed.
1N/A
1N/ATo make things a bit more flexible (or complicated), the values for
1N/A${cert_issuer} and ${cert_subject} can be optionally modified by regular
1N/Aexpressions defined in the m4 variables _CERT_REGEX_ISSUER_ and
1N/A_CERT_REGEX_SUBJECT_, respectively. To avoid problems with those macros in
1N/Arulesets and map lookups, they are modified as follows: each non-printable
1N/Acharacter and the characters '<', '>', '(', ')', '"', '+', ' ' are replaced
1N/Aby their HEX value with a leading '+'. For example:
1N/A
1N/A/C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/Email=
1N/Adarth+cert@endmail.org
1N/A
1N/Ais encoded as:
1N/A
1N/A/C=US/ST=California/O=endmail.org/OU=private/CN=
1N/ADarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
1N/A
1N/A(line breaks have been inserted for readability).
1N/A
1N/AThe macros which are subject to this encoding are ${cert_subject},
1N/A${cert_issuer}, ${cn_subject}, and ${cn_issuer}.
1N/A
1N/AExamples:
1N/A
1N/ATo allow relaying for everyone who can present a cert signed by
1N/A
1N/A/C=US/ST=California/O=endmail.org/OU=private/CN=
1N/ADarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
1N/A
1N/Asimply use:
1N/A
1N/ACertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN=
1N/ADarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org RELAY
1N/A
1N/ATo allow relaying only for a subset of machines that have a cert signed by
1N/A
1N/A/C=US/ST=California/O=endmail.org/OU=private/CN=
1N/ADarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org
1N/A
1N/Ause:
1N/A
1N/ACertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN=
1N/ADarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org SUBJECT
1N/ACertSubject:/C=US/ST=California/O=endmail.org/OU=private/CN=
1N/ADeathStar/Email=deathstar@endmail.org RELAY
1N/A
1N/ANotes:
1N/A- line breaks have been inserted after "CN=" for readability,
1N/A each tagged entry must be one (long) line in the access map.
1N/A- if OpenSSL 0.9.7 or newer is used then the "Email=" part of a DN
1N/A is replaced by "emailAddress=".
1N/A
1N/AOf course it is also possible to write a simple ruleset that allows
1N/Arelaying for everyone who can present a cert that can be verified, e.g.,
1N/A
1N/ALOCAL_RULESETS
1N/ASLocal_check_rcpt
1N/AR$* $: $&{verify}
1N/AROK $# OK
1N/A
1N/AAllowing Connections
1N/A--------------------
1N/A
1N/AThe rulesets tls_server, tls_client, and tls_rcpt are used to decide whether
1N/Aan SMTP connection is accepted (or should continue).
1N/A
1N/Atls_server is called when sendmail acts as client after a STARTTLS command
1N/A(should) have been issued. The parameter is the value of ${verify}.
1N/A
1N/Atls_client is called when sendmail acts as server, after a STARTTLS command
1N/Ahas been issued, and from check_mail. The parameter is the value of
1N/A${verify} and STARTTLS or MAIL, respectively.
1N/A
1N/ABoth rulesets behave the same. If no access map is in use, the connection
1N/Awill be accepted unless ${verify} is SOFTWARE, in which case the connection
1N/Ais always aborted. For tls_server/tls_client, ${client_name}/${server_name}
1N/Ais looked up in the access map using the tag TLS_Srv/TLS_Clt, which is done
1N/Awith the ruleset LookUpDomain. If no entry is found, ${client_addr}
1N/A(${server_addr}) is looked up in the access map (same tag, ruleset
1N/ALookUpAddr). If this doesn't result in an entry either, just the tag is
1N/Alooked up in the access map (included the trailing colon). Notice:
1N/Arequiring that e-mail is sent to a server only encrypted, e.g., via
1N/A
1N/ATLS_Srv:secure.domain ENCR:112
1N/A
1N/Adoesn't necessarily mean that e-mail sent to that domain is encrypted.
1N/AIf the domain has multiple MX servers, e.g.,
1N/A
1N/Asecure.domain. IN MX 10 mail.secure.domain.
1N/Asecure.domain. IN MX 50 mail.other.domain.
1N/A
1N/Athen mail to user@secure.domain may go unencrypted to mail.other.domain.
1N/Atls_rcpt can be used to address this problem.
1N/A
1N/Atls_rcpt is called before a RCPT TO: command is sent. The parameter is the
1N/Acurrent recipient. This ruleset is only defined if FEATURE(`access_db')
1N/Ais selected. A recipient address user@domain is looked up in the access
1N/Amap in four formats: TLS_Rcpt:user@domain, TLS_Rcpt:user@, TLS_Rcpt:domain,
1N/Aand TLS_Rcpt:; the first match is taken.
1N/A
1N/AThe result of the lookups is then used to call the ruleset TLS_connection,
1N/Awhich checks the requirement specified by the RHS in the access map against
1N/Athe actual parameters of the current TLS connection, esp. ${verify} and
1N/A${cipher_bits}. Legal RHSs in the access map are:
1N/A
1N/AVERIFY verification must have succeeded
1N/AVERIFY:bits verification must have succeeded and ${cipher_bits} must
1N/A be greater than or equal bits.
1N/AENCR:bits ${cipher_bits} must be greater than or equal bits.
1N/A
1N/AThe RHS can optionally be prefixed by TEMP+ or PERM+ to select a temporary
1N/Aor permanent error. The default is a temporary error code (403 4.7.0)
1N/Aunless the macro TLS_PERM_ERR is set during generation of the .cf file.
1N/A
1N/AIf a certain level of encryption is required, then it might also be
1N/Apossible that this level is provided by the security layer from a SASL
1N/Aalgorithm, e.g., DIGEST-MD5.
1N/A
1N/AFurthermore, there can be a list of extensions added. Such a list
1N/Astarts with '+' and the items are separated by '++'. Allowed
1N/Aextensions are:
1N/A
1N/ACN:name name must match ${cn_subject}
1N/ACN ${client_name}/${server_name} must match ${cn_subject}
1N/ACS:name name must match ${cert_subject}
1N/ACI:name name must match ${cert_issuer}
1N/A
1N/AExample: e-mail sent to secure.example.com should only use an encrypted
1N/Aconnection. E-mail received from hosts within the laptop.example.com domain
1N/Ashould only be accepted if they have been authenticated. The host which
1N/Areceives e-mail for darth@endmail.org must present a cert that uses the
1N/ACN smtp.endmail.org.
1N/A
1N/ATLS_Srv:secure.example.com ENCR:112
1N/ATLS_Clt:laptop.example.com PERM+VERIFY:112
1N/ATLS_Rcpt:darth@endmail.org ENCR:112+CN:smtp.endmail.org
1N/A
1N/A
1N/ADisabling STARTTLS And Setting SMTP Server Features
1N/A---------------------------------------------------
1N/A
1N/ABy default STARTTLS is used whenever possible. However, there are
1N/Asome broken MTAs that don't properly implement STARTTLS. To be able
1N/Ato send to (or receive from) those MTAs, the ruleset try_tls
1N/A(srv_features) can be used that work together with the access map.
1N/AEntries for the access map must be tagged with Try_TLS (Srv_Features)
1N/Aand refer to the hostname or IP address of the connecting system.
1N/AA default case can be specified by using just the tag. For example,
1N/Athe following entries in the access map:
1N/A
1N/A Try_TLS:broken.server NO
1N/A Srv_Features:my.domain v
1N/A Srv_Features: V
1N/A
1N/Awill turn off STARTTLS when sending to broken.server (or any host
1N/Ain that domain), and request a client certificate during the TLS
1N/Ahandshake only for hosts in my.domain. The valid entries on the RHS
1N/Afor Srv_Features are listed in the Sendmail Installation and
1N/AOperations Guide.
1N/A
1N/A
1N/AReceived: Header
1N/A----------------
1N/A
1N/AThe Received: header reveals whether STARTTLS has been used. It contains an
1N/Aextra line:
1N/A
1N/A(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})
1N/A
1N/A
1N/A+--------------------------------+
1N/A| ADDING NEW MAILERS OR RULESETS |
1N/A+--------------------------------+
1N/A
1N/ASometimes you may need to add entirely new mailers or rulesets. They
1N/Ashould be introduced with the constructs MAILER_DEFINITIONS and
1N/ALOCAL_RULESETS respectively. For example:
1N/A
1N/A MAILER_DEFINITIONS
1N/A Mmymailer, ...
1N/A ...
1N/A
1N/A LOCAL_RULESETS
1N/A Smyruleset
1N/A ...
1N/A
1N/ALocal additions for the rulesets srv_features, try_tls, tls_rcpt,
1N/Atls_client, and tls_server can be made using LOCAL_SRV_FEATURES,
1N/ALOCAL_TRY_TLS, LOCAL_TLS_RCPT, LOCAL_TLS_CLIENT, and LOCAL_TLS_SERVER,
1N/Arespectively. For example, to add a local ruleset that decides
1N/Awhether to try STARTTLS in a sendmail client, use:
1N/A
1N/A LOCAL_TRY_TLS
1N/A R...
1N/A
1N/ANote: you don't need to add a name for the ruleset, it is implicitly
1N/Adefined by using the appropriate macro.
1N/A
1N/A
1N/A+-------------------------+
1N/A| ADDING NEW MAIL FILTERS |
1N/A+-------------------------+
1N/A
1N/ASendmail supports mail filters to filter incoming SMTP messages according
1N/Ato the "Sendmail Mail Filter API" documentation. These filters can be
1N/Aconfigured in your mc file using the two commands:
1N/A
1N/A MAIL_FILTER(`name', `equates')
1N/A INPUT_MAIL_FILTER(`name', `equates')
1N/A
1N/AThe first command, MAIL_FILTER(), simply defines a filter with the given
1N/Aname and equates. For example:
1N/A
1N/A MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
1N/A
1N/AThis creates the equivalent sendmail.cf entry:
1N/A
1N/A Xarchive, S=local:/var/run/archivesock, F=R
1N/A
1N/AThe INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER
1N/Abut also populates the m4 variable `confINPUT_MAIL_FILTERS' with the name
1N/Aof the filter such that the filter will actually be called by sendmail.
1N/A
1N/AFor example, the two commands:
1N/A
1N/A INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
1N/A INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
1N/A
1N/Aare equivalent to the three commands:
1N/A
1N/A MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R')
1N/A MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T')
1N/A define(`confINPUT_MAIL_FILTERS', `archive, spamcheck')
1N/A
1N/AIn general, INPUT_MAIL_FILTER() should be used unless you need to define
1N/Amore filters than you want to use for `confINPUT_MAIL_FILTERS'.
1N/A
1N/ANote that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER()
1N/Acommands will clear the list created by the prior INPUT_MAIL_FILTER()
1N/Acommands.
1N/A
1N/A
1N/A+-------------------------+
1N/A| QUEUE GROUP DEFINITIONS |
1N/A+-------------------------+
1N/A
1N/AIn addition to the queue directory (which is the default queue group
1N/Acalled "mqueue"), sendmail can deal with multiple queue groups, which
1N/Aare collections of queue directories with the same behaviour. Queue
1N/Agroups can be defined using the command:
1N/A
1N/A QUEUE_GROUP(`name', `equates')
1N/A
1N/AFor details about queue groups, please see doc/op/op.{me,ps,txt}.
1N/A
1N/A+-------------------------------+
1N/A| NON-SMTP BASED CONFIGURATIONS |
1N/A+-------------------------------+
1N/A
1N/AThese configuration files are designed primarily for use by
1N/ASMTP-based sites. They may not be well tuned for UUCP-only or
1N/AUUCP-primarily nodes (the latter is defined as a small local net
1N/Aconnected to the rest of the world via UUCP). However, there is
1N/Aone hook to handle some special cases.
1N/A
1N/AYou can define a ``smart host'' that understands a richer address syntax
1N/Ausing:
1N/A
1N/A define(`SMART_HOST', `mailer:hostname')
1N/A
1N/AIn this case, the ``mailer:'' defaults to "relay". Any messages that
1N/Acan't be handled using the usual UUCP rules are passed to this host.
1N/A
1N/AIf you are on a local SMTP-based net that connects to the outside
1N/Aworld via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules.
1N/AFor example:
1N/A
1N/A define(`SMART_HOST', `uucp-new:uunet')
1N/A LOCAL_NET_CONFIG
1N/A R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3
1N/A
1N/AThis will cause all names that end in your domain name ($m) to be sent
1N/Avia SMTP; anything else will be sent via uucp-new (smart UUCP) to uunet.
1N/AIf you have FEATURE(`nocanonify'), you may need to omit the dots after
1N/Athe $m. If you are running a local DNS inside your domain which is
1N/Anot otherwise connected to the outside world, you probably want to
1N/Ause:
1N/A
1N/A define(`SMART_HOST', `smtp:fire.wall.com')
1N/A LOCAL_NET_CONFIG
1N/A R$* < @ $* . > $* $#smtp $@ $2. $: $1 < @ $2. > $3
1N/A
1N/AThat is, send directly only to things you found in your DNS lookup;
1N/Aanything else goes through SMART_HOST.
1N/A
1N/AYou may need to turn off the anti-spam rules in order to accept
1N/AUUCP mail with FEATURE(`promiscuous_relay') and
1N/AFEATURE(`accept_unresolvable_domains').
1N/A
1N/A
1N/A+-----------+
1N/A| WHO AM I? |
1N/A+-----------+
1N/A
1N/ANormally, the $j macro is automatically defined to be your fully
1N/Aqualified domain name (FQDN). Sendmail does this by getting your
1N/Ahost name using gethostname and then calling gethostbyname on the
1N/Aresult. For example, in some environments gethostname returns
1N/Aonly the root of the host name (such as "foo"); gethostbyname is
1N/Asupposed to return the FQDN ("foo.bar.com"). In some (fairly rare)
1N/Acases, gethostbyname may fail to return the FQDN. In this case
1N/Ayou MUST define confDOMAIN_NAME to be your fully qualified domain
1N/Aname. This is usually done using:
1N/A
1N/A Dmbar.com
1N/A define(`confDOMAIN_NAME', `$w.$m')dnl
1N/A
1N/A
1N/A+-----------------------------------+
1N/A| ACCEPTING MAIL FOR MULTIPLE NAMES |
1N/A+-----------------------------------+
1N/A
1N/AIf your host is known by several different names, you need to augment
1N/Aclass {w}. This is a list of names by which your host is known, and
1N/Aanything sent to an address using a host name in this list will be
1N/Atreated as local mail. You can do this in two ways: either create the
1N/Afile /etc/mail/local-host-names containing a list of your aliases (one per
1N/Aline), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add
1N/A``LOCAL_DOMAIN(`alias.host.name')''. Be sure you use the fully-qualified
1N/Aname of the host, rather than a short name.
1N/A
1N/AIf you want to have different address in different domains, take
1N/Aa look at the virtusertable feature, which is also explained at
1N/Ahttp://www.sendmail.org/virtual-hosting.html
1N/A
1N/A
1N/A+--------------------+
1N/A| USING MAILERTABLES |
1N/A+--------------------+
1N/A
1N/ATo use FEATURE(`mailertable'), you will have to create an external
1N/Adatabase containing the routing information for various domains.
1N/AFor example, a mailertable file in text format might be:
1N/A
1N/A .my.domain xnet:%1.my.domain
1N/A uuhost1.my.domain uucp-new:uuhost1
1N/A .bitnet smtp:relay.bit.net
1N/A
1N/AThis should normally be stored in /etc/mail/mailertable. The actual
1N/Adatabase version of the mailertable is built using:
1N/A
1N/A makemap hash /etc/mail/mailertable < /etc/mail/mailertable
1N/A
1N/AThe semantics are simple. Any LHS entry that does not begin with
1N/Aa dot matches the full host name indicated. LHS entries beginning
1N/Awith a dot match anything ending with that domain name (including
1N/Athe leading dot) -- that is, they can be thought of as having a
1N/Aleading ".+" regular expression pattern for a non-empty sequence of
1N/Acharacters. Matching is done in order of most-to-least qualified
1N/A-- for example, even though ".my.domain" is listed first in the
1N/Aabove example, an entry of "uuhost1.my.domain" will match the second
1N/Aentry since it is more explicit. Note: e-mail to "user@my.domain"
1N/Adoes not match any entry in the above table. You need to have
1N/Asomething like:
1N/A
1N/A my.domain esmtp:host.my.domain
1N/A
1N/AThe RHS should always be a "mailer:host" pair. The mailer is the
1N/Aconfiguration name of a mailer (that is, an M line in the
1N/Asendmail.cf file). The "host" will be the hostname passed to
1N/Athat mailer. In domain-based matches (that is, those with leading
1N/Adots) the "%1" may be used to interpolate the wildcarded part of
1N/Athe host name. For example, the first line above sends everything
1N/Aaddressed to "anything.my.domain" to that same host name, but using
1N/Athe (presumably experimental) xnet mailer.
1N/A
1N/AIn some cases you may want to temporarily turn off MX records,
1N/Aparticularly on gateways. For example, you may want to MX
1N/Aeverything in a domain to one machine that then forwards it
1N/Adirectly. To do this, you might use the DNS configuration:
1N/A
1N/A *.domain. IN MX 0 relay.machine
1N/A
1N/Aand on relay.machine use the mailertable:
1N/A
1N/A .domain smtp:[gateway.domain]
1N/A
1N/AThe [square brackets] turn off MX records for this host only.
1N/AIf you didn't do this, the mailertable would use the MX record
1N/Aagain, which would give you an MX loop. Note that the use of
1N/Awildcard MX records is almost always a bad idea. Please avoid
1N/Ausing them if possible.
1N/A
1N/A
1N/A+--------------------------------+
1N/A| USING USERDB TO MAP FULL NAMES |
1N/A+--------------------------------+
1N/A
1N/AThe user database was not originally intended for mapping full names
1N/Ato login names (e.g., Eric.Allman => eric), but some people are using
1N/Ait that way. (it is recommended that you set up aliases for this
1N/Apurpose instead -- since you can specify multiple alias files, this
1N/Ais fairly easy.) The intent was to locate the default maildrop at
1N/Aa site, but allow you to override this by sending to a specific host.
1N/A
1N/AIf you decide to set up the user database in this fashion, it is
1N/Aimperative that you not use FEATURE(`stickyhost') -- otherwise,
1N/Ae-mail sent to Full.Name@local.host.name will be rejected.
1N/A
1N/ATo build the internal form of the user database, use:
1N/A
1N/A makemap btree /etc/mail/userdb < /etc/mail/userdb.txt
1N/A
1N/AAs a general rule, it is an extremely bad idea to using full names
1N/Aas e-mail addresses, since they are not in any sense unique. For
1N/Aexample, the UNIX software-development community has at least two
1N/Awell-known Peter Deutsches, and at one time Bell Labs had two
1N/AStephen R. Bournes with offices along the same hallway. Which one
1N/Awill be forced to suffer the indignity of being Stephen_R_Bourne_2?
1N/AThe less famous of the two, or the one that was hired later?
1N/A
1N/AFinger should handle full names (and be fuzzy). Mail should use
1N/Ahandles, and not be fuzzy.
1N/A
1N/A
1N/A+--------------------------------+
1N/A| MISCELLANEOUS SPECIAL FEATURES |
1N/A+--------------------------------+
1N/A
1N/APlussed users
1N/A Sometimes it is convenient to merge configuration on a
1N/A centralized mail machine, for example, to forward all
1N/A root mail to a mail server. In this case it might be
1N/A useful to be able to treat the root addresses as a class
1N/A of addresses with subtle differences. You can do this
1N/A using plussed users. For example, a client might include
1N/A the alias:
1N/A
1N/A root: root+client1@server
1N/A
1N/A On the server, this will match an alias for "root+client1".
1N/A If that is not found, the alias "root+*" will be tried,
1N/A then "root".
1N/A
1N/A
1N/A+----------------+
1N/A| SECURITY NOTES |
1N/A+----------------+
1N/A
1N/AA lot of sendmail security comes down to you. Sendmail 8 is much
1N/Amore careful about checking for security problems than previous
1N/Aversions, but there are some things that you still need to watch
1N/Afor. In particular:
1N/A
1N/A* Make sure the aliases file is not writable except by trusted
1N/A system personnel. This includes both the text and database
1N/A version.
1N/A
1N/A* Make sure that other files that sendmail reads, such as the
1N/A mailertable, are only writable by trusted system personnel.
1N/A
1N/A* The queue directory should not be world writable PARTICULARLY
1N/A if your system allows "file giveaways" (that is, if a non-root
1N/A user can chown any file they own to any other user).
1N/A
1N/A* If your system allows file giveaways, DO NOT create a publically
1N/A writable directory for forward files. This will allow anyone
1N/A to steal anyone else's e-mail. Instead, create a script that
1N/A copies the .forward file from users' home directories once a
1N/A night (if you want the non-NFS-mounted forward directory).
1N/A
1N/A* If your system allows file giveaways, you'll find that
1N/A sendmail is much less trusting of :include: files -- in
1N/A particular, you'll have to have /SENDMAIL/ANY/SHELL/ in
1N/A /etc/shells before they will be trusted (that is, before
1N/A files and programs listed in them will be honored).
1N/A
1N/AIn general, file giveaways are a mistake -- if you can turn them
1N/Aoff, do so.
1N/A
1N/A
1N/A+--------------------------------+
1N/A| TWEAKING CONFIGURATION OPTIONS |
1N/A+--------------------------------+
1N/A
1N/AThere are a large number of configuration options that don't normally
1N/Aneed to be changed. However, if you feel you need to tweak them,
1N/Ayou can define the following M4 variables. Note that some of these
1N/Avariables require formats that are defined in RFC 2821 or RFC 2822.
1N/ABefore changing them you need to make sure you do not violate those
1N/A(and other relevant) RFCs.
1N/A
1N/AThis list is shown in four columns: the name you define, the default
1N/Avalue for that definition, the option or macro that is affected
1N/A(either Ox for an option or Dx for a macro), and a brief description.
1N/A
1N/ASome options are likely to be deprecated in future versions -- that is,
1N/Athe option is only included to provide back-compatibility. These are
1N/Amarked with "*".
1N/A
1N/ARemember that these options are M4 variables, and hence may need to
1N/Abe quoted. In particular, arguments with commas will usually have to
1N/Abe ``double quoted, like this phrase'' to avoid having the comma
1N/Aconfuse things. This is common for alias file definitions and for
1N/Athe read timeout.
1N/A
1N/AM4 Variable Name Configuration [Default] & Description
1N/A================ ============= =======================
1N/AconfMAILER_NAME $n macro [MAILER-DAEMON] The sender name used
1N/A for internally generated outgoing
1N/A messages.
1N/AconfDOMAIN_NAME $j macro If defined, sets $j. This should
1N/A only be done if your system cannot
1N/A determine your local domain name,
1N/A and then it should be set to
1N/A $w.Foo.COM, where Foo.COM is your
1N/A domain name.
1N/AconfCF_VERSION $Z macro If defined, this is appended to the
1N/A configuration version name.
1N/AconfLDAP_CLUSTER ${sendmailMTACluster} macro
1N/A If defined, this is the LDAP
1N/A cluster to use for LDAP searches
1N/A as described above in ``USING LDAP
1N/A FOR ALIASES, MAPS, AND CLASSES''.
1N/AconfFROM_HEADER From: [$?x$x <$g>$|$g$.] The format of an
1N/A internally generated From: address.
1N/AconfRECEIVED_HEADER Received:
1N/A [$?sfrom $s $.$?_($?s$|from $.$_)
1N/A $.$?{auth_type}(authenticated)
1N/A $.by $j ($v/$Z)$?r with $r$. id $i$?u
1N/A for $u; $|;
1N/A $.$b]
1N/A The format of the Received: header
1N/A in messages passed through this host.
1N/A It is unwise to try to change this.
1N/AconfMESSAGEID_HEADER Message-Id: [<$t.$i@$j>] The format of an
1N/A internally generated Message-Id:
1N/A header.
1N/AconfCW_FILE Fw class [/etc/mail/local-host-names] Name
1N/A of file used to get the local
1N/A additions to class {w} (local host
1N/A names).
1N/AconfCT_FILE Ft class [/etc/mail/trusted-users] Name of
1N/A file used to get the local additions
1N/A to class {t} (trusted users).
1N/AconfCR_FILE FR class [/etc/mail/relay-domains] Name of
1N/A file used to get the local additions
1N/A to class {R} (hosts allowed to relay).
1N/AconfTRUSTED_USERS Ct class [no default] Names of users to add to
1N/A the list of trusted users. This list
1N/A always includes root, uucp, and daemon.
1N/A See also FEATURE(`use_ct_file').
1N/AconfTRUSTED_USER TrustedUser [no default] Trusted user for file
1N/A ownership and starting the daemon.
1N/A Not to be confused with
1N/A confTRUSTED_USERS (see above).
1N/AconfSMTP_MAILER - [esmtp] The mailer name used when
1N/A SMTP connectivity is required.
1N/A One of "smtp", "smtp8",
1N/A "esmtp", or "dsmtp".
1N/AconfUUCP_MAILER - [uucp-old] The mailer to be used by
1N/A default for bang-format recipient
1N/A addresses. See also discussion of
1N/A class {U}, class {Y}, and class {Z}
1N/A in the MAILER(`uucp') section.
1N/AconfLOCAL_MAILER - [local] The mailer name used when
1N/A local connectivity is required.
1N/A Almost always "local".
1N/AconfRELAY_MAILER - [relay] The default mailer name used
1N/A for relaying any mail (e.g., to a
1N/A BITNET_RELAY, a SMART_HOST, or
1N/A whatever). This can reasonably be
1N/A "uucp-new" if you are on a
1N/A UUCP-connected site.
1N/AconfSEVEN_BIT_INPUT SevenBitInput [False] Force input to seven bits?
1N/AconfEIGHT_BIT_HANDLING EightBitMode [pass8] 8-bit data handling
1N/AconfALIAS_WAIT AliasWait [10m] Time to wait for alias file
1N/A rebuild until you get bored and
1N/A decide that the apparently pending
1N/A rebuild failed.
1N/AconfMIN_FREE_BLOCKS MinFreeBlocks [100] Minimum number of free blocks on
1N/A queue filesystem to accept SMTP mail.
1N/A (Prior to 8.7 this was minfree/maxsize,
1N/A where minfree was the number of free
1N/A blocks and maxsize was the maximum
1N/A message size. Use confMAX_MESSAGE_SIZE
1N/A for the second value now.)
1N/AconfMAX_MESSAGE_SIZE MaxMessageSize [infinite] The maximum size of messages
1N/A that will be accepted (in bytes).
1N/AconfBLANK_SUB BlankSub [.] Blank (space) substitution
1N/A character.
1N/AconfCON_EXPENSIVE HoldExpensive [False] Avoid connecting immediately
1N/A to mailers marked expensive.
1N/AconfCHECKPOINT_INTERVAL CheckpointInterval
1N/A [10] Checkpoint queue files every N
1N/A recipients.
1N/AconfDELIVERY_MODE DeliveryMode [background] Default delivery mode.
1N/AconfERROR_MODE ErrorMode [print] Error message mode.
1N/AconfERROR_MESSAGE ErrorHeader [undefined] Error message header/file.
1N/AconfSAVE_FROM_LINES SaveFromLine Save extra leading From_ lines.
1N/AconfTEMP_FILE_MODE TempFileMode [0600] Temporary file mode.
1N/AconfMATCH_GECOS MatchGECOS [False] Match GECOS field.
1N/AconfMAX_HOP MaxHopCount [25] Maximum hop count.
1N/AconfIGNORE_DOTS* IgnoreDots [False; always False in -bs or -bd
1N/A mode] Ignore dot as terminator for
1N/A incoming messages?
1N/AconfBIND_OPTS ResolverOptions [undefined] Default options for DNS
1N/A resolver.
1N/AconfMIME_FORMAT_ERRORS* SendMimeErrors [True] Send error messages as MIME-
1N/A encapsulated messages per RFC 1344.
1N/AconfFORWARD_PATH ForwardPath [$z/.forward.$w:$z/.forward]
1N/A The colon-separated list of places to
1N/A search for .forward files. N.B.: see
1N/A the Security Notes section.
1N/AconfMCI_CACHE_SIZE ConnectionCacheSize
1N/A [2] Size of open connection cache.
1N/AconfMCI_CACHE_TIMEOUT ConnectionCacheTimeout
1N/A [5m] Open connection cache timeout.
1N/AconfHOST_STATUS_DIRECTORY HostStatusDirectory
1N/A [undefined] If set, host status is kept
1N/A on disk between sendmail runs in the
1N/A named directory tree. This need not be
1N/A a full pathname, in which case it is
1N/A interpreted relative to the queue
1N/A directory.
1N/AconfSINGLE_THREAD_DELIVERY SingleThreadDelivery
1N/A [False] If this option and the
1N/A HostStatusDirectory option are both
1N/A set, single thread deliveries to other
1N/A hosts. That is, don't allow any two
1N/A sendmails on this host to connect
1N/A simultaneously to any other single
1N/A host. This can slow down delivery in
1N/A some cases, in particular since a
1N/A cached but otherwise idle connection
1N/A to a host will prevent other sendmails
1N/A from connecting to the other host.
1N/AconfUSE_ERRORS_TO* UseErrorsTo [False] Use the Errors-To: header to
1N/A deliver error messages. This should
1N/A not be necessary because of general
1N/A acceptance of the envelope/header
1N/A distinction.
1N/AconfLOG_LEVEL LogLevel [9] Log level.
1N/AconfME_TOO MeToo [True] Include sender in group
1N/A expansions. This option is
1N/A deprecated and will be removed from
1N/A a future version.
1N/AconfCHECK_ALIASES CheckAliases [False] Check RHS of aliases when
1N/A running newaliases. Since this does
1N/A DNS lookups on every address, it can
1N/A slow down the alias rebuild process
1N/A considerably on large alias files.
1N/AconfOLD_STYLE_HEADERS* OldStyleHeaders [True] Assume that headers without
1N/A special chars are old style.
1N/AconfPRIVACY_FLAGS PrivacyOptions [authwarnings] Privacy flags.
1N/AconfCOPY_ERRORS_TO PostmasterCopy [undefined] Address for additional
1N/A copies of all error messages.
1N/AconfQUEUE_FACTOR QueueFactor [600000] Slope of queue-only function.
1N/AconfQUEUE_FILE_MODE QueueFileMode [undefined] Default permissions for
1N/A queue files (octal). If not set,
1N/A sendmail uses 0600 unless its real
1N/A and effective uid are different in
1N/A which case it uses 0644.
1N/AconfDONT_PRUNE_ROUTES DontPruneRoutes [False] Don't prune down route-addr
1N/A syntax addresses to the minimum
1N/A possible.
1N/AconfSAFE_QUEUE* SuperSafe [True] Commit all messages to disk
1N/A before forking.
1N/AconfTO_INITIAL Timeout.initial [5m] The timeout waiting for a response
1N/A on the initial connect.
1N/AconfTO_CONNECT Timeout.connect [0] The timeout waiting for an initial
1N/A connect() to complete. This can only
1N/A shorten connection timeouts; the kernel
1N/A silently enforces an absolute maximum
1N/A (which varies depending on the system).
1N/AconfTO_ICONNECT Timeout.iconnect
1N/A [undefined] Like Timeout.connect, but
1N/A applies only to the very first attempt
1N/A to connect to a host in a message.
1N/A This allows a single very fast pass
1N/A followed by more careful delivery
1N/A attempts in the future.
1N/AconfTO_ACONNECT Timeout.aconnect
1N/A [0] The overall timeout waiting for
1N/A all connection for a single delivery
1N/A attempt to succeed. If 0, no overall
1N/A limit is applied.
1N/AconfTO_HELO Timeout.helo [5m] The timeout waiting for a response
1N/A to a HELO or EHLO command.
1N/AconfTO_MAIL Timeout.mail [10m] The timeout waiting for a
1N/A response to the MAIL command.
1N/AconfTO_RCPT Timeout.rcpt [1h] The timeout waiting for a response
1N/A to the RCPT command.
1N/AconfTO_DATAINIT Timeout.datainit
1N/A [5m] The timeout waiting for a 354
1N/A response from the DATA command.
1N/AconfTO_DATABLOCK Timeout.datablock
1N/A [1h] The timeout waiting for a block
1N/A during DATA phase.
1N/AconfTO_DATAFINAL Timeout.datafinal
1N/A [1h] The timeout waiting for a response
1N/A to the final "." that terminates a
1N/A message.
1N/AconfTO_RSET Timeout.rset [5m] The timeout waiting for a response
1N/A to the RSET command.
1N/AconfTO_QUIT Timeout.quit [2m] The timeout waiting for a response
1N/A to the QUIT command.
1N/AconfTO_MISC Timeout.misc [2m] The timeout waiting for a response
1N/A to other SMTP commands.
1N/AconfTO_COMMAND Timeout.command [1h] In server SMTP, the timeout
1N/A waiting for a command to be issued.
1N/AconfTO_IDENT Timeout.ident [5s] The timeout waiting for a
1N/A response to an IDENT query.
1N/AconfTO_FILEOPEN Timeout.fileopen
1N/A [60s] The timeout waiting for a file
1N/A (e.g., :include: file) to be opened.
1N/AconfTO_LHLO Timeout.lhlo [2m] The timeout waiting for a response
1N/A to an LMTP LHLO command.
1N/AconfTO_STARTTLS Timeout.starttls
1N/A [1h] The timeout waiting for a
1N/A response to an SMTP STARTTLS command.
1N/AconfTO_CONTROL Timeout.control
1N/A [2m] The timeout for a complete
1N/A control socket transaction to complete.
1N/AconfTO_QUEUERETURN Timeout.queuereturn
1N/A [5d] The timeout before a message is
1N/A returned as undeliverable.
1N/AconfTO_QUEUERETURN_NORMAL
1N/A Timeout.queuereturn.normal
1N/A [undefined] As above, for normal
1N/A priority messages.
1N/AconfTO_QUEUERETURN_URGENT
1N/A Timeout.queuereturn.urgent
1N/A [undefined] As above, for urgent
1N/A priority messages.
1N/AconfTO_QUEUERETURN_NONURGENT
1N/A Timeout.queuereturn.non-urgent
1N/A [undefined] As above, for non-urgent
1N/A (low) priority messages.
1N/AconfTO_QUEUERETURN_DSN
1N/A Timeout.queuereturn.dsn
1N/A [undefined] As above, for delivery
1N/A status notification messages.
1N/AconfTO_QUEUEWARN Timeout.queuewarn
1N/A [4h] The timeout before a warning
1N/A message is sent to the sender telling
1N/A them that the message has been
1N/A deferred.
1N/AconfTO_QUEUEWARN_NORMAL Timeout.queuewarn.normal
1N/A [undefined] As above, for normal
1N/A priority messages.
1N/AconfTO_QUEUEWARN_URGENT Timeout.queuewarn.urgent
1N/A [undefined] As above, for urgent
1N/A priority messages.
1N/AconfTO_QUEUEWARN_NONURGENT
1N/A Timeout.queuewarn.non-urgent
1N/A [undefined] As above, for non-urgent
1N/A (low) priority messages.
1N/AconfTO_QUEUEWARN_DSN
1N/A Timeout.queuewarn.dsn
1N/A [undefined] As above, for delivery
1N/A status notification messages.
1N/AconfTO_HOSTSTATUS Timeout.hoststatus
1N/A [30m] How long information about host
1N/A statuses will be maintained before it
1N/A is considered stale and the host should
1N/A be retried. This applies both within
1N/A a single queue run and to persistent
1N/A information (see below).
1N/AconfTO_RESOLVER_RETRANS Timeout.resolver.retrans
1N/A [varies] Sets the resolver's
1N/A retransmission time interval (in
1N/A seconds). Sets both
1N/A Timeout.resolver.retrans.first and
1N/A Timeout.resolver.retrans.normal.
1N/AconfTO_RESOLVER_RETRANS_FIRST Timeout.resolver.retrans.first
1N/A [varies] Sets the resolver's
1N/A retransmission time interval (in
1N/A seconds) for the first attempt to
1N/A deliver a message.
1N/AconfTO_RESOLVER_RETRANS_NORMAL Timeout.resolver.retrans.normal
1N/A [varies] Sets the resolver's
1N/A retransmission time interval (in
1N/A seconds) for all resolver lookups
1N/A except the first delivery attempt.
1N/AconfTO_RESOLVER_RETRY Timeout.resolver.retry
1N/A [varies] Sets the number of times
1N/A to retransmit a resolver query.
1N/A Sets both
1N/A Timeout.resolver.retry.first and
1N/A Timeout.resolver.retry.normal.
1N/AconfTO_RESOLVER_RETRY_FIRST Timeout.resolver.retry.first
1N/A [varies] Sets the number of times
1N/A to retransmit a resolver query for
1N/A the first attempt to deliver a
1N/A message.
1N/AconfTO_RESOLVER_RETRY_NORMAL Timeout.resolver.retry.normal
1N/A [varies] Sets the number of times
1N/A to retransmit a resolver query for
1N/A all resolver lookups except the
1N/A first delivery attempt.
1N/AconfTIME_ZONE TimeZoneSpec [USE_SYSTEM] Time zone info -- can be
1N/A USE_SYSTEM to use the system's idea,
1N/A USE_TZ to use the user's TZ envariable,
1N/A or something else to force that value.
1N/AconfDEF_USER_ID DefaultUser [1:1] Default user id.
1N/AconfUSERDB_SPEC UserDatabaseSpec
1N/A [undefined] User database
1N/A specification.
1N/AconfFALLBACK_MX FallbackMXhost [undefined] Fallback MX host.
1N/AconfFALLBACK_SMARTHOST FallbackSmartHost
1N/A [undefined] Fallback smart host.
1N/AconfTRY_NULL_MX_LIST TryNullMXList [False] If this host is the best MX
1N/A for a host and other arrangements
1N/A haven't been made, try connecting
1N/A to the host directly; normally this
1N/A would be a config error.
1N/AconfQUEUE_LA QueueLA [varies] Load average at which
1N/A queue-only function kicks in.
1N/A Default values is (8 * numproc)
1N/A where numproc is the number of
1N/A processors online (if that can be
1N/A determined).
1N/AconfREFUSE_LA RefuseLA [varies] Load average at which
1N/A incoming SMTP connections are
1N/A refused. Default values is (12 *
1N/A numproc) where numproc is the
1N/A number of processors online (if
1N/A that can be determined).
1N/AconfREJECT_LOG_INTERVAL RejectLogInterval [3h] Log interval when
1N/A refusing connections for this long.
1N/AconfDELAY_LA DelayLA [0] Load average at which sendmail
1N/A will sleep for one second on most
1N/A SMTP commands and before accepting
1N/A connections. 0 means no limit.
1N/AconfMAX_ALIAS_RECURSION MaxAliasRecursion
1N/A [10] Maximum depth of alias recursion.
1N/AconfMAX_DAEMON_CHILDREN MaxDaemonChildren
1N/A [undefined] The maximum number of
1N/A children the daemon will permit. After
1N/A this number, connections will be
1N/A rejected. If not set or <= 0, there is
1N/A no limit.
1N/AconfMAX_HEADERS_LENGTH MaxHeadersLength
1N/A [32768] Maximum length of the sum
1N/A of all headers.
1N/AconfMAX_MIME_HEADER_LENGTH MaxMimeHeaderLength
1N/A [undefined] Maximum length of
1N/A certain MIME header field values.
1N/AconfCONNECTION_RATE_THROTTLE ConnectionRateThrottle
1N/A [undefined] The maximum number of
1N/A connections permitted per second per
1N/A daemon. After this many connections
1N/A are accepted, further connections
1N/A will be delayed. If not set or <= 0,
1N/A there is no limit.
1N/AconfCONNECTION_RATE_WINDOW_SIZE ConnectionRateWindowSize
1N/A [60s] Define the length of the
1N/A interval for which the number of
1N/A incoming connections is maintained.
1N/AconfWORK_RECIPIENT_FACTOR
1N/A RecipientFactor [30000] Cost of each recipient.
1N/AconfSEPARATE_PROC ForkEachJob [False] Run all deliveries in a
1N/A separate process.
1N/AconfWORK_CLASS_FACTOR ClassFactor [1800] Priority multiplier for class.
1N/AconfWORK_TIME_FACTOR RetryFactor [90000] Cost of each delivery attempt.
1N/AconfQUEUE_SORT_ORDER QueueSortOrder [Priority] Queue sort algorithm:
1N/A Priority, Host, Filename, Random,
1N/A Modification, or Time.
1N/AconfMIN_QUEUE_AGE MinQueueAge [0] The minimum amount of time a job
1N/A must sit in the queue between queue
1N/A runs. This allows you to set the
1N/A queue run interval low for better
1N/A responsiveness without trying all
1N/A jobs in each run.
1N/AconfDEF_CHAR_SET DefaultCharSet [unknown-8bit] When converting
1N/A unlabeled 8 bit input to MIME, the
1N/A character set to use by default.
1N/AconfSERVICE_SWITCH_FILE ServiceSwitchFile
1N/A [/etc/mail/service.switch] The file
1N/A to use for the service switch on
1N/A systems that do not have a
1N/A system-defined switch.
1N/AconfHOSTS_FILE HostsFile [/etc/hosts] The file to use when doing
1N/A "file" type access of hosts names.
1N/AconfDIAL_DELAY DialDelay [0s] If a connection fails, wait this
1N/A long and try again. Zero means "don't
1N/A retry". This is to allow "dial on
1N/A demand" connections to have enough time
1N/A to complete a connection.
1N/AconfNO_RCPT_ACTION NoRecipientAction
1N/A [none] What to do if there are no legal
1N/A recipient fields (To:, Cc: or Bcc:)
1N/A in the message. Legal values can
1N/A be "none" to just leave the
1N/A nonconforming message as is, "add-to"
1N/A to add a To: header with all the
1N/A known recipients (which may expose
1N/A blind recipients), "add-apparently-to"
1N/A to do the same but use Apparently-To:
1N/A instead of To: (strongly discouraged
1N/A in accordance with IETF standards),
1N/A "add-bcc" to add an empty Bcc:
1N/A header, or "add-to-undisclosed" to
1N/A add the header
1N/A ``To: undisclosed-recipients:;''.
1N/AconfSAFE_FILE_ENV SafeFileEnvironment
1N/A [undefined] If set, sendmail will do a
1N/A chroot() into this directory before
1N/A writing files.
1N/AconfCOLON_OK_IN_ADDR ColonOkInAddr [True unless Configuration Level > 6]
1N/A If set, colons are treated as a regular
1N/A character in addresses. If not set,
1N/A they are treated as the introducer to
1N/A the RFC 822 "group" syntax. Colons are
1N/A handled properly in route-addrs. This
1N/A option defaults on for V5 and lower
1N/A configuration files.
1N/AconfMAX_QUEUE_RUN_SIZE MaxQueueRunSize [0] If set, limit the maximum size of
1N/A any given queue run to this number of
1N/A entries. Essentially, this will stop
1N/A reading each queue directory after this
1N/A number of entries are reached; it does
1N/A _not_ pick the highest priority jobs,
1N/A so this should be as large as your
1N/A system can tolerate. If not set, there
1N/A is no limit.
1N/AconfMAX_QUEUE_CHILDREN MaxQueueChildren
1N/A [undefined] Limits the maximum number
1N/A of concurrent queue runners active.
1N/A This is to keep system resources used
1N/A within a reasonable limit. Relates to
1N/A Queue Groups and ForkEachJob.
1N/AconfMAX_RUNNERS_PER_QUEUE MaxRunnersPerQueue
1N/A [1] Only active when MaxQueueChildren
1N/A defined. Controls the maximum number
1N/A of queue runners (aka queue children)
1N/A active at the same time in a work
1N/A group. See also MaxQueueChildren.
1N/AconfDONT_EXPAND_CNAMES DontExpandCnames
1N/A [False] If set, $[ ... $] lookups that
1N/A do DNS based lookups do not expand
1N/A CNAME records. This currently violates
1N/A the published standards, but the IETF
1N/A seems to be moving toward legalizing
1N/A this. For example, if "FTP.Foo.ORG"
1N/A is a CNAME for "Cruft.Foo.ORG", then
1N/A with this option set a lookup of
1N/A "FTP" will return "FTP.Foo.ORG"; if
1N/A clear it returns "Cruft.FOO.ORG". N.B.
1N/A you may not see any effect until your
1N/A downstream neighbors stop doing CNAME
1N/A lookups as well.
1N/AconfFROM_LINE UnixFromLine [From $g $d] The From_ line used
1N/A when sending to files or programs.
1N/AconfSINGLE_LINE_FROM_HEADER SingleLineFromHeader
1N/A [False] From: lines that have
1N/A embedded newlines are unwrapped
1N/A onto one line.
1N/AconfALLOW_BOGUS_HELO AllowBogusHELO [False] Allow HELO SMTP command that
1N/A does not include a host name.
1N/AconfMUST_QUOTE_CHARS MustQuoteChars [.'] Characters to be quoted in a full
1N/A name phrase (@,;:\()[] are automatic).
1N/AconfOPERATORS OperatorChars [.:%@!^/[]+] Address operator
1N/A characters.
1N/AconfSMTP_LOGIN_MSG SmtpGreetingMessage
1N/A [$j Sendmail $v/$Z; $b]
1N/A The initial (spontaneous) SMTP
1N/A greeting message. The word "ESMTP"
1N/A will be inserted between the first and
1N/A second words to convince other
1N/A sendmails to try to speak ESMTP.
1N/AconfDONT_INIT_GROUPS DontInitGroups [False] If set, the initgroups(3)
1N/A routine will never be invoked. You
1N/A might want to do this if you are
1N/A running NIS and you have a large group
1N/A map, since this call does a sequential
1N/A scan of the map; in a large site this
1N/A can cause your ypserv to run
1N/A essentially full time. If you set
1N/A this, agents run on behalf of users
1N/A will only have their primary
1N/A (/etc/passwd) group permissions.
1N/AconfUNSAFE_GROUP_WRITES UnsafeGroupWrites
1N/A [True] If set, group-writable
1N/A :include: and .forward files are
1N/A considered "unsafe", that is, programs
1N/A and files cannot be directly referenced
1N/A from such files. World-writable files
1N/A are always considered unsafe.
1N/A Notice: this option is deprecated and
1N/A will be removed in future versions;
1N/A Set GroupWritableForwardFileSafe
1N/A and GroupWritableIncludeFileSafe in
1N/A DontBlameSendmail if required.
1N/AconfCONNECT_ONLY_TO ConnectOnlyTo [undefined] override connection
1N/A address (for testing).
1N/AconfCONTROL_SOCKET_NAME ControlSocketName
1N/A [undefined] Control socket for daemon
1N/A management.
1N/AconfDOUBLE_BOUNCE_ADDRESS DoubleBounceAddress
1N/A [postmaster] If an error occurs when
1N/A sending an error message, send that
1N/A "double bounce" error message to this
1N/A address. If it expands to an empty
1N/A string, double bounces are dropped.
1N/AconfSOFT_BOUNCE SoftBounce [False] If set, issue temporary errors
1N/A (4xy) instead of permanent errors
1N/A (5xy). This can be useful during
1N/A testing of a new configuration to
1N/A avoid erroneous bouncing of mails.
1N/AconfDEAD_LETTER_DROP DeadLetterDrop [undefined] Filename to save bounce
1N/A messages which could not be returned
1N/A to the user or sent to postmaster.
1N/A If not set, the queue file will
1N/A be renamed.
1N/AconfRRT_IMPLIES_DSN RrtImpliesDsn [False] Return-Receipt-To: header
1N/A implies DSN request.
1N/AconfRUN_AS_USER RunAsUser [undefined] If set, become this user
1N/A when reading and delivering mail.
1N/A Causes all file reads (e.g., .forward
1N/A and :include: files) to be done as
1N/A this user. Also, all programs will
1N/A be run as this user, and all output
1N/A files will be written as this user.
1N/AconfMAX_RCPTS_PER_MESSAGE MaxRecipientsPerMessage
1N/A [infinite] If set, allow no more than
1N/A the specified number of recipients in
1N/A an SMTP envelope. Further recipients
1N/A receive a 452 error code (i.e., they
1N/A are deferred for the next delivery
1N/A attempt).
1N/AconfBAD_RCPT_THROTTLE BadRcptThrottle [infinite] If set and the specified
1N/A number of recipients in a single SMTP
1N/A transaction have been rejected, sleep
1N/A for one second after each subsequent
1N/A RCPT command in that transaction.
1N/AconfDONT_PROBE_INTERFACES DontProbeInterfaces
1N/A [False] If set, sendmail will _not_
1N/A insert the names and addresses of any
1N/A local interfaces into class {w}
1N/A (list of known "equivalent" addresses).
1N/A If you set this, you must also include
1N/A some support for these addresses (e.g.,
1N/A in a mailertable entry) -- otherwise,
1N/A mail to addresses in this list will
1N/A bounce with a configuration error.
1N/A If set to "loopback" (without
1N/A quotes), sendmail will skip
1N/A loopback interfaces (e.g., "lo0").
1N/AconfPID_FILE PidFile [system dependent] Location of pid
1N/A file.
1N/AconfPROCESS_TITLE_PREFIX ProcessTitlePrefix
1N/A [undefined] Prefix string for the
1N/A process title shown on 'ps' listings.
1N/AconfDONT_BLAME_SENDMAIL DontBlameSendmail
1N/A [safe] Override sendmail's file
1N/A safety checks. This will definitely
1N/A compromise system security and should
1N/A not be used unless absolutely
1N/A necessary.
1N/AconfREJECT_MSG - [550 Access denied] The message
1N/A given if the access database contains
1N/A REJECT in the value portion.
1N/AconfRELAY_MSG - [550 Relaying denied] The message
1N/A given if an unauthorized relaying
1N/A attempt is rejected.
1N/AconfDF_BUFFER_SIZE DataFileBufferSize
1N/A [4096] The maximum size of a
1N/A memory-buffered data (df) file
1N/A before a disk-based file is used.
1N/AconfXF_BUFFER_SIZE XScriptFileBufferSize
1N/A [4096] The maximum size of a
1N/A memory-buffered transcript (xf)
1N/A file before a disk-based file is
1N/A used.
1N/AconfTLS_SRV_OPTIONS TLSSrvOptions If this option is 'V' no client
1N/A verification is performed, i.e.,
1N/A the server doesn't ask for a
1N/A certificate.
1N/AconfLDAP_DEFAULT_SPEC LDAPDefaultSpec [undefined] Default map
1N/A specification for LDAP maps. The
1N/A value should only contain LDAP
1N/A specific settings such as "-h host
1N/A -p port -d bindDN", etc. The
1N/A settings will be used for all LDAP
1N/A maps unless they are specified in
1N/A the individual map specification
1N/A ('K' command).
1N/AconfCACERT_PATH CACertPath [undefined] Path to directory
1N/A with certs of CAs.
1N/AconfCACERT CACertFile [undefined] File containing one CA
1N/A cert.
1N/AconfSERVER_CERT ServerCertFile [undefined] File containing the
1N/A cert of the server, i.e., this cert
1N/A is used when sendmail acts as
1N/A server.
1N/AconfSERVER_KEY ServerKeyFile [undefined] File containing the
1N/A private key belonging to the server
1N/A cert.
1N/AconfCLIENT_CERT ClientCertFile [undefined] File containing the
1N/A cert of the client, i.e., this cert
1N/A is used when sendmail acts as
1N/A client.
1N/AconfCLIENT_KEY ClientKeyFile [undefined] File containing the
1N/A private key belonging to the client
1N/A cert.
1N/AconfCRL CRLFile [undefined] File containing certificate
1N/A revocation status, useful for X.509v3
1N/A authentication. Note that CRL requires
1N/A at least OpenSSL version 0.9.7.
1N/AconfDH_PARAMETERS DHParameters [undefined] File containing the
1N/A DH parameters.
1N/AconfRAND_FILE RandFile [undefined] File containing random
1N/A data (use prefix file:) or the
1N/A name of the UNIX socket if EGD is
1N/A used (use prefix egd:). STARTTLS
1N/A requires this option if the compile
1N/A flag HASURANDOM is not set (see
1N/A sendmail/README).
1N/AconfNICE_QUEUE_RUN NiceQueueRun [undefined] If set, the priority of
1N/A queue runners is set the given value
1N/A (nice(3)).
1N/AconfDIRECT_SUBMISSION_MODIFIERS DirectSubmissionModifiers
1N/A [undefined] Defines {daemon_flags}
1N/A for direct submissions.
1N/AconfUSE_MSP UseMSP [undefined] Use as mail submission
1N/A program.
1N/AconfDELIVER_BY_MIN DeliverByMin [0] Minimum time for Deliver By
1N/A SMTP Service Extension (RFC 2852).
1N/AconfREQUIRES_DIR_FSYNC RequiresDirfsync [true] RequiresDirfsync can
1N/A be used to turn off the compile time
1N/A flag REQUIRES_DIR_FSYNC at runtime.
1N/A See sendmail/README for details.
1N/AconfSHARED_MEMORY_KEY SharedMemoryKey [0] Key for shared memory.
1N/AconfSHARED_MEMORY_KEY_FILE
1N/A SharedMemoryKeyFile
1N/A [undefined] File where the
1N/A automatically selected key for
1N/A shared memory is stored.
1N/AconfFAST_SPLIT FastSplit [1] If set to a value greater than
1N/A zero, the initial MX lookups on
1N/A addresses is suppressed when they
1N/A are sorted which may result in
1N/A faster envelope splitting. If the
1N/A mail is submitted directly from the
1N/A command line, then the value also
1N/A limits the number of processes to
1N/A deliver the envelopes.
1N/AconfMAILBOX_DATABASE MailboxDatabase [pw] Type of lookup to find
1N/A information about local mailboxes.
1N/AconfDEQUOTE_OPTS - [empty] Additional options for the
1N/A dequote map.
1N/AconfMAX_NOOP_COMMANDS MaxNOOPCommands [20] Maximum number of "useless"
1N/A commands before the SMTP server
1N/A will slow down responding.
1N/AconfHELO_NAME HeloName If defined, use as name for EHLO/HELO
1N/A command (instead of $j).
1N/AconfINPUT_MAIL_FILTERS InputMailFilters
1N/A A comma separated list of filters
1N/A which determines which filters and
1N/A the invocation sequence are
1N/A contacted for incoming SMTP
1N/A messages. If none are set, no
1N/A filters will be contacted.
1N/AconfMILTER_LOG_LEVEL Milter.LogLevel [9] Log level for input mail filter
1N/A actions, defaults to LogLevel.
1N/AconfMILTER_MACROS_CONNECT Milter.macros.connect
1N/A [j, _, {daemon_name}, {if_name},
1N/A {if_addr}] Macros to transmit to
1N/A milters when a session connection
1N/A starts.
1N/AconfMILTER_MACROS_HELO Milter.macros.helo
1N/A [{tls_version}, {cipher},
1N/A {cipher_bits}, {cert_subject},
1N/A {cert_issuer}] Macros to transmit to
1N/A milters after HELO/EHLO command.
1N/AconfMILTER_MACROS_ENVFROM Milter.macros.envfrom
1N/A [i, {auth_type}, {auth_authen},
1N/A {auth_ssf}, {auth_author},
1N/A {mail_mailer}, {mail_host},
1N/A {mail_addr}] Macros to transmit to
1N/A milters after MAIL FROM command.
1N/AconfMILTER_MACROS_ENVRCPT Milter.macros.envrcpt
1N/A [{rcpt_mailer}, {rcpt_host},
1N/A {rcpt_addr}] Macros to transmit to
1N/A milters after RCPT TO command.
1N/AconfMILTER_MACROS_EOM Milter.macros.eom
1N/A [{msg_id}] Macros to transmit to
1N/A milters after the terminating
1N/A DATA '.' is received.
1N/AconfMILTER_MACROS_EOH Milter.macros.eoh
1N/A Macros to transmit to milters
1N/A after the end of headers.
1N/AconfMILTER_MACROS_DATA Milter.macros.data
1N/A Macros to transmit to milters
1N/A after DATA command is received.
1N/A
1N/A
1N/ASee also the description of OSTYPE for some parameters that can be
1N/Atweaked (generally pathnames to mailers).
1N/A
1N/AClientPortOptions and DaemonPortOptions are special cases since multiple
1N/Aclients/daemons can be defined. This can be done via
1N/A
1N/A CLIENT_OPTIONS(`field1=value1,field2=value2,...')
1N/A DAEMON_OPTIONS(`field1=value1,field2=value2,...')
1N/A
1N/ANote that multiple CLIENT_OPTIONS() commands (and therefore multiple
1N/AClientPortOptions settings) are allowed in order to give settings for each
1N/Aprotocol family (e.g., one for Family=inet and one for Family=inet6). A
1N/Arestriction placed on one family only affects outgoing connections on that
1N/Aparticular family.
1N/A
1N/AIf DAEMON_OPTIONS is not used, then the default is
1N/A
1N/A DAEMON_OPTIONS(`Port=smtp, Name=MTA')
1N/A DAEMON_OPTIONS(`Port=587, Name=MSA, M=E')
1N/A
1N/AIf you use one DAEMON_OPTIONS macro, it will alter the parameters
1N/Aof the first of these. The second will still be defaulted; it
1N/Arepresents a "Message Submission Agent" (MSA) as defined by RFC
1N/A2476 (see below). To turn off the default definition for the MSA,
1N/Ause FEATURE(`no_default_msa') (see also FEATURES). If you use
1N/Aadditional DAEMON_OPTIONS macros, they will add additional daemons.
1N/A
1N/AExample 1: To change the port for the SMTP listener, while
1N/Astill using the MSA default, use
1N/A DAEMON_OPTIONS(`Port=925, Name=MTA')
1N/A
1N/AExample 2: To change the port for the MSA daemon, while still
1N/Ausing the default SMTP port, use
1N/A FEATURE(`no_default_msa')
1N/A DAEMON_OPTIONS(`Name=MTA')
1N/A DAEMON_OPTIONS(`Port=987, Name=MSA, M=E')
1N/A
1N/ANote that if the first of those DAEMON_OPTIONS lines were omitted, then
1N/Athere would be no listener on the standard SMTP port.
1N/A
1N/AExample 3: To listen on both IPv4 and IPv6 interfaces, use
1N/A
1N/A DAEMON_OPTIONS(`Name=MTA-v4, Family=inet')
1N/A DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6')
1N/A
1N/AA "Message Submission Agent" still uses all of the same rulesets for
1N/Aprocessing the message (and therefore still allows message rejection via
1N/Athe check_* rulesets). In accordance with the RFC, the MSA will ensure
1N/Athat all domains in envelope addresses are fully qualified if the message
1N/Ais relayed to another MTA. It will also enforce the normal address syntax
1N/Arules and log error messages. Additionally, by using the M=a modifier you
1N/Acan require authentication before messages are accepted by the MSA.
1N/ANotice: Do NOT use the 'a' modifier on a public accessible MTA! Finally,
1N/Athe M=E modifier shown above disables ETRN as required by RFC 2476.
1N/A
1N/AMail filters can be defined using the INPUT_MAIL_FILTER() and MAIL_FILTER()
1N/Acommands:
1N/A
1N/A INPUT_MAIL_FILTER(`sample', `S=local:/var/run/f1.sock')
1N/A MAIL_FILTER(`myfilter', `S=inet:3333@localhost')
1N/A
1N/AThe INPUT_MAIL_FILTER() command causes the filter(s) to be called in the
1N/Asame order they were specified by also setting confINPUT_MAIL_FILTERS. A
1N/Afilter can be defined without adding it to the input filter list by using
1N/AMAIL_FILTER() instead of INPUT_MAIL_FILTER() in your .mc file.
1N/AAlternatively, you can reset the list of filters and their order by setting
1N/AconfINPUT_MAIL_FILTERS option after all INPUT_MAIL_FILTER() commands in
1N/Ayour .mc file.
1N/A
1N/A
1N/A+----------------------------+
1N/A| MESSAGE SUBMISSION PROGRAM |
1N/A+----------------------------+
1N/A
1N/AThis section contains a list of caveats and
1N/Aa few hints how for those who want to tweak the default configuration
1N/Afor it (which is installed as submit.cf).
1N/A
1N/ANotice: do not add options/features to submit.mc unless you are
1N/Aabsolutely sure you need them. Options you may want to change
1N/Ainclude:
1N/A
1N/A- confTRUSTED_USERS, FEATURE(`use_ct_file'), and confCT_FILE for
1N/A avoiding X-Authentication warnings.
1N/A- confTIME_ZONE to change it from the default `USE_TZ'.
1N/A- confDELIVERY_MODE is set to interactive in msp.m4 instead
1N/A of the default background mode.
1N/A- FEATURE(stickyhost) and LOCAL_RELAY to send unqualified addresses
1N/A to the LOCAL_RELAY instead of the default relay.
1N/A
1N/AThe MSP performs hostname canonicalization by default. Mail may end
1N/Aup for various DNS related reasons in the MSP queue. This problem
1N/Acan be minimized by using
1N/A
1N/A FEATURE(`nocanonify', `canonify_hosts')
1N/A define(`confDIRECT_SUBMISSION_MODIFIERS', `C')
1N/A
1N/ASee the discussion about nocanonify for possible side effects.
1N/A
1N/ASome things are not intended to work with the MSP. These include
1N/Afeatures that influence the delivery process (e.g., mailertable,
1N/Aaliases), or those that are only important for a SMTP server (e.g.,
1N/Avirtusertable, DaemonPortOptions, multiple queues). Moreover,
1N/Arelaxing certain restrictions (RestrictQueueRun, permissions on
1N/Aqueue directory) or adding features (e.g., enabling prog/file mailer)
1N/Acan cause security problems.
1N/A
1N/AOther things don't work well with the MSP and require tweaking or
1N/Aworkarounds.
1N/A
1N/AThe file and the map created by makemap should be owned by smmsp,
1N/Aits group should be smmsp, and it should have mode 640.
1N/A
1N/Afeature/msp.m4 defines almost all settings for the MSP. Most of
1N/Athose should not be changed at all. Some of the features and options
1N/Acan be overridden if really necessary. It is a bit tricky to do
1N/Athis, because it depends on the actual way the option is defined
1N/Ain feature/msp.m4. If it is directly defined (i.e., define()) then
1N/Athe modified value must be defined after
1N/A
1N/A FEATURE(`msp')
1N/A
1N/AIf it is conditionally defined (i.e., ifdef()) then the desired
1N/Avalue must be defined before the FEATURE line in the .mc file.
1N/ATo see how the options are defined read feature/msp.m4.
1N/A
1N/A
1N/A+--------------------------+
1N/A| FORMAT OF FILES AND MAPS |
1N/A+--------------------------+
1N/A
1N/AFiles that define classes, i.e., F{classname}, consist of lines
1N/Aeach of which contains a single element of the class. For example,
1N/A/etc/mail/local-host-names may have the following content:
1N/A
1N/Amy.domain
1N/Aanother.domain
1N/A
1N/AMaps must be created using makemap(8) , e.g.,
1N/A
1N/A makemap hash MAP < MAP
1N/A
1N/AIn general, a text file from which a map is created contains lines
1N/Aof the form
1N/A
1N/Akey value
1N/A
1N/Awhere 'key' and 'value' are also called LHS and RHS, respectively.
1N/ABy default, the delimiter between LHS and RHS is a non-empty sequence
1N/Aof white space characters.
1N/A
1N/A
1N/A+------------------+
1N/A| DIRECTORY LAYOUT |
1N/A+------------------+
1N/A
1N/AWithin this directory are several subdirectories, to wit:
1N/A
1N/Am4 General support routines. These are typically
1N/A very important and should not be changed without
1N/A very careful consideration.
1N/A
1N/Acf The configuration files themselves. They have
1N/A ".mc" suffixes, and must be run through m4 to
1N/A become complete. The resulting output should
1N/A have a ".cf" suffix.
1N/A
1N/Aostype Definitions describing a particular operating
1N/A system type. These should always be referenced
1N/A using the OSTYPE macro in the .mc file. Examples
1N/A include "bsd4.3", "bsd4.4", "sunos3.5", and
1N/A "sunos4.1".
1N/A
1N/Adomain Definitions describing a particular domain, referenced
1N/A using the DOMAIN macro in the .mc file. These are
1N/A site dependent; for example, "CS.Berkeley.EDU.m4"
1N/A describes hosts in the CS.Berkeley.EDU subdomain.
1N/A
1N/Amailer Descriptions of mailers. These are referenced using
1N/A the MAILER macro in the .mc file.
1N/A
1N/Ash Shell files used when building the .cf file from the
1N/A .mc file in the cf subdirectory.
1N/A
1N/Afeature These hold special orthogonal features that you might
1N/A want to include. They should be referenced using
1N/A the FEATURE macro.
1N/A
1N/Ahack Local hacks. These can be referenced using the HACK
1N/A macro. They shouldn't be of more than voyeuristic
1N/A interest outside the .Berkeley.EDU domain, but who knows?
1N/A
1N/Asiteconfig Site configuration -- e.g., tables of locally connected
1N/A UUCP sites.
1N/A
1N/A
1N/A+------------------------+
1N/A| ADMINISTRATIVE DETAILS |
1N/A+------------------------+
1N/A
1N/AThe following sections detail usage of certain internal parts of the
1N/Asendmail.cf file. Read them carefully if you are trying to modify
1N/Athe current model. If you find the above descriptions adequate, these
1N/Ashould be {boring, confusing, tedious, ridiculous} (pick one or more).
1N/A
1N/ARULESETS (* means built in to sendmail)
1N/A
1N/A 0 * Parsing
1N/A 1 * Sender rewriting
1N/A 2 * Recipient rewriting
1N/A 3 * Canonicalization
1N/A 4 * Post cleanup
1N/A 5 * Local address rewrite (after aliasing)
1N/A 1x mailer rules (sender qualification)
1N/A 2x mailer rules (recipient qualification)
1N/A 3x mailer rules (sender header qualification)
1N/A 4x mailer rules (recipient header qualification)
1N/A 5x mailer subroutines (general)
1N/A 6x mailer subroutines (general)
1N/A 7x mailer subroutines (general)
1N/A 8x reserved
1N/A 90 Mailertable host stripping
1N/A 96 Bottom half of Ruleset 3 (ruleset 6 in old sendmail)
1N/A 97 Hook for recursive ruleset 0 call (ruleset 7 in old sendmail)
1N/A 98 Local part of ruleset 0 (ruleset 8 in old sendmail)
1N/A
1N/A
1N/AMAILERS
1N/A
1N/A 0 local, prog local and program mailers
1N/A 1 [e]smtp, relay SMTP channel
1N/A 2 uucp-* UNIX-to-UNIX Copy Program
1N/A 3 netnews Network News delivery
1N/A 4 fax Sam Leffler's HylaFAX software
1N/A 5 mail11 DECnet mailer
1N/A
1N/A
1N/AMACROS
1N/A
1N/A A
1N/A B Bitnet Relay
1N/A C DECnet Relay
1N/A D The local domain -- usually not needed
1N/A E reserved for X.400 Relay
1N/A F FAX Relay
1N/A G
1N/A H mail Hub (for mail clusters)
1N/A I
1N/A J
1N/A K
1N/A L Luser Relay
1N/A M Masquerade (who you claim to be)
1N/A N
1N/A O
1N/A P
1N/A Q
1N/A R Relay (for unqualified names)
1N/A S Smart Host
1N/A T
1N/A U my UUCP name (if you have a UUCP connection)
1N/A V UUCP Relay (class {V} hosts)
1N/A W UUCP Relay (class {W} hosts)
1N/A X UUCP Relay (class {X} hosts)
1N/A Y UUCP Relay (all other hosts)
1N/A Z Version number
1N/A
1N/A
1N/ACLASSES
1N/A
1N/A A
1N/A B domains that are candidates for bestmx lookup
1N/A C
1N/A D
1N/A E addresses that should not seem to come from $M
1N/A F hosts this system forward for
1N/A G domains that should be looked up in genericstable
1N/A H
1N/A I
1N/A J
1N/A K
1N/A L addresses that should not be forwarded to $R
1N/A M domains that should be mapped to $M
1N/A N host/domains that should not be mapped to $M
1N/A O operators that indicate network operations (cannot be in local names)
1N/A P top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc.
1N/A Q
1N/A R domains this system is willing to relay (pass anti-spam filters)
1N/A S
1N/A T
1N/A U locally connected UUCP hosts
1N/A V UUCP hosts connected to relay $V
1N/A W UUCP hosts connected to relay $W
1N/A X UUCP hosts connected to relay $X
1N/A Y locally connected smart UUCP hosts
1N/A Z locally connected domain-ized UUCP hosts
1N/A . the class containing only a dot
1N/A [ the class containing only a left bracket
1N/A
1N/A
1N/AM4 DIVERSIONS
1N/A
1N/A 1 Local host detection and resolution
1N/A 2 Local Ruleset 3 additions
1N/A 3 Local Ruleset 0 additions
1N/A 4 UUCP Ruleset 0 additions
1N/A 5 locally interpreted names (overrides $R)
1N/A 6 local configuration (at top of file)
1N/A 7 mailer definitions
1N/A 8 DNS based blacklists
1N/A 9 special local rulesets (1 and 2)
1N/A
1N/A$Revision: 8.727 $, Last updated $Date: 2009/05/07 23:46:17 $