README revision 94334
138032Speter 264562Sgshapiro SENDMAIL CONFIGURATION FILES 338032Speter 490792SgshapiroThis document describes the sendmail configuration files. It 590792Sgshapiroexplains how to create a sendmail.cf file for use with sendmail. 690792SgshapiroIt also describes how to set options for sendmail which are explained 790792Sgshapiroin the Sendmail Installation and Operation guide (doc/op/op.me). 838032Speter 990792SgshapiroTo get started, you may want to look at tcpproto.mc (for TCP-only 1090792Sgshapirosites) and clientproto.mc (for clusters of clients using a single 1190792Sgshapiromail host), or the generic-*.mc files as operating system-specific 1290792Sgshapiroexamples. 1338032Speter 1490792SgshapiroTable of Content: 1538032Speter 1690792SgshapiroINTRODUCTION AND EXAMPLE 1790792SgshapiroA BRIEF INTRODUCTION TO M4 1890792SgshapiroFILE LOCATIONS 1990792SgshapiroOSTYPE 2090792SgshapiroDOMAINS 2190792SgshapiroMAILERS 2290792SgshapiroFEATURES 2390792SgshapiroHACKS 2490792SgshapiroSITE CONFIGURATION 2590792SgshapiroUSING UUCP MAILERS 2690792SgshapiroTWEAKING RULESETS 2790792SgshapiroMASQUERADING AND RELAYING 2890792SgshapiroUSING LDAP FOR ALIASES, MAPS, AND CLASSES 2990792SgshapiroLDAP ROUTING 3090792SgshapiroANTI-SPAM CONFIGURATION CONTROL 3190792SgshapiroSTARTTLS 3290792SgshapiroSMTP AUTHENTICATION 3390792SgshapiroADDING NEW MAILERS OR RULESETS 3490792SgshapiroADDING NEW MAIL FILTERS 3590792SgshapiroQUEUE GROUP DEFINITIONS 3690792SgshapiroNON-SMTP BASED CONFIGURATIONS 3790792SgshapiroWHO AM I? 3890792SgshapiroACCEPTING MAIL FOR MULTIPLE NAMES 3990792SgshapiroUSING MAILERTABLES 4090792SgshapiroUSING USERDB TO MAP FULL NAMES 4190792SgshapiroMISCELLANEOUS SPECIAL FEATURES 4290792SgshapiroSECURITY NOTES 4390792SgshapiroTWEAKING CONFIGURATION OPTIONS 4490792SgshapiroMESSAGE SUBMISSION PROGRAM 4590792SgshapiroFORMAT OF FILES AND MAPS 4690792SgshapiroDIRECTORY LAYOUT 4790792SgshapiroADMINISTRATIVE DETAILS 4838032Speter 4990792Sgshapiro 5038032Speter+--------------------------+ 5138032Speter| INTRODUCTION AND EXAMPLE | 5238032Speter+--------------------------+ 5338032Speter 5438032SpeterConfiguration files are contained in the subdirectory "cf", with a 5538032Spetersuffix ".mc". They must be run through "m4" to produce a ".cf" file. 5638032SpeterYou must pre-load "cf.m4": 5738032Speter 5838032Speter m4 ${CFDIR}/m4/cf.m4 config.mc > config.cf 5938032Speter 6064562SgshapiroAlternatively, you can simply: 6164562Sgshapiro 6264562Sgshapiro cd ${CFDIR}/cf 6364562Sgshapiro ./Build config.cf 6464562Sgshapiro 6538032Speterwhere ${CFDIR} is the root of the cf directory and config.mc is the 6638032Spetername of your configuration file. If you are running a version of M4 6738032Speterthat understands the __file__ builtin (versions of GNU m4 >= 0.75 do 6838032Speterthis, but the versions distributed with 4.4BSD and derivatives do not) 6938032Speteror the -I flag (ditto), then ${CFDIR} can be in an arbitrary directory. 7038032SpeterFor "traditional" versions, ${CFDIR} ***MUST*** be "..", or you MUST 7138032Speteruse -D_CF_DIR_=/path/to/cf/dir/ -- note the trailing slash! For example: 7238032Speter 7338032Speter m4 -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 config.mc > config.cf 7438032Speter 7538032SpeterLet's examine a typical .mc file: 7638032Speter 7738032Speter divert(-1) 7838032Speter # 7990792Sgshapiro # Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. 8064562Sgshapiro # All rights reserved. 8138032Speter # Copyright (c) 1983 Eric P. Allman. All rights reserved. 8238032Speter # Copyright (c) 1988, 1993 8338032Speter # The Regents of the University of California. All rights reserved. 8438032Speter # 8538032Speter # By using this file, you agree to the terms and conditions set 8638032Speter # forth in the LICENSE file which can be found at the top level of 8738032Speter # the sendmail distribution. 8838032Speter # 8938032Speter 9038032Speter # 9138032Speter # This is a Berkeley-specific configuration file for HP-UX 9.x. 9238032Speter # It applies only to the Computer Science Division at Berkeley, 9338032Speter # and should not be used elsewhere. It is provided on the sendmail 9438032Speter # distribution as a sample only. To create your own configuration 9538032Speter # file, create an appropriate domain file in ../domain, change the 9638032Speter # `DOMAIN' macro below to reference that file, and copy the result 9738032Speter # to a name of your own choosing. 9838032Speter # 9938032Speter divert(0) 10038032Speter 10138032SpeterThe divert(-1) will delete the crud in the resulting output file. 10238032SpeterThe copyright notice can be replaced by whatever your lawyers require; 10364562Sgshapiroour lawyers require the one that is included in these files. A copyleft 10438032Speteris a copyright by another name. The divert(0) restores regular output. 10538032Speter 10638032Speter VERSIONID(`<SCCS or RCS version id>') 10738032Speter 10838032SpeterVERSIONID is a macro that stuffs the version information into the 10964562Sgshapiroresulting file. You could use SCCS, RCS, CVS, something else, or 11038032Speteromit it completely. This is not the same as the version id included 11138032Speterin SMTP greeting messages -- this is defined in m4/version.m4. 11238032Speter 11364562Sgshapiro OSTYPE(`hpux9')dnl 11438032Speter 11538032SpeterYou must specify an OSTYPE to properly configure things such as the 11638032Speterpathname of the help and status files, the flags needed for the local 11738032Spetermailer, and other important things. If you omit it, you will get an 11838032Spetererror when you try to build the configuration. Look at the ostype 11938032Speterdirectory for the list of known operating system types. 12038032Speter 12164562Sgshapiro DOMAIN(`CS.Berkeley.EDU')dnl 12238032Speter 12338032SpeterThis example is specific to the Computer Science Division at Berkeley. 12464562SgshapiroYou can use "DOMAIN(`generic')" to get a sufficiently bland definition 12538032Speterthat may well work for you, or you can create a customized domain 12638032Speterdefinition appropriate for your environment. 12738032Speter 12864562Sgshapiro MAILER(`local') 12964562Sgshapiro MAILER(`smtp') 13038032Speter 13190792SgshapiroThese describe the mailers used at the default CS site. The local 13290792Sgshapiromailer is always included automatically. Beware: MAILER declarations 13390792Sgshapiroshould always be at the end of the configuration file. The general 13490792Sgshapirorules are that the order should be: 13538032Speter 13638032Speter VERSIONID 13738032Speter OSTYPE 13838032Speter DOMAIN 13938032Speter FEATURE 14038032Speter local macro definitions 14138032Speter MAILER 14290792Sgshapiro LOCAL_CONFIG 14364562Sgshapiro LOCAL_RULE_* 14464562Sgshapiro LOCAL_RULESETS 14538032Speter 14664562SgshapiroThere are a few exceptions to this rule. Local macro definitions which 14764562Sgshapiroinfluence a FEATURE() should be done before that feature. For example, 14864562Sgshapiroa define(`PROCMAIL_MAILER_PATH', ...) should be done before 14964562SgshapiroFEATURE(`local_procmail'). 15038032Speter 15190792Sgshapiro******************************************************************* 15290792Sgshapiro*** BE SURE YOU CUSTOMIZE THESE FILES! They have some *** 15390792Sgshapiro*** Berkeley-specific assumptions built in, such as the name *** 15490792Sgshapiro*** of their UUCP-relay. You'll want to create your own *** 15590792Sgshapiro*** domain description, and use that in place of *** 15690792Sgshapiro*** domain/Berkeley.EDU.m4. *** 15790792Sgshapiro******************************************************************* 15864562Sgshapiro 15990792Sgshapiro 16038032Speter+----------------------------+ 16138032Speter| A BRIEF INTRODUCTION TO M4 | 16238032Speter+----------------------------+ 16338032Speter 16438032SpeterSendmail uses the M4 macro processor to ``compile'' the configuration 16538032Speterfiles. The most important thing to know is that M4 is stream-based, 16638032Speterthat is, it doesn't understand about lines. For this reason, in some 16738032Speterplaces you may see the word ``dnl'', which stands for ``delete 16838032Speterthrough newline''; essentially, it deletes all characters starting 16938032Speterat the ``dnl'' up to and including the next newline character. In 17038032Spetermost cases sendmail uses this only to avoid lots of unnecessary 17138032Speterblank lines in the output. 17238032Speter 17338032SpeterOther important directives are define(A, B) which defines the macro 17438032Speter``A'' to have value ``B''. Macros are expanded as they are read, so 17538032Speterone normally quotes both values to prevent expansion. For example, 17638032Speter 17738032Speter define(`SMART_HOST', `smart.foo.com') 17838032Speter 17938032SpeterOne word of warning: M4 macros are expanded even in lines that appear 18038032Speterto be comments. For example, if you have 18138032Speter 18264562Sgshapiro # See FEATURE(`foo') above 18338032Speter 18464562Sgshapiroit will not do what you expect, because the FEATURE(`foo') will be 18538032Speterexpanded. This also applies to 18638032Speter 18738032Speter # And then define the $X macro to be the return address 18838032Speter 18938032Speterbecause ``define'' is an M4 keyword. If you want to use them, surround 19038032Speterthem with directed quotes, `like this'. 19138032Speter 19290792Sgshapiro 19390792SgshapiroNotice: 19490792Sgshapiro------- 19590792Sgshapiro 19690792SgshapiroThis package requires a post-V7 version of m4; if you are running the 19790792Sgshapiro4.2bsd, SysV.2, or 7th Edition version. SunOS's /usr/5bin/m4 or 19890792SgshapiroBSD-Net/2's m4 both work. GNU m4 version 1.1 or later also works. 19990792SgshapiroUnfortunately, the M4 on BSDI 1.0 doesn't work -- you'll have to use a 20090792SgshapiroNet/2 or GNU version. GNU m4 is available from 20190792Sgshapiroftp://ftp.gnu.org/pub/gnu/m4/m4-1.4.tar.gz (check for the latest version). 20290792SgshapiroEXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken (3.x is fine). Use GNU 20390792Sgshapirom4 on this platform. 20490792Sgshapiro 20590792Sgshapiro 20638032Speter+----------------+ 20738032Speter| FILE LOCATIONS | 20838032Speter+----------------+ 20938032Speter 21038032Spetersendmail 8.9 has introduced a new configuration directory for sendmail 21138032Speterrelated files, /etc/mail. The new files available for sendmail 8.9 -- 21264562Sgshapirothe class {R} /etc/mail/relay-domains and the access database 21364562Sgshapiro/etc/mail/access -- take advantage of this new directory. Beginning with 21464562Sgshapiro8.10, all files will use this directory by default (some options may be 21564562Sgshapiroset by OSTYPE() files). This new directory should help to restore 21664562Sgshapirouniformity to sendmail's file locations. 21738032Speter 21864562SgshapiroBelow is a table of some of the common changes: 21964562Sgshapiro 22064562SgshapiroOld filename New filename 22164562Sgshapiro------------ ------------ 22264562Sgshapiro/etc/bitdomain /etc/mail/bitdomain 22364562Sgshapiro/etc/domaintable /etc/mail/domaintable 22464562Sgshapiro/etc/genericstable /etc/mail/genericstable 22564562Sgshapiro/etc/uudomain /etc/mail/uudomain 22664562Sgshapiro/etc/virtusertable /etc/mail/virtusertable 22764562Sgshapiro/etc/userdb /etc/mail/userdb 22864562Sgshapiro 22964562Sgshapiro/etc/aliases /etc/mail/aliases 23064562Sgshapiro/etc/sendmail/aliases /etc/mail/aliases 23164562Sgshapiro/etc/ucbmail/aliases /etc/mail/aliases 23264562Sgshapiro/usr/adm/sendmail/aliases /etc/mail/aliases 23364562Sgshapiro/usr/lib/aliases /etc/mail/aliases 23464562Sgshapiro/usr/lib/mail/aliases /etc/mail/aliases 23564562Sgshapiro/usr/ucblib/aliases /etc/mail/aliases 23664562Sgshapiro 23764562Sgshapiro/etc/sendmail.cw /etc/mail/local-host-names 23864562Sgshapiro/etc/mail/sendmail.cw /etc/mail/local-host-names 23964562Sgshapiro/etc/sendmail/sendmail.cw /etc/mail/local-host-names 24064562Sgshapiro 24164562Sgshapiro/etc/sendmail.ct /etc/mail/trusted-users 24264562Sgshapiro 24364562Sgshapiro/etc/sendmail.oE /etc/mail/error-header 24464562Sgshapiro 24564562Sgshapiro/etc/sendmail.hf /etc/mail/helpfile 24664562Sgshapiro/etc/mail/sendmail.hf /etc/mail/helpfile 24764562Sgshapiro/usr/ucblib/sendmail.hf /etc/mail/helpfile 24864562Sgshapiro/etc/ucbmail/sendmail.hf /etc/mail/helpfile 24964562Sgshapiro/usr/lib/sendmail.hf /etc/mail/helpfile 25064562Sgshapiro/usr/share/lib/sendmail.hf /etc/mail/helpfile 25164562Sgshapiro/usr/share/misc/sendmail.hf /etc/mail/helpfile 25264562Sgshapiro/share/misc/sendmail.hf /etc/mail/helpfile 25364562Sgshapiro 25464562Sgshapiro/etc/service.switch /etc/mail/service.switch 25564562Sgshapiro 25664562Sgshapiro/etc/sendmail.st /etc/mail/statistics 25764562Sgshapiro/etc/mail/sendmail.st /etc/mail/statistics 25864562Sgshapiro/etc/mailer/sendmail.st /etc/mail/statistics 25964562Sgshapiro/etc/sendmail/sendmail.st /etc/mail/statistics 26064562Sgshapiro/usr/lib/sendmail.st /etc/mail/statistics 26164562Sgshapiro/usr/ucblib/sendmail.st /etc/mail/statistics 26264562Sgshapiro 26364562SgshapiroNote that all of these paths actually use a new m4 macro MAIL_SETTINGS_DIR 26464562Sgshapiroto create the pathnames. The default value of this variable is 26564562Sgshapiro`/etc/mail/'. If you set this macro to a different value, you MUST include 26664562Sgshapiroa trailing slash. 26764562Sgshapiro 26880785SgshapiroNotice: all filenames used in a .mc (or .cf) file should be absolute 26980785Sgshapiro(starting at the root, i.e., with '/'). Relative filenames most 27080785Sgshapirolikely cause surprises during operations (unless otherwise noted). 27180785Sgshapiro 27280785Sgshapiro 27338032Speter+--------+ 27438032Speter| OSTYPE | 27538032Speter+--------+ 27638032Speter 27738032SpeterYou MUST define an operating system environment, or the configuration 27838032Speterfile build will puke. There are several environments available; look 27938032Speterat the "ostype" directory for the current list. This macro changes 28038032Speterthings like the location of the alias file and queue directory. Some 28138032Speterof these files are identical to one another. 28238032Speter 28338032SpeterIt is IMPERATIVE that the OSTYPE occur before any MAILER definitions. 28438032SpeterIn general, the OSTYPE macro should go immediately after any version 28538032Speterinformation, and MAILER definitions should always go last. 28638032Speter 28738032SpeterOperating system definitions are usually easy to write. They may define 28838032Speterthe following variables (everything defaults, so an ostype file may be 28938032Speterempty). Unfortunately, the list of configuration-supported systems is 29038032Speternot as broad as the list of source-supported systems, since many of 29138032Speterthe source contributors do not include corresponding ostype files. 29238032Speter 29364562SgshapiroALIAS_FILE [/etc/mail/aliases] The location of the text version 29438032Speter of the alias file(s). It can be a comma-separated 29538032Speter list of names (but be sure you quote values with 29638032Speter commas in them -- for example, use 29738032Speter define(`ALIAS_FILE', `a,b') 29838032Speter to get "a" and "b" both listed as alias files; 29938032Speter otherwise the define() primitive only sees "a"). 30064562SgshapiroHELP_FILE [/etc/mail/helpfile] The name of the file 30138032Speter containing information printed in response to 30238032Speter the SMTP HELP command. 30338032SpeterQUEUE_DIR [/var/spool/mqueue] The directory containing 30464562Sgshapiro queue files. To use multiple queues, supply 30564562Sgshapiro a value ending with an asterisk. For 30673188Sgshapiro example, /var/spool/mqueue/qd* will use all of the 30764562Sgshapiro directories or symbolic links to directories 30873188Sgshapiro beginning with 'qd' in /var/spool/mqueue as queue 30964562Sgshapiro directories. The names 'qf', 'df', and 'xf' are 31073188Sgshapiro reserved as specific subdirectories for the 31173188Sgshapiro corresponding queue file types as explained in 31290792Sgshapiro doc/op/op.me. See also QUEUE GROUP DEFINITIONS. 31390792SgshapiroMSP_QUEUE_DIR [/var/spool/clientmqueue] The directory containing 31490792Sgshapiro queue files for the MSP (Mail Submission Program, 31590792Sgshapiro see sendmail/SECURITY). 31664562SgshapiroSTATUS_FILE [/etc/mail/statistics] The file containing status 31738032Speter information. 31838032SpeterLOCAL_MAILER_PATH [/bin/mail] The program used to deliver local mail. 31964562SgshapiroLOCAL_MAILER_FLAGS [Prmn9] The flags used by the local mailer. The 32064562Sgshapiro flags lsDFMAw5:/|@q are always included. 32138032SpeterLOCAL_MAILER_ARGS [mail -d $u] The arguments passed to deliver local 32238032Speter mail. 32338032SpeterLOCAL_MAILER_MAX [undefined] If defined, the maximum size of local 32438032Speter mail that you are willing to accept. 32564562SgshapiroLOCAL_MAILER_MAXMSGS [undefined] If defined, the maximum number of 32664562Sgshapiro messages to deliver in a single connection. Only 32764562Sgshapiro useful for LMTP local mailers. 32838032SpeterLOCAL_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 32938032Speter that ARRIVE from an address that resolves to the 33038032Speter local mailer and which are converted to MIME will be 33138032Speter labeled with this character set. 33264562SgshapiroLOCAL_MAILER_EOL [undefined] If defined, the string to use as the 33364562Sgshapiro end of line for the local mailer. 33464562SgshapiroLOCAL_MAILER_DSN_DIAGNOSTIC_CODE 33564562Sgshapiro [X-Unix] The DSN Diagnostic-Code value for the 33664562Sgshapiro local mailer. This should be changed with care. 33738032SpeterLOCAL_SHELL_PATH [/bin/sh] The shell used to deliver piped email. 33838032SpeterLOCAL_SHELL_FLAGS [eu9] The flags used by the shell mailer. The 33938032Speter flags lsDFM are always included. 34038032SpeterLOCAL_SHELL_ARGS [sh -c $u] The arguments passed to deliver "prog" 34138032Speter mail. 34238032SpeterLOCAL_SHELL_DIR [$z:/] The directory search path in which the 34338032Speter shell should run. 34490792SgshapiroLOCAL_MAILER_QGRP [undefined] The queue group for the local mailer. 34538032SpeterUSENET_MAILER_PATH [/usr/lib/news/inews] The name of the program 34638032Speter used to submit news. 34764562SgshapiroUSENET_MAILER_FLAGS [rsDFMmn] The mailer flags for the usenet mailer. 34838032SpeterUSENET_MAILER_ARGS [-m -h -n] The command line arguments for the 34990792Sgshapiro usenet mailer. NOTE: Some versions of inews 35090792Sgshapiro (such as those shipped with newer versions of INN) 35190792Sgshapiro use different flags. Double check the defaults 35290792Sgshapiro against the inews man page. 35338032SpeterUSENET_MAILER_MAX [100000] The maximum size of messages that will 35438032Speter be accepted by the usenet mailer. 35590792SgshapiroUSENET_MAILER_QGRP [undefined] The queue group for the usenet mailer. 35638032SpeterSMTP_MAILER_FLAGS [undefined] Flags added to SMTP mailer. Default 35764562Sgshapiro flags are `mDFMuX' for all SMTP-based mailers; the 35864562Sgshapiro "esmtp" mailer adds `a'; "smtp8" adds `8'; and 35964562Sgshapiro "dsmtp" adds `%'. 36064562SgshapiroRELAY_MAILER_FLAGS [undefined] Flags added to the relay mailer. Default 36164562Sgshapiro flags are `mDFMuX' for all SMTP-based mailers; the 36264562Sgshapiro relay mailer adds `a8'. If this is not defined, 36364562Sgshapiro then SMTP_MAILER_FLAGS is used. 36438032SpeterSMTP_MAILER_MAX [undefined] The maximum size of messages that will 36564562Sgshapiro be transported using the smtp, smtp8, esmtp, or dsmtp 36638032Speter mailers. 36764562SgshapiroSMTP_MAILER_MAXMSGS [undefined] If defined, the maximum number of 36864562Sgshapiro messages to deliver in a single connection for the 36964562Sgshapiro smtp, smtp8, esmtp, or dsmtp mailers. 37094334SgshapiroSMTP_MAILER_MAXRCPTS [undefined] If defined, the maximum number of 37194334Sgshapiro recipients to deliver in a single connection for the 37294334Sgshapiro smtp, smtp8, esmtp, or dsmtp mailers. 37366494SgshapiroSMTP_MAILER_ARGS [TCP $h] The arguments passed to the smtp mailer. 37438032Speter About the only reason you would want to change this 37538032Speter would be to change the default port. 37666494SgshapiroESMTP_MAILER_ARGS [TCP $h] The arguments passed to the esmtp mailer. 37766494SgshapiroSMTP8_MAILER_ARGS [TCP $h] The arguments passed to the smtp8 mailer. 37866494SgshapiroDSMTP_MAILER_ARGS [TCP $h] The arguments passed to the dsmtp mailer. 37966494SgshapiroRELAY_MAILER_ARGS [TCP $h] The arguments passed to the relay mailer. 38090792SgshapiroSMTP_MAILER_QGRP [undefined] The queue group for the smtp mailer. 38190792SgshapiroESMTP_MAILER_QGRP [undefined] The queue group for the esmtp mailer. 38290792SgshapiroSMTP8_MAILER_QGRP [undefined] The queue group for the smtp8 mailer. 38390792SgshapiroDSMTP_MAILER_QGRP [undefined] The queue group for the dsmtp mailer. 38490792SgshapiroRELAY_MAILER_QGRP [undefined] The queue group for the relay mailer. 38564562SgshapiroRELAY_MAILER_MAXMSGS [undefined] If defined, the maximum number of 38664562Sgshapiro messages to deliver in a single connection for the 38764562Sgshapiro relay mailer. 38838032SpeterSMTP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 38938032Speter that ARRIVE from an address that resolves to one of 39038032Speter the SMTP mailers and which are converted to MIME will 39138032Speter be labeled with this character set. 39238032SpeterUUCP_MAILER_PATH [/usr/bin/uux] The program used to send UUCP mail. 39338032SpeterUUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer. Default 39438032Speter flags are `DFMhuU' (and `m' for uucp-new mailer, 39538032Speter minus `U' for uucp-dom mailer). 39638032SpeterUUCP_MAILER_ARGS [uux - -r -z -a$g -gC $h!rmail ($u)] The arguments 39738032Speter passed to the UUCP mailer. 39838032SpeterUUCP_MAILER_MAX [100000] The maximum size message accepted for 39938032Speter transmission by the UUCP mailers. 40038032SpeterUUCP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 40138032Speter that ARRIVE from an address that resolves to one of 40238032Speter the UUCP mailers and which are converted to MIME will 40338032Speter be labeled with this character set. 40490792SgshapiroUUCP_MAILER_QGRP [undefined] The queue group for the UUCP mailers. 40538032SpeterFAX_MAILER_PATH [/usr/local/lib/fax/mailfax] The program used to 40638032Speter submit FAX messages. 40738032SpeterFAX_MAILER_ARGS [mailfax $u $h $f] The arguments passed to the FAX 40838032Speter mailer. 40938032SpeterFAX_MAILER_MAX [100000] The maximum size message accepted for 41038032Speter transmission by FAX. 41138032SpeterPOP_MAILER_PATH [/usr/lib/mh/spop] The pathname of the POP mailer. 41264562SgshapiroPOP_MAILER_FLAGS [Penu] Flags added to POP mailer. Flags lsDFMq 41338032Speter are always added. 41438032SpeterPOP_MAILER_ARGS [pop $u] The arguments passed to the POP mailer. 41590792SgshapiroPOP_MAILER_QGRP [undefined] The queue group for the pop mailer. 41638032SpeterPROCMAIL_MAILER_PATH [/usr/local/bin/procmail] The path to the procmail 41743730Speter program. This is also used by 41843730Speter FEATURE(`local_procmail'). 41938032SpeterPROCMAIL_MAILER_FLAGS [SPhnu9] Flags added to Procmail mailer. Flags 42064562Sgshapiro DFM are always set. This is NOT used by 42143730Speter FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS 42238032Speter instead. 42338032SpeterPROCMAIL_MAILER_ARGS [procmail -Y -m $h $f $u] The arguments passed to 42438032Speter the Procmail mailer. This is NOT used by 42543730Speter FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS 42638032Speter instead. 42738032SpeterPROCMAIL_MAILER_MAX [undefined] If set, the maximum size message that 42838032Speter will be accepted by the procmail mailer. 42990792SgshapiroPROCMAIL_MAILER_QGRP [undefined] The queue group for the procmail mailer. 43038032SpeterMAIL11_MAILER_PATH [/usr/etc/mail11] The path to the mail11 mailer. 43138032SpeterMAIL11_MAILER_FLAGS [nsFx] Flags for the mail11 mailer. 43238032SpeterMAIL11_MAILER_ARGS [mail11 $g $x $h $u] Arguments passed to the mail11 43338032Speter mailer. 43490792SgshapiroMAIL11_MAILER_QGRP [undefined] The queue group for the mail11 mailer. 43538032SpeterPH_MAILER_PATH [/usr/local/etc/phquery] The path to the phquery 43638032Speter program. 43764562SgshapiroPH_MAILER_FLAGS [ehmu] Flags for the phquery mailer. Flags nrDFM 43864562Sgshapiro are always set. 43938032SpeterPH_MAILER_ARGS [phquery -- $u] -- arguments to the phquery mailer. 44090792SgshapiroPH_MAILER_QGRP [undefined] The queue group for the ph mailer. 44164562SgshapiroCYRUS_MAILER_FLAGS [Ah5@/:|] The flags used by the cyrus mailer. The 44238032Speter flags lsDFMnPq are always included. 44338032SpeterCYRUS_MAILER_PATH [/usr/cyrus/bin/deliver] The program used to deliver 44438032Speter cyrus mail. 44538032SpeterCYRUS_MAILER_ARGS [deliver -e -m $h -- $u] The arguments passed 44638032Speter to deliver cyrus mail. 44738032SpeterCYRUS_MAILER_MAX [undefined] If set, the maximum size message that 44838032Speter will be accepted by the cyrus mailer. 44938032SpeterCYRUS_MAILER_USER [cyrus:mail] The user and group to become when 45038032Speter running the cyrus mailer. 45190792SgshapiroCYRUS_MAILER_QGRP [undefined] The queue group for the cyrus mailer. 45264562SgshapiroCYRUS_BB_MAILER_FLAGS [u] The flags used by the cyrusbb mailer. 45364562Sgshapiro The flags lsDFMnP are always included. 45438032SpeterCYRUS_BB_MAILER_ARGS [deliver -e -m $u] The arguments passed 45538032Speter to deliver cyrusbb mail. 45638032SpeterconfEBINDIR [/usr/libexec] The directory for executables. 45743730Speter Currently used for FEATURE(`local_lmtp') and 45843730Speter FEATURE(`smrsh'). 45964562SgshapiroQPAGE_MAILER_FLAGS [mDFMs] The flags used by the qpage mailer. 46064562SgshapiroQPAGE_MAILER_PATH [/usr/local/bin/qpage] The program used to deliver 46164562Sgshapiro qpage mail. 46264562SgshapiroQPAGE_MAILER_ARGS [qpage -l0 -m -P$u] The arguments passed 46364562Sgshapiro to deliver qpage mail. 46464562SgshapiroQPAGE_MAILER_MAX [4096] If set, the maximum size message that 46564562Sgshapiro will be accepted by the qpage mailer. 46690792SgshapiroQPAGE_MAILER_QGRP [undefined] The queue group for the qpage mailer. 46790792SgshapiroLOCAL_PROG_QGRP [undefined] The queue group for the prog mailer. 46838032Speter 46964562SgshapiroNote: to tweak Name_MAILER_FLAGS use the macro MODIFY_MAILER_FLAGS: 47064562SgshapiroMODIFY_MAILER_FLAGS(`Name', `change') where Name is the first part of 47164562Sgshapirothe macro Name_MAILER_FLAGS and change can be: flags that should 47264562Sgshapirobe used directly (thus overriding the default value), or if it 47364562Sgshapirostarts with `+' (`-') then those flags are added to (removed from) 47464562Sgshapirothe default value. Example: 47538032Speter 47664562Sgshapiro MODIFY_MAILER_FLAGS(`LOCAL', `+e') 47738032Speter 47890792Sgshapirowill add the flag `e' to LOCAL_MAILER_FLAGS. Notice: there are 47990792Sgshapiroseveral smtp mailers all of which are manipulated individually. 48090792SgshapiroSee the section MAILERS for the available mailer names. 48164562SgshapiroWARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS 48264562Sgshapirounconditionally, i.e., without respecting any definitions in an 48364562SgshapiroOSTYPE setting. 48464562Sgshapiro 48564562Sgshapiro 48638032Speter+---------+ 48738032Speter| DOMAINS | 48838032Speter+---------+ 48938032Speter 49038032SpeterYou will probably want to collect domain-dependent defines into one 49164562Sgshapirofile, referenced by the DOMAIN macro. For example, the Berkeley 49238032Speterdomain file includes definitions for several internal distinguished 49338032Speterhosts: 49438032Speter 49538032SpeterUUCP_RELAY The host that will accept UUCP-addressed email. 49638032Speter If not defined, all UUCP sites must be directly 49738032Speter connected. 49838032SpeterBITNET_RELAY The host that will accept BITNET-addressed email. 49938032Speter If not defined, the .BITNET pseudo-domain won't work. 50038032SpeterDECNET_RELAY The host that will accept DECNET-addressed email. 50138032Speter If not defined, the .DECNET pseudo-domain and addresses 50238032Speter of the form node::user will not work. 50338032SpeterFAX_RELAY The host that will accept mail to the .FAX pseudo-domain. 50438032Speter The "fax" mailer overrides this value. 50571345SgshapiroLOCAL_RELAY The site that will handle unqualified names -- that 50682017Sgshapiro is, names without an @domain extension. 50771345Sgshapiro Normally MAIL_HUB is preferred for this function. 50871345Sgshapiro LOCAL_RELAY is mostly useful in conjunction with 50990792Sgshapiro FEATURE(`stickyhost') -- see the discussion of 51071345Sgshapiro stickyhost below. If not set, they are assumed to 51171345Sgshapiro belong on this machine. This allows you to have a 51271345Sgshapiro central site to store a company- or department-wide 51371345Sgshapiro alias database. This only works at small sites, 51471345Sgshapiro and only with some user agents. 51538032SpeterLUSER_RELAY The site that will handle lusers -- that is, apparently 51664562Sgshapiro local names that aren't local accounts or aliases. To 51764562Sgshapiro specify a local user instead of a site, set this to 51864562Sgshapiro ``local:username''. 51938032Speter 52038032SpeterAny of these can be either ``mailer:hostname'' (in which case the 52138032Spetermailer is the internal mailer name, such as ``uucp-new'' and the hostname 52238032Speteris the name of the host as appropriate for that mailer) or just a 52338032Speter``hostname'', in which case a default mailer type (usually ``relay'', 52438032Spetera variant on SMTP) is used. WARNING: if you have a wildcard MX 52538032Speterrecord matching your domain, you probably want to define these to 52638032Speterhave a trailing dot so that you won't get the mail diverted back 52738032Speterto yourself. 52838032Speter 52938032SpeterThe domain file can also be used to define a domain name, if needed 53038032Speter(using "DD<domain>") and set certain site-wide features. If all hosts 53138032Speterat your site masquerade behind one email name, you could also use 53238032SpeterMASQUERADE_AS here. 53338032Speter 53438032SpeterYou do not have to define a domain -- in particular, if you are a 53538032Spetersingle machine sitting off somewhere, it is probably more work than 53638032Speterit's worth. This is just a mechanism for combining "domain dependent 53738032Speterknowledge" into one place. 53838032Speter 53990792Sgshapiro 54038032Speter+---------+ 54138032Speter| MAILERS | 54238032Speter+---------+ 54338032Speter 54438032SpeterThere are fewer mailers supported in this version than the previous 54538032Speterversion, owing mostly to a simpler world. As a general rule, put the 54690792SgshapiroMAILER definitions last in your .mc file. 54738032Speter 54838032Speterlocal The local and prog mailers. You will almost always 54938032Speter need these; the only exception is if you relay ALL 55038032Speter your mail to another site. This mailer is included 55138032Speter automatically. 55238032Speter 55338032Spetersmtp The Simple Mail Transport Protocol mailer. This does 55438032Speter not hide hosts behind a gateway or another other 55538032Speter such hack; it assumes a world where everyone is 55638032Speter running the name server. This file actually defines 55764562Sgshapiro five mailers: "smtp" for regular (old-style) SMTP to 55838032Speter other servers, "esmtp" for extended SMTP to other 55938032Speter servers, "smtp8" to do SMTP to other servers without 56038032Speter converting 8-bit data to MIME (essentially, this is 56138032Speter your statement that you know the other end is 8-bit 56264562Sgshapiro clean even if it doesn't say so), "dsmtp" to do on 56364562Sgshapiro demand delivery, and "relay" for transmission to the 56464562Sgshapiro RELAY_HOST, LUSER_RELAY, or MAIL_HUB. 56538032Speter 56666494Sgshapirouucp The UNIX-to-UNIX Copy Program mailer. Actually, this 56738032Speter defines two mailers, "uucp-old" (a.k.a. "uucp") and 56838032Speter "uucp-new" (a.k.a. "suucp"). The latter is for when you 56938032Speter know that the UUCP mailer at the other end can handle 57038032Speter multiple recipients in one transfer. If the smtp mailer 57190792Sgshapiro is included in your configuration, two other mailers 57290792Sgshapiro ("uucp-dom" and "uucp-uudom") are also defined [warning: you 57390792Sgshapiro MUST specify MAILER(`smtp') before MAILER(`uucp')]. When you 57438032Speter include the uucp mailer, sendmail looks for all names in 57564562Sgshapiro class {U} and sends them to the uucp-old mailer; all 57664562Sgshapiro names in class {Y} are sent to uucp-new; and all 57764562Sgshapiro names in class {Z} are sent to uucp-uudom. Note that 57838032Speter this is a function of what version of rmail runs on 57938032Speter the receiving end, and hence may be out of your control. 58038032Speter See the section below describing UUCP mailers in more 58138032Speter detail. 58238032Speter 58338032Speterusenet Usenet (network news) delivery. If this is specified, 58438032Speter an extra rule is added to ruleset 0 that forwards all 58538032Speter local email for users named ``group.usenet'' to the 58638032Speter ``inews'' program. Note that this works for all groups, 58738032Speter and may be considered a security problem. 58838032Speter 58938032Speterfax Facsimile transmission. This is experimental and based 59038032Speter on Sam Leffler's HylaFAX software. For more information, 59171345Sgshapiro see http://www.hylafax.org/. 59238032Speter 59338032Speterpop Post Office Protocol. 59438032Speter 59538032Speterprocmail An interface to procmail (does not come with sendmail). 59638032Speter This is designed to be used in mailertables. For example, 59738032Speter a common question is "how do I forward all mail for a given 59838032Speter domain to a single person?". If you have this mailer 59938032Speter defined, you could set up a mailertable reading: 60038032Speter 60138032Speter host.com procmail:/etc/procmailrcs/host.com 60238032Speter 60338032Speter with the file /etc/procmailrcs/host.com reading: 60438032Speter 60538032Speter :0 # forward mail for host.com 60638032Speter ! -oi -f $1 person@other.host 60738032Speter 60838032Speter This would arrange for (anything)@host.com to be sent 60938032Speter to person@other.host. Within the procmail script, $1 is 61038032Speter the name of the sender and $2 is the name of the recipient. 61143730Speter If you use this with FEATURE(`local_procmail'), the FEATURE 61238032Speter should be listed first. 61338032Speter 61490792Sgshapiro Of course there are other ways to solve this particular 61590792Sgshapiro problem, e.g., a catch-all entry in a virtusertable. 61690792Sgshapiro 61738032Spetermail11 The DECnet mail11 mailer, useful only if you have the mail11 61838032Speter program from gatekeeper.dec.com:/pub/DEC/gwtools (and 61938032Speter DECnet, of course). This is for Phase IV DECnet support; 62038032Speter if you have Phase V at your site you may have additional 62138032Speter problems. 62238032Speter 62338032Speterphquery The phquery program. This is somewhat counterintuitively 62438032Speter referenced as the "ph" mailer internally. It can be used 62538032Speter to do CCSO name server lookups. The phquery program, which 62638032Speter this mailer uses, is distributed with the ph client. 62738032Speter 62838032Spetercyrus The cyrus and cyrusbb mailers. The cyrus mailer delivers to 62938032Speter a local cyrus user. this mailer can make use of the 63090792Sgshapiro "user+detail@local.host" syntax (see 63190792Sgshapiro FEATURE(`preserve_local_plus_detail')); it will deliver the 63290792Sgshapiro mail to the user's "detail" mailbox if the mailbox's ACL 63390792Sgshapiro permits. The cyrusbb mailer delivers to a system-wide 63490792Sgshapiro cyrus mailbox if the mailbox's ACL permits. The cyrus 63590792Sgshapiro mailer must be defined after the local mailer. 63638032Speter 63764562Sgshapiroqpage A mailer for QuickPage, a pager interface. See 63864562Sgshapiro http://www.qpage.org/ for further information. 63938032Speter 64038032SpeterThe local mailer accepts addresses of the form "user+detail", where 64138032Speterthe "+detail" is not used for mailbox matching but is available 64243730Speterto certain local mail programs (in particular, see 64343730SpeterFEATURE(`local_procmail')). For example, "eric", "eric+sendmail", and 64443730Speter"eric+sww" all indicate the same user, but additional arguments <null>, 64543730Speter"sendmail", and "sww" may be provided for use in sorting mail. 64638032Speter 64738032Speter 64838032Speter+----------+ 64938032Speter| FEATURES | 65038032Speter+----------+ 65138032Speter 65238032SpeterSpecial features can be requested using the "FEATURE" macro. For 65338032Speterexample, the .mc line: 65438032Speter 65543730Speter FEATURE(`use_cw_file') 65638032Speter 65764562Sgshapirotells sendmail that you want to have it read an /etc/mail/local-host-names 65890792Sgshapirofile to get values for class {w}. A FEATURE may contain up to 9 65964562Sgshapirooptional parameters -- for example: 66038032Speter 66143730Speter FEATURE(`mailertable', `dbm /usr/lib/mailertable') 66238032Speter 66338032SpeterThe default database map type for the table features can be set with 66464562Sgshapiro 66538032Speter define(`DATABASE_MAP_TYPE', `dbm') 66638032Speter 66738032Speterwhich would set it to use ndbm databases. The default is the Berkeley DB 66838032Speterhash database format. Note that you must still declare a database map type 66938032Speterif you specify an argument to a FEATURE. DATABASE_MAP_TYPE is only used 67064562Sgshapiroif no argument is given for the FEATURE. It must be specified before any 67164562Sgshapirofeature that uses a map. 67238032Speter 67390792SgshapiroAlso, features which can take a map definition as an argument can also take 67490792Sgshapirothe special keyword `LDAP'. If that keyword is used, the map will use the 67590792SgshapiroLDAP definition described in the ``USING LDAP FOR ALIASES, MAPS, AND 67690792SgshapiroCLASSES'' section below. 67790792Sgshapiro 67838032SpeterAvailable features are: 67938032Speter 68064562Sgshapirouse_cw_file Read the file /etc/mail/local-host-names file to get 68164562Sgshapiro alternate names for this host. This might be used if you 68264562Sgshapiro were on a host that MXed for a dynamic set of other hosts. 68364562Sgshapiro If the set is static, just including the line "Cw<name1> 68464562Sgshapiro <name2> ..." (where the names are fully qualified domain 68564562Sgshapiro names) is probably superior. The actual filename can be 68664562Sgshapiro overridden by redefining confCW_FILE. 68738032Speter 68864562Sgshapirouse_ct_file Read the file /etc/mail/trusted-users file to get the 68964562Sgshapiro names of users that will be ``trusted'', that is, able to 69064562Sgshapiro set their envelope from address using -f without generating 69164562Sgshapiro a warning message. The actual filename can be overridden 69264562Sgshapiro by redefining confCT_FILE. 69338032Speter 69438032Speterredirect Reject all mail addressed to "address.REDIRECT" with 69564562Sgshapiro a ``551 User has moved; please try <address>'' message. 69638032Speter If this is set, you can alias people who have left 69738032Speter to their new address with ".REDIRECT" appended. 69838032Speter 69964562Sgshapironouucp Don't route UUCP addresses. This feature takes one 70064562Sgshapiro parameter: 70164562Sgshapiro `reject': reject addresses which have "!" in the local 70264562Sgshapiro part unless it originates from a system 70364562Sgshapiro that is allowed to relay. 70464562Sgshapiro `nospecial': don't do anything special with "!". 70590792Sgshapiro Warnings: 1. See the notice in the anti-spam section. 70664562Sgshapiro 2. don't remove "!" from OperatorChars if `reject' is 70764562Sgshapiro given as parameter. 70838032Speter 70964562Sgshapironocanonify Don't pass addresses to $[ ... $] for canonification 71071345Sgshapiro by default, i.e., host/domain names are considered canonical, 71171345Sgshapiro except for unqualified names, which must not be used in this 71271345Sgshapiro mode (violation of the standard). It can be changed by 71371345Sgshapiro setting the DaemonPortOptions modifiers (M=). That is, 71464562Sgshapiro FEATURE(`nocanonify') will be overridden by setting the 71564562Sgshapiro 'c' flag. Conversely, if FEATURE(`nocanonify') is not used, 71664562Sgshapiro it can be emulated by setting the 'C' flag 71764562Sgshapiro (DaemonPortOptions=Modifiers=C). This would generally only 71864562Sgshapiro be used by sites that only act as mail gateways or which have 71964562Sgshapiro user agents that do full canonification themselves. You may 72064562Sgshapiro also want to use 72164562Sgshapiro "define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')" to turn off 72264562Sgshapiro the usual resolver options that do a similar thing. 72338032Speter 72464562Sgshapiro An exception list for FEATURE(`nocanonify') can be 72564562Sgshapiro specified with CANONIFY_DOMAIN or CANONIFY_DOMAIN_FILE, 72664562Sgshapiro i.e., a list of domains which are nevertheless passed to 72764562Sgshapiro $[ ... $] for canonification. This is useful to turn on 72864562Sgshapiro canonification for local domains, e.g., use 72964562Sgshapiro CANONIFY_DOMAIN(`my.domain my') to canonify addresses 73064562Sgshapiro which end in "my.domain" or "my". 73164562Sgshapiro Another way to require canonification in the local 73264562Sgshapiro domain is CANONIFY_DOMAIN(`$=m'). 73364562Sgshapiro 73464562Sgshapiro A trailing dot is added to addresses with more than 73564562Sgshapiro one component in it such that other features which 73664562Sgshapiro expect a trailing dot (e.g., virtusertable) will 73764562Sgshapiro still work. 73864562Sgshapiro 73964562Sgshapiro If `canonify_hosts' is specified as parameter, i.e., 74064562Sgshapiro FEATURE(`nocanonify', `canonify_hosts'), then 74164562Sgshapiro addresses which have only a hostname, e.g., 74264562Sgshapiro <user@host>, will be canonified (and hopefully fully 74364562Sgshapiro qualified), too. 74464562Sgshapiro 74571345Sgshapirostickyhost This feature is sometimes used with LOCAL_RELAY, 74671345Sgshapiro although it can be used for a different effect with 74771345Sgshapiro MAIL_HUB. 74838032Speter 74973188Sgshapiro When used without MAIL_HUB, email sent to 75071345Sgshapiro "user@local.host" are marked as "sticky" -- that 75171345Sgshapiro is, the local addresses aren't matched against UDB, 75271345Sgshapiro don't go through ruleset 5, and are not forwarded to 75371345Sgshapiro the LOCAL_RELAY (if defined). 75471345Sgshapiro 75571345Sgshapiro With MAIL_HUB, mail addressed to "user@local.host" 75671345Sgshapiro is forwarded to the mail hub, with the envelope 75771345Sgshapiro address still remaining "user@local.host". 75871345Sgshapiro Without stickyhost, the envelope would be changed 75971345Sgshapiro to "user@mail_hub", in order to protect against 76071345Sgshapiro mailing loops. 76171345Sgshapiro 76238032Spetermailertable Include a "mailer table" which can be used to override 76364562Sgshapiro routing for particular domains (which are not in class {w}, 76464562Sgshapiro i.e. local host names). The argument of the FEATURE may be 76564562Sgshapiro the key definition. If none is specified, the definition 76664562Sgshapiro used is: 76743730Speter 76864562Sgshapiro hash /etc/mail/mailertable 76943730Speter 77038032Speter Keys in this database are fully qualified domain names 77138032Speter or partial domains preceded by a dot -- for example, 77264562Sgshapiro "vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU". As a 77364562Sgshapiro special case of the latter, "." matches any domain not 77464562Sgshapiro covered by other keys. Values must be of the form: 77538032Speter mailer:domain 77638032Speter where "mailer" is the internal mailer name, and "domain" 77738032Speter is where to send the message. These maps are not 77838032Speter reflected into the message header. As a special case, 77938032Speter the forms: 78038032Speter local:user 78138032Speter will forward to the indicated user using the local mailer, 78238032Speter local: 78338032Speter will forward to the original user in the e-mail address 78438032Speter using the local mailer, and 78538032Speter error:code message 78664562Sgshapiro error:D.S.N:code message 78764562Sgshapiro will give an error message with the indicated SMTP reply 78864562Sgshapiro code and message, where D.S.N is an RFC 1893 compliant 78964562Sgshapiro error code. 79038032Speter 79138032Speterdomaintable Include a "domain table" which can be used to provide 79238032Speter domain name mapping. Use of this should really be 79338032Speter limited to your own domains. It may be useful if you 79438032Speter change names (e.g., your company changes names from 79538032Speter oldname.com to newname.com). The argument of the 79638032Speter FEATURE may be the key definition. If none is specified, 79738032Speter the definition used is: 79843730Speter 79964562Sgshapiro hash /etc/mail/domaintable 80043730Speter 80138032Speter The key in this table is the domain name; the value is 80238032Speter the new (fully qualified) domain. Anything in the 80338032Speter domaintable is reflected into headers; that is, this 80438032Speter is done in ruleset 3. 80538032Speter 80638032Speterbitdomain Look up bitnet hosts in a table to try to turn them into 80738032Speter internet addresses. The table can be built using the 80838032Speter bitdomain program contributed by John Gardiner Myers. 80938032Speter The argument of the FEATURE may be the key definition; if 81038032Speter none is specified, the definition used is: 81143730Speter 81264562Sgshapiro hash /etc/mail/bitdomain 81343730Speter 81438032Speter Keys are the bitnet hostname; values are the corresponding 81538032Speter internet hostname. 81638032Speter 81738032Speteruucpdomain Similar feature for UUCP hosts. The default map definition 81838032Speter is: 81943730Speter 82064562Sgshapiro hash /etc/mail/uudomain 82143730Speter 82238032Speter At the moment there is no automagic tool to build this 82338032Speter database. 82438032Speter 82538032Speteralways_add_domain 82638032Speter Include the local host domain even on locally delivered 82738032Speter mail. Normally it is not added on unqualified names. 82838032Speter However, if you use a shared message store but do not use 82938032Speter the same user name space everywhere, you may need the host 83090792Sgshapiro name on local names. An optional argument specifies 83190792Sgshapiro another domain to be added than the local. 83238032Speter 83338032Speterallmasquerade If masquerading is enabled (using MASQUERADE_AS), this 83438032Speter feature will cause recipient addresses to also masquerade 83538032Speter as being from the masquerade host. Normally they get 83638032Speter the local hostname. Although this may be right for 83738032Speter ordinary users, it can break local aliases. For example, 83838032Speter if you send to "localalias", the originating sendmail will 83938032Speter find that alias and send to all members, but send the 84038032Speter message with "To: localalias@masqueradehost". Since that 84138032Speter alias likely does not exist, replies will fail. Use this 84238032Speter feature ONLY if you can guarantee that the ENTIRE 84338032Speter namespace on your masquerade host supersets all the 84438032Speter local entries. 84538032Speter 84638032Speterlimited_masquerade 84764562Sgshapiro Normally, any hosts listed in class {w} are masqueraded. If 84864562Sgshapiro this feature is given, only the hosts listed in class {M} (see 84964562Sgshapiro below: MASQUERADE_DOMAIN) are masqueraded. This is useful 85064562Sgshapiro if you have several domains with disjoint namespaces hosted 85164562Sgshapiro on the same machine. 85238032Speter 85338032Spetermasquerade_entire_domain 85464562Sgshapiro If masquerading is enabled (using MASQUERADE_AS) and 85538032Speter MASQUERADE_DOMAIN (see below) is set, this feature will 85638032Speter cause addresses to be rewritten such that the masquerading 85738032Speter domains are actually entire domains to be hidden. All 85838032Speter hosts within the masquerading domains will be rewritten 85938032Speter to the masquerade name (used in MASQUERADE_AS). For example, 86038032Speter if you have: 86138032Speter 86264562Sgshapiro MASQUERADE_AS(`masq.com') 86364562Sgshapiro MASQUERADE_DOMAIN(`foo.org') 86464562Sgshapiro MASQUERADE_DOMAIN(`bar.com') 86538032Speter 86638032Speter then *foo.org and *bar.com are converted to masq.com. Without 86738032Speter this feature, only foo.org and bar.com are masqueraded. 86838032Speter 86938032Speter NOTE: only domains within your jurisdiction and 87038032Speter current hierarchy should be masqueraded using this. 87138032Speter 87290792Sgshapirolocal_no_masquerade 87390792Sgshapiro This feature prevents the local mailer from masquerading even 87490792Sgshapiro if MASQUERADE_AS is used. MASQUERADE_AS will only have effect 87590792Sgshapiro on addresses of mail going outside the local domain. 87690792Sgshapiro 87764562Sgshapirogenericstable This feature will cause unqualified addresses (i.e., without 87864562Sgshapiro a domain) and addresses with a domain listed in class {G} 87964562Sgshapiro to be looked up in a map and turned into another ("generic") 88064562Sgshapiro form, which can change both the domain name and the user name. 88190792Sgshapiro Notice: if you use an MSP (as it is default starting with 88290792Sgshapiro 8.12), the MTA will only receive qualified addresses from the 88390792Sgshapiro MSP (as required by the RFCs). Hence you need to add your 88490792Sgshapiro domain to class {G}. This feature is similar to the userdb 88590792Sgshapiro functionality. The same types of addresses as for 88690792Sgshapiro masquerading are looked up, i.e., only header sender 88790792Sgshapiro addresses unless the allmasquerade and/or masquerade_envelope 88890792Sgshapiro features are given. Qualified addresses must have the domain 88990792Sgshapiro part in class {G}; entries can be added to this class by the 89090792Sgshapiro macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE (analogously 89190792Sgshapiro to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below). 89238032Speter 89343730Speter The argument of FEATURE(`genericstable') may be the map 89438032Speter definition; the default map definition is: 89538032Speter 89664562Sgshapiro hash /etc/mail/genericstable 89738032Speter 89864562Sgshapiro The key for this table is either the full address, the domain 89964562Sgshapiro (with a leading @; the localpart is passed as first argument) 90064562Sgshapiro or the unqualified username (tried in the order mentioned); 90164562Sgshapiro the value is the new user address. If the new user address 90264562Sgshapiro does not include a domain, it will be qualified in the standard 90364562Sgshapiro manner, i.e., using $j or the masquerade name. Note that the 90438032Speter address being looked up must be fully qualified. For local 90543730Speter mail, it is necessary to use FEATURE(`always_add_domain') 90643730Speter for the addresses to be qualified. 90764562Sgshapiro The "+detail" of an address is passed as %1, so entries like 90838032Speter 90964562Sgshapiro old+*@foo.org new+%1@example.com 91064562Sgshapiro gen+*@foo.org %1@example.com 91164562Sgshapiro 91264562Sgshapiro and other forms are possible. 91364562Sgshapiro 91464562Sgshapirogenerics_entire_domain 91564562Sgshapiro If the genericstable is enabled and GENERICS_DOMAIN or 91664562Sgshapiro GENERICS_DOMAIN_FILE is used, this feature will cause 91764562Sgshapiro addresses to be searched in the map if their domain 91864562Sgshapiro parts are subdomains of elements in class {G}. 91964562Sgshapiro 92038032Spetervirtusertable A domain-specific form of aliasing, allowing multiple 92138032Speter virtual domains to be hosted on one machine. For example, 92238032Speter if the virtuser table contained: 92338032Speter 92438032Speter info@foo.com foo-info 92538032Speter info@bar.com bar-info 92690792Sgshapiro joe@bar.com error:nouser 550 No such user here 92790792Sgshapiro jax@bar.com error:5.7.0:550 Address invalid 92864562Sgshapiro @baz.org jane@example.net 92938032Speter 93038032Speter then mail addressed to info@foo.com will be sent to the 93138032Speter address foo-info, mail addressed to info@bar.com will be 93264562Sgshapiro delivered to bar-info, and mail addressed to anyone at baz.org 93364562Sgshapiro will be sent to jane@example.net, mail to joe@bar.com will 93464562Sgshapiro be rejected with the specified error message, and mail to 93564562Sgshapiro jax@bar.com will also have a RFC 1893 compliant error code 93690792Sgshapiro 5.7.0. 93738032Speter 93864562Sgshapiro The username from the original address is passed 93964562Sgshapiro as %1 allowing: 94038032Speter 94164562Sgshapiro @foo.org %1@example.com 94238032Speter 94364562Sgshapiro meaning someone@foo.org will be sent to someone@example.com. 94464562Sgshapiro Additionally, if the local part consists of "user+detail" 94590792Sgshapiro then "detail" is passed as %2 and "+detail" is passed as %3 94690792Sgshapiro when a match against user+* is attempted, so entries like 94764562Sgshapiro 94864562Sgshapiro old+*@foo.org new+%2@example.com 94964562Sgshapiro gen+*@foo.org %2@example.com 95090792Sgshapiro +*@foo.org %1%3@example.com 95190792Sgshapiro X++@foo.org Z%3@example.com 95290792Sgshapiro @bar.org %1%3 95364562Sgshapiro 95464562Sgshapiro and other forms are possible. Note: to preserve "+detail" 95590792Sgshapiro for a default case (@domain) %1%3 must be used as RHS. 95690792Sgshapiro There are two wildcards after "+": "+" matches only a non-empty 95790792Sgshapiro detail, "*" matches also empty details, e.g., user+@foo.org 95890792Sgshapiro matches +*@foo.org but not ++@foo.org. This can be used 95990792Sgshapiro to ensure that the parameters %2 and %3 are not empty. 96064562Sgshapiro 96138032Speter All the host names on the left hand side (foo.com, bar.com, 96290792Sgshapiro and baz.org) must be in class {w} or class {VirtHost}. The 96364562Sgshapiro latter can be defined by the macros VIRTUSER_DOMAIN or 96464562Sgshapiro VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 96564562Sgshapiro MASQUERADE_DOMAIN_FILE, see below). If VIRTUSER_DOMAIN or 96664562Sgshapiro VIRTUSER_DOMAIN_FILE is used, then the entries of class 96764562Sgshapiro {VirtHost} are added to class {R}, i.e., relaying is allowed 96864562Sgshapiro to (and from) those domains. The default map definition is: 96938032Speter 97064562Sgshapiro hash /etc/mail/virtusertable 97138032Speter 97238032Speter A new definition can be specified as the second argument of 97338032Speter the FEATURE macro, such as 97438032Speter 97564562Sgshapiro FEATURE(`virtusertable', `dbm /etc/mail/virtusers') 97638032Speter 97764562Sgshapirovirtuser_entire_domain 97864562Sgshapiro If the virtusertable is enabled and VIRTUSER_DOMAIN or 97964562Sgshapiro VIRTUSER_DOMAIN_FILE is used, this feature will cause 98064562Sgshapiro addresses to be searched in the map if their domain 98164562Sgshapiro parts are subdomains of elements in class {VirtHost}. 98264562Sgshapiro 98364562Sgshapiroldap_routing Implement LDAP-based e-mail recipient routing according to 98464562Sgshapiro the Internet Draft draft-lachman-laser-ldap-mail-routing-01. 98564562Sgshapiro This provides a method to re-route addresses with a 98664562Sgshapiro domain portion in class {LDAPRoute} to either a 98764562Sgshapiro different mail host or a different address. Hosts can 98864562Sgshapiro be added to this class using LDAPROUTE_DOMAIN and 98964562Sgshapiro LDAPROUTE_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 99064562Sgshapiro MASQUERADE_DOMAIN_FILE, see below). 99164562Sgshapiro 99264562Sgshapiro See the LDAP ROUTING section below for more information. 99364562Sgshapiro 99464562Sgshapironodns If you aren't running DNS at your site (for example, 99564562Sgshapiro you are UUCP-only connected). It's hard to consider 99638032Speter this a "feature", but hey, it had to go somewhere. 99738032Speter Actually, as of 8.7 this is a no-op -- remove "dns" from 99838032Speter the hosts service switch entry instead. 99938032Speter 100064562Sgshapironullclient This is a special case -- it creates a configuration file 100164562Sgshapiro containing nothing but support for forwarding all mail to a 100264562Sgshapiro central hub via a local SMTP-based network. The argument 100364562Sgshapiro is the name of that hub. 100464562Sgshapiro 100538032Speter The only other feature that should be used in conjunction 100664562Sgshapiro with this one is FEATURE(`nocanonify'). No mailers 100738032Speter should be defined. No aliasing or forwarding is done. 100838032Speter 100938032Speterlocal_lmtp Use an LMTP capable local mailer. The argument to this 101038032Speter feature is the pathname of an LMTP capable mailer. By 101138032Speter default, mail.local is used. This is expected to be the 101238032Speter mail.local which came with the 8.9 distribution which is 101338032Speter LMTP capable. The path to mail.local is set by the 101438032Speter confEBINDIR m4 variable -- making the default 101538032Speter LOCAL_MAILER_PATH /usr/libexec/mail.local. 101664562Sgshapiro WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally, 101764562Sgshapiro i.e., without respecting any definitions in an OSTYPE setting. 101838032Speter 101964562Sgshapirolocal_procmail Use procmail or another delivery agent as the local mailer. 102064562Sgshapiro The argument to this feature is the pathname of the 102164562Sgshapiro delivery agent, which defaults to PROCMAIL_MAILER_PATH. 102264562Sgshapiro Note that this does NOT use PROCMAIL_MAILER_FLAGS or 102364562Sgshapiro PROCMAIL_MAILER_ARGS for the local mailer; tweak 102464562Sgshapiro LOCAL_MAILER_FLAGS and LOCAL_MAILER_ARGS instead, or 102564562Sgshapiro specify the appropriate parameters. When procmail is used, 102664562Sgshapiro the local mailer can make use of the 102764562Sgshapiro "user+indicator@local.host" syntax; normally the +indicator 102864562Sgshapiro is just tossed, but by default it is passed as the -a 102964562Sgshapiro argument to procmail. 103038032Speter 103164562Sgshapiro This feature can take up to three arguments: 103264562Sgshapiro 103364562Sgshapiro 1. Path to the mailer program 103464562Sgshapiro [default: /usr/local/bin/procmail] 103564562Sgshapiro 2. Argument vector including name of the program 103664562Sgshapiro [default: procmail -Y -a $h -d $u] 103764562Sgshapiro 3. Flags for the mailer [default: SPfhn9] 103864562Sgshapiro 103964562Sgshapiro Empty arguments cause the defaults to be taken. 104064562Sgshapiro 104164562Sgshapiro For example, this allows it to use the maildrop 104264562Sgshapiro (http://www.flounder.net/~mrsam/maildrop/) mailer instead 104364562Sgshapiro by specifying: 104464562Sgshapiro 104564562Sgshapiro FEATURE(`local_procmail', `/usr/local/bin/maildrop', 104664562Sgshapiro `maildrop -d $u') 104764562Sgshapiro 104864562Sgshapiro or scanmails using: 104964562Sgshapiro 105064562Sgshapiro FEATURE(`local_procmail', `/usr/local/bin/scanmails') 105164562Sgshapiro 105264562Sgshapiro WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally, 105364562Sgshapiro i.e., without respecting any definitions in an OSTYPE setting. 105464562Sgshapiro 105538032Speterbestmx_is_local Accept mail as though locally addressed for any host that 105638032Speter lists us as the best possible MX record. This generates 105738032Speter additional DNS traffic, but should be OK for low to 105838032Speter medium traffic hosts. The argument may be a set of 105938032Speter domains, which will limit the feature to only apply to 106038032Speter these domains -- this will reduce unnecessary DNS 106138032Speter traffic. THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH 106238032Speter WILDCARD MX RECORDS!!! If you have a wildcard MX record 106338032Speter that matches your domain, you cannot use this feature. 106438032Speter 106538032Spetersmrsh Use the SendMail Restricted SHell (smrsh) provided 106638032Speter with the distribution instead of /bin/sh for mailing 106738032Speter to programs. This improves the ability of the local 106838032Speter system administrator to control what gets run via 106938032Speter e-mail. If an argument is provided it is used as the 107038032Speter pathname to smrsh; otherwise, the path defined by 107138032Speter confEBINDIR is used for the smrsh binary -- by default, 107238032Speter /usr/libexec/smrsh is assumed. 107338032Speter 107438032Speterpromiscuous_relay 107538032Speter By default, the sendmail configuration files do not permit 107638032Speter mail relaying (that is, accepting mail from outside your 107764562Sgshapiro local host (class {w}) and sending it to another host than 107864562Sgshapiro your local host). This option sets your site to allow 107964562Sgshapiro mail relaying from any site to any site. In almost all 108064562Sgshapiro cases, it is better to control relaying more carefully 108164562Sgshapiro with the access map, class {R}, or authentication. Domains 108264562Sgshapiro can be added to class {R} by the macros RELAY_DOMAIN or 108364562Sgshapiro RELAY_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 108464562Sgshapiro MASQUERADE_DOMAIN_FILE, see below). 108538032Speter 108638032Speterrelay_entire_domain 108738032Speter By default, only hosts listed as RELAY in the access db 108838032Speter will be allowed to relay. This option also allows any 108964562Sgshapiro host in your domain as defined by class {m}. 109094334Sgshapiro Notice: make sure that your domain is not just a top level 109194334Sgshapiro domain, e.g., com. This can happen if you give your 109294334Sgshapiro host a name like example.com instead of host.example.com. 109338032Speter 109438032Speterrelay_hosts_only 109538032Speter By default, names that are listed as RELAY in the access 109664562Sgshapiro db and class {R} are domain names, not host names. 109738032Speter For example, if you specify ``foo.com'', then mail to or 109838032Speter from foo.com, abc.foo.com, or a.very.deep.domain.foo.com 109938032Speter will all be accepted for relaying. This feature changes 110038032Speter the behaviour to lookup individual host names only. 110138032Speter 110238032Speterrelay_based_on_MX 110338032Speter Turns on the ability to allow relaying based on the MX 110442575Speter records of the host portion of an incoming recipient; that 110542575Speter is, if an MX record for host foo.com points to your site, 110642575Speter you will accept and relay mail addressed to foo.com. See 110738032Speter description below for more information before using this 110842575Speter feature. Also, see the KNOWNBUGS entry regarding bestmx 110942575Speter map lookups. 111038032Speter 111143730Speter FEATURE(`relay_based_on_MX') does not necessarily allow 111242575Speter routing of these messages which you expect to be allowed, 111342575Speter if route address syntax (or %-hack syntax) is used. If 111442575Speter this is a problem, add entries to the access-table or use 111543730Speter FEATURE(`loose_relay_check'). 111642575Speter 111764562Sgshapirorelay_mail_from 111864562Sgshapiro Allows relaying if the mail sender is listed as RELAY in 111964562Sgshapiro the access map. If an optional argument `domain' is given, 112090792Sgshapiro relaying can be allowed just based on the domain portion 112190792Sgshapiro of the sender address. This feature should only be used if 112290792Sgshapiro absolutely necessary as the sender address can be easily 112390792Sgshapiro forged. Use of this feature requires the "From:" tag be 112490792Sgshapiro prepended to the key in the access map; see the discussion 112590792Sgshapiro of tags and FEATURE(`relay_mail_from') in the section on 112690792Sgshapiro anti-spam configuration control. 112764562Sgshapiro 112838032Speterrelay_local_from 112938032Speter Allows relaying if the domain portion of the mail sender 113038032Speter is a local host. This should only be used if absolutely 113142575Speter necessary as it opens a window for spammers. Specifically, 113242575Speter they can send mail to your mail server that claims to be 113342575Speter from your domain (either directly or via a routed address), 113442575Speter and you will go ahead and relay it out to arbitrary hosts 113542575Speter on the Internet. 113664562Sgshapiro 113738032Speteraccept_unqualified_senders 113838032Speter Normally, MAIL FROM: commands in the SMTP session will be 113938032Speter refused if the connection is a network connection and the 114038032Speter sender address does not include a domain name. If your 114164562Sgshapiro setup sends local mail unqualified (i.e., MAIL FROM: <joe>), 114238032Speter you will need to use this feature to accept unqualified 114364562Sgshapiro sender addresses. Setting the DaemonPortOptions modifier 114464562Sgshapiro 'u' overrides the default behavior, i.e., unqualified 114564562Sgshapiro addresses are accepted even without this FEATURE. 114664562Sgshapiro If this FEATURE is not used, the DaemonPortOptions modifier 114764562Sgshapiro 'f' can be used to enforce fully qualified addresses. 114864562Sgshapiro 114938032Speteraccept_unresolvable_domains 115038032Speter Normally, MAIL FROM: commands in the SMTP session will be 115164562Sgshapiro refused if the host part of the argument to MAIL FROM: 115264562Sgshapiro cannot be located in the host name service (e.g., an A or 115364562Sgshapiro MX record in DNS). If you are inside a firewall that has 115464562Sgshapiro only a limited view of the Internet host name space, this 115564562Sgshapiro could cause problems. In this case you probably want to 115664562Sgshapiro use this feature to accept all domains on input, even if 115764562Sgshapiro they are unresolvable. 115838032Speter 115938032Speteraccess_db Turns on the access database feature. The access db gives 116038032Speter you the ability to allow or refuse to accept mail from 116190792Sgshapiro specified domains for administrative reasons. Moreover, 116290792Sgshapiro it can control the behavior of sendmail in various situations. 116390792Sgshapiro By default, the access database specification is: 116438032Speter 116590792Sgshapiro hash -T<TMPF> /etc/mail/access 116643730Speter 116790792Sgshapiro See the anti-spam configuration control section for further 116890792Sgshapiro important information about this feature. Notice: 116990792Sgshapiro "-T<TMPF>" is meant literal, do not replace it by anything. 117043730Speter 117138032Speterblacklist_recipients 117238032Speter Turns on the ability to block incoming mail for certain 117338032Speter recipient usernames, hostnames, or addresses. For 117438032Speter example, you can block incoming mail to user nobody, 117538032Speter host foo.mydomain.com, or guest@bar.mydomain.com. 117638032Speter These specifications are put in the access db as 117764562Sgshapiro described in the anti-spam configuration control section 117864562Sgshapiro later in this document. 117938032Speter 118071345Sgshapirodelay_checks The rulesets check_mail and check_relay will not be called 118171345Sgshapiro when a client connects or issues a MAIL command, respectively. 118271345Sgshapiro Instead, those rulesets will be called by the check_rcpt 118371345Sgshapiro ruleset; they will be skipped under certain circumstances. 118490792Sgshapiro See "Delay all checks" in the anti-spam configuration control 118590792Sgshapiro section. Note: this feature is incompatible to the versions 118690792Sgshapiro in 8.10 and 8.11. 118771345Sgshapiro 118864562Sgshapirodnsbl Turns on rejection of hosts found in an DNS based rejection 118964562Sgshapiro list. If an argument is provided it is used as the domain 119064562Sgshapiro in which blocked hosts are listed; otherwise it defaults to 119171345Sgshapiro blackholes.mail-abuse.org. An explanation for an DNS based 119290792Sgshapiro rejection list can be found at http://mail-abuse.org/rbl/. 119390792Sgshapiro A second argument can be used to change the default error 119490792Sgshapiro message. Without that second argument, the error message 119590792Sgshapiro will be 119690792Sgshapiro Mail from IP-ADDRESS refused by blackhole site SERVER 119790792Sgshapiro where IP-ADDRESS and SERVER are replaced by the appropriate 119890792Sgshapiro information. By default, temporary lookup failures are 119990792Sgshapiro ignored. This behavior can be changed by specifying a 120090792Sgshapiro third argument, which must be either `t' or a full error 120190792Sgshapiro message. See the anti-spam configuration control section for 120290792Sgshapiro an example. The dnsbl feature can be included several times 120390792Sgshapiro to query different DNS based rejection lists. See also 120490792Sgshapiro enhdnsbl for an enhanced version. 120564562Sgshapiro 120680785Sgshapiro NOTE: The default DNS blacklist, blackholes.mail-abuse.org, 120780785Sgshapiro is a service offered by the Mail Abuse Prevention System 120880785Sgshapiro (MAPS). As of July 31, 2001, MAPS is a subscription 120980785Sgshapiro service, so using that network address won't work if you 121080785Sgshapiro haven't subscribed. Contact MAPS to subscribe 121180785Sgshapiro (http://mail-abuse.org/). 121280785Sgshapiro 121390792Sgshapiroenhdnsbl Enhanced version of dnsbl (see above). Further arguments 121490792Sgshapiro (up to 5) can be used to specify specific return values 121590792Sgshapiro from lookups. Temporary lookup failures are ignored unless 121690792Sgshapiro a third argument is given, which must be either `t' or a full 121790792Sgshapiro error message. By default, any successful lookup will 121890792Sgshapiro generate an error. Otherwise the result of the lookup is 121990792Sgshapiro compared with the supplied argument(s), and only if a match 122090792Sgshapiro occurs an error is generated. For example, 122190792Sgshapiro 122290792Sgshapiro FEATURE(`enhdnsbl', `dnsbl.example.com', `', `t', `127.0.0.2.') 122390792Sgshapiro 122490792Sgshapiro will reject the e-mail if the lookup returns the value 122590792Sgshapiro ``127.0.0.2.'', or generate a 451 response if the lookup 122690792Sgshapiro temporarily failed. The arguments can contain metasymbols 122790792Sgshapiro as they are allowed in the LHS of rules. As the example 122890792Sgshapiro shows, the default values are also used if an empty argument, 122990792Sgshapiro i.e., `', is specified. This feature requires that sendmail 123090792Sgshapiro has been compiled with the flag DNSMAP (see sendmail/README). 123190792Sgshapiro 123290792Sgshapirolookupdotdomain Look up also .domain in the access map. This allows to 123390792Sgshapiro match only subdomains. It does not work well with 123490792Sgshapiro FEATURE(`relay_hosts_only'), because most lookups for 123590792Sgshapiro subdomains are suppressed by the latter feature. 123690792Sgshapiro 123738032Speterloose_relay_check 123864562Sgshapiro Normally, if % addressing is used for a recipient, e.g. 123964562Sgshapiro user%site@othersite, and othersite is in class {R}, the 124038032Speter check_rcpt ruleset will strip @othersite and recheck 124138032Speter user@site for relaying. This feature changes that 124238032Speter behavior. It should not be needed for most installations. 124338032Speter 124490792Sgshapiroauthinfo Provide a separate map for client side authentication 124590792Sgshapiro information. See SMTP AUTHENTICATION for details. 124690792Sgshapiro By default, the authinfo database specification is: 124790792Sgshapiro 124890792Sgshapiro hash /etc/mail/authinfo 124990792Sgshapiro 125090792Sgshapiropreserve_luser_host 125190792Sgshapiro Preserve the name of the recipient host if LUSER_RELAY is 125290792Sgshapiro used. Without this option, the domain part of the 125390792Sgshapiro recipient address will be replaced by the host specified as 125490792Sgshapiro LUSER_RELAY. This feature only works if the hostname is 125590792Sgshapiro passed to the mailer (see mailer triple in op.me). Note 125690792Sgshapiro that in the default configuration the local mailer does not 125790792Sgshapiro receive the hostname, i.e., the mailer triple has an empty 125890792Sgshapiro hostname. 125990792Sgshapiro 126090792Sgshapiropreserve_local_plus_detail 126190792Sgshapiro Preserve the +detail portion of the address when passing 126290792Sgshapiro address to local delivery agent. Disables alias and 126390792Sgshapiro .forward +detail stripping (e.g., given user+detail, only 126490792Sgshapiro that address will be looked up in the alias file; user+* and 126590792Sgshapiro user will not be looked up). Only use if the local 126690792Sgshapiro delivery agent in use supports +detail addressing. 126790792Sgshapiro 126890792Sgshapirocompat_check Enable ruleset check_compat to look up pairs of addresses 126990792Sgshapiro with the Compat: tag -- Compat:sender<@>recipient -- in the 127090792Sgshapiro access map. Valid values for the RHS include 127190792Sgshapiro DISCARD silently discard recipient 127290792Sgshapiro TEMP: return a temporary error 127390792Sgshapiro ERROR: return a permanent error 127490792Sgshapiro In the last two cases, a 4xy/5xy SMTP reply code should 127590792Sgshapiro follow the colon. 127690792Sgshapiro 127764562Sgshapirono_default_msa Don't generate the default MSA daemon, i.e., 127864562Sgshapiro DAEMON_OPTIONS(`Port=587,Name=MSA,M=E') 127964562Sgshapiro To define a MSA daemon with other parameters, use this 128064562Sgshapiro FEATURE and introduce new settings via DAEMON_OPTIONS(). 128138032Speter 128290792Sgshapiromsp Defines config file for Message Submission Program. 128394334Sgshapiro See sendmail/SECURITY for details and cf/cf/submit.mc how 128494334Sgshapiro to use it. An optional argument can be used to override 128594334Sgshapiro the default of `[localhost]' to use as host to send all 128694334Sgshapiro e-mails to. Note that MX records will be used if the 128794334Sgshapiro specified hostname is not in square brackets (e.g., 128894334Sgshapiro [hostname]). If `MSA' is specified as second argument then 128994334Sgshapiro port 587 is used to contact the server. Example: 129090792Sgshapiro 129190792Sgshapiro FEATURE(`msp', `', `MSA') 129290792Sgshapiro 129390792Sgshapiro Some more hints about possible changes can be found below 129490792Sgshapiro in the section MESSAGE SUBMISSION PROGRAM. 129590792Sgshapiro 129690792Sgshapiroqueuegroup A simple example how to select a queue group based 129790792Sgshapiro on the full e-mail address or the domain of the 129890792Sgshapiro recipient. Selection is done via entries in the 129990792Sgshapiro access map using the tag QGRP:, for example: 130090792Sgshapiro 130190792Sgshapiro QGRP:example.com main 130290792Sgshapiro QGRP:friend@some.org others 130390792Sgshapiro QGRP:my.domain local 130490792Sgshapiro 130590792Sgshapiro where "main", "others", and "local" are names of 130690792Sgshapiro queue groups. If an argument is specified, it is used 130790792Sgshapiro as default queue group. 130890792Sgshapiro 130994334Sgshapiro Note: please read the warning in doc/op/op.me about 131094334Sgshapiro queue groups and possible queue manipulations. 131194334Sgshapiro 131238032Speter+-------+ 131338032Speter| HACKS | 131438032Speter+-------+ 131538032Speter 131638032SpeterSome things just can't be called features. To make this clear, 131738032Speterthey go in the hack subdirectory and are referenced using the HACK 131838032Spetermacro. These will tend to be site-dependent. The release 131938032Speterincludes the Berkeley-dependent "cssubdomain" hack (that makes 132038032Spetersendmail accept local names in either Berkeley.EDU or CS.Berkeley.EDU; 132164562Sgshapirothis is intended as a short-term aid while moving hosts into 132238032Spetersubdomains. 132338032Speter 132438032Speter 132538032Speter+--------------------+ 132638032Speter| SITE CONFIGURATION | 132738032Speter+--------------------+ 132838032Speter 132938032Speter ***************************************************** 133038032Speter * This section is really obsolete, and is preserved * 133138032Speter * only for back compatibility. You should plan on * 133290792Sgshapiro * using mailertables for new installations. In * 133338032Speter * particular, it doesn't work for the newer forms * 133438032Speter * of UUCP mailers, such as uucp-uudom. * 133538032Speter ***************************************************** 133638032Speter 133738032SpeterComplex sites will need more local configuration information, such as 133838032Speterlists of UUCP hosts they speak with directly. This can get a bit more 133938032Spetertricky. For an example of a "complex" site, see cf/ucbvax.mc. 134038032Speter 134138032SpeterThe SITECONFIG macro allows you to indirectly reference site-dependent 134238032Speterconfiguration information stored in the siteconfig subdirectory. For 134338032Speterexample, the line 134438032Speter 134564562Sgshapiro SITECONFIG(`uucp.ucbvax', `ucbvax', `U') 134638032Speter 134738032Speterreads the file uucp.ucbvax for local connection information. The 134838032Spetersecond parameter is the local name (in this case just "ucbvax" since 134938032Speterit is locally connected, and hence a UUCP hostname). The third 135038032Speterparameter is the name of both a macro to store the local name (in 135164562Sgshapirothis case, {U}) and the name of the class (e.g., {U}) in which to store 135238032Speterthe host information read from the file. Another SITECONFIG line reads 135338032Speter 135464562Sgshapiro SITECONFIG(`uucp.ucbarpa', `ucbarpa.Berkeley.EDU', `W') 135538032Speter 135638032SpeterThis says that the file uucp.ucbarpa contains the list of UUCP sites 135764562Sgshapiroconnected to ucbarpa.Berkeley.EDU. Class {W} will be used to 135838032Speterstore this list, and $W is defined to be ucbarpa.Berkeley.EDU, that 135938032Speteris, the name of the relay to which the hosts listed in uucp.ucbarpa 136064562Sgshapiroare connected. [The machine ucbarpa is gone now, but this 136164562Sgshapiroout-of-date configuration file has been left around to demonstrate 136264562Sgshapirohow you might do this.] 136338032Speter 136438032SpeterNote that the case of SITECONFIG with a third parameter of ``U'' is 136538032Speterspecial; the second parameter is assumed to be the UUCP name of the 136638032Speterlocal site, rather than the name of a remote site, and the UUCP name 136764562Sgshapirois entered into class {w} (the list of local hostnames) as $U.UUCP. 136838032Speter 136938032SpeterThe siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing 137038032Spetermore than a sequence of SITE macros describing connectivity. For 137138032Speterexample: 137238032Speter 137364562Sgshapiro SITE(`cnmat') 137464562Sgshapiro SITE(`sgi olympus') 137538032Speter 137638032SpeterThe second example demonstrates that you can use two names on the 137738032Spetersame line; these are usually aliases for the same host (or are at 137838032Speterleast in the same company). 137938032Speter 138038032Speter 138138032Speter+--------------------+ 138238032Speter| USING UUCP MAILERS | 138338032Speter+--------------------+ 138438032Speter 138538032SpeterIt's hard to get UUCP mailers right because of the extremely ad hoc 138638032Speternature of UUCP addressing. These config files are really designed 138738032Speterfor domain-based addressing, even for UUCP sites. 138838032Speter 138938032SpeterThere are four UUCP mailers available. The choice of which one to 139038032Speteruse is partly a matter of local preferences and what is running at 139138032Speterthe other end of your UUCP connection. Unlike good protocols that 139238032Speterdefine what will go over the wire, UUCP uses the policy that you 139338032Spetershould do what is right for the other end; if they change, you have 139438032Speterto change. This makes it hard to do the right thing, and discourages 139538032Speterpeople from updating their software. In general, if you can avoid 139638032SpeterUUCP, please do. 139738032Speter 139838032SpeterThe major choice is whether to go for a domainized scheme or a 139938032Speternon-domainized scheme. This depends entirely on what the other 140038032Speterend will recognize. If at all possible, you should encourage the 140138032Speterother end to go to a domain-based system -- non-domainized addresses 140238032Speterdon't work entirely properly. 140338032Speter 140438032SpeterThe four mailers are: 140538032Speter 140638032Speter uucp-old (obsolete name: "uucp") 140738032Speter This is the oldest, the worst (but the closest to UUCP) way of 140838032Speter sending messages accros UUCP connections. It does bangify 140938032Speter everything and prepends $U (your UUCP name) to the sender's 141038032Speter address (which can already be a bang path itself). It can 141138032Speter only send to one address at a time, so it spends a lot of 141238032Speter time copying duplicates of messages. Avoid this if at all 141338032Speter possible. 141438032Speter 141538032Speter uucp-new (obsolete name: "suucp") 141638032Speter The same as above, except that it assumes that in one rmail 141738032Speter command you can specify several recipients. It still has a 141838032Speter lot of other problems. 141938032Speter 142038032Speter uucp-dom 142138032Speter This UUCP mailer keeps everything as domain addresses. 142238032Speter Basically, it uses the SMTP mailer rewriting rules. This mailer 142390792Sgshapiro is only included if MAILER(`smtp') is specified before 142490792Sgshapiro MAILER(`uucp'). 142538032Speter 142638032Speter Unfortunately, a lot of UUCP mailer transport agents require 142738032Speter bangified addresses in the envelope, although you can use 142838032Speter domain-based addresses in the message header. (The envelope 142938032Speter shows up as the From_ line on UNIX mail.) So.... 143038032Speter 143138032Speter uucp-uudom 143238032Speter This is a cross between uucp-new (for the envelope addresses) 143338032Speter and uucp-dom (for the header addresses). It bangifies the 143438032Speter envelope sender (From_ line in messages) without adding the 143538032Speter local hostname, unless there is no host name on the address 143638032Speter at all (e.g., "wolf") or the host component is a UUCP host name 143738032Speter instead of a domain name ("somehost!wolf" instead of 143864562Sgshapiro "some.dom.ain!wolf"). This is also included only if MAILER(`smtp') 143990792Sgshapiro is also specified earlier. 144038032Speter 144138032SpeterExamples: 144238032Speter 144364562SgshapiroOn host grasp.insa-lyon.fr (UUCP host name "grasp"), the following 144464562Sgshapirosummarizes the sender rewriting for various mailers. 144538032Speter 144666494SgshapiroMailer sender rewriting in the envelope 144738032Speter------ ------ ------------------------- 144838032Speteruucp-{old,new} wolf grasp!wolf 144938032Speteruucp-dom wolf wolf@grasp.insa-lyon.fr 145038032Speteruucp-uudom wolf grasp.insa-lyon.fr!wolf 145138032Speter 145238032Speteruucp-{old,new} wolf@fr.net grasp!fr.net!wolf 145338032Speteruucp-dom wolf@fr.net wolf@fr.net 145438032Speteruucp-uudom wolf@fr.net fr.net!wolf 145538032Speter 145638032Speteruucp-{old,new} somehost!wolf grasp!somehost!wolf 145738032Speteruucp-dom somehost!wolf somehost!wolf@grasp.insa-lyon.fr 145838032Speteruucp-uudom somehost!wolf grasp.insa-lyon.fr!somehost!wolf 145938032Speter 146038032SpeterIf you are using one of the domainized UUCP mailers, you really want 146138032Speterto convert all UUCP addresses to domain format -- otherwise, it will 146238032Speterdo it for you (and probably not the way you expected). For example, 146338032Speterif you have the address foo!bar!baz (and you are not sending to foo), 146438032Speterthe heuristics will add the @uucp.relay.name or @local.host.name to 146538032Speterthis address. However, if you map foo to foo.host.name first, it 146638032Speterwill not add the local hostname. You can do this using the uucpdomain 146738032Speterfeature. 146838032Speter 146938032Speter 147038032Speter+-------------------+ 147138032Speter| TWEAKING RULESETS | 147238032Speter+-------------------+ 147338032Speter 147438032SpeterFor more complex configurations, you can define special rules. 147538032SpeterThe macro LOCAL_RULE_3 introduces rules that are used in canonicalizing 147638032Speterthe names. Any modifications made here are reflected in the header. 147738032Speter 147838032SpeterA common use is to convert old UUCP addresses to SMTP addresses using 147938032Speterthe UUCPSMTP macro. For example: 148038032Speter 148138032Speter LOCAL_RULE_3 148264562Sgshapiro UUCPSMTP(`decvax', `decvax.dec.com') 148364562Sgshapiro UUCPSMTP(`research', `research.att.com') 148438032Speter 148538032Speterwill cause addresses of the form "decvax!user" and "research!user" 148638032Speterto be converted to "user@decvax.dec.com" and "user@research.att.com" 148738032Speterrespectively. 148838032Speter 148938032SpeterThis could also be used to look up hosts in a database map: 149038032Speter 149138032Speter LOCAL_RULE_3 149238032Speter R$* < @ $+ > $* $: $1 < @ $(hostmap $2 $) > $3 149338032Speter 149438032SpeterThis map would be defined in the LOCAL_CONFIG portion, as shown below. 149538032Speter 149638032SpeterSimilarly, LOCAL_RULE_0 can be used to introduce new parsing rules. 149738032SpeterFor example, new rules are needed to parse hostnames that you accept 149838032Spetervia MX records. For example, you might have: 149938032Speter 150038032Speter LOCAL_RULE_0 150138032Speter R$+ <@ host.dom.ain.> $#uucp $@ cnmat $: $1 < @ host.dom.ain.> 150238032Speter 150338032SpeterYou would use this if you had installed an MX record for cnmat.Berkeley.EDU 150438032Speterpointing at this host; this rule catches the message and forwards it on 150538032Speterusing UUCP. 150638032Speter 150738032SpeterYou can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2. 150838032SpeterThese rulesets are normally empty. 150938032Speter 151038032SpeterA similar macro is LOCAL_CONFIG. This introduces lines added after the 151164562Sgshapiroboilerplate option setting but before rulesets. Do not declare rulesets in 151264562Sgshapirothe LOCAL_CONFIG section. It can be used to declare local database maps or 151364562Sgshapirowhatever. For example: 151438032Speter 151538032Speter LOCAL_CONFIG 151664562Sgshapiro Khostmap hash /etc/mail/hostmap 151738032Speter Kyplocal nis -m hosts.byname 151838032Speter 151938032Speter 152038032Speter+---------------------------+ 152138032Speter| MASQUERADING AND RELAYING | 152238032Speter+---------------------------+ 152338032Speter 152438032SpeterYou can have your host masquerade as another using 152538032Speter 152664562Sgshapiro MASQUERADE_AS(`host.domain') 152738032Speter 152838032SpeterThis causes mail being sent to be labeled as coming from the 152938032Speterindicated host.domain, rather than $j. One normally masquerades as 153064562Sgshapiroone of one's own subdomains (for example, it's unlikely that 153164562SgshapiroBerkeley would choose to masquerade as an MIT site). This 153264562Sgshapirobehaviour is modified by a plethora of FEATUREs; in particular, see 153364562Sgshapiromasquerade_envelope, allmasquerade, limited_masquerade, and 153464562Sgshapiromasquerade_entire_domain. 153538032Speter 153638032SpeterThe masquerade name is not normally canonified, so it is important 153738032Speterthat it be your One True Name, that is, fully qualified and not a 153838032SpeterCNAME. However, if you use a CNAME, the receiving side may canonify 153938032Speterit for you, so don't think you can cheat CNAME mapping this way. 154038032Speter 154138032SpeterNormally the only addresses that are masqueraded are those that come 154264562Sgshapirofrom this host (that is, are either unqualified or in class {w}, the list 154364562Sgshapiroof local domain names). You can augment this list, which is realized 154464562Sgshapiroby class {M} using 154538032Speter 154664562Sgshapiro MASQUERADE_DOMAIN(`otherhost.domain') 154738032Speter 154838032SpeterThe effect of this is that although mail to user@otherhost.domain 154938032Speterwill not be delivered locally, any mail including any user@otherhost.domain 155038032Speterwill, when relayed, be rewritten to have the MASQUERADE_AS address. 155138032SpeterThis can be a space-separated list of names. 155238032Speter 155338032SpeterIf these names are in a file, you can use 155438032Speter 155564562Sgshapiro MASQUERADE_DOMAIN_FILE(`filename') 155638032Speter 155764562Sgshapiroto read the list of names from the indicated file (i.e., to add 155864562Sgshapiroelements to class {M}). 155938032Speter 156064562SgshapiroTo exempt hosts or subdomains from being masqueraded, you can use 156164562Sgshapiro 156264562Sgshapiro MASQUERADE_EXCEPTION(`host.domain') 156364562Sgshapiro 156464562SgshapiroThis can come handy if you want to masquerade a whole domain 156590792Sgshapiroexcept for one (or a few) host(s). If these names are in a file, 156690792Sgshapiroyou can use 156764562Sgshapiro 156890792Sgshapiro MASQUERADE_EXCEPTION_FILE(`filename') 156990792Sgshapiro 157038032SpeterNormally only header addresses are masqueraded. If you want to 157138032Spetermasquerade the envelope as well, use 157238032Speter 157343730Speter FEATURE(`masquerade_envelope') 157438032Speter 157538032SpeterThere are always users that need to be "exposed" -- that is, their 157638032Speterinternal site name should be displayed instead of the masquerade name. 157764562SgshapiroRoot is an example (which has been "exposed" by default prior to 8.10). 157864562SgshapiroYou can add users to this list using 157938032Speter 158064562Sgshapiro EXPOSED_USER(`usernames') 158138032Speter 158290792SgshapiroThis adds users to class {E}; you could also use 158338032Speter 158490792Sgshapiro EXPOSED_USER_FILE(`filename') 158538032Speter 158638032SpeterYou can also arrange to relay all unqualified names (that is, names 158738032Speterwithout @host) to a relay host. For example, if you have a central 158838032Speteremail server, you might relay to that host so that users don't have 158938032Speterto have .forward files or aliases. You can do this using 159038032Speter 159143730Speter define(`LOCAL_RELAY', `mailer:hostname') 159238032Speter 159338032SpeterThe ``mailer:'' can be omitted, in which case the mailer defaults to 159438032Speter"relay". There are some user names that you don't want relayed, perhaps 159538032Speterbecause of local aliases. A common example is root, which may be 159638032Speterlocally aliased. You can add entries to this list using 159738032Speter 159864562Sgshapiro LOCAL_USER(`usernames') 159938032Speter 160090792SgshapiroThis adds users to class {L}; you could also use 160138032Speter 160290792Sgshapiro LOCAL_USER_FILE(`filename') 160338032Speter 160438032SpeterIf you want all incoming mail sent to a centralized hub, as for a 160538032Spetershared /var/spool/mail scheme, use 160638032Speter 160743730Speter define(`MAIL_HUB', `mailer:hostname') 160838032Speter 160938032SpeterAgain, ``mailer:'' defaults to "relay". If you define both LOCAL_RELAY 161043730Speterand MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will 161138032Speterbe sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB. 161264562SgshapiroNote: there is a (long standing) bug which keeps this combination from 161364562Sgshapiroworking for addresses of the form user+detail. 161464562SgshapiroNames in class {L} will be delivered locally, so you MUST have aliases or 161538032Speter.forward files for them. 161638032Speter 161738032SpeterFor example, if you are on machine mastodon.CS.Berkeley.EDU and you have 161843730SpeterFEATURE(`stickyhost'), the following combinations of settings will have the 161938032Speterindicated effects: 162038032Speter 162138032Speteremail sent to.... eric eric@mastodon.CS.Berkeley.EDU 162238032Speter 162338032SpeterLOCAL_RELAY set to mail.CS.Berkeley.EDU (delivered locally) 162438032Spetermail.CS.Berkeley.EDU (no local aliasing) (aliasing done) 162538032Speter 162638032SpeterMAIL_HUB set to mammoth.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU 162738032Spetermammoth.CS.Berkeley.EDU (aliasing done) (aliasing done) 162838032Speter 162938032SpeterBoth LOCAL_RELAY and mail.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU 163038032SpeterMAIL_HUB set as above (no local aliasing) (aliasing done) 163138032Speter 163243730SpeterIf you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and 163338032SpeterMAIL_HUB act identically, with MAIL_HUB taking precedence. 163438032Speter 163538032SpeterIf you want all outgoing mail to go to a central relay site, define 163638032SpeterSMART_HOST as well. Briefly: 163738032Speter 163838032Speter LOCAL_RELAY applies to unqualified names (e.g., "eric"). 163938032Speter MAIL_HUB applies to names qualified with the name of the 164038032Speter local host (e.g., "eric@mastodon.CS.Berkeley.EDU"). 164164562Sgshapiro SMART_HOST applies to names qualified with other hosts or 164264562Sgshapiro bracketed addresses (e.g., "eric@mastodon.CS.Berkeley.EDU" 164364562Sgshapiro or "eric@[127.0.0.1]"). 164438032Speter 164538032SpeterHowever, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY, 164638032SpeterDECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you 164738032Speterreally want absolutely everything to go to a single central site you will 164838032Speterneed to unset all the other relays -- or better yet, find or build a 164938032Speterminimal config file that does this. 165038032Speter 165138032SpeterFor duplicate suppression to work properly, the host name is best 165238032Speterspecified with a terminal dot: 165338032Speter 165438032Speter define(`MAIL_HUB', `host.domain.') 165538032Speter note the trailing dot ---^ 165638032Speter 165738032Speter 165890792Sgshapiro+-------------------------------------------+ 165990792Sgshapiro| USING LDAP FOR ALIASES, MAPS, AND CLASSES | 166090792Sgshapiro+-------------------------------------------+ 166190792Sgshapiro 166290792SgshapiroLDAP can be used for aliases, maps, and classes by either specifying your 166390792Sgshapiroown LDAP map specification or using the built-in default LDAP map 166490792Sgshapirospecification. The built-in default specifications all provide lookups 166590792Sgshapirowhich match against either the machine's fully qualified hostname (${j}) or 166690792Sgshapiroa "cluster". The cluster allows you to share LDAP entries among a large 166790792Sgshapironumber of machines without having to enter each of the machine names into 166890792Sgshapiroeach LDAP entry. To set the LDAP cluster name to use for a particular 166990792Sgshapiromachine or set of machines, set the confLDAP_CLUSTER m4 variable to a 167090792Sgshapirounique name. For example: 167190792Sgshapiro 167290792Sgshapiro define(`confLDAP_CLUSTER', `Servers') 167390792Sgshapiro 167490792SgshapiroHere, the word `Servers' will be the cluster name. As an example, assume 167590792Sgshapirothat smtp.sendmail.org, etrn.sendmail.org, and mx.sendmail.org all belong 167690792Sgshapiroto the Servers cluster. 167790792Sgshapiro 167890792SgshapiroSome of the LDAP LDIF examples below show use of the Servers cluster. 167990792SgshapiroEvery entry must have either a sendmailMTAHost or sendmailMTACluster 168090792Sgshapiroattribute or it will be ignored. Be careful as mixing clusters and 168190792Sgshapiroindividual host records can have surprising results (see the CAUTION 168290792Sgshapirosections below). 168390792Sgshapiro 168490792SgshapiroSee the file cf/sendmail.schema for the actual LDAP schemas. Note that 168590792Sgshapirothis schema (and therefore the lookups and examples below) is experimental 168690792Sgshapiroat this point as it has had little public review. Therefore, it may change 168790792Sgshapiroin future versions. Feedback via sendmail@sendmail.org is encouraged. 168890792Sgshapiro 168990792Sgshapiro------- 169090792SgshapiroAliases 169190792Sgshapiro------- 169290792Sgshapiro 169390792SgshapiroThe ALIAS_FILE (O AliasFile) option can be set to use LDAP for alias 169490792Sgshapirolookups. To use the default schema, simply use: 169590792Sgshapiro 169690792Sgshapiro define(`ALIAS_FILE', `ldap:') 169790792Sgshapiro 169890792SgshapiroBy doing so, you will use the default schema which expands to a map 169990792Sgshapirodeclared as follows: 170090792Sgshapiro 170190792Sgshapiro ldap -k (&(objectClass=sendmailMTAAliasObject) 170290792Sgshapiro (sendmailMTAAliasGrouping=aliases) 170390792Sgshapiro (|(sendmailMTACluster=${sendmailMTACluster}) 170490792Sgshapiro (sendmailMTAHost=$j)) 170590792Sgshapiro (sendmailMTAKey=%0)) 170690792Sgshapiro -v sendmailMTAAliasValue 170790792Sgshapiro 170890792SgshapiroNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually 170990792Sgshapiroused when the binary expands the `ldap:' token as the AliasFile option is 171090792Sgshapironot actually macro-expanded when read from the sendmail.cf file. 171190792Sgshapiro 171290792SgshapiroExample LDAP LDIF entries might be: 171390792Sgshapiro 171490792Sgshapiro dn: sendmailMTAKey=sendmail-list, dc=sendmail, dc=org 171590792Sgshapiro objectClass: sendmailMTA 171690792Sgshapiro objectClass: sendmailMTAAlias 171790792Sgshapiro objectClass: sendmailMTAAliasObject 171890792Sgshapiro sendmailMTAAliasGrouping: aliases 171990792Sgshapiro sendmailMTAHost: etrn.sendmail.org 172090792Sgshapiro sendmailMTAKey: sendmail-list 172190792Sgshapiro sendmailMTAAliasValue: ca@example.org 172290792Sgshapiro sendmailMTAAliasValue: eric 172390792Sgshapiro sendmailMTAAliasValue: gshapiro@example.com 172490792Sgshapiro 172590792Sgshapiro dn: sendmailMTAKey=owner-sendmail-list, dc=sendmail, dc=org 172690792Sgshapiro objectClass: sendmailMTA 172790792Sgshapiro objectClass: sendmailMTAAlias 172890792Sgshapiro objectClass: sendmailMTAAliasObject 172990792Sgshapiro sendmailMTAAliasGrouping: aliases 173090792Sgshapiro sendmailMTAHost: etrn.sendmail.org 173190792Sgshapiro sendmailMTAKey: owner-sendmail-list 173290792Sgshapiro sendmailMTAAliasValue: eric 173390792Sgshapiro 173490792Sgshapiro dn: sendmailMTAKey=postmaster, dc=sendmail, dc=org 173590792Sgshapiro objectClass: sendmailMTA 173690792Sgshapiro objectClass: sendmailMTAAlias 173790792Sgshapiro objectClass: sendmailMTAAliasObject 173890792Sgshapiro sendmailMTAAliasGrouping: aliases 173990792Sgshapiro sendmailMTACluster: Servers 174090792Sgshapiro sendmailMTAKey: postmaster 174190792Sgshapiro sendmailMTAAliasValue: eric 174290792Sgshapiro 174390792SgshapiroHere, the aliases sendmail-list and owner-sendmail-list will be available 174490792Sgshapiroonly on etrn.sendmail.org but the postmaster alias will be available on 174590792Sgshapiroevery machine in the Servers cluster (including etrn.sendmail.org). 174690792Sgshapiro 174790792SgshapiroCAUTION: aliases are additive so that entries like these: 174890792Sgshapiro 174990792Sgshapiro dn: sendmailMTAKey=bob, dc=sendmail, dc=org 175090792Sgshapiro objectClass: sendmailMTA 175190792Sgshapiro objectClass: sendmailMTAAlias 175290792Sgshapiro objectClass: sendmailMTAAliasObject 175390792Sgshapiro sendmailMTAAliasGrouping: aliases 175490792Sgshapiro sendmailMTACluster: Servers 175590792Sgshapiro sendmailMTAKey: bob 175690792Sgshapiro sendmailMTAAliasValue: eric 175790792Sgshapiro 175894334Sgshapiro dn: sendmailMTAKey=bobetrn, dc=sendmail, dc=org 175990792Sgshapiro objectClass: sendmailMTA 176090792Sgshapiro objectClass: sendmailMTAAlias 176190792Sgshapiro objectClass: sendmailMTAAliasObject 176290792Sgshapiro sendmailMTAAliasGrouping: aliases 176390792Sgshapiro sendmailMTAHost: etrn.sendmail.org 176490792Sgshapiro sendmailMTAKey: bob 176590792Sgshapiro sendmailMTAAliasValue: gshapiro 176690792Sgshapiro 176790792Sgshapirowould mean that on all of the hosts in the cluster, mail to bob would go to 176890792Sgshapiroeric EXCEPT on etrn.sendmail.org in which case it would go to BOTH eric and 176990792Sgshapirogshapiro. 177090792Sgshapiro 177190792SgshapiroIf you prefer not to use the default LDAP schema for your aliases, you can 177290792Sgshapirospecify the map parameters when setting ALIAS_FILE. For example: 177390792Sgshapiro 177490792Sgshapiro define(`ALIAS_FILE', `ldap:-k (&(objectClass=mailGroup)(mail=%0)) -v mgrpRFC822MailMember') 177590792Sgshapiro 177690792Sgshapiro---- 177790792SgshapiroMaps 177890792Sgshapiro---- 177990792Sgshapiro 178090792SgshapiroFEATURE()'s which take an optional map definition argument (e.g., access, 178190792Sgshapiromailertable, virtusertable, etc.) can instead take the special keyword 178290792Sgshapiro`LDAP', e.g.: 178390792Sgshapiro 178490792Sgshapiro FEATURE(`access_db', `LDAP') 178590792Sgshapiro FEATURE(`virtusertable', `LDAP') 178690792Sgshapiro 178790792SgshapiroWhen this keyword is given, that map will use LDAP lookups consisting of 178890792Sgshapirothe objectClass sendmailMTAClassObject, the attribute sendmailMTAMapName 178990792Sgshapirowith the map name, a search attribute of sendmailMTAKey, and the value 179090792Sgshapiroattribute sendmailMTAMapValue. 179190792Sgshapiro 179290792SgshapiroThe values for sendmailMTAMapName are: 179390792Sgshapiro 179490792Sgshapiro FEATURE() sendmailMTAMapName 179590792Sgshapiro --------- ------------------ 179690792Sgshapiro access_db access 179790792Sgshapiro authinfo authinfo 179890792Sgshapiro bitdomain bitdomain 179990792Sgshapiro domaintable domain 180090792Sgshapiro genericstable generics 180190792Sgshapiro mailertable mailer 180290792Sgshapiro uucpdomain uucpdomain 180390792Sgshapiro virtusertable virtuser 180490792Sgshapiro 180590792SgshapiroFor example, FEATURE(`mailertable', `LDAP') would use the map definition: 180690792Sgshapiro 180790792Sgshapiro Kmailertable ldap -k (&(objectClass=sendmailMTAMapObject) 180890792Sgshapiro (sendmailMTAMapName=mailer) 180990792Sgshapiro (|(sendmailMTACluster=${sendmailMTACluster}) 181090792Sgshapiro (sendmailMTAHost=$j)) 181190792Sgshapiro (sendmailMTAKey=%0)) 181290792Sgshapiro -1 -v sendmailMTAMapValue 181390792Sgshapiro 181490792SgshapiroAn example LDAP LDIF entry using this map might be: 181590792Sgshapiro 181690792Sgshapiro dn: sendmailMTAMapName=mailer, dc=sendmail, dc=org 181790792Sgshapiro objectClass: sendmailMTA 181890792Sgshapiro objectClass: sendmailMTAMap 181990792Sgshapiro sendmailMTACluster: Servers 182090792Sgshapiro sendmailMTAMapName: mailer 182190792Sgshapiro 182290792Sgshapiro dn: sendmailMTAKey=example.com, sendmailMTAMapName=mailer, dc=sendmail, dc=org 182390792Sgshapiro objectClass: sendmailMTA 182490792Sgshapiro objectClass: sendmailMTAMap 182590792Sgshapiro objectClass: sendmailMTAMapObject 182690792Sgshapiro sendmailMTAMapName: mailer 182790792Sgshapiro sendmailMTACluster: Servers 182890792Sgshapiro sendmailMTAKey: example.com 182990792Sgshapiro sendmailMTAMapValue: relay:[smtp.example.com] 183090792Sgshapiro 183190792SgshapiroCAUTION: If your LDAP database contains the record above and *ALSO* a host 183290792Sgshapirospecific record such as: 183390792Sgshapiro 183490792Sgshapiro dn: sendmailMTAKey=example.com@etrn, sendmailMTAMapName=mailer, dc=sendmail, dc=org 183590792Sgshapiro objectClass: sendmailMTA 183690792Sgshapiro objectClass: sendmailMTAMap 183790792Sgshapiro objectClass: sendmailMTAMapObject 183890792Sgshapiro sendmailMTAMapName: mailer 183990792Sgshapiro sendmailMTAHost: etrn.sendmail.org 184090792Sgshapiro sendmailMTAKey: example.com 184190792Sgshapiro sendmailMTAMapValue: relay:[mx.example.com] 184290792Sgshapiro 184390792Sgshapirothen these entries will give unexpected results. When the lookup is done 184490792Sgshapiroon etrn.sendmail.org, the effect is that there is *NO* match at all as maps 184590792Sgshapirorequire a single match. Since the host etrn.sendmail.org is also in the 184690792SgshapiroServers cluster, LDAP would return two answers for the example.com map key 184790792Sgshapiroin which case sendmail would treat this as no match at all. 184890792Sgshapiro 184990792SgshapiroIf you prefer not to use the default LDAP schema for your maps, you can 185090792Sgshapirospecify the map parameters when using the FEATURE(). For example: 185190792Sgshapiro 185290792Sgshapiro FEATURE(`access_db', `ldap:-1 -k (&(objectClass=mapDatabase)(key=%0)) -v value') 185390792Sgshapiro 185490792Sgshapiro------- 185590792SgshapiroClasses 185690792Sgshapiro------- 185790792Sgshapiro 185890792SgshapiroNormally, classes can be filled via files or programs. As of 8.12, they 185990792Sgshapirocan also be filled via map lookups using a new syntax: 186090792Sgshapiro 186190792Sgshapiro F{ClassName}mapkey@mapclass:mapspec 186290792Sgshapiro 186390792Sgshapiromapkey is optional and if not provided the map key will be empty. This can 186490792Sgshapirobe used with LDAP to read classes from LDAP. Note that the lookup is only 186590792Sgshapirodone when sendmail is initially started. Use the special value `@LDAP' to 186690792Sgshapirouse the default LDAP schema. For example: 186790792Sgshapiro 186890792Sgshapiro RELAY_DOMAIN_FILE(`@LDAP') 186990792Sgshapiro 187090792Sgshapirowould put all of the attribute sendmailMTAClassValue values of LDAP records 187190792Sgshapirowith objectClass sendmailMTAClass and an attribute sendmailMTAClassName of 187290792Sgshapiro'R' into class $={R}. In other words, it is equivalent to the LDAP map 187390792Sgshapirospecification: 187490792Sgshapiro 187590792Sgshapiro F{R}@ldap:-k (&(objectClass=sendmailMTAClass) 187690792Sgshapiro (sendmailMTAClassName=R) 187790792Sgshapiro (|(sendmailMTACluster=${sendmailMTACluster}) 187890792Sgshapiro (sendmailMTAHost=$j))) 187990792Sgshapiro -v sendmailMTAClassValue 188090792Sgshapiro 188190792SgshapiroNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually 188290792Sgshapiroused when the binary expands the `@LDAP' token as class declarations are 188390792Sgshapironot actually macro-expanded when read from the sendmail.cf file. 188490792Sgshapiro 188590792SgshapiroThis can be used with class related commands such as RELAY_DOMAIN_FILE(), 188690792SgshapiroMASQUERADE_DOMAIN_FILE(), etc: 188790792Sgshapiro 188890792Sgshapiro Command sendmailMTAClassName 188990792Sgshapiro ------- -------------------- 189090792Sgshapiro CANONIFY_DOMAIN_FILE() Canonify 189190792Sgshapiro EXPOSED_USER_FILE() E 189290792Sgshapiro GENERICS_DOMAIN_FILE() G 189390792Sgshapiro LDAPROUTE_DOMAIN_FILE() LDAPRoute 189490792Sgshapiro LDAPROUTE_EQUIVALENT_FILE() LDAPRouteEquiv 189590792Sgshapiro LOCAL_USER_FILE() L 189690792Sgshapiro MASQUERADE_DOMAIN_FILE() M 189790792Sgshapiro MASQUERADE_EXCEPTION_FILE() N 189890792Sgshapiro RELAY_DOMAIN_FILE() R 189990792Sgshapiro VIRTUSER_DOMAIN_FILE() VirtHost 190090792Sgshapiro 190190792SgshapiroYou can also add your own as any 'F'ile class of the form: 190290792Sgshapiro 190390792Sgshapiro F{ClassName}@LDAP 190490792Sgshapiro ^^^^^^^^^ 190590792Sgshapirowill use "ClassName" for the sendmailMTAClassName. 190690792Sgshapiro 190790792SgshapiroAn example LDAP LDIF entry would look like: 190890792Sgshapiro 190990792Sgshapiro dn: sendmailMTAClassName=R, dc=sendmail, dc=org 191090792Sgshapiro objectClass: sendmailMTA 191190792Sgshapiro objectClass: sendmailMTAClass 191290792Sgshapiro sendmailMTACluster: Servers 191390792Sgshapiro sendmailMTAClassName: R 191490792Sgshapiro sendmailMTAClassValue: sendmail.org 191590792Sgshapiro sendmailMTAClassValue: example.com 191690792Sgshapiro sendmailMTAClassValue: 10.56.23 191790792Sgshapiro 191890792SgshapiroCAUTION: If your LDAP database contains the record above and *ALSO* a host 191990792Sgshapirospecific record such as: 192090792Sgshapiro 192190792Sgshapiro dn: sendmailMTAClassName=R@etrn.sendmail.org, dc=sendmail, dc=org 192290792Sgshapiro objectClass: sendmailMTA 192390792Sgshapiro objectClass: sendmailMTAClass 192490792Sgshapiro sendmailMTAHost: etrn.sendmail.org 192590792Sgshapiro sendmailMTAClassName: R 192690792Sgshapiro sendmailMTAClassValue: example.com 192790792Sgshapiro 192890792Sgshapirothe result will be similar to the aliases caution above. When the lookup 192990792Sgshapirois done on etrn.sendmail.org, $={R} would contain all of the entries (from 193090792Sgshapiroboth the cluster match and the host match). In other words, the effective 193190792Sgshapirois additive. 193290792Sgshapiro 193390792SgshapiroIf you prefer not to use the default LDAP schema for your classes, you can 193490792Sgshapirospecify the map parameters when using the class command. For example: 193590792Sgshapiro 193690792Sgshapiro VIRTUSER_DOMAIN_FILE(`@ldap:-k (&(objectClass=virtHosts)(host=*)) -v host') 193790792Sgshapiro 193890792SgshapiroRemember, macros can not be used in a class declaration as the binary does 193990792Sgshapironot expand them. 194090792Sgshapiro 194190792Sgshapiro 194264562Sgshapiro+--------------+ 194364562Sgshapiro| LDAP ROUTING | 194464562Sgshapiro+--------------+ 194564562Sgshapiro 194664562SgshapiroFEATURE(`ldap_routing') can be used to implement the IETF Internet Draft 194764562SgshapiroLDAP Schema for Intranet Mail Routing 194864562Sgshapiro(draft-lachman-laser-ldap-mail-routing-01). This feature enables 194964562SgshapiroLDAP-based rerouting of a particular address to either a different host 195064562Sgshapiroor a different address. The LDAP lookup is first attempted on the full 195164562Sgshapiroaddress (e.g., user@example.com) and then on the domain portion 195264562Sgshapiro(e.g., @example.com). Be sure to setup your domain for LDAP routing using 195364562SgshapiroLDAPROUTE_DOMAIN(), e.g.: 195464562Sgshapiro 195564562Sgshapiro LDAPROUTE_DOMAIN(`example.com') 195664562Sgshapiro 195790792SgshapiroAdditionally, you can specify equivalent domains for LDAP routing using 195890792SgshapiroLDAPROUTE_EQUIVALENT() and LDAPROUTE_EQUIVALENT_FILE(). 'Equivalent' 195990792Sgshapirohostnames are mapped to $M (the masqueraded hostname for the server) before 196090792Sgshapirothe LDAP query. For example, if the mail is addressed to 196190792Sgshapirouser@host1.example.com, normally the LDAP lookup would only be done for 196290792Sgshapiro'user@host1.example.com' and '@host1.example.com'. However, if 196390792SgshapiroLDAPROUTE_EQUIVALENT(`host1.example.com') is used, the lookups would also be 196490792Sgshapirodone on 'user@example.com' and '@example.com' after attempting the 196590792Sgshapirohost1.example.com lookups. 196690792Sgshapiro 196764562SgshapiroBy default, the feature will use the schemas as specified in the draft 196864562Sgshapiroand will not reject addresses not found by the LDAP lookup. However, 196964562Sgshapirothis behavior can be changed by giving additional arguments to the FEATURE() 197064562Sgshapirocommand: 197164562Sgshapiro 197290792Sgshapiro FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>, <detail>) 197364562Sgshapiro 197464562Sgshapirowhere <mailHost> is a map definition describing how to lookup an alternative 197564562Sgshapiromail host for a particular address; <mailRoutingAddress> is a map definition 197690792Sgshapirodescribing how to lookup an alternative address for a particular address; 197764562Sgshapirothe <bounce> argument, if present and not the word "passthru", dictates 197864562Sgshapirothat mail should be bounced if neither a mailHost nor mailRoutingAddress 197990792Sgshapirois found; and <detail> indicates what actions to take if the address 198090792Sgshapirocontains +detail information -- `strip' tries the lookup with the +detail 198190792Sgshapiroand if no matches are found, strips the +detail and tries the lookup again; 198290792Sgshapiro`preserve', does the same as `strip' but if a mailRoutingAddress match is 198390792Sgshapirofound, the +detail information is copied to the new address. 198464562Sgshapiro 198564562SgshapiroThe default <mailHost> map definition is: 198664562Sgshapiro 198794334Sgshapiro ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient) 198864562Sgshapiro (mailLocalAddress=%0)) 198964562Sgshapiro 199064562SgshapiroThe default <mailRoutingAddress> map definition is: 199164562Sgshapiro 199294334Sgshapiro ldap -1 -T<TMPF> -v mailRoutingAddress 199394334Sgshapiro -k (&(objectClass=inetLocalMailRecipient) 199494334Sgshapiro (mailLocalAddress=%0)) 199564562Sgshapiro 199664562SgshapiroNote that neither includes the LDAP server hostname (-h server) or base DN 199764562Sgshapiro(-b o=org,c=COUNTRY), both necessary for LDAP queries. It is presumed that 199864562Sgshapiroyour .mc file contains a setting for the confLDAP_DEFAULT_SPEC option with 199964562Sgshapirothese settings. If this is not the case, the map definitions should be 200094334Sgshapirochanged as described above. The "-T<TMPF>" is required in any user 200194334Sgshapirospecified map definition to catch temporary errors. 200264562Sgshapiro 200364562SgshapiroThe following possibilities exist as a result of an LDAP lookup on an 200464562Sgshapiroaddress: 200564562Sgshapiro 200664562Sgshapiro mailHost is mailRoutingAddress is Results in 200764562Sgshapiro ----------- --------------------- ---------- 200864562Sgshapiro set to a set mail delivered to 200964562Sgshapiro "local" host mailRoutingAddress 201064562Sgshapiro 201164562Sgshapiro set to a not set delivered to 201264562Sgshapiro "local" host original address 201364562Sgshapiro 201464562Sgshapiro set to a set mailRoutingAddress 201564562Sgshapiro remote host relayed to mailHost 201664562Sgshapiro 201764562Sgshapiro set to a not set original address 201864562Sgshapiro remote host relayed to mailHost 201964562Sgshapiro 202064562Sgshapiro not set set mail delivered to 202164562Sgshapiro mailRoutingAddress 202264562Sgshapiro 202364562Sgshapiro not set not set delivered to 202464562Sgshapiro original address *OR* 202564562Sgshapiro bounced as unknown user 202664562Sgshapiro 202790792SgshapiroThe term "local" host above means the host specified is in class {w}. If 202890792Sgshapirothe result would mean sending the mail to a different host, that host is 202990792Sgshapirolooked up in the mailertable before delivery. 203090792Sgshapiro 203164562SgshapiroNote that the last case depends on whether the third argument is given 203264562Sgshapiroto the FEATURE() command. The default is to deliver the message to the 203364562Sgshapirooriginal address. 203464562Sgshapiro 203564562SgshapiroThe LDAP entries should be set up with an objectClass of 203664562SgshapiroinetLocalMailRecipient and the address be listed in a mailLocalAddress 203764562Sgshapiroattribute. If present, there must be only one mailHost attribute and it 203864562Sgshapiromust contain a fully qualified host name as its value. Similarly, if 203964562Sgshapiropresent, there must be only one mailRoutingAddress attribute and it must 204090792Sgshapirocontain an RFC 822 compliant address. Some example LDAP records (in LDIF 204164562Sgshapiroformat): 204264562Sgshapiro 204364562Sgshapiro dn: uid=tom, o=example.com, c=US 204464562Sgshapiro objectClass: inetLocalMailRecipient 204564562Sgshapiro mailLocalAddress: tom@example.com 204664562Sgshapiro mailRoutingAddress: thomas@mailhost.example.com 204764562Sgshapiro 204864562SgshapiroThis would deliver mail for tom@example.com to thomas@mailhost.example.com. 204964562Sgshapiro 205064562Sgshapiro dn: uid=dick, o=example.com, c=US 205164562Sgshapiro objectClass: inetLocalMailRecipient 205264562Sgshapiro mailLocalAddress: dick@example.com 205364562Sgshapiro mailHost: eng.example.com 205464562Sgshapiro 205564562SgshapiroThis would relay mail for dick@example.com to the same address but redirect 205690792Sgshapirothe mail to MX records listed for the host eng.example.com (unless the 205790792Sgshapiromailertable overrides). 205864562Sgshapiro 205964562Sgshapiro dn: uid=harry, o=example.com, c=US 206064562Sgshapiro objectClass: inetLocalMailRecipient 206164562Sgshapiro mailLocalAddress: harry@example.com 206264562Sgshapiro mailHost: mktmail.example.com 206364562Sgshapiro mailRoutingAddress: harry@mkt.example.com 206464562Sgshapiro 206564562SgshapiroThis would relay mail for harry@example.com to the MX records listed for 206664562Sgshapirothe host mktmail.example.com using the new address harry@mkt.example.com 206764562Sgshapirowhen talking to that host. 206864562Sgshapiro 206964562Sgshapiro dn: uid=virtual.example.com, o=example.com, c=US 207064562Sgshapiro objectClass: inetLocalMailRecipient 207164562Sgshapiro mailLocalAddress: @virtual.example.com 207264562Sgshapiro mailHost: server.example.com 207364562Sgshapiro mailRoutingAddress: virtual@example.com 207464562Sgshapiro 207564562SgshapiroThis would send all mail destined for any username @virtual.example.com to 207664562Sgshapirothe machine server.example.com's MX servers and deliver to the address 207764562Sgshapirovirtual@example.com on that relay machine. 207864562Sgshapiro 207964562Sgshapiro 208038032Speter+---------------------------------+ 208138032Speter| ANTI-SPAM CONFIGURATION CONTROL | 208238032Speter+---------------------------------+ 208338032Speter 208438032SpeterThe primary anti-spam features available in sendmail are: 208538032Speter 208638032Speter* Relaying is denied by default. 208738032Speter* Better checking on sender information. 208838032Speter* Access database. 208938032Speter* Header checks. 209038032Speter 209164562SgshapiroRelaying (transmission of messages from a site outside your host (class 209264562Sgshapiro{w}) to another site except yours) is denied by default. Note that this 209364562Sgshapirochanged in sendmail 8.9; previous versions allowed relaying by default. 209464562SgshapiroIf you really want to revert to the old behaviour, you will need to use 209564562SgshapiroFEATURE(`promiscuous_relay'). You can allow certain domains to relay 209664562Sgshapirothrough your server by adding their domain name or IP address to class 209764562Sgshapiro{R} using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database 209890792Sgshapiro(described below). Note that IPv6 addresses must be prefaced with "IPv6:". 209990792SgshapiroThe file consists (like any other file based class) of entries listed on 210090792Sgshapiroseparate lines, e.g., 210138032Speter 210264562Sgshapiro sendmail.org 210364562Sgshapiro 128.32 210490792Sgshapiro IPv6:2002:c0a8:02c7 210590792Sgshapiro IPv6:2002:c0a8:51d2::23f4 210664562Sgshapiro host.mydomain.com 210790792Sgshapiro [UNIX:localhost] 210864562Sgshapiro 210990792SgshapiroNotice: the last entry allows relaying for connections via a UNIX 211090792Sgshapirosocket to the MTA/MSP. This might be necessary if your configuration 211190792Sgshapirodoesn't allow relaying by other means in that case, e.g., by having 211290792Sgshapirolocalhost.$m in class {R} (make sure $m is not just a top level 211390792Sgshapirodomain). 211490792Sgshapiro 211538032SpeterIf you use 211638032Speter 211743730Speter FEATURE(`relay_entire_domain') 211838032Speter 211964562Sgshapirothen any host in any of your local domains (that is, class {m}) 212042575Speterwill be relayed (that is, you will accept mail either to or from any 212142575Speterhost in your domain). 212238032Speter 212338032SpeterYou can also allow relaying based on the MX records of the host 212438032Speterportion of an incoming recipient address by using 212538032Speter 212643730Speter FEATURE(`relay_based_on_MX') 212738032Speter 212838032SpeterFor example, if your server receives a recipient of user@domain.com 212938032Speterand domain.com lists your server in its MX records, the mail will be 213090792Sgshapiroaccepted for relay to domain.com. This feature may cause problems 213190792Sgshapiroif MX lookups for the recipient domain are slow or time out. In that 213290792Sgshapirocase, mail will be temporarily rejected. It is usually better to 213390792Sgshapiromaintain a list of hosts/domains for which the server acts as relay. 213490792SgshapiroNote also that this feature will stop spammers from using your host 213590792Sgshapiroto relay spam but it will not stop outsiders from using your server 213690792Sgshapiroas a relay for their site (that is, they set up an MX record pointing 213790792Sgshapiroto your mail server, and you will relay mail addressed to them 213890792Sgshapirowithout any prior arrangement). Along the same lines, 213938032Speter 214043730Speter FEATURE(`relay_local_from') 214138032Speter 214238032Speterwill allow relaying if the sender specifies a return path (i.e. 214390792SgshapiroMAIL FROM: <user@domain>) domain which is a local domain. This is a 214438032Speterdangerous feature as it will allow spammers to spam using your mail 214538032Speterserver by simply specifying a return address of user@your.domain.com. 214638032SpeterIt should not be used unless absolutely necessary. 214764562SgshapiroA slightly better solution is 214838032Speter 214964562Sgshapiro FEATURE(`relay_mail_from') 215064562Sgshapiro 215164562Sgshapirowhich allows relaying if the mail sender is listed as RELAY in the 215264562Sgshapiroaccess map. If an optional argument `domain' is given, the domain 215364562Sgshapiroportion of the mail sender is also checked to allowing relaying. 215464562SgshapiroThis option only works together with the tag From: for the LHS of 215590792Sgshapirothe access map entries (see below: Finer control...). This feature 215690792Sgshapiroallows spammers to abuse your mail server by specifying a return 215790792Sgshapiroaddress that you enabled in your access file. This may be harder 215890792Sgshapiroto figure out for spammers, but it should not be used unless 215990792Sgshapironecessary. Instead use SMTP AUTH or STARTTLS to allow relaying 216090792Sgshapirofor roaming users. 216164562Sgshapiro 216264562Sgshapiro 216390792SgshapiroIf source routing is used in the recipient address (e.g., 216438032SpeterRCPT TO: <user%site.com@othersite.com>), sendmail will check 216538032Speteruser@site.com for relaying if othersite.com is an allowed relay host 216664562Sgshapiroin either class {R}, class {m} if FEATURE(`relay_entire_domain') is used, 216743730Speteror the access database if FEATURE(`access_db') is used. To prevent 216838032Speterthe address from being stripped down, use: 216938032Speter 217043730Speter FEATURE(`loose_relay_check') 217138032Speter 217238032SpeterIf you think you need to use this feature, you probably do not. This 217338032Spetershould only be used for sites which have no control over the addresses 217438032Speterthat they provide a gateway for. Use this FEATURE with caution as it 217538032Spetercan allow spammers to relay through your server if not setup properly. 217638032Speter 217764562SgshapiroNOTICE: It is possible to relay mail through a system which the anti-relay 217864562Sgshapirorules do not prevent: the case of a system that does use FEATURE(`nouucp', 217964562Sgshapiro`nospecial') (system A) and relays local messages to a mail hub (e.g., via 218064562SgshapiroLOCAL_RELAY or LUSER_RELAY) (system B). If system B doesn't use 218164562SgshapiroFEATURE(`nouucp') at all, addresses of the form 218264562Sgshapiro<example.net!user@local.host> would be relayed to <user@example.net>. 218364562SgshapiroSystem A doesn't recognize `!' as an address separator and therefore 218464562Sgshapiroforwards it to the mail hub which in turns relays it because it came from 218564562Sgshapiroa trusted local host. So if a mailserver allows UUCP (bang-format) 218664562Sgshapiroaddresses, all systems from which it allows relaying should do the same 218764562Sgshapiroor reject those addresses. 218864562Sgshapiro 218938032SpeterAs of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has 219038032Speteran unresolvable domain (i.e., one that DNS, your local name service, 219190792Sgshapiroor special case rules in ruleset 3 cannot locate). This also applies 219290792Sgshapiroto addresses that use domain literals, e.g., <user@[1.2.3.4]>, if the 219390792SgshapiroIP address can't be mapped to a host name. If you want to continue 219490792Sgshapiroto accept such domains, e.g., because you are inside a firewall that 219590792Sgshapirohas only a limited view of the Internet host name space (note that you 219690792Sgshapirowill not be able to return mail to them unless you have some "smart 219790792Sgshapirohost" forwarder), use 219838032Speter 219943730Speter FEATURE(`accept_unresolvable_domains') 220038032Speter 220190792SgshapiroAlternatively, you can allow specific addresses by adding them to 220290792Sgshapirothe access map, e.g., 220390792Sgshapiro 220490792Sgshapiro From:unresolvable.domain OK 220590792Sgshapiro From:[1.2.3.4] OK 220690792Sgshapiro From:[1.2.4] OK 220790792Sgshapiro 220890792SgshapiroNotice: domains which are temporarily unresolvable are (temporarily) 220990792Sgshapirorejected with a 451 reply code. If those domains should be accepted 221090792Sgshapiro(which is discouraged) then you can use 221190792Sgshapiro 221290792Sgshapiro LOCAL_CONFIG 221390792Sgshapiro C{ResOk}TEMP 221490792Sgshapiro 221538032Spetersendmail will also refuse mail if the MAIL FROM: parameter is not 221638032Speterfully qualified (i.e., contains a domain as well as a user). If you 221738032Speterwant to continue to accept such senders, use 221838032Speter 221943730Speter FEATURE(`accept_unqualified_senders') 222038032Speter 222164562SgshapiroSetting the DaemonPortOptions modifier 'u' overrides the default behavior, 222264562Sgshapiroi.e., unqualified addresses are accepted even without this FEATURE. If 222364562Sgshapirothis FEATURE is not used, the DaemonPortOptions modifier 'f' can be used 222490792Sgshapiroto enforce fully qualified domain names. 222564562Sgshapiro 222638032SpeterAn ``access'' database can be created to accept or reject mail from 222738032Speterselected domains. For example, you may choose to reject all mail 222838032Speteroriginating from known spammers. To enable such a database, use 222938032Speter 223043730Speter FEATURE(`access_db') 223138032Speter 223290792SgshapiroNotice: the access database is applied to the envelope addresses 223390792Sgshapiroand the connection information, not to the header. 223490792Sgshapiro 223590792SgshapiroThe FEATURE macro can accept as second parameter the key file 223638032Speterdefinition for the database; for example 223738032Speter 223890792Sgshapiro FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access_map') 223938032Speter 224090792SgshapiroNotice: If a second argument is specified it must contain the option 224190792Sgshapiro`-T<TMPF>' as shown above. The optional third and fourth parameters 224290792Sgshapiromay be `skip' or `lookupdotdomain'. The former enables SKIP as 224390792Sgshapirovalue part (see below), the latter is another way to enable the 224490792Sgshapirofeature of the same name (see above). 224590792Sgshapiro 224642575SpeterRemember, since /etc/mail/access is a database, after creating the text 224742575Speterfile as described below, you must use makemap to create the database 224842575Spetermap. For example: 224942575Speter 225043730Speter makemap hash /etc/mail/access < /etc/mail/access 225142575Speter 225238032SpeterThe table itself uses e-mail addresses, domain names, and network 225390792Sgshapironumbers as keys. Note that IPv6 addresses must be prefaced with "IPv6:". 225490792SgshapiroFor example, 225538032Speter 225690792Sgshapiro spammer@aol.com REJECT 225790792Sgshapiro cyberspammer.com REJECT 225894334Sgshapiro TLD REJECT 225990792Sgshapiro 192.168.212 REJECT 226090792Sgshapiro IPv6:2002:c0a8:02c7 RELAY 226190792Sgshapiro IPv6:2002:c0a8:51d2::23f4 REJECT 226238032Speter 226338032Speterwould refuse mail from spammer@aol.com, any user from cyberspammer.com 226494334Sgshapiro(or any host within the cyberspammer.com domain), any host in the entire 226594334Sgshapirotop level domain TLD, 192.168.212.* network, and the IPv6 address 226694334Sgshapiro2002:c0a8:51d2::23f4. It would allow relay for the IPv6 network 226794334Sgshapiro2002:c0a8:02c7::/48. 226838032Speter 226938032SpeterThe value part of the map can contain: 227038032Speter 227190792Sgshapiro OK Accept mail even if other rules in the running 227290792Sgshapiro ruleset would reject it, for example, if the domain 227390792Sgshapiro name is unresolvable. "Accept" does not mean 227490792Sgshapiro "relay", but at most acceptance for local 227590792Sgshapiro recipients. That is, OK allows less than RELAY. 227642575Speter RELAY Accept mail addressed to the indicated domain or 227742575Speter received from the indicated domain for relaying 227842575Speter through your SMTP server. RELAY also serves as 227942575Speter an implicit OK for the other checks. 228042575Speter REJECT Reject the sender or recipient with a general 228138032Speter purpose message. 228242575Speter DISCARD Discard the message completely using the 228371345Sgshapiro $#discard mailer. If it is used in check_compat, 228471345Sgshapiro it affects only the designated recipient, not 228571345Sgshapiro the whole message as it does in all other cases. 228671345Sgshapiro This should only be used if really necessary. 228790792Sgshapiro SKIP This can only be used for host/domain names 228890792Sgshapiro and IP addresses/nets. It will abort the current 228990792Sgshapiro search for this entry without accepting or rejecting 229090792Sgshapiro it but causing the default action. 229166494Sgshapiro ### any text where ### is an RFC 821 compliant error code and 229266494Sgshapiro "any text" is a message to return for the command. 229366494Sgshapiro The string should be quoted to avoid surprises, 229466494Sgshapiro e.g., sendmail may remove spaces otherwise. 229590792Sgshapiro This type is deprecated, use one the two 229690792Sgshapiro ERROR: entries below instead. 229764562Sgshapiro ERROR:### any text 229864562Sgshapiro as above, but useful to mark error messages as such. 229964562Sgshapiro ERROR:D.S.N:### any text 230064562Sgshapiro where D.S.N is an RFC 1893 compliant error code 230164562Sgshapiro and the rest as above. 230238032Speter 230338032SpeterFor example: 230438032Speter 230590792Sgshapiro cyberspammer.com ERROR:550 "We don't accept mail from spammers" 230638032Speter okay.cyberspammer.com OK 230764562Sgshapiro sendmail.org RELAY 230838032Speter 128.32 RELAY 230990792Sgshapiro IPv6:1:2:3:4:5:6:7 RELAY 231064562Sgshapiro [127.0.0.3] OK 231190792Sgshapiro [IPv6:1:2:3:4:5:6:7:8] OK 231238032Speter 231364562Sgshapirowould accept mail from okay.cyberspammer.com, but would reject mail from 231464562Sgshapiroall other hosts at cyberspammer.com with the indicated message. It would 231564562Sgshapiroallow relaying mail from and to any hosts in the sendmail.org domain, and 231664562Sgshapiroallow relaying from the 128.32.*.* network and the IPv6 1:2:3:4:5:6:7:* 231764562Sgshapironetwork. The latter two entries are for checks against ${client_name} if 231864562Sgshapirothe IP address doesn't resolve to a hostname (or is considered as "may be 231990792Sgshapiroforged"). That is, using square brackets means these are host names, 232090792Sgshapironot network numbers. 232138032Speter 232264562SgshapiroWarning: if you change the RFC 821 compliant error code from the default 232364562Sgshapirovalue of 550, then you should probably also change the RFC 1893 compliant 232464562Sgshapiroerror code to match it. For example, if you use 232564562Sgshapiro 232690792Sgshapiro user@example.com ERROR:450 mailbox full 232764562Sgshapiro 232890792Sgshapirothe error returned would be "450 5.0.0 mailbox full" which is wrong. 232990792SgshapiroUse "ERROR:4.2.2:450 mailbox full" instead. 233064562Sgshapiro 233164562SgshapiroNote, UUCP users may need to add hostname.UUCP to the access database 233290792Sgshapiroor class {R}. 233364562Sgshapiro 233490792SgshapiroIf you also use: 233590792Sgshapiro 233643730Speter FEATURE(`relay_hosts_only') 233738032Speter 233838032Speterthen the above example will allow relaying for sendmail.org, but not 233938032Speterhosts within the sendmail.org domain. Note that this will also require 234064562Sgshapirohosts listed in class {R} to be fully qualified host names. 234138032Speter 234238032SpeterYou can also use the access database to block sender addresses based on 234338032Speterthe username portion of the address. For example: 234438032Speter 234566494Sgshapiro FREE.STEALTH.MAILER@ ERROR:550 Spam not accepted 234638032Speter 234738032SpeterNote that you must include the @ after the username to signify that 234838032Speterthis database entry is for checking only the username portion of the 234938032Spetersender address. 235038032Speter 235138032SpeterIf you use: 235238032Speter 235343730Speter FEATURE(`blacklist_recipients') 235438032Speter 235538032Speterthen you can add entries to the map for local users, hosts in your 235638032Speterdomains, or addresses in your domain which should not receive mail: 235738032Speter 235866494Sgshapiro badlocaluser@ ERROR:550 Mailbox disabled for this username 235966494Sgshapiro host.mydomain.com ERROR:550 That host does not accept mail 236066494Sgshapiro user@otherhost.mydomain.com ERROR:550 Mailbox disabled for this recipient 236138032Speter 236238032SpeterThis would prevent a recipient of badlocaluser@mydomain.com, any 236338032Speteruser at host.mydomain.com, and the single address 236464562Sgshapirouser@otherhost.mydomain.com from receiving mail. Please note: a 236564562Sgshapirolocal username must be now tagged with an @ (this is consistent 236664562Sgshapirowith the check of the sender address, and hence it is possible to 236764562Sgshapirodistinguish between hostnames and usernames). Enabling this feature 236864562Sgshapirowill keep you from sending mails to all addresses that have an 236964562Sgshapiroerror message or REJECT as value part in the access map. Taking 237064562Sgshapirothe example from above: 237138032Speter 237242575Speter spammer@aol.com REJECT 237342575Speter cyberspammer.com REJECT 237442575Speter 237542575SpeterMail can't be sent to spammer@aol.com or anyone at cyberspammer.com. 237642575Speter 237790792SgshapiroThere are several DNS based blacklists, the first of which was 237890792Sgshapirothe RBL (``Realtime Blackhole List'') run by the MAPS project, 237990792Sgshapirosee http://mail-abuse.org/. These are databases of spammers 238090792Sgshapiromaintained in DNS. To use such a database, specify 238138032Speter 238264562Sgshapiro FEATURE(`dnsbl') 238338032Speter 238490792SgshapiroThis will cause sendmail to reject mail from any site in the original 238580785SgshapiroRealtime Blackhole List database. This default DNS blacklist, 238680785Sgshapiroblackholes.mail-abuse.org, is a service offered by the Mail Abuse 238780785SgshapiroPrevention System (MAPS). As of July 31, 2001, MAPS is a subscription 238880785Sgshapiroservice, so using that network address won't work if you haven't 238980785Sgshapirosubscribed. Contact MAPS to subscribe (http://mail-abuse.org/). 239038032Speter 239180785SgshapiroYou can specify an alternative RBL server to check by specifying an 239280785Sgshapiroargument to the FEATURE. The default error message is 239380785Sgshapiro 239490792Sgshapiro Mail from IP-ADDRESS refused by blackhole site SERVER 239580785Sgshapiro 239690792Sgshapirowhere IP-ADDRESS and SERVER are replaced by the appropriate 239790792Sgshapiroinformation. A second argument can be used to specify a different 239890792Sgshapirotext. By default, temporary lookup failures are ignored and hence 239990792Sgshapirocause the connection not to be rejected by the DNS based rejection 240090792Sgshapirolist. This behavior can be changed by specifying a third argument, 240190792Sgshapirowhich must be either `t' or a full error message. For example: 240271345Sgshapiro 240390792Sgshapiro FEATURE(`dnsbl', `dnsbl.example.com', `', 240490792Sgshapiro `"451 Temporary lookup failure for " $&{client_addr} " in dnsbl.example.com"') 240571345Sgshapiro 240690792SgshapiroIf `t' is used, the error message is: 240790792Sgshapiro 240890792Sgshapiro 451 Temporary lookup failure of IP-ADDRESS at SERVER 240990792Sgshapiro 241090792Sgshapirowhere IP-ADDRESS and SERVER are replaced by the appropriate 241190792Sgshapiroinformation. 241290792Sgshapiro 241390792SgshapiroThis FEATURE can be included several times to query different 241490792SgshapiroDNS based rejection lists, e.g., the dial-up user list (see 241590792Sgshapirohttp://mail-abuse.org/dul/). 241690792Sgshapiro 241790792SgshapiroNotice: to avoid checking your own local domains against those 241890792Sgshapiroblacklists, use the access_db feature and add: 241990792Sgshapiro 242090792Sgshapiro Connect:10.1 OK 242190792Sgshapiro Connect:127.0.0.1 RELAY 242290792Sgshapiro 242390792Sgshapiroto the access map, where 10.1 is your local network. You may 242490792Sgshapirowant to use "RELAY" instead of "OK" to allow also relaying 242590792Sgshapiroinstead of just disabling the DNS lookups in the backlists. 242690792Sgshapiro 242790792Sgshapiro 242838032SpeterThe features described above make use of the check_relay, check_mail, 242938032Speterand check_rcpt rulesets. If you wish to include your own checks, 243038032Speteryou can put your checks in the rulesets Local_check_relay, 243138032SpeterLocal_check_mail, and Local_check_rcpt. For example if you wanted to 243238032Speterblock senders with all numeric usernames (i.e. 2312343@bigisp.com), 243390792Sgshapiroyou would use Local_check_mail and the regex map: 243438032Speter 243564562Sgshapiro LOCAL_CONFIG 243664562Sgshapiro Kallnumbers regex -a@MATCH ^[0-9]+$ 243764562Sgshapiro 243864562Sgshapiro LOCAL_RULESETS 243964562Sgshapiro SLocal_check_mail 244064562Sgshapiro # check address against various regex checks 244138032Speter R$* $: $>Parse0 $>3 $1 244264562Sgshapiro R$+ < @ bigisp.com. > $* $: $(allnumbers $1 $) 244364562Sgshapiro R@MATCH $#error $: 553 Header Error 244438032Speter 244538032SpeterThese rules are called with the original arguments of the corresponding 244638032Spetercheck_* ruleset. If the local ruleset returns $#OK, no further checking 244738032Speteris done by the features described above and the mail is accepted. If the 244838032Speterlocal ruleset resolves to a mailer (such as $#error or $#discard), the 244938032Speterappropriate action is taken. Otherwise, the results of the local 245038032Speterrewriting are ignored. 245138032Speter 245264562SgshapiroFiner control by using tags for the LHS of the access map 245390792Sgshapiro--------------------------------------------------------- 245438032Speter 245564562SgshapiroRead this section only if the options listed so far are not sufficient 245664562Sgshapirofor your purposes. There is now the option to tag entries in the 245764562Sgshapiroaccess map according to their type. Three tags are available: 245864562Sgshapiro 245964562Sgshapiro Connect: connection information (${client_addr}, ${client_name}) 246073188Sgshapiro From: envelope sender 246173188Sgshapiro To: envelope recipient 246264562Sgshapiro 246364562SgshapiroIf the required item is looked up in a map, it will be tried first 246464562Sgshapirowith the corresponding tag in front, then (as fallback to enable 246590792Sgshapirobackward compatibility) without any tag, unless the specific feature 246690792Sgshapirorequires a tag. For example, 246764562Sgshapiro 246864562Sgshapiro From:spammer@some.dom REJECT 246964562Sgshapiro To:friend.domain RELAY 247064562Sgshapiro Connect:friend.domain OK 247164562Sgshapiro Connect:from.domain RELAY 247264562Sgshapiro From:good@another.dom OK 247364562Sgshapiro From:another.dom REJECT 247464562Sgshapiro 247564562SgshapiroThis would deny mails from spammer@some.dom but you could still 247664562Sgshapirosend mail to that address even if FEATURE(`blacklist_recipients') 247764562Sgshapirois enabled. Your system will allow relaying to friend.domain, but 247864562Sgshapironot from it (unless enabled by other means). Connections from that 247964562Sgshapirodomain will be allowed even if it ends up in one of the DNS based 248064562Sgshapirorejection lists. Relaying is enabled from from.domain but not to 248164562Sgshapiroit (since relaying is based on the connection information for 248264562Sgshapirooutgoing relaying, the tag Connect: must be used; for incoming 248364562Sgshapirorelaying, which is based on the recipient address, To: must be 248464562Sgshapiroused). The last two entries allow mails from good@another.dom but 248564562Sgshapiroreject mail from all other addresses with another.dom as domain 248664562Sgshapiropart. 248764562Sgshapiro 248864562SgshapiroDelay all checks 248990792Sgshapiro---------------- 249064562Sgshapiro 249164562SgshapiroBy using FEATURE(`delay_checks') the rulesets check_mail and check_relay 249264562Sgshapirowill not be called when a client connects or issues a MAIL command, 249364562Sgshapirorespectively. Instead, those rulesets will be called by the check_rcpt 249464562Sgshapiroruleset; they will be skipped if a sender has been authenticated using 249564562Sgshapiroa "trusted" mechanism, i.e., one that is defined via TRUST_AUTH_MECH(). 249664562SgshapiroIf check_mail returns an error then the RCPT TO command will be rejected 249764562Sgshapirowith that error. If it returns some other result starting with $# then 249864562Sgshapirocheck_relay will be skipped. If the sender address (or a part of it) is 249964562Sgshapirolisted in the access map and it has a RHS of OK or RELAY, then check_relay 250064562Sgshapirowill be skipped. This has an interesting side effect: if your domain is 250164562Sgshapiromy.domain and you have 250264562Sgshapiro 250364562Sgshapiro my.domain RELAY 250464562Sgshapiro 250564562Sgshapiroin the access map, then all e-mail with a sender address of 250664562Sgshapiro<user@my.domain> gets through, even if check_relay would reject it 250764562Sgshapiro(e.g., based on the hostname or IP address). This allows spammers 250864562Sgshapiroto get around DNS based blacklist by faking the sender address. To 250964562Sgshapiroavoid this problem you have to use tagged entries: 251064562Sgshapiro 251164562Sgshapiro To:my.domain RELAY 251264562Sgshapiro Connect:my.domain RELAY 251364562Sgshapiro 251464562Sgshapiroif you need those entries at all (class {R} may take care of them). 251573188Sgshapiro 251664562SgshapiroFEATURE(`delay_checks') can take an optional argument: 251764562Sgshapiro 251864562Sgshapiro FEATURE(`delay_checks', `friend') 251964562Sgshapiro enables spamfriend test 252064562Sgshapiro FEATURE(`delay_checks', `hater') 252164562Sgshapiro enables spamhater test 252264562Sgshapiro 252394334SgshapiroIf such an argument is given, the recipient will be looked up in the 252494334Sgshapiroaccess map (using the tag Spam:). If the argument is `friend', then 252594334Sgshapirothe default behavior is to apply the other rulesets and make a SPAM 252694334Sgshapirofriend the exception. The rulesets check_mail and check_relay will be 252794334Sgshapiroskipped only if the recipient address is found and has RHS FRIEND. If 252894334Sgshapirothe argument is `hater', then the default behavior is to skip the rulesets 252994334Sgshapirocheck_mail and check_relay and make a SPAM hater the exception. The 253094334Sgshapiroother two rulesets will be applied only if the recipient address is 253194334Sgshapirofound and has RHS HATER. 253264562Sgshapiro 253364562SgshapiroThis allows for simple exceptions from the tests, e.g., by activating 253490792Sgshapirothe friend option and having 253564562Sgshapiro 253690792Sgshapiro Spam:abuse@ FRIEND 253764562Sgshapiro 253864562Sgshapiroin the access map, mail to abuse@localdomain will get through. It is 253964562Sgshapiroalso possible to specify a full address or an address with +detail: 254064562Sgshapiro 254190792Sgshapiro Spam:abuse@my.domain FRIEND 254290792Sgshapiro Spam:me+abuse@ FRIEND 254390792Sgshapiro Spam:spam.domain FRIEND 254464562Sgshapiro 254590792SgshapiroNote: The required tag has been changed in 8.12 from To: to Spam:. 254690792SgshapiroThis change is incompatible to previous versions. However, you can 254790792Sgshapiro(for now) simply add the new entries to the access map, the old 254890792Sgshapiroones will be ignored. As soon as you removed the old entries from 254990792Sgshapirothe access map, specify a third parameter (`n') to this feature and 255090792Sgshapirothe backward compatibility rules will not be in the generated .cf 255190792Sgshapirofile. 255264562Sgshapiro 255364562SgshapiroHeader Checks 255490792Sgshapiro------------- 255564562Sgshapiro 255638032SpeterYou can also reject mail on the basis of the contents of headers. 255738032SpeterThis is done by adding a ruleset call to the 'H' header definition command 255838032Speterin sendmail.cf. For example, this can be used to check the validity of 255938032Spetera Message-ID: header: 256038032Speter 256138032Speter LOCAL_RULESETS 256238032Speter HMessage-Id: $>CheckMessageId 256338032Speter 256438032Speter SCheckMessageId 256538032Speter R< $+ @ $+ > $@ OK 256638032Speter R$* $#error $: 553 Header Error 256738032Speter 256864562SgshapiroThe alternative format: 256938032Speter 257064562Sgshapiro HSubject: $>+CheckSubject 257142575Speter 257264562Sgshapirothat is, $>+ instead of $>, gives the full Subject: header including 257364562Sgshapirocomments to the ruleset (comments in parentheses () are stripped 257464562Sgshapiroby default). 257542575Speter 257664562SgshapiroA default ruleset for headers which don't have a specific ruleset 257764562Sgshapirodefined for them can be given by: 257842575Speter 257964562Sgshapiro H*: $>CheckHdr 258043730Speter 258190792SgshapiroNotice: 258290792Sgshapiro1. All rules act on tokens as explained in doc/op/op.{me,ps,txt}. 258373188SgshapiroThat may cause problems with simple header checks due to the 258490792Sgshapirotokenization. It might be simpler to use a regex map and apply it 258573188Sgshapiroto $&{currHeader}. 258690792Sgshapiro2. There are no default rulesets coming with this distribution of 258790792Sgshapirosendmail. You can either write your own or you can search the 258890792SgshapiroWWW for examples, e.g., http://www.digitalanswers.org/check_local/ 258973188Sgshapiro 259064562SgshapiroAfter all of the headers are read, the check_eoh ruleset will be called for 259164562Sgshapiroany final header-related checks. The ruleset is called with the number of 259264562Sgshapiroheaders and the size of all of the headers in bytes separated by $|. One 259364562Sgshapiroexample usage is to reject messages which do not have a Message-Id: 259464562Sgshapiroheader. However, the Message-Id: header is *NOT* a required header and is 259564562Sgshapironot a guaranteed spam indicator. This ruleset is an example and should 259664562Sgshapiroprobably not be used in production. 259764562Sgshapiro 259864562Sgshapiro LOCAL_CONFIG 259964562Sgshapiro Kstorage macro 260064562Sgshapiro 260164562Sgshapiro LOCAL_RULESETS 260264562Sgshapiro HMessage-Id: $>CheckMessageId 260364562Sgshapiro 260464562Sgshapiro SCheckMessageId 260564562Sgshapiro # Record the presence of the header 260664562Sgshapiro R$* $: $(storage {MessageIdCheck} $@ OK $) $1 260764562Sgshapiro R< $+ @ $+ > $@ OK 260864562Sgshapiro R$* $#error $: 553 Header Error 260964562Sgshapiro 261064562Sgshapiro Scheck_eoh 261164562Sgshapiro # Check the macro 261264562Sgshapiro R$* $: < $&{MessageIdCheck} > 261364562Sgshapiro # Clear the macro for the next message 261464562Sgshapiro R$* $: $(storage {MessageIdCheck} $) $1 261564562Sgshapiro # Has a Message-Id: header 261664562Sgshapiro R< $+ > $@ OK 261764562Sgshapiro # Allow missing Message-Id: from local mail 261864562Sgshapiro R$* $: < $&{client_name} > 261964562Sgshapiro R< > $@ OK 262064562Sgshapiro R< $=w > $@ OK 262164562Sgshapiro # Otherwise, reject the mail 262264562Sgshapiro R$* $#error $: 553 Header Error 262364562Sgshapiro 262466494Sgshapiro+----------+ 262566494Sgshapiro| STARTTLS | 262666494Sgshapiro+----------+ 262764562Sgshapiro 262864562SgshapiroIn this text, cert will be used as an abreviation for X.509 certificate, 262990792SgshapiroDN (CN) is the distinguished (common) name of a cert, and CA is a 263090792Sgshapirocertification authority, which signs (issues) certs. 263164562Sgshapiro 263280785SgshapiroFor STARTTLS to be offered by sendmail you need to set at least 263380785Sgshapirothis variables (the file names and paths are just examples): 263480785Sgshapiro 263580785Sgshapiro define(`confCACERT_PATH', `/etc/mail/certs/') 263680785Sgshapiro define(`confCACERT', `/etc/mail/certs/CA.cert.pem') 263780785Sgshapiro define(`confSERVER_CERT', `/etc/mail/certs/my.cert.pem') 263880785Sgshapiro define(`confSERVER_KEY', `/etc/mail/certs/my.key.pem') 263980785Sgshapiro 264080785SgshapiroOn systems which do not have the compile flag HASURANDOM set (see 264180785Sgshapirosendmail/README) you also must set confRAND_FILE. 264280785Sgshapiro 264390792SgshapiroSee doc/op/op.{me,ps,txt} for more information about these options, 264490792Sgshapiroespecially the sections ``Certificates for STARTTLS'' and ``PRNG for 264580785SgshapiroSTARTTLS''. 264680785Sgshapiro 264764562SgshapiroMacros related to STARTTLS are: 264864562Sgshapiro 264964562Sgshapiro${cert_issuer} holds the DN of the CA (the cert issuer). 265064562Sgshapiro${cert_subject} holds the DN of the cert (called the cert subject). 265190792Sgshapiro${cn_issuer} holds the CN of the CA (the cert issuer). 265290792Sgshapiro${cn_subject} holds the CN of the cert (called the cert subject). 265364562Sgshapiro${tls_version} the TLS/SSL version used for the connection, e.g., TLSv1, 265490792Sgshapiro TLSv1/SSLv3, SSLv3, SSLv2. 265564562Sgshapiro${cipher} the cipher used for the connection, e.g., EDH-DSS-DES-CBC3-SHA, 265664562Sgshapiro EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA. 265764562Sgshapiro${cipher_bits} the keylength (in bits) of the symmetric encryption algorithm 265864562Sgshapiro used for the connection. 265990792Sgshapiro${verify} holds the result of the verification of the presented cert. 266090792Sgshapiro Possible values are: 266190792Sgshapiro OK verification succeeded. 266290792Sgshapiro NO no cert presented. 266390792Sgshapiro NOT no cert requested. 266490792Sgshapiro FAIL cert presented but could not be verified, 266590792Sgshapiro e.g., the cert of the signing CA is missing. 266690792Sgshapiro NONE STARTTLS has not been performed. 266790792Sgshapiro TEMP temporary error occurred. 266890792Sgshapiro PROTOCOL protocol error occurred (SMTP level). 266964562Sgshapiro SOFTWARE STARTTLS handshake failed. 267090792Sgshapiro${server_name} the name of the server of the current outgoing SMTP 267164562Sgshapiro connection. 267290792Sgshapiro${server_addr} the address of the server of the current outgoing SMTP 267364562Sgshapiro connection. 267464562Sgshapiro 267564562SgshapiroRelaying 267690792Sgshapiro-------- 267764562Sgshapiro 267864562SgshapiroSMTP STARTTLS can allow relaying for senders who have successfully 267990792Sgshapiroauthenticated themselves. This is done in the ruleset RelayAuth. If the 268064562Sgshapiroverification of the cert failed (${verify} != OK), relaying is subject to 268190792Sgshapirothe usual rules. Otherwise the DN of the issuer is looked up in the access 268290792Sgshapiromap using the tag CERTISSUER. If the resulting value is RELAY, relaying is 268390792Sgshapiroallowed. If it is SUBJECT, the DN of the cert subject is looked up next in 268490792Sgshapirothe access map using the tag CERTSUBJECT. If the value is RELAY, relaying 268564562Sgshapirois allowed. 268664562Sgshapiro 268764562SgshapiroTo make things a bit more flexible (or complicated), the values for 268864562Sgshapiro${cert_issuer} and ${cert_subject} can be optionally modified by regular 268964562Sgshapiroexpressions defined in the m4 variables _CERT_REGEX_ISSUER_ and 269090792Sgshapiro_CERT_REGEX_SUBJECT_, respectively. To avoid problems with those macros in 269164562Sgshapirorulesets and map lookups, they are modified as follows: each non-printable 269264562Sgshapirocharacter and the characters '<', '>', '(', ')', '"', '+' are replaced by 269390792Sgshapirotheir HEX value with a leading '+'. For example: 269464562Sgshapiro 269564562Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/Email= 269664562Sgshapirodarth+cert@endmail.org 269764562Sgshapiro 269864562Sgshapirois encoded as: 269964562Sgshapiro 270064562Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN= 270164562SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 270264562Sgshapiro 270364562Sgshapiro(line breaks have been inserted for readability). 270464562Sgshapiro 270590792SgshapiroExamples: 270690792Sgshapiro 270790792SgshapiroTo allow relaying for everyone who can present a cert signed by 270890792Sgshapiro 270990792Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN= 271090792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 271190792Sgshapiro 271290792Sgshapirosimply use: 271390792Sgshapiro 271490792SgshapiroCERTIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN= 271590792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org RELAY 271690792Sgshapiro 271790792SgshapiroTo allow relaying only for a subset of machines that have a cert signed by 271890792Sgshapiro 271990792Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN= 272090792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 272190792Sgshapiro 272290792Sgshapirouse: 272390792Sgshapiro 272490792SgshapiroCERTIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN= 272590792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org SUBJECT 272690792SgshapiroCERTSubject:/C=US/ST=California/O=endmail.org/OU=private/CN= 272790792SgshapiroDeathStar/Email=deathstar@endmail.org RELAY 272890792Sgshapiro 272990792SgshapiroNote: line breaks have been inserted after "CN=" for readability, 273090792Sgshapiroeach tagged entry must be one (long) line in the access map. 273190792Sgshapiro 273290792SgshapiroOf course it is also possible to write a simple ruleset that allows 273364562Sgshapirorelaying for everyone who can present a cert that can be verified, e.g., 273464562Sgshapiro 273564562SgshapiroLOCAL_RULESETS 273664562SgshapiroSLocal_check_rcpt 273764562SgshapiroR$* $: $&{verify} 273864562SgshapiroROK $# OK 273964562Sgshapiro 274064562SgshapiroAllowing Connections 274190792Sgshapiro-------------------- 274264562Sgshapiro 274390792SgshapiroThe rulesets tls_server, tls_client, and tls_rcpt are used to decide whether 274490792Sgshapiroan SMTP connection is accepted (or should continue). 274564562Sgshapiro 274664562Sgshapirotls_server is called when sendmail acts as client after a STARTTLS command 274790792Sgshapiro(should) have been issued. The parameter is the value of ${verify}. 274864562Sgshapiro 274964562Sgshapirotls_client is called when sendmail acts as server, after a STARTTLS command 275090792Sgshapirohas been issued, and from check_mail. The parameter is the value of 275164562Sgshapiro${verify} and STARTTLS or MAIL, respectively. 275264562Sgshapiro 275390792SgshapiroBoth rulesets behave the same. If no access map is in use, the connection 275464562Sgshapirowill be accepted unless ${verify} is SOFTWARE, in which case the connection 275590792Sgshapirois always aborted. For tls_server/tls_client, ${client_name}/${server_name} 275690792Sgshapirois looked up in the access map using the tag TLS_Srv/TLS_Clt, which is done 275790792Sgshapirowith the ruleset LookUpDomain. If no entry is found, ${client_addr} 275864562Sgshapiro(${server_addr}) is looked up in the access map (same tag, ruleset 275990792SgshapiroLookUpAddr). If this doesn't result in an entry either, just the tag is 276090792Sgshapirolooked up in the access map (included the trailing colon). Notice: 276190792Sgshapirorequiring that e-mail is sent to a server only encrypted, e.g., via 276264562Sgshapiro 276390792SgshapiroTLS_Srv:secure.domain ENCR:112 276490792Sgshapiro 276590792Sgshapirodoesn't necessarily mean that e-mail sent to that domain is encrypted. 276690792SgshapiroIf the domain has multiple MX servers, e.g., 276790792Sgshapiro 276890792Sgshapirosecure.domain. IN MX 10 mail.secure.domain. 276990792Sgshapirosecure.domain. IN MX 50 mail.other.domain. 277090792Sgshapiro 277190792Sgshapirothen mail to user@secure.domain may go unencrypted to mail.other.domain. 277290792Sgshapirotls_rcpt can be used to address this problem. 277390792Sgshapiro 277490792Sgshapirotls_rcpt is called before a RCPT TO: command is sent. The parameter is the 277590792Sgshapirocurrent recipient. This ruleset is only defined if FEATURE(`access_db') 277690792Sgshapirois selected. A recipient address user@domain is looked up in the access 277790792Sgshapiromap in four formats: TLS_Rcpt:user@domain, TLS_Rcpt:user@, TLS_Rcpt:domain, 277890792Sgshapiroand TLS_Rcpt:; the first match is taken. 277990792Sgshapiro 278090792SgshapiroThe result of the lookups is then used to call the ruleset TLS_connection, 278190792Sgshapirowhich checks the requirement specified by the RHS in the access map against 278290792Sgshapirothe actual parameters of the current TLS connection, esp. ${verify} and 278390792Sgshapiro${cipher_bits}. Legal RHSs in the access map are: 278490792Sgshapiro 278564562SgshapiroVERIFY verification must have succeeded 278664562SgshapiroVERIFY:bits verification must have succeeded and ${cipher_bits} must 278764562Sgshapiro be greater than or equal bits. 278864562SgshapiroENCR:bits ${cipher_bits} must be greater than or equal bits. 278964562Sgshapiro 279064562SgshapiroThe RHS can optionally be prefixed by TEMP+ or PERM+ to select a temporary 279190792Sgshapiroor permanent error. The default is a temporary error code (403 4.7.0) 279264562Sgshapirounless the macro TLS_PERM_ERR is set during generation of the .cf file. 279364562Sgshapiro 279464562SgshapiroIf a certain level of encryption is required, then it might also be 279564562Sgshapiropossible that this level is provided by the security layer from a SASL 279664562Sgshapiroalgorithm, e.g., DIGEST-MD5. 279764562Sgshapiro 279890792SgshapiroFurthermore, there can be a list of extensions added. Such a list 279990792Sgshapirostarts with '+' and the items are separated by '++'. Allowed 280090792Sgshapiroextensions are: 280190792Sgshapiro 280290792SgshapiroCN:name name must match ${cn_subject} 280390792SgshapiroCN ${server_name} must match ${cn_subject} 280490792SgshapiroCS:name name must match ${cert_subject} 280590792SgshapiroCI:name name must match ${cert_issuer} 280690792Sgshapiro 280782017SgshapiroExample: e-mail sent to secure.example.com should only use an encrypted 280890792Sgshapiroconnection. E-mail received from hosts within the laptop.example.com domain 280990792Sgshapiroshould only be accepted if they have been authenticated. The host which 281090792Sgshapiroreceives e-mail for darth@endmail.org must present a cert that uses the 281190792SgshapiroCN smtp.endmail.org. 281290792Sgshapiro 281364562SgshapiroTLS_Srv:secure.example.com ENCR:112 281464562SgshapiroTLS_Clt:laptop.example.com PERM+VERIFY:112 281590792SgshapiroTLS_Rcpt:darth@endmail.org ENCR:112+CN:smtp.endmail.org 281664562Sgshapiro 281773188Sgshapiro 281890792SgshapiroDisabling STARTTLS And Setting SMTP Server Features 281990792Sgshapiro--------------------------------------------------- 282073188Sgshapiro 282190792SgshapiroBy default STARTTLS is used whenever possible. However, there are 282290792Sgshapirosome broken MTAs that don't properly implement STARTTLS. To be able 282390792Sgshapiroto send to (or receive from) those MTAs, the ruleset try_tls 282490792Sgshapiro(srv_features) can be used that work together with the access map. 282590792SgshapiroEntries for the access map must be tagged with Try_TLS (Srv_Features) 282690792Sgshapiroand refer to the hostname or IP address of the connecting system. 282790792SgshapiroA default case can be specified by using just the tag. For example, 282890792Sgshapirothe following entries in the access map: 282973188Sgshapiro 283090792Sgshapiro Try_TLS:broken.server NO 283190792Sgshapiro Srv_Features:my.domain v 283290792Sgshapiro Srv_Features: V 283373188Sgshapiro 283490792Sgshapirowill turn off STARTTLS when sending to broken.server (or any host 283590792Sgshapiroin that domain), and request a client certificate during the TLS 283690792Sgshapirohandshake only for hosts in my.domain. The valid entries on the RHS 283790792Sgshapirofor Srv_Features are listed in the Sendmail Installation and 283890792SgshapiroOperations Guide. 283973188Sgshapiro 284073188Sgshapiro 284164562SgshapiroReceived: Header 284290792Sgshapiro---------------- 284364562Sgshapiro 284490792SgshapiroThe Received: header reveals whether STARTTLS has been used. It contains an 284564562Sgshapiroextra line: 284664562Sgshapiro 284790792Sgshapiro(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify}) 284864562Sgshapiro 284990792Sgshapiro 285066494Sgshapiro+---------------------+ 285166494Sgshapiro| SMTP AUTHENTICATION | 285266494Sgshapiro+---------------------+ 285364562Sgshapiro 285464562SgshapiroThe macros ${auth_authen}, ${auth_author}, and ${auth_type} can be 285564562Sgshapiroused in anti-relay rulesets to allow relaying for those users that 285664562Sgshapiroauthenticated themselves. A very simple example is: 285764562Sgshapiro 285864562SgshapiroSLocal_check_rcpt 285964562SgshapiroR$* $: $&{auth_type} 286064562SgshapiroR$+ $# OK 286164562Sgshapiro 286264562Sgshapirowhich checks whether a user has successfully authenticated using 286364562Sgshapiroany available mechanism. Depending on the setup of the CYRUS SASL 286464562Sgshapirolibrary, more sophisticated rulesets might be required, e.g., 286564562Sgshapiro 286664562SgshapiroSLocal_check_rcpt 286764562SgshapiroR$* $: $&{auth_type} $| $&{auth_authen} 286864562SgshapiroRDIGEST-MD5 $| $+@$=w $# OK 286964562Sgshapiro 287064562Sgshapiroto allow relaying for users that authenticated using DIGEST-MD5 287164562Sgshapiroand have an identity in the local domains. 287264562Sgshapiro 287390792SgshapiroThe ruleset trust_auth is used to determine whether a given AUTH= 287464562Sgshapiroparameter (that is passed to this ruleset) should be trusted. This 287564562Sgshapiroruleset may make use of the other ${auth_*} macros. Only if the 287664562Sgshapiroruleset resolves to the error mailer, the AUTH= parameter is not 287764562Sgshapirotrusted. A user supplied ruleset Local_trust_auth can be written 287864562Sgshapiroto modify the default behavior, which only trust the AUTH= 287964562Sgshapiroparameter if it is identical to the authenticated user. 288064562Sgshapiro 288164562SgshapiroPer default, relaying is allowed for any user who authenticated 288264562Sgshapirovia a "trusted" mechanism, i.e., one that is defined via 288364562SgshapiroTRUST_AUTH_MECH(`list of mechanisms') 288471345SgshapiroFor example: 288571345SgshapiroTRUST_AUTH_MECH(`KERBEROS_V4 DIGEST-MD5') 288664562Sgshapiro 288764562SgshapiroIf the selected mechanism provides a security layer the number of 288864562Sgshapirobits used for the key of the symmetric cipher is stored in the 288964562Sgshapiromacro ${auth_ssf}. 289064562Sgshapiro 289190792SgshapiroIf sendmail acts as client, it needs some information how to 289290792Sgshapiroauthenticate against another MTA. This information can be provided 289390792Sgshapiroby the ruleset authinfo or by the option DefaultAuthInfo. The 289490792Sgshapiroauthinfo ruleset looks up {server_name} using the tag AuthInfo: in 289590792Sgshapirothe access map. If no entry is found, {server_addr} is looked up 289690792Sgshapiroin the same way and finally just the tag AuthInfo: to provide 289790792Sgshapirodefault values. 289890792Sgshapiro 289990792SgshapiroNotice: the default configuration file causes the option DefaultAuthInfo 290090792Sgshapiroto fail since the ruleset authinfo is in the .cf file. If you really 290190792Sgshapirowant to use DefaultAuthInfo (it is deprecated) then you have to 290290792Sgshapiroremove the ruleset. 290390792Sgshapiro 290490792SgshapiroThe RHS for an AuthInfo: entry in the access map should consists of a 290590792Sgshapirolist of tokens, each of which has the form: "TDstring" (including 290690792Sgshapirothe quotes). T is a tag which describes the item, D is a delimiter, 290790792Sgshapiroeither ':' for simple text or '=' for a base64 encoded string. 290890792SgshapiroValid values for the tag are: 290990792Sgshapiro 291090792Sgshapiro U user (authorization) id 291190792Sgshapiro I authentication id 291290792Sgshapiro P password 291390792Sgshapiro R realm 291490792Sgshapiro M list of mechanisms delimited by spaces 291590792Sgshapiro 291690792SgshapiroExample entries are: 291790792Sgshapiro 291890792SgshapiroAuthInfo:other.dom "U:user" "I:user" "P:secret" "R:other.dom" "M:DIGEST-MD5" 291990792SgshapiroAuthInfo:more.dom "U:user" "P=c2VjcmV0" 292090792Sgshapiro 292190792SgshapiroUser or authentication id must exist as well as the password. All 292290792Sgshapiroother entries have default values. If one of user or authentication 292390792Sgshapiroid is missing, the existing value is used for the missing item. 292490792SgshapiroIf "R:" is not specified, realm defaults to $j. The list of mechanisms 292590792Sgshapirodefaults to those specified by AuthMechanisms. 292690792Sgshapiro 292790792SgshapiroSince this map contains sensitive information, either the access 292890792Sgshapiromap must be unreadable by everyone but root (or the trusted user) 292990792Sgshapiroor FEATURE(`authinfo') must be used which provides a separate map. 293090792SgshapiroNotice: It is not checked whether the map is actually 293190792Sgshapirogroup/world-unreadable, this is left to the user. 293290792Sgshapiro 293364562Sgshapiro+--------------------------------+ 293438032Speter| ADDING NEW MAILERS OR RULESETS | 293538032Speter+--------------------------------+ 293638032Speter 293738032SpeterSometimes you may need to add entirely new mailers or rulesets. They 293838032Spetershould be introduced with the constructs MAILER_DEFINITIONS and 293938032SpeterLOCAL_RULESETS respectively. For example: 294038032Speter 294138032Speter MAILER_DEFINITIONS 294238032Speter Mmymailer, ... 294338032Speter ... 294438032Speter 294538032Speter LOCAL_RULESETS 294638032Speter Smyruleset 294738032Speter ... 294838032Speter 294990792SgshapiroLocal additions for the rulesets srv_features, try_tls, tls_rcpt, 295090792Sgshapirotls_client, and tls_server can be made using LOCAL_SRV_FEATURES, 295190792SgshapiroLOCAL_TRY_TLS, LOCAL_TLS_RCPT, LOCAL_TLS_CLIENT, and LOCAL_TLS_SERVER, 295290792Sgshapirorespectively. For example, to add a local ruleset that decides 295390792Sgshapirowhether to try STARTTLS in a sendmail client, use: 295438032Speter 295590792Sgshapiro LOCAL_TRY_TLS 295690792Sgshapiro R... 295790792Sgshapiro 295890792SgshapiroNote: you don't need to add a name for the ruleset, it is implicitly 295990792Sgshapirodefined by using the appropriate macro. 296090792Sgshapiro 296190792Sgshapiro 296271345Sgshapiro+-------------------------+ 296371345Sgshapiro| ADDING NEW MAIL FILTERS | 296471345Sgshapiro+-------------------------+ 296564562Sgshapiro 296664562SgshapiroSendmail supports mail filters to filter incoming SMTP messages according 296764562Sgshapiroto the "Sendmail Mail Filter API" documentation. These filters can be 296864562Sgshapiroconfigured in your mc file using the two commands: 296964562Sgshapiro 297064562Sgshapiro MAIL_FILTER(`name', `equates') 297164562Sgshapiro INPUT_MAIL_FILTER(`name', `equates') 297264562Sgshapiro 297364562SgshapiroThe first command, MAIL_FILTER(), simply defines a filter with the given 297464562Sgshapironame and equates. For example: 297564562Sgshapiro 297664562Sgshapiro MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 297764562Sgshapiro 297864562SgshapiroThis creates the equivalent sendmail.cf entry: 297964562Sgshapiro 298064562Sgshapiro Xarchive, S=local:/var/run/archivesock, F=R 298164562Sgshapiro 298264562SgshapiroThe INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER 298364562Sgshapirobut also populates the m4 variable `confINPUT_MAIL_FILTERS' with the name 298464562Sgshapiroof the filter such that the filter will actually be called by sendmail. 298564562Sgshapiro 298664562SgshapiroFor example, the two commands: 298764562Sgshapiro 298864562Sgshapiro INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 298964562Sgshapiro INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T') 299064562Sgshapiro 299164562Sgshapiroare equivalent to the three commands: 299264562Sgshapiro 299364562Sgshapiro MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 299464562Sgshapiro MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T') 299564562Sgshapiro define(`confINPUT_MAIL_FILTERS', `archive, spamcheck') 299664562Sgshapiro 299764562SgshapiroIn general, INPUT_MAIL_FILTER() should be used unless you need to define 299864562Sgshapiromore filters than you want to use for `confINPUT_MAIL_FILTERS'. 299964562Sgshapiro 300064562SgshapiroNote that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER() 300164562Sgshapirocommands will clear the list created by the prior INPUT_MAIL_FILTER() 300264562Sgshapirocommands. 300364562Sgshapiro 300464562Sgshapiro 300590792Sgshapiro+-------------------------+ 300690792Sgshapiro| QUEUE GROUP DEFINITIONS | 300790792Sgshapiro+-------------------------+ 300890792Sgshapiro 300990792SgshapiroIn addition to the queue directory (which is the default queue group 301090792Sgshapirocalled "mqueue"), sendmail can deal with multiple queue groups, which 301190792Sgshapiroare collections of queue directories with the same behaviour. Queue 301290792Sgshapirogroups can be defined using the command: 301390792Sgshapiro 301490792Sgshapiro QUEUE_GROUP(`name', `equates') 301590792Sgshapiro 301690792SgshapiroFor details about queue groups, please see doc/op/op.{me,ps,txt}. 301790792Sgshapiro 301838032Speter+-------------------------------+ 301938032Speter| NON-SMTP BASED CONFIGURATIONS | 302038032Speter+-------------------------------+ 302138032Speter 302264562SgshapiroThese configuration files are designed primarily for use by 302364562SgshapiroSMTP-based sites. They may not be well tuned for UUCP-only or 302438032SpeterUUCP-primarily nodes (the latter is defined as a small local net 302564562Sgshapiroconnected to the rest of the world via UUCP). However, there is 302664562Sgshapiroone hook to handle some special cases. 302738032Speter 302838032SpeterYou can define a ``smart host'' that understands a richer address syntax 302938032Speterusing: 303038032Speter 303143730Speter define(`SMART_HOST', `mailer:hostname') 303238032Speter 303338032SpeterIn this case, the ``mailer:'' defaults to "relay". Any messages that 303438032Spetercan't be handled using the usual UUCP rules are passed to this host. 303538032Speter 303638032SpeterIf you are on a local SMTP-based net that connects to the outside 303738032Speterworld via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules. 303838032SpeterFor example: 303938032Speter 304064562Sgshapiro define(`SMART_HOST', `uucp-new:uunet') 304138032Speter LOCAL_NET_CONFIG 304238032Speter R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 304338032Speter 304494334SgshapiroThis will cause all names that end in your domain name ($m) to be sent 304594334Sgshapirovia SMTP; anything else will be sent via uucp-new (smart UUCP) to uunet. 304643730SpeterIf you have FEATURE(`nocanonify'), you may need to omit the dots after 304738032Speterthe $m. If you are running a local DNS inside your domain which is 304838032Speternot otherwise connected to the outside world, you probably want to 304938032Speteruse: 305038032Speter 305143730Speter define(`SMART_HOST', `smtp:fire.wall.com') 305238032Speter LOCAL_NET_CONFIG 305338032Speter R$* < @ $* . > $* $#smtp $@ $2. $: $1 < @ $2. > $3 305438032Speter 305538032SpeterThat is, send directly only to things you found in your DNS lookup; 305638032Speteranything else goes through SMART_HOST. 305738032Speter 305838032SpeterYou may need to turn off the anti-spam rules in order to accept 305943730SpeterUUCP mail with FEATURE(`promiscuous_relay') and 306043730SpeterFEATURE(`accept_unresolvable_domains'). 306138032Speter 306238032Speter 306338032Speter+-----------+ 306438032Speter| WHO AM I? | 306538032Speter+-----------+ 306638032Speter 306738032SpeterNormally, the $j macro is automatically defined to be your fully 306838032Speterqualified domain name (FQDN). Sendmail does this by getting your 306938032Speterhost name using gethostname and then calling gethostbyname on the 307038032Speterresult. For example, in some environments gethostname returns 307138032Speteronly the root of the host name (such as "foo"); gethostbyname is 307238032Spetersupposed to return the FQDN ("foo.bar.com"). In some (fairly rare) 307338032Spetercases, gethostbyname may fail to return the FQDN. In this case 307438032Speteryou MUST define confDOMAIN_NAME to be your fully qualified domain 307538032Spetername. This is usually done using: 307638032Speter 307738032Speter Dmbar.com 307838032Speter define(`confDOMAIN_NAME', `$w.$m')dnl 307938032Speter 308038032Speter 308164562Sgshapiro+-----------------------------------+ 308264562Sgshapiro| ACCEPTING MAIL FOR MULTIPLE NAMES | 308364562Sgshapiro+-----------------------------------+ 308464562Sgshapiro 308564562SgshapiroIf your host is known by several different names, you need to augment 308664562Sgshapiroclass {w}. This is a list of names by which your host is known, and 308764562Sgshapiroanything sent to an address using a host name in this list will be 308864562Sgshapirotreated as local mail. You can do this in two ways: either create the 308964562Sgshapirofile /etc/mail/local-host-names containing a list of your aliases (one per 309064562Sgshapiroline), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add 309164562Sgshapiro``LOCAL_DOMAIN(`alias.host.name')''. Be sure you use the fully-qualified 309264562Sgshapironame of the host, rather than a short name. 309364562Sgshapiro 309464562SgshapiroIf you want to have different address in different domains, take 309564562Sgshapiroa look at the virtusertable feature, which is also explained at 309664562Sgshapirohttp://www.sendmail.org/virtual-hosting.html 309764562Sgshapiro 309864562Sgshapiro 309938032Speter+--------------------+ 310038032Speter| USING MAILERTABLES | 310138032Speter+--------------------+ 310238032Speter 310343730SpeterTo use FEATURE(`mailertable'), you will have to create an external 310438032Speterdatabase containing the routing information for various domains. 310538032SpeterFor example, a mailertable file in text format might be: 310638032Speter 310738032Speter .my.domain xnet:%1.my.domain 310864562Sgshapiro uuhost1.my.domain uucp-new:uuhost1 310938032Speter .bitnet smtp:relay.bit.net 311038032Speter 311164562SgshapiroThis should normally be stored in /etc/mail/mailertable. The actual 311238032Speterdatabase version of the mailertable is built using: 311338032Speter 311464562Sgshapiro makemap hash /etc/mail/mailertable < /etc/mail/mailertable 311538032Speter 311638032SpeterThe semantics are simple. Any LHS entry that does not begin with 311738032Spetera dot matches the full host name indicated. LHS entries beginning 311866494Sgshapirowith a dot match anything ending with that domain name (including 311966494Sgshapirothe leading dot) -- that is, they can be thought of as having a 312066494Sgshapiroleading ".+" regular expression pattern for a non-empty sequence of 312166494Sgshapirocharacters. Matching is done in order of most-to-least qualified 312266494Sgshapiro-- for example, even though ".my.domain" is listed first in the 312366494Sgshapiroabove example, an entry of "uuhost1.my.domain" will match the second 312466494Sgshapiroentry since it is more explicit. Note: e-mail to "user@my.domain" 312566494Sgshapirodoes not match any entry in the above table. You need to have 312666494Sgshapirosomething like: 312738032Speter 312864562Sgshapiro my.domain esmtp:host.my.domain 312964562Sgshapiro 313038032SpeterThe RHS should always be a "mailer:host" pair. The mailer is the 313190792Sgshapiroconfiguration name of a mailer (that is, an M line in the 313238032Spetersendmail.cf file). The "host" will be the hostname passed to 313338032Speterthat mailer. In domain-based matches (that is, those with leading 313438032Speterdots) the "%1" may be used to interpolate the wildcarded part of 313538032Speterthe host name. For example, the first line above sends everything 313638032Speteraddressed to "anything.my.domain" to that same host name, but using 313738032Speterthe (presumably experimental) xnet mailer. 313838032Speter 313938032SpeterIn some cases you may want to temporarily turn off MX records, 314038032Speterparticularly on gateways. For example, you may want to MX 314138032Spetereverything in a domain to one machine that then forwards it 314238032Speterdirectly. To do this, you might use the DNS configuration: 314338032Speter 314438032Speter *.domain. IN MX 0 relay.machine 314538032Speter 314638032Speterand on relay.machine use the mailertable: 314738032Speter 314838032Speter .domain smtp:[gateway.domain] 314938032Speter 315038032SpeterThe [square brackets] turn off MX records for this host only. 315138032SpeterIf you didn't do this, the mailertable would use the MX record 315238032Speteragain, which would give you an MX loop. 315338032Speter 315438032Speter 315538032Speter+--------------------------------+ 315638032Speter| USING USERDB TO MAP FULL NAMES | 315738032Speter+--------------------------------+ 315838032Speter 315938032SpeterThe user database was not originally intended for mapping full names 316038032Speterto login names (e.g., Eric.Allman => eric), but some people are using 316164562Sgshapiroit that way. (it is recommended that you set up aliases for this 316238032Speterpurpose instead -- since you can specify multiple alias files, this 316338032Speteris fairly easy.) The intent was to locate the default maildrop at 316438032Spetera site, but allow you to override this by sending to a specific host. 316538032Speter 316638032SpeterIf you decide to set up the user database in this fashion, it is 316743730Speterimperative that you not use FEATURE(`stickyhost') -- otherwise, 316838032Spetere-mail sent to Full.Name@local.host.name will be rejected. 316938032Speter 317038032SpeterTo build the internal form of the user database, use: 317138032Speter 317264562Sgshapiro makemap btree /etc/mail/userdb < /etc/mail/userdb.txt 317338032Speter 317464562SgshapiroAs a general rule, it is an extremely bad idea to using full names 317564562Sgshapiroas e-mail addresses, since they are not in any sense unique. For 317666494Sgshapiroexample, the UNIX software-development community has at least two 317764562Sgshapirowell-known Peter Deutsches, and at one time Bell Labs had two 317864562SgshapiroStephen R. Bournes with offices along the same hallway. Which one 317964562Sgshapirowill be forced to suffer the indignity of being Stephen_R_Bourne_2? 318064562SgshapiroThe less famous of the two, or the one that was hired later? 318138032Speter 318238032SpeterFinger should handle full names (and be fuzzy). Mail should use 318364562Sgshapirohandles, and not be fuzzy. 318438032Speter 318538032Speter 318638032Speter+--------------------------------+ 318738032Speter| MISCELLANEOUS SPECIAL FEATURES | 318838032Speter+--------------------------------+ 318938032Speter 319038032SpeterPlussed users 319138032Speter Sometimes it is convenient to merge configuration on a 319238032Speter centralized mail machine, for example, to forward all 319338032Speter root mail to a mail server. In this case it might be 319438032Speter useful to be able to treat the root addresses as a class 319538032Speter of addresses with subtle differences. You can do this 319638032Speter using plussed users. For example, a client might include 319738032Speter the alias: 319838032Speter 319938032Speter root: root+client1@server 320038032Speter 320138032Speter On the server, this will match an alias for "root+client1". 320238032Speter If that is not found, the alias "root+*" will be tried, 320338032Speter then "root". 320438032Speter 320538032Speter 320638032Speter+----------------+ 320738032Speter| SECURITY NOTES | 320838032Speter+----------------+ 320938032Speter 321038032SpeterA lot of sendmail security comes down to you. Sendmail 8 is much 321138032Spetermore careful about checking for security problems than previous 321238032Speterversions, but there are some things that you still need to watch 321338032Speterfor. In particular: 321438032Speter 321538032Speter* Make sure the aliases file isn't writable except by trusted 321638032Speter system personnel. This includes both the text and database 321738032Speter version. 321838032Speter 321938032Speter* Make sure that other files that sendmail reads, such as the 322038032Speter mailertable, are only writable by trusted system personnel. 322138032Speter 322238032Speter* The queue directory should not be world writable PARTICULARLY 322338032Speter if your system allows "file giveaways" (that is, if a non-root 322438032Speter user can chown any file they own to any other user). 322538032Speter 322638032Speter* If your system allows file giveaways, DO NOT create a publically 322738032Speter writable directory for forward files. This will allow anyone 322838032Speter to steal anyone else's e-mail. Instead, create a script that 322938032Speter copies the .forward file from users' home directories once a 323038032Speter night (if you want the non-NFS-mounted forward directory). 323138032Speter 323238032Speter* If your system allows file giveaways, you'll find that 323338032Speter sendmail is much less trusting of :include: files -- in 323438032Speter particular, you'll have to have /SENDMAIL/ANY/SHELL/ in 323538032Speter /etc/shells before they will be trusted (that is, before 323638032Speter files and programs listed in them will be honored). 323738032Speter 323838032SpeterIn general, file giveaways are a mistake -- if you can turn them 323964562Sgshapirooff, do so. 324038032Speter 324138032Speter 324238032Speter+--------------------------------+ 324338032Speter| TWEAKING CONFIGURATION OPTIONS | 324438032Speter+--------------------------------+ 324538032Speter 324638032SpeterThere are a large number of configuration options that don't normally 324738032Speterneed to be changed. However, if you feel you need to tweak them, you 324838032Spetercan define the following M4 variables. This list is shown in four 324938032Spetercolumns: the name you define, the default value for that definition, 325038032Speterthe option or macro that is affected (either Ox for an option or Dx 325138032Speterfor a macro), and a brief description. Greater detail of the semantics 325238032Spetercan be found in the Installation and Operations Guide. 325338032Speter 325438032SpeterSome options are likely to be deprecated in future versions -- that is, 325538032Speterthe option is only included to provide back-compatibility. These are 325638032Spetermarked with "*". 325738032Speter 325838032SpeterRemember that these options are M4 variables, and hence may need to 325938032Speterbe quoted. In particular, arguments with commas will usually have to 326038032Speterbe ``double quoted, like this phrase'' to avoid having the comma 326138032Speterconfuse things. This is common for alias file definitions and for 326238032Speterthe read timeout. 326338032Speter 326438032SpeterM4 Variable Name Configuration Description & [Default] 326538032Speter================ ============= ======================= 326638032SpeterconfMAILER_NAME $n macro [MAILER-DAEMON] The sender name used 326738032Speter for internally generated outgoing 326838032Speter messages. 326938032SpeterconfDOMAIN_NAME $j macro If defined, sets $j. This should 327038032Speter only be done if your system cannot 327138032Speter determine your local domain name, 327238032Speter and then it should be set to 327338032Speter $w.Foo.COM, where Foo.COM is your 327438032Speter domain name. 327538032SpeterconfCF_VERSION $Z macro If defined, this is appended to the 327638032Speter configuration version name. 327790792SgshapiroconfLDAP_CLUSTER ${sendmailMTACluster} macro 327890792Sgshapiro If defined, this is the LDAP 327990792Sgshapiro cluster to use for LDAP searches 328090792Sgshapiro as described above in ``USING LDAP 328190792Sgshapiro FOR ALIASES, MAPS, AND CLASSES''. 328264562SgshapiroconfFROM_HEADER From: [$?x$x <$g>$|$g$.] The format of an 328338032Speter internally generated From: address. 328438032SpeterconfRECEIVED_HEADER Received: 328538032Speter [$?sfrom $s $.$?_($?s$|from $.$_) 328664562Sgshapiro $.$?{auth_type}(authenticated) 328738032Speter $.by $j ($v/$Z)$?r with $r$. id $i$?u 328838032Speter for $u; $|; 328938032Speter $.$b] 329038032Speter The format of the Received: header 329138032Speter in messages passed through this host. 329238032Speter It is unwise to try to change this. 329364562SgshapiroconfCW_FILE Fw class [/etc/mail/local-host-names] Name 329464562Sgshapiro of file used to get the local 329564562Sgshapiro additions to class {w} (local host 329664562Sgshapiro names). 329764562SgshapiroconfCT_FILE Ft class [/etc/mail/trusted-users] Name of 329864562Sgshapiro file used to get the local additions 329964562Sgshapiro to class {t} (trusted users). 330038032SpeterconfCR_FILE FR class [/etc/mail/relay-domains] Name of 330138032Speter file used to get the local additions 330264562Sgshapiro to class {R} (hosts allowed to relay). 330338032SpeterconfTRUSTED_USERS Ct class [no default] Names of users to add to 330438032Speter the list of trusted users. This list 330538032Speter always includes root, uucp, and daemon. 330643730Speter See also FEATURE(`use_ct_file'). 330764562SgshapiroconfTRUSTED_USER TrustedUser [no default] Trusted user for file 330864562Sgshapiro ownership and starting the daemon. 330964562Sgshapiro Not to be confused with 331064562Sgshapiro confTRUSTED_USERS (see above). 331138032SpeterconfSMTP_MAILER - [esmtp] The mailer name used when 331238032Speter SMTP connectivity is required. 331364562Sgshapiro One of "smtp", "smtp8", 331464562Sgshapiro "esmtp", or "dsmtp". 331538032SpeterconfUUCP_MAILER - [uucp-old] The mailer to be used by 331638032Speter default for bang-format recipient 331738032Speter addresses. See also discussion of 331864562Sgshapiro class {U}, class {Y}, and class {Z} 331964562Sgshapiro in the MAILER(`uucp') section. 332038032SpeterconfLOCAL_MAILER - [local] The mailer name used when 332138032Speter local connectivity is required. 332238032Speter Almost always "local". 332338032SpeterconfRELAY_MAILER - [relay] The default mailer name used 332438032Speter for relaying any mail (e.g., to a 332538032Speter BITNET_RELAY, a SMART_HOST, or 332638032Speter whatever). This can reasonably be 332738032Speter "uucp-new" if you are on a 332838032Speter UUCP-connected site. 332938032SpeterconfSEVEN_BIT_INPUT SevenBitInput [False] Force input to seven bits? 333038032SpeterconfEIGHT_BIT_HANDLING EightBitMode [pass8] 8-bit data handling 333138032SpeterconfALIAS_WAIT AliasWait [10m] Time to wait for alias file 333238032Speter rebuild until you get bored and 333338032Speter decide that the apparently pending 333438032Speter rebuild failed. 333538032SpeterconfMIN_FREE_BLOCKS MinFreeBlocks [100] Minimum number of free blocks on 333638032Speter queue filesystem to accept SMTP mail. 333738032Speter (Prior to 8.7 this was minfree/maxsize, 333838032Speter where minfree was the number of free 333938032Speter blocks and maxsize was the maximum 334038032Speter message size. Use confMAX_MESSAGE_SIZE 334138032Speter for the second value now.) 334238032SpeterconfMAX_MESSAGE_SIZE MaxMessageSize [infinite] The maximum size of messages 334338032Speter that will be accepted (in bytes). 334438032SpeterconfBLANK_SUB BlankSub [.] Blank (space) substitution 334538032Speter character. 334638032SpeterconfCON_EXPENSIVE HoldExpensive [False] Avoid connecting immediately 334764562Sgshapiro to mailers marked expensive. 334838032SpeterconfCHECKPOINT_INTERVAL CheckpointInterval 334938032Speter [10] Checkpoint queue files every N 335038032Speter recipients. 335138032SpeterconfDELIVERY_MODE DeliveryMode [background] Default delivery mode. 335238032SpeterconfERROR_MODE ErrorMode [print] Error message mode. 335338032SpeterconfERROR_MESSAGE ErrorHeader [undefined] Error message header/file. 335442575SpeterconfSAVE_FROM_LINES SaveFromLine Save extra leading From_ lines. 335538032SpeterconfTEMP_FILE_MODE TempFileMode [0600] Temporary file mode. 335638032SpeterconfMATCH_GECOS MatchGECOS [False] Match GECOS field. 335738032SpeterconfMAX_HOP MaxHopCount [25] Maximum hop count. 335864562SgshapiroconfIGNORE_DOTS* IgnoreDots [False; always False in -bs or -bd 335964562Sgshapiro mode] Ignore dot as terminator for 336064562Sgshapiro incoming messages? 336138032SpeterconfBIND_OPTS ResolverOptions [undefined] Default options for DNS 336238032Speter resolver. 336338032SpeterconfMIME_FORMAT_ERRORS* SendMimeErrors [True] Send error messages as MIME- 336438032Speter encapsulated messages per RFC 1344. 336538032SpeterconfFORWARD_PATH ForwardPath [$z/.forward.$w:$z/.forward] 336638032Speter The colon-separated list of places to 336738032Speter search for .forward files. N.B.: see 336838032Speter the Security Notes section. 336938032SpeterconfMCI_CACHE_SIZE ConnectionCacheSize 337038032Speter [2] Size of open connection cache. 337138032SpeterconfMCI_CACHE_TIMEOUT ConnectionCacheTimeout 337238032Speter [5m] Open connection cache timeout. 337338032SpeterconfHOST_STATUS_DIRECTORY HostStatusDirectory 337438032Speter [undefined] If set, host status is kept 337538032Speter on disk between sendmail runs in the 337638032Speter named directory tree. This need not be 337738032Speter a full pathname, in which case it is 337838032Speter interpreted relative to the queue 337938032Speter directory. 338038032SpeterconfSINGLE_THREAD_DELIVERY SingleThreadDelivery 338138032Speter [False] If this option and the 338238032Speter HostStatusDirectory option are both 338338032Speter set, single thread deliveries to other 338438032Speter hosts. That is, don't allow any two 338538032Speter sendmails on this host to connect 338638032Speter simultaneously to any other single 338738032Speter host. This can slow down delivery in 338838032Speter some cases, in particular since a 338938032Speter cached but otherwise idle connection 339038032Speter to a host will prevent other sendmails 339138032Speter from connecting to the other host. 339264562SgshapiroconfUSE_ERRORS_TO* UseErrorsTo [False] Use the Errors-To: header to 339338032Speter deliver error messages. This should 339438032Speter not be necessary because of general 339538032Speter acceptance of the envelope/header 339638032Speter distinction. 339738032SpeterconfLOG_LEVEL LogLevel [9] Log level. 339864562SgshapiroconfME_TOO MeToo [True] Include sender in group 339964562Sgshapiro expansions. This option is 340064562Sgshapiro deprecated and will be removed from 340164562Sgshapiro a future version. 340238032SpeterconfCHECK_ALIASES CheckAliases [False] Check RHS of aliases when 340338032Speter running newaliases. Since this does 340438032Speter DNS lookups on every address, it can 340538032Speter slow down the alias rebuild process 340638032Speter considerably on large alias files. 340738032SpeterconfOLD_STYLE_HEADERS* OldStyleHeaders [True] Assume that headers without 340838032Speter special chars are old style. 340938032SpeterconfPRIVACY_FLAGS PrivacyOptions [authwarnings] Privacy flags. 341038032SpeterconfCOPY_ERRORS_TO PostmasterCopy [undefined] Address for additional 341138032Speter copies of all error messages. 341238032SpeterconfQUEUE_FACTOR QueueFactor [600000] Slope of queue-only function. 341390792SgshapiroconfQUEUE_FILE_MODE QueueFileMode [undefined] Default permissions for 341490792Sgshapiro queue files (octal). If not set, 341590792Sgshapiro sendmail uses 0600 unless its real 341690792Sgshapiro and effective uid are different in 341790792Sgshapiro which case it uses 0644. 341838032SpeterconfDONT_PRUNE_ROUTES DontPruneRoutes [False] Don't prune down route-addr 341938032Speter syntax addresses to the minimum 342038032Speter possible. 342138032SpeterconfSAFE_QUEUE* SuperSafe [True] Commit all messages to disk 342238032Speter before forking. 342338032SpeterconfTO_INITIAL Timeout.initial [5m] The timeout waiting for a response 342438032Speter on the initial connect. 342538032SpeterconfTO_CONNECT Timeout.connect [0] The timeout waiting for an initial 342638032Speter connect() to complete. This can only 342738032Speter shorten connection timeouts; the kernel 342838032Speter silently enforces an absolute maximum 342938032Speter (which varies depending on the system). 343038032SpeterconfTO_ICONNECT Timeout.iconnect 343138032Speter [undefined] Like Timeout.connect, but 343238032Speter applies only to the very first attempt 343338032Speter to connect to a host in a message. 343438032Speter This allows a single very fast pass 343538032Speter followed by more careful delivery 343638032Speter attempts in the future. 343790792SgshapiroconfTO_ACONNECT Timeout.aconnect 343890792Sgshapiro [0] The overall timeout waiting for 343990792Sgshapiro all connection for a single delivery 344090792Sgshapiro attempt to succeed. If 0, no overall 344190792Sgshapiro limit is applied. 344238032SpeterconfTO_HELO Timeout.helo [5m] The timeout waiting for a response 344338032Speter to a HELO or EHLO command. 344438032SpeterconfTO_MAIL Timeout.mail [10m] The timeout waiting for a 344538032Speter response to the MAIL command. 344638032SpeterconfTO_RCPT Timeout.rcpt [1h] The timeout waiting for a response 344738032Speter to the RCPT command. 344838032SpeterconfTO_DATAINIT Timeout.datainit 344938032Speter [5m] The timeout waiting for a 354 345038032Speter response from the DATA command. 345138032SpeterconfTO_DATABLOCK Timeout.datablock 345238032Speter [1h] The timeout waiting for a block 345338032Speter during DATA phase. 345438032SpeterconfTO_DATAFINAL Timeout.datafinal 345538032Speter [1h] The timeout waiting for a response 345638032Speter to the final "." that terminates a 345738032Speter message. 345838032SpeterconfTO_RSET Timeout.rset [5m] The timeout waiting for a response 345938032Speter to the RSET command. 346038032SpeterconfTO_QUIT Timeout.quit [2m] The timeout waiting for a response 346138032Speter to the QUIT command. 346238032SpeterconfTO_MISC Timeout.misc [2m] The timeout waiting for a response 346338032Speter to other SMTP commands. 346464562SgshapiroconfTO_COMMAND Timeout.command [1h] In server SMTP, the timeout 346564562Sgshapiro waiting for a command to be issued. 346664562SgshapiroconfTO_IDENT Timeout.ident [5s] The timeout waiting for a 346764562Sgshapiro response to an IDENT query. 346838032SpeterconfTO_FILEOPEN Timeout.fileopen 346938032Speter [60s] The timeout waiting for a file 347038032Speter (e.g., :include: file) to be opened. 347190792SgshapiroconfTO_LHLO Timeout.lhlo [2m] The timeout waiting for a response 347290792Sgshapiro to an LMTP LHLO command. 347390792SgshapiroconfTO_AUTH Timeout.auth [10m] The timeout waiting for a 347490792Sgshapiro response in an AUTH dialogue. 347590792SgshapiroconfTO_STARTTLS Timeout.starttls 347690792Sgshapiro [1h] The timeout waiting for a 347790792Sgshapiro response to an SMTP STARTTLS command. 347864562SgshapiroconfTO_CONTROL Timeout.control 347964562Sgshapiro [2m] The timeout for a complete 348064562Sgshapiro control socket transaction to complete. 348138032SpeterconfTO_QUEUERETURN Timeout.queuereturn 348238032Speter [5d] The timeout before a message is 348338032Speter returned as undeliverable. 348438032SpeterconfTO_QUEUERETURN_NORMAL 348538032Speter Timeout.queuereturn.normal 348638032Speter [undefined] As above, for normal 348738032Speter priority messages. 348838032SpeterconfTO_QUEUERETURN_URGENT 348938032Speter Timeout.queuereturn.urgent 349038032Speter [undefined] As above, for urgent 349138032Speter priority messages. 349238032SpeterconfTO_QUEUERETURN_NONURGENT 349338032Speter Timeout.queuereturn.non-urgent 349438032Speter [undefined] As above, for non-urgent 349538032Speter (low) priority messages. 349638032SpeterconfTO_QUEUEWARN Timeout.queuewarn 349738032Speter [4h] The timeout before a warning 349838032Speter message is sent to the sender telling 349964562Sgshapiro them that the message has been 350064562Sgshapiro deferred. 350138032SpeterconfTO_QUEUEWARN_NORMAL Timeout.queuewarn.normal 350238032Speter [undefined] As above, for normal 350338032Speter priority messages. 350438032SpeterconfTO_QUEUEWARN_URGENT Timeout.queuewarn.urgent 350538032Speter [undefined] As above, for urgent 350638032Speter priority messages. 350738032SpeterconfTO_QUEUEWARN_NONURGENT 350838032Speter Timeout.queuewarn.non-urgent 350938032Speter [undefined] As above, for non-urgent 351038032Speter (low) priority messages. 351138032SpeterconfTO_HOSTSTATUS Timeout.hoststatus 351238032Speter [30m] How long information about host 351338032Speter statuses will be maintained before it 351438032Speter is considered stale and the host should 351538032Speter be retried. This applies both within 351638032Speter a single queue run and to persistent 351738032Speter information (see below). 351864562SgshapiroconfTO_RESOLVER_RETRANS Timeout.resolver.retrans 351964562Sgshapiro [varies] Sets the resolver's 352064562Sgshapiro retransmition time interval (in 352164562Sgshapiro seconds). Sets both 352264562Sgshapiro Timeout.resolver.retrans.first and 352364562Sgshapiro Timeout.resolver.retrans.normal. 352464562SgshapiroconfTO_RESOLVER_RETRANS_FIRST Timeout.resolver.retrans.first 352564562Sgshapiro [varies] Sets the resolver's 352664562Sgshapiro retransmition time interval (in 352764562Sgshapiro seconds) for the first attempt to 352864562Sgshapiro deliver a message. 352964562SgshapiroconfTO_RESOLVER_RETRANS_NORMAL Timeout.resolver.retrans.normal 353064562Sgshapiro [varies] Sets the resolver's 353164562Sgshapiro retransmition time interval (in 353264562Sgshapiro seconds) for all resolver lookups 353364562Sgshapiro except the first delivery attempt. 353464562SgshapiroconfTO_RESOLVER_RETRY Timeout.resolver.retry 353564562Sgshapiro [varies] Sets the number of times 353664562Sgshapiro to retransmit a resolver query. 353764562Sgshapiro Sets both 353864562Sgshapiro Timeout.resolver.retry.first and 353964562Sgshapiro Timeout.resolver.retry.normal. 354064562SgshapiroconfTO_RESOLVER_RETRY_FIRST Timeout.resolver.retry.first 354164562Sgshapiro [varies] Sets the number of times 354264562Sgshapiro to retransmit a resolver query for 354364562Sgshapiro the first attempt to deliver a 354464562Sgshapiro message. 354564562SgshapiroconfTO_RESOLVER_RETRY_NORMAL Timeout.resolver.retry.normal 354664562Sgshapiro [varies] Sets the number of times 354764562Sgshapiro to retransmit a resolver query for 354864562Sgshapiro all resolver lookups except the 354964562Sgshapiro first delivery attempt. 355038032SpeterconfTIME_ZONE TimeZoneSpec [USE_SYSTEM] Time zone info -- can be 355138032Speter USE_SYSTEM to use the system's idea, 355238032Speter USE_TZ to use the user's TZ envariable, 355338032Speter or something else to force that value. 355438032SpeterconfDEF_USER_ID DefaultUser [1:1] Default user id. 355538032SpeterconfUSERDB_SPEC UserDatabaseSpec 355664562Sgshapiro [undefined] User database 355764562Sgshapiro specification. 355838032SpeterconfFALLBACK_MX FallbackMXhost [undefined] Fallback MX host. 355964562SgshapiroconfTRY_NULL_MX_LIST TryNullMXList [False] If this host is the best MX 356064562Sgshapiro for a host and other arrangements 356164562Sgshapiro haven't been made, try connecting 356264562Sgshapiro to the host directly; normally this 356364562Sgshapiro would be a config error. 356464562SgshapiroconfQUEUE_LA QueueLA [varies] Load average at which 356564562Sgshapiro queue-only function kicks in. 356664562Sgshapiro Default values is (8 * numproc) 356764562Sgshapiro where numproc is the number of 356864562Sgshapiro processors online (if that can be 356964562Sgshapiro determined). 357064562SgshapiroconfREFUSE_LA RefuseLA [varies] Load average at which 357164562Sgshapiro incoming SMTP connections are 357264562Sgshapiro refused. Default values is (12 * 357364562Sgshapiro numproc) where numproc is the 357464562Sgshapiro number of processors online (if 357564562Sgshapiro that can be determined). 357690792SgshapiroconfDELAY_LA DelayLA [0] Load average at which sendmail 357790792Sgshapiro will sleep for one second on most 357890792Sgshapiro SMTP commands and before accepting 357990792Sgshapiro connections. 0 means no limit. 358064562SgshapiroconfMAX_ALIAS_RECURSION MaxAliasRecursion 358164562Sgshapiro [10] Maximum depth of alias recursion. 358238032SpeterconfMAX_DAEMON_CHILDREN MaxDaemonChildren 358338032Speter [undefined] The maximum number of 358438032Speter children the daemon will permit. After 358538032Speter this number, connections will be 358638032Speter rejected. If not set or <= 0, there is 358738032Speter no limit. 358864562SgshapiroconfMAX_HEADERS_LENGTH MaxHeadersLength 358971345Sgshapiro [32768] Maximum length of the sum 359064562Sgshapiro of all headers. 359164562SgshapiroconfMAX_MIME_HEADER_LENGTH MaxMimeHeaderLength 359264562Sgshapiro [undefined] Maximum length of 359364562Sgshapiro certain MIME header field values. 359438032SpeterconfCONNECTION_RATE_THROTTLE ConnectionRateThrottle 359538032Speter [undefined] The maximum number of 359690792Sgshapiro connections permitted per second per 359790792Sgshapiro daemon. After this many connections 359890792Sgshapiro are accepted, further connections 359990792Sgshapiro will be delayed. If not set or <= 0, 360090792Sgshapiro there is no limit. 360138032SpeterconfWORK_RECIPIENT_FACTOR 360238032Speter RecipientFactor [30000] Cost of each recipient. 360364562SgshapiroconfSEPARATE_PROC ForkEachJob [False] Run all deliveries in a 360464562Sgshapiro separate process. 360538032SpeterconfWORK_CLASS_FACTOR ClassFactor [1800] Priority multiplier for class. 360638032SpeterconfWORK_TIME_FACTOR RetryFactor [90000] Cost of each delivery attempt. 360738032SpeterconfQUEUE_SORT_ORDER QueueSortOrder [Priority] Queue sort algorithm: 360890792Sgshapiro Priority, Host, Filename, Random, 360990792Sgshapiro Modification, or Time. 361038032SpeterconfMIN_QUEUE_AGE MinQueueAge [0] The minimum amount of time a job 361138032Speter must sit in the queue between queue 361238032Speter runs. This allows you to set the 361338032Speter queue run interval low for better 361438032Speter responsiveness without trying all 361538032Speter jobs in each run. 361638032SpeterconfDEF_CHAR_SET DefaultCharSet [unknown-8bit] When converting 361738032Speter unlabeled 8 bit input to MIME, the 361838032Speter character set to use by default. 361938032SpeterconfSERVICE_SWITCH_FILE ServiceSwitchFile 362064562Sgshapiro [/etc/mail/service.switch] The file 362164562Sgshapiro to use for the service switch on 362264562Sgshapiro systems that do not have a 362364562Sgshapiro system-defined switch. 362438032SpeterconfHOSTS_FILE HostsFile [/etc/hosts] The file to use when doing 362538032Speter "file" type access of hosts names. 362638032SpeterconfDIAL_DELAY DialDelay [0s] If a connection fails, wait this 362738032Speter long and try again. Zero means "don't 362838032Speter retry". This is to allow "dial on 362938032Speter demand" connections to have enough time 363038032Speter to complete a connection. 363138032SpeterconfNO_RCPT_ACTION NoRecipientAction 363238032Speter [none] What to do if there are no legal 363338032Speter recipient fields (To:, Cc: or Bcc:) 363438032Speter in the message. Legal values can 363538032Speter be "none" to just leave the 363638032Speter nonconforming message as is, "add-to" 363738032Speter to add a To: header with all the 363838032Speter known recipients (which may expose 363938032Speter blind recipients), "add-apparently-to" 364038032Speter to do the same but use Apparently-To: 364190792Sgshapiro instead of To: (strongly discouraged 364290792Sgshapiro in accordance with IETF standards), 364390792Sgshapiro "add-bcc" to add an empty Bcc: 364490792Sgshapiro header, or "add-to-undisclosed" to 364590792Sgshapiro add the header 364638032Speter ``To: undisclosed-recipients:;''. 364738032SpeterconfSAFE_FILE_ENV SafeFileEnvironment 364838032Speter [undefined] If set, sendmail will do a 364938032Speter chroot() into this directory before 365038032Speter writing files. 365138032SpeterconfCOLON_OK_IN_ADDR ColonOkInAddr [True unless Configuration Level > 6] 365238032Speter If set, colons are treated as a regular 365338032Speter character in addresses. If not set, 365438032Speter they are treated as the introducer to 365538032Speter the RFC 822 "group" syntax. Colons are 365638032Speter handled properly in route-addrs. This 365738032Speter option defaults on for V5 and lower 365838032Speter configuration files. 365938032SpeterconfMAX_QUEUE_RUN_SIZE MaxQueueRunSize [0] If set, limit the maximum size of 366038032Speter any given queue run to this number of 366138032Speter entries. Essentially, this will stop 366264562Sgshapiro reading each queue directory after this 366338032Speter number of entries are reached; it does 366438032Speter _not_ pick the highest priority jobs, 366538032Speter so this should be as large as your 366638032Speter system can tolerate. If not set, there 366738032Speter is no limit. 366890792SgshapiroconfMAX_QUEUE_CHILDREN MaxQueueChildren 366990792Sgshapiro [undefined] Limits the maximum number 367090792Sgshapiro of concurrent queue runners active. 367190792Sgshapiro This is to keep system resources used 367290792Sgshapiro within a reasonable limit. Relates to 367390792Sgshapiro Queue Groups and ForkAllJobs. 367490792SgshapiroconfMAX_RUNNERS_PER_QUEUE MaxRunnersPerQueue 367590792Sgshapiro [1] Only active when MaxQueueChildren 367690792Sgshapiro defined. Controls the maximum number 367790792Sgshapiro of queue runners (aka queue children) 367890792Sgshapiro active at the same time in a work 367990792Sgshapiro group. See also MaxQueueChildren. 368038032SpeterconfDONT_EXPAND_CNAMES DontExpandCnames 368138032Speter [False] If set, $[ ... $] lookups that 368238032Speter do DNS based lookups do not expand 368338032Speter CNAME records. This currently violates 368438032Speter the published standards, but the IETF 368538032Speter seems to be moving toward legalizing 368638032Speter this. For example, if "FTP.Foo.ORG" 368738032Speter is a CNAME for "Cruft.Foo.ORG", then 368838032Speter with this option set a lookup of 368938032Speter "FTP" will return "FTP.Foo.ORG"; if 369038032Speter clear it returns "Cruft.FOO.ORG". N.B. 369138032Speter you may not see any effect until your 369238032Speter downstream neighbors stop doing CNAME 369338032Speter lookups as well. 369464562SgshapiroconfFROM_LINE UnixFromLine [From $g $d] The From_ line used 369538032Speter when sending to files or programs. 369638032SpeterconfSINGLE_LINE_FROM_HEADER SingleLineFromHeader 369738032Speter [False] From: lines that have 369838032Speter embedded newlines are unwrapped 369938032Speter onto one line. 370038032SpeterconfALLOW_BOGUS_HELO AllowBogusHELO [False] Allow HELO SMTP command that 370138032Speter does not include a host name. 370238032SpeterconfMUST_QUOTE_CHARS MustQuoteChars [.'] Characters to be quoted in a full 370338032Speter name phrase (@,;:\()[] are automatic). 370438032SpeterconfOPERATORS OperatorChars [.:%@!^/[]+] Address operator 370538032Speter characters. 370638032SpeterconfSMTP_LOGIN_MSG SmtpGreetingMessage 370738032Speter [$j Sendmail $v/$Z; $b] 370838032Speter The initial (spontaneous) SMTP 370938032Speter greeting message. The word "ESMTP" 371038032Speter will be inserted between the first and 371138032Speter second words to convince other 371238032Speter sendmails to try to speak ESMTP. 371338032SpeterconfDONT_INIT_GROUPS DontInitGroups [False] If set, the initgroups(3) 371438032Speter routine will never be invoked. You 371538032Speter might want to do this if you are 371638032Speter running NIS and you have a large group 371738032Speter map, since this call does a sequential 371838032Speter scan of the map; in a large site this 371938032Speter can cause your ypserv to run 372038032Speter essentially full time. If you set 372138032Speter this, agents run on behalf of users 372238032Speter will only have their primary 372338032Speter (/etc/passwd) group permissions. 372438032SpeterconfUNSAFE_GROUP_WRITES UnsafeGroupWrites 372538032Speter [False] If set, group-writable 372638032Speter :include: and .forward files are 372738032Speter considered "unsafe", that is, programs 372838032Speter and files cannot be directly referenced 372938032Speter from such files. World-writable files 373038032Speter are always considered unsafe. 373164562SgshapiroconfCONNECT_ONLY_TO ConnectOnlyTo [undefined] override connection 373264562Sgshapiro address (for testing). 373364562SgshapiroconfCONTROL_SOCKET_NAME ControlSocketName 373464562Sgshapiro [undefined] Control socket for daemon 373564562Sgshapiro management. 373638032SpeterconfDOUBLE_BOUNCE_ADDRESS DoubleBounceAddress 373738032Speter [postmaster] If an error occurs when 373838032Speter sending an error message, send that 373938032Speter "double bounce" error message to this 374090792Sgshapiro address. If it expands to an empty 374190792Sgshapiro string, double bounces are dropped. 374264562SgshapiroconfDEAD_LETTER_DROP DeadLetterDrop [undefined] Filename to save bounce 374364562Sgshapiro messages which could not be returned 374464562Sgshapiro to the user or sent to postmaster. 374564562Sgshapiro If not set, the queue file will 374664562Sgshapiro be renamed. 374764562SgshapiroconfRRT_IMPLIES_DSN RrtImpliesDsn [False] Return-Receipt-To: header 374864562Sgshapiro implies DSN request. 374938032SpeterconfRUN_AS_USER RunAsUser [undefined] If set, become this user 375038032Speter when reading and delivering mail. 375138032Speter Causes all file reads (e.g., .forward 375238032Speter and :include: files) to be done as 375338032Speter this user. Also, all programs will 375438032Speter be run as this user, and all output 375538032Speter files will be written as this user. 375638032Speter Intended for use only on firewalls 375738032Speter where users do not have accounts. 375838032SpeterconfMAX_RCPTS_PER_MESSAGE MaxRecipientsPerMessage 375938032Speter [infinite] If set, allow no more than 376038032Speter the specified number of recipients in 376138032Speter an SMTP envelope. Further recipients 376238032Speter receive a 452 error code (i.e., they 376338032Speter are deferred for the next delivery 376438032Speter attempt). 376590792SgshapiroconfBAD_RCPT_THROTTLE BadRcptThrottle [infinite] If set and more than the 376690792Sgshapiro specified number of recipients in an 376790792Sgshapiro envelope are rejected, sleep for one 376890792Sgshapiro second after each rejected RCPT 376990792Sgshapiro command. 377038032SpeterconfDONT_PROBE_INTERFACES DontProbeInterfaces 377138032Speter [False] If set, sendmail will _not_ 377238032Speter insert the names and addresses of any 377364562Sgshapiro local interfaces into class {w} 377438032Speter (list of known "equivalent" addresses). 377538032Speter If you set this, you must also include 377638032Speter some support for these addresses (e.g., 377738032Speter in a mailertable entry) -- otherwise, 377838032Speter mail to addresses in this list will 377938032Speter bounce with a configuration error. 378090792Sgshapiro If set to "loopback" (without 378190792Sgshapiro quotes), sendmail will skip 378290792Sgshapiro loopback interfaces (e.g., "lo0"). 378364562SgshapiroconfPID_FILE PidFile [system dependent] Location of pid 378464562Sgshapiro file. 378564562SgshapiroconfPROCESS_TITLE_PREFIX ProcessTitlePrefix 378664562Sgshapiro [undefined] Prefix string for the 378764562Sgshapiro process title shown on 'ps' listings. 378838032SpeterconfDONT_BLAME_SENDMAIL DontBlameSendmail 378938032Speter [safe] Override sendmail's file 379038032Speter safety checks. This will definitely 379138032Speter compromise system security and should 379238032Speter not be used unless absolutely 379338032Speter necessary. 379438032SpeterconfREJECT_MSG - [550 Access denied] The message 379538032Speter given if the access database contains 379638032Speter REJECT in the value portion. 379790792SgshapiroconfRELAY_MSG - [550 Relaying denied] The message 379890792Sgshapiro given if an unauthorized relaying 379990792Sgshapiro attempt is rejected. 380064562SgshapiroconfDF_BUFFER_SIZE DataFileBufferSize 380164562Sgshapiro [4096] The maximum size of a 380264562Sgshapiro memory-buffered data (df) file 380364562Sgshapiro before a disk-based file is used. 380464562SgshapiroconfXF_BUFFER_SIZE XScriptFileBufferSize 380564562Sgshapiro [4096] The maximum size of a 380664562Sgshapiro memory-buffered transcript (xf) 380764562Sgshapiro file before a disk-based file is 380864562Sgshapiro used. 380964562SgshapiroconfAUTH_MECHANISMS AuthMechanisms [GSSAPI KERBEROS_V4 DIGEST-MD5 381064562Sgshapiro CRAM-MD5] List of authentication 381164562Sgshapiro mechanisms for AUTH (separated by 381264562Sgshapiro spaces). The advertised list of 381364562Sgshapiro authentication mechanisms will be the 381464562Sgshapiro intersection of this list and the list 381564562Sgshapiro of available mechanisms as determined 381664562Sgshapiro by the CYRUS SASL library. 381773188SgshapiroconfDEF_AUTH_INFO DefaultAuthInfo [undefined] Name of file that contains 381864562Sgshapiro authentication information for 381990792Sgshapiro outgoing connections. This file must 382090792Sgshapiro contain the user id, the authorization 382190792Sgshapiro id, the password (plain text), the 382290792Sgshapiro realm to use, and the list of 382390792Sgshapiro mechanisms to try, each on a separate 382490792Sgshapiro line and must be readable by root (or 382590792Sgshapiro the trusted user) only. If no realm 382690792Sgshapiro is specified, $j is used. If no 382790792Sgshapiro mechanisms are given in the file, 382890792Sgshapiro AuthMechanisms is used. Notice: this 382990792Sgshapiro option is deprecated and will be 383090792Sgshapiro removed in future versions; it doesn't 383190792Sgshapiro work for the MSP since it can't read 383290792Sgshapiro the file. Use the authinfo ruleset 383390792Sgshapiro instead. See also the section SMTP 383490792Sgshapiro AUTHENTICATION. 383590792SgshapiroconfAUTH_OPTIONS AuthOptions [undefined] If this option is 'A' 383664562Sgshapiro then the AUTH= parameter for the 383764562Sgshapiro MAIL FROM command is only issued 383864562Sgshapiro when authentication succeeded. 383990792Sgshapiro Other values (which should be listed 384090792Sgshapiro one after the other without any 384190792Sgshapiro intervening characters except for 384290792Sgshapiro space or comma) are a, c, d, f, p, 384390792Sgshapiro and y. See doc/op/op.me for 384490792Sgshapiro details. 384590792SgshapiroconfAUTH_MAX_BITS AuthMaxBits [INT_MAX] Limit the maximum encryption 384690792Sgshapiro strength for the security layer in 384790792Sgshapiro SMTP AUTH (SASL). Default is 384890792Sgshapiro essentially unlimited. 384990792SgshapiroconfTLS_SRV_OPTIONS TLSSrvOptions If this option is 'V' no client 385090792Sgshapiro verification is performed, i.e., 385190792Sgshapiro the server doesn't ask for a 385290792Sgshapiro certificate. 385364562SgshapiroconfLDAP_DEFAULT_SPEC LDAPDefaultSpec [undefined] Default map 385464562Sgshapiro specification for LDAP maps. The 385564562Sgshapiro value should only contain LDAP 385664562Sgshapiro specific settings such as "-h host 385764562Sgshapiro -p port -d bindDN", etc. The 385864562Sgshapiro settings will be used for all LDAP 385964562Sgshapiro maps unless they are specified in 386064562Sgshapiro the individual map specification 386164562Sgshapiro ('K' command). 386264562SgshapiroconfCACERT_PATH CACERTPath [undefined] Path to directory 386364562Sgshapiro with certs of CAs. 386464562SgshapiroconfCACERT CACERTFile [undefined] File containing one CA 386564562Sgshapiro cert. 386664562SgshapiroconfSERVER_CERT ServerCertFile [undefined] File containing the 386764562Sgshapiro cert of the server, i.e., this cert 386864562Sgshapiro is used when sendmail acts as 386964562Sgshapiro server. 387064562SgshapiroconfSERVER_KEY ServerKeyFile [undefined] File containing the 387164562Sgshapiro private key belonging to the server 387264562Sgshapiro cert. 387364562SgshapiroconfCLIENT_CERT ClientCertFile [undefined] File containing the 387464562Sgshapiro cert of the client, i.e., this cert 387564562Sgshapiro is used when sendmail acts as 387664562Sgshapiro client. 387764562SgshapiroconfCLIENT_KEY ClientKeyFile [undefined] File containing the 387864562Sgshapiro private key belonging to the client 387964562Sgshapiro cert. 388064562SgshapiroconfDH_PARAMETERS DHParameters [undefined] File containing the 388164562Sgshapiro DH parameters. 388264562SgshapiroconfRAND_FILE RandFile [undefined] File containing random 388366494Sgshapiro data (use prefix file:) or the 388466494Sgshapiro name of the UNIX socket if EGD is 388566494Sgshapiro used (use prefix egd:). STARTTLS 388666494Sgshapiro requires this option if the compile 388766494Sgshapiro flag HASURANDOM is not set (see 388864562Sgshapiro sendmail/README). 388990792SgshapiroconfNICE_QUEUE_RUN NiceQueueRun [undefined] If set, the priority of 389090792Sgshapiro queue runners is set the given value 389190792Sgshapiro (nice(3)). 389290792SgshapiroconfDIRECT_SUBMISSION_MODIFIERS DirectSubmissionModifiers 389390792Sgshapiro [undefined] Defines {daemon_flags} 389490792Sgshapiro for direct submissions. 389590792SgshapiroconfUSE_MSP UseMSP [false] Use as mail submission 389690792Sgshapiro program, see sendmail/SECURITY. 389790792SgshapiroconfDELIVER_BY_MIN DeliverByMin [0] Minimum time for Deliver By 389890792Sgshapiro SMTP Service Extension (RFC 2852). 389990792SgshapiroconfSHARED_MEMORY_KEY SharedMemoryKey [0] Key for shared memory. 390090792SgshapiroconfFAST_SPLIT FastSplit [1] If set to a value greater than 390190792Sgshapiro zero, the initial MX lookups on 390290792Sgshapiro addresses is suppressed when they 390390792Sgshapiro are sorted which may result in 390490792Sgshapiro faster envelope splitting. If the 390590792Sgshapiro mail is submitted directly from the 390690792Sgshapiro command line, then the value also 390790792Sgshapiro limits the number of processes to 390890792Sgshapiro deliver the envelopes. 390990792SgshapiroconfMAILBOX_DATABASE MailboxDatabase [pw] Type of lookup to find 391090792Sgshapiro information about local mailboxes. 391190792SgshapiroconfDEQUOTE_OPTS - [empty] Additional options for the 391290792Sgshapiro dequote map. 391390792SgshapiroconfINPUT_MAIL_FILTERS InputMailFilters 391490792Sgshapiro A comma separated list of filters 391590792Sgshapiro which determines which filters and 391690792Sgshapiro the invocation sequence are 391790792Sgshapiro contacted for incoming SMTP 391890792Sgshapiro messages. If none are set, no 391990792Sgshapiro filters will be contacted. 392090792SgshapiroconfMILTER_LOG_LEVEL Milter.LogLevel [9] Log level for input mail filter 392190792Sgshapiro actions, defaults to LogLevel. 392290792SgshapiroconfMILTER_MACROS_CONNECT Milter.macros.connect 392390792Sgshapiro [empty] Macros to transmit to milters 392490792Sgshapiro when a session connection starts. 392590792SgshapiroconfMILTER_MACROS_HELO Milter.macros.helo 392690792Sgshapiro [empty] Macros to transmit to milters 392790792Sgshapiro after HELO command. 392890792SgshapiroconfMILTER_MACROS_ENVFROM Milter.macros.envfrom 392990792Sgshapiro [empty] Macros to transmit to milters 393090792Sgshapiro after MAIL FROM command. 393190792SgshapiroconfMILTER_MACROS_ENVRCPT Milter.macros.envrcpt 393290792Sgshapiro [empty] Macros to transmit to milters 393390792Sgshapiro after RCPT TO command. 393464562Sgshapiro 393590792Sgshapiro 393638032SpeterSee also the description of OSTYPE for some parameters that can be 393738032Spetertweaked (generally pathnames to mailers). 393838032Speter 393990792SgshapiroClientPortOptions and DaemonPortOptions are special cases since multiple 394090792Sgshapiroclients/daemons can be defined. This can be done via 394138032Speter 394290792Sgshapiro CLIENT_OPTIONS(`field1=value1,field2=value2,...') 394364562Sgshapiro DAEMON_OPTIONS(`field1=value1,field2=value2,...') 394464562Sgshapiro 394590792SgshapiroNote that multiple CLIENT_OPTIONS() commands (and therefore multiple 394690792SgshapiroClientPortOptions settings) are allowed in order to give settings for each 394790792Sgshapiroprotocol family (e.g., one for Family=inet and one for Family=inet6). A 394890792Sgshapirorestriction placed on one family only affects outgoing connections on that 394990792Sgshapiroparticular family. 395090792Sgshapiro 395164562SgshapiroIf DAEMON_OPTIONS is not used, then the default is 395264562Sgshapiro 395364562Sgshapiro DAEMON_OPTIONS(`Port=smtp, Name=MTA') 395464562Sgshapiro DAEMON_OPTIONS(`Port=587, Name=MSA, M=E') 395564562Sgshapiro 395664562SgshapiroIf you use one DAEMON_OPTIONS macro, it will alter the parameters 395764562Sgshapiroof the first of these. The second will still be defaulted; it 395864562Sgshapirorepresents a "Message Submission Agent" (MSA) as defined by RFC 395964562Sgshapiro2476 (see below). To turn off the default definition for the MSA, 396064562Sgshapirouse FEATURE(`no_default_msa') (see also FEATURES). If you use 396164562Sgshapiroadditional DAEMON_OPTIONS macros, they will add additional daemons. 396264562Sgshapiro 396364562SgshapiroExample 1: To change the port for the SMTP listener, while 396464562Sgshapirostill using the MSA default, use 396564562Sgshapiro DAEMON_OPTIONS(`Port=925, Name=MTA') 396664562Sgshapiro 396764562SgshapiroExample 2: To change the port for the MSA daemon, while still 396864562Sgshapirousing the default SMTP port, use 396964562Sgshapiro FEATURE(`no_default_msa') 397064562Sgshapiro DAEMON_OPTIONS(`Name=MTA') 397164562Sgshapiro DAEMON_OPTIONS(`Port=987, Name=MSA, M=E') 397264562Sgshapiro 397364562SgshapiroNote that if the first of those DAEMON_OPTIONS lines were omitted, then 397464562Sgshapirothere would be no listener on the standard SMTP port. 397564562Sgshapiro 397664562SgshapiroExample 3: To listen on both IPv4 and IPv6 interfaces, use 397764562Sgshapiro 397864562Sgshapiro DAEMON_OPTIONS(`Name=MTA-v4, Family=inet') 397964562Sgshapiro DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6') 398064562Sgshapiro 398164562SgshapiroA "Message Submission Agent" still uses all of the same rulesets for 398264562Sgshapiroprocessing the message (and therefore still allows message rejection via 398364562Sgshapirothe check_* rulesets). In accordance with the RFC, the MSA will ensure 398464562Sgshapirothat all domains in the envelope are fully qualified if the message is 398564562Sgshapirorelayed to another MTA. It will also enforce the normal address syntax 398664562Sgshapirorules and log error messages. Additionally, by using the M=a modifier 398764562Sgshapiroyou can require authentication before messages are accepted by the MSA. 398877349SgshapiroNotice: Do NOT use the 'a' modifier on a public accessible MTA! 398964562SgshapiroFinally, the M=E modifier shown above disables ETRN as required by RFC 399064562Sgshapiro2476. 399164562Sgshapiro 399290792SgshapiroMail filters can be defined using the INPUT_MAIL_FILTER() and MAIL_FILTER() 399390792Sgshapirocommands: 399464562Sgshapiro 399590792Sgshapiro INPUT_MAIL_FILTER(`sample', `S=local:/var/run/f1.sock') 399690792Sgshapiro MAIL_FILTER(`myfilter', `S=inet:3333@localhost') 399738032Speter 399890792SgshapiroThe INPUT_MAIL_FILTER() command causes the filter(s) to be called in the 399990792Sgshapirosame order they were specified by also setting confINPUT_MAIL_FILTERS. A 400090792Sgshapirofilter can be defined without adding it to the input filter list by using 400190792SgshapiroMAIL_FILTER() instead of INPUT_MAIL_FILTER() in your .mc file. 400290792SgshapiroAlternatively, you can reset the list of filters and their order by setting 400390792SgshapiroconfINPUT_MAIL_FILTERS option after all INPUT_MAIL_FILTER() commands in 400490792Sgshapiroyour .mc file. 400590792Sgshapiro 400690792Sgshapiro 400790792Sgshapiro+----------------------------+ 400890792Sgshapiro| MESSAGE SUBMISSION PROGRAM | 400990792Sgshapiro+----------------------------+ 401090792Sgshapiro 401190792SgshapiroThe purpose of the message submission program (MSP) is explained 401290792Sgshapiroin sendmail/SECURITY. This section contains a list of caveats and 401390792Sgshapiroa few hints how for those who want to tweak the default configuration 401490792Sgshapirofor it (which is installed as submit.cf). 401590792Sgshapiro 401690792SgshapiroNotice: do not add options/features to submit.mc unless you are 401790792Sgshapiroabsolutely sure you need them. Options you may want to change 401890792Sgshapiroinclude: 401990792Sgshapiro 402094334Sgshapiro- confTRUSTED_USERS, FEATURE(`use_ct_file'), and confCT_FILE for 402194334Sgshapiro avoiding X-Authorization warnings. 402294334Sgshapiro- confTIME_ZONE to change it from the default `USE_TZ'. 402390792Sgshapiro- confDELIVERY_MODE is set to interactive in msp.m4 instead 402490792Sgshapiro of the default background mode. 402590792Sgshapiro 402690792SgshapiroSome things are not intended to work with the MSP. These include 402790792Sgshapirofeatures that influence the delivery process (e.g., mailertable, 402890792Sgshapiroaliases), or those that are only important for a SMTP server (e.g., 402990792Sgshapirovirtusertable, DaemonPortOptions, multiple queues). Moreover, 403090792Sgshapirorelaxing certain restrictions (RestrictQueueRun, permissions on 403190792Sgshapiroqueue directory) or adding features (e.g., enabling prog/file mailer) 403290792Sgshapirocan cause security problems. 403390792Sgshapiro 403490792SgshapiroOther things don't work well with the MSP and require tweaking or 403590792Sgshapiroworkarounds. For example, to allow for client authentication it 403690792Sgshapirois not just sufficient to provide a client certificate and the 403790792Sgshapirocorresponding key, but it is also necessary to make the key group 403890792Sgshapiro(smmsp) readable and tell sendmail not to complain about that, i.e., 403990792Sgshapiro 404090792Sgshapiro define(`confDONT_BLAME_SENDMAIL', `GroupReadableKeyFile') 404190792Sgshapiro 404290792SgshapiroIf the MSP should actually use AUTH then the necessary data 404390792Sgshapiroshould be placed in a map as explained in SMTP AUTHENTICATION: 404490792Sgshapiro 404590792SgshapiroFEATURE(`authinfo', `DATABASE_MAP_TYPE /etc/mail/msp-authinfo') 404690792Sgshapiro 404790792Sgshapiro/etc/mail/msp-authinfo should contain an entry like: 404890792Sgshapiro 404990792Sgshapiro AuthInfo:127.0.0.1 "U:smmsp" "P:secret" "M:DIGEST-MD5" 405090792Sgshapiro 405190792SgshapiroThe file and the map created by makemap should be owned by smmsp, 405290792Sgshapiroits group should be smmsp, and it should have mode 640. The database 405390792Sgshapiroused by the MTA for AUTH must have a corresponding entry. 405490792SgshapiroAdditionally the MTA must trust this authentication data so the AUTH= 405590792Sgshapiropart will be relayed on to the next hop. This can be achieved by 405690792Sgshapiroadding the following to your sendmail.mc file: 405790792Sgshapiro 405890792Sgshapiro LOCAL_RULESETS 405990792Sgshapiro SLocal_trust_auth 406090792Sgshapiro R$* $: $&{auth_authen} 406190792Sgshapiro Rsmmsp $# OK 406290792Sgshapiro 406390792Sgshapirofeature/msp.m4 defines almost all settings for the MSP. Most of 406490792Sgshapirothose should not be changed at all. Some of the features and options 406590792Sgshapirocan be overridden if really necessary. It is a bit tricky to do 406690792Sgshapirothis, because it depends on the actual way the option is defined 406790792Sgshapiroin feature/msp.m4. If it is directly defined (i.e., define()) then 406890792Sgshapirothe modified value must be defined after 406990792Sgshapiro 407090792Sgshapiro FEATURE(`msp') 407190792Sgshapiro 407290792SgshapiroIf it is conditionally defined (i.e., ifdef()) then the desired 407390792Sgshapirovalue must be defined before the FEATURE line in the .mc file. 407490792SgshapiroTo see how the options are defined read feature/msp.m4. 407590792Sgshapiro 407690792Sgshapiro 407790792Sgshapiro+--------------------------+ 407890792Sgshapiro| FORMAT OF FILES AND MAPS | 407990792Sgshapiro+--------------------------+ 408090792Sgshapiro 408190792SgshapiroFiles that define classes, i.e., F{classname}, consist of lines 408290792Sgshapiroeach of which contains a single element of the class. For example, 408390792Sgshapiro/etc/mail/local-host-names may have the following content: 408490792Sgshapiro 408590792Sgshapiromy.domain 408690792Sgshapiroanother.domain 408790792Sgshapiro 408890792SgshapiroMaps must be created using makemap(8) , e.g., 408990792Sgshapiro 409090792Sgshapiro makemap hash MAP < MAP 409190792Sgshapiro 409290792SgshapiroIn general, a text file from which a map is created contains lines 409390792Sgshapiroof the form 409490792Sgshapiro 409590792Sgshapirokey value 409690792Sgshapiro 409790792Sgshapirowhere 'key' and 'value' are also called LHS and RHS, respectively. 409890792SgshapiroBy default, the delimiter between LHS and RHS is a non-empty sequence 409990792Sgshapiroof white space characters. 410090792Sgshapiro 410190792Sgshapiro 410290792Sgshapiro+------------------+ 410390792Sgshapiro| DIRECTORY LAYOUT | 410490792Sgshapiro+------------------+ 410590792Sgshapiro 410638032SpeterWithin this directory are several subdirectories, to wit: 410738032Speter 410838032Speterm4 General support routines. These are typically 410938032Speter very important and should not be changed without 411038032Speter very careful consideration. 411138032Speter 411238032Spetercf The configuration files themselves. They have 411338032Speter ".mc" suffixes, and must be run through m4 to 411438032Speter become complete. The resulting output should 411538032Speter have a ".cf" suffix. 411638032Speter 411738032Speterostype Definitions describing a particular operating 411838032Speter system type. These should always be referenced 411938032Speter using the OSTYPE macro in the .mc file. Examples 412038032Speter include "bsd4.3", "bsd4.4", "sunos3.5", and 412138032Speter "sunos4.1". 412238032Speter 412338032Speterdomain Definitions describing a particular domain, referenced 412438032Speter using the DOMAIN macro in the .mc file. These are 412538032Speter site dependent; for example, "CS.Berkeley.EDU.m4" 412638032Speter describes hosts in the CS.Berkeley.EDU subdomain. 412738032Speter 412866494Sgshapiromailer Descriptions of mailers. These are referenced using 412938032Speter the MAILER macro in the .mc file. 413038032Speter 413138032Spetersh Shell files used when building the .cf file from the 413238032Speter .mc file in the cf subdirectory. 413338032Speter 413438032Speterfeature These hold special orthogonal features that you might 413538032Speter want to include. They should be referenced using 413638032Speter the FEATURE macro. 413738032Speter 413838032Speterhack Local hacks. These can be referenced using the HACK 413938032Speter macro. They shouldn't be of more than voyeuristic 414038032Speter interest outside the .Berkeley.EDU domain, but who knows? 414138032Speter 414238032Spetersiteconfig Site configuration -- e.g., tables of locally connected 414338032Speter UUCP sites. 414438032Speter 414538032Speter 414638032Speter+------------------------+ 414738032Speter| ADMINISTRATIVE DETAILS | 414838032Speter+------------------------+ 414938032Speter 415038032SpeterThe following sections detail usage of certain internal parts of the 415138032Spetersendmail.cf file. Read them carefully if you are trying to modify 415238032Speterthe current model. If you find the above descriptions adequate, these 415338032Spetershould be {boring, confusing, tedious, ridiculous} (pick one or more). 415438032Speter 415538032SpeterRULESETS (* means built in to sendmail) 415638032Speter 415738032Speter 0 * Parsing 415838032Speter 1 * Sender rewriting 415938032Speter 2 * Recipient rewriting 416038032Speter 3 * Canonicalization 416138032Speter 4 * Post cleanup 416238032Speter 5 * Local address rewrite (after aliasing) 416338032Speter 1x mailer rules (sender qualification) 416438032Speter 2x mailer rules (recipient qualification) 416538032Speter 3x mailer rules (sender header qualification) 416638032Speter 4x mailer rules (recipient header qualification) 416738032Speter 5x mailer subroutines (general) 416838032Speter 6x mailer subroutines (general) 416938032Speter 7x mailer subroutines (general) 417038032Speter 8x reserved 417138032Speter 90 Mailertable host stripping 417238032Speter 96 Bottom half of Ruleset 3 (ruleset 6 in old sendmail) 417338032Speter 97 Hook for recursive ruleset 0 call (ruleset 7 in old sendmail) 417438032Speter 98 Local part of ruleset 0 (ruleset 8 in old sendmail) 417538032Speter 417638032Speter 417738032SpeterMAILERS 417838032Speter 417938032Speter 0 local, prog local and program mailers 418038032Speter 1 [e]smtp, relay SMTP channel 418138032Speter 2 uucp-* UNIX-to-UNIX Copy Program 418238032Speter 3 netnews Network News delivery 418338032Speter 4 fax Sam Leffler's HylaFAX software 418438032Speter 5 mail11 DECnet mailer 418538032Speter 418638032Speter 418738032SpeterMACROS 418838032Speter 418938032Speter A 419038032Speter B Bitnet Relay 419138032Speter C DECnet Relay 419238032Speter D The local domain -- usually not needed 419338032Speter E reserved for X.400 Relay 419438032Speter F FAX Relay 419538032Speter G 419638032Speter H mail Hub (for mail clusters) 419738032Speter I 419838032Speter J 419938032Speter K 420038032Speter L Luser Relay 420164562Sgshapiro M Masquerade (who you claim to be) 420238032Speter N 420338032Speter O 420438032Speter P 420538032Speter Q 420638032Speter R Relay (for unqualified names) 420738032Speter S Smart Host 420838032Speter T 420964562Sgshapiro U my UUCP name (if you have a UUCP connection) 421064562Sgshapiro V UUCP Relay (class {V} hosts) 421164562Sgshapiro W UUCP Relay (class {W} hosts) 421264562Sgshapiro X UUCP Relay (class {X} hosts) 421338032Speter Y UUCP Relay (all other hosts) 421438032Speter Z Version number 421538032Speter 421638032Speter 421738032SpeterCLASSES 421838032Speter 421938032Speter A 422038032Speter B domains that are candidates for bestmx lookup 422138032Speter C 422238032Speter D 422338032Speter E addresses that should not seem to come from $M 422464562Sgshapiro F hosts this system forward for 422538032Speter G domains that should be looked up in genericstable 422638032Speter H 422738032Speter I 422838032Speter J 422938032Speter K 423038032Speter L addresses that should not be forwarded to $R 423138032Speter M domains that should be mapped to $M 423264562Sgshapiro N host/domains that should not be mapped to $M 423338032Speter O operators that indicate network operations (cannot be in local names) 423438032Speter P top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc. 423538032Speter Q 423664562Sgshapiro R domains this system is willing to relay (pass anti-spam filters) 423738032Speter S 423838032Speter T 423938032Speter U locally connected UUCP hosts 424038032Speter V UUCP hosts connected to relay $V 424138032Speter W UUCP hosts connected to relay $W 424238032Speter X UUCP hosts connected to relay $X 424338032Speter Y locally connected smart UUCP hosts 424438032Speter Z locally connected domain-ized UUCP hosts 424538032Speter . the class containing only a dot 424638032Speter [ the class containing only a left bracket 424738032Speter 424838032Speter 424938032SpeterM4 DIVERSIONS 425038032Speter 425138032Speter 1 Local host detection and resolution 425238032Speter 2 Local Ruleset 3 additions 425338032Speter 3 Local Ruleset 0 additions 425438032Speter 4 UUCP Ruleset 0 additions 425538032Speter 5 locally interpreted names (overrides $R) 425638032Speter 6 local configuration (at top of file) 425738032Speter 7 mailer definitions 425864562Sgshapiro 8 DNS based blacklists 425938032Speter 9 special local rulesets (1 and 2) 426064562Sgshapiro 426194334Sgshapiro$Revision: 8.612 $, Last updated $Date: 2002/04/03 17:12:52 $ 4262