README revision 285229
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 31132943SgshapiroCONNECTION CONTROL 3290792SgshapiroSTARTTLS 3390792SgshapiroSMTP AUTHENTICATION 3490792SgshapiroADDING NEW MAILERS OR RULESETS 3590792SgshapiroADDING NEW MAIL FILTERS 3690792SgshapiroQUEUE GROUP DEFINITIONS 3790792SgshapiroNON-SMTP BASED CONFIGURATIONS 3890792SgshapiroWHO AM I? 3990792SgshapiroACCEPTING MAIL FOR MULTIPLE NAMES 4090792SgshapiroUSING MAILERTABLES 4190792SgshapiroUSING USERDB TO MAP FULL NAMES 4290792SgshapiroMISCELLANEOUS SPECIAL FEATURES 4390792SgshapiroSECURITY NOTES 4490792SgshapiroTWEAKING CONFIGURATION OPTIONS 4590792SgshapiroMESSAGE SUBMISSION PROGRAM 4690792SgshapiroFORMAT OF FILES AND MAPS 4790792SgshapiroDIRECTORY LAYOUT 4890792SgshapiroADMINISTRATIVE DETAILS 4938032Speter 5090792Sgshapiro 5138032Speter+--------------------------+ 5238032Speter| INTRODUCTION AND EXAMPLE | 5338032Speter+--------------------------+ 5438032Speter 5538032SpeterConfiguration files are contained in the subdirectory "cf", with a 5638032Spetersuffix ".mc". They must be run through "m4" to produce a ".cf" file. 5738032SpeterYou must pre-load "cf.m4": 5838032Speter 5938032Speter m4 ${CFDIR}/m4/cf.m4 config.mc > config.cf 6038032Speter 6164562SgshapiroAlternatively, you can simply: 6264562Sgshapiro 6364562Sgshapiro cd ${CFDIR}/cf 6464562Sgshapiro ./Build config.cf 6564562Sgshapiro 6638032Speterwhere ${CFDIR} is the root of the cf directory and config.mc is the 6738032Spetername of your configuration file. If you are running a version of M4 6838032Speterthat understands the __file__ builtin (versions of GNU m4 >= 0.75 do 6938032Speterthis, but the versions distributed with 4.4BSD and derivatives do not) 7038032Speteror the -I flag (ditto), then ${CFDIR} can be in an arbitrary directory. 7138032SpeterFor "traditional" versions, ${CFDIR} ***MUST*** be "..", or you MUST 7238032Speteruse -D_CF_DIR_=/path/to/cf/dir/ -- note the trailing slash! For example: 7338032Speter 7438032Speter m4 -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 config.mc > config.cf 7538032Speter 7638032SpeterLet's examine a typical .mc file: 7738032Speter 7838032Speter divert(-1) 7938032Speter # 80261194Sgshapiro # Copyright (c) 1998-2005 Proofpoint, Inc. and its suppliers. 8164562Sgshapiro # All rights reserved. 8238032Speter # Copyright (c) 1983 Eric P. Allman. All rights reserved. 8338032Speter # Copyright (c) 1988, 1993 8438032Speter # The Regents of the University of California. All rights reserved. 8538032Speter # 8638032Speter # By using this file, you agree to the terms and conditions set 8738032Speter # forth in the LICENSE file which can be found at the top level of 8838032Speter # the sendmail distribution. 8938032Speter # 9038032Speter 9138032Speter # 9238032Speter # This is a Berkeley-specific configuration file for HP-UX 9.x. 9338032Speter # It applies only to the Computer Science Division at Berkeley, 9438032Speter # and should not be used elsewhere. It is provided on the sendmail 9538032Speter # distribution as a sample only. To create your own configuration 9638032Speter # file, create an appropriate domain file in ../domain, change the 9738032Speter # `DOMAIN' macro below to reference that file, and copy the result 9838032Speter # to a name of your own choosing. 9938032Speter # 10038032Speter divert(0) 10138032Speter 10238032SpeterThe divert(-1) will delete the crud in the resulting output file. 10338032SpeterThe copyright notice can be replaced by whatever your lawyers require; 10464562Sgshapiroour lawyers require the one that is included in these files. A copyleft 10538032Speteris a copyright by another name. The divert(0) restores regular output. 10638032Speter 10738032Speter VERSIONID(`<SCCS or RCS version id>') 10838032Speter 10938032SpeterVERSIONID is a macro that stuffs the version information into the 11064562Sgshapiroresulting file. You could use SCCS, RCS, CVS, something else, or 11138032Speteromit it completely. This is not the same as the version id included 11238032Speterin SMTP greeting messages -- this is defined in m4/version.m4. 11338032Speter 11464562Sgshapiro OSTYPE(`hpux9')dnl 11538032Speter 11638032SpeterYou must specify an OSTYPE to properly configure things such as the 11738032Speterpathname of the help and status files, the flags needed for the local 11838032Spetermailer, and other important things. If you omit it, you will get an 11938032Spetererror when you try to build the configuration. Look at the ostype 12038032Speterdirectory for the list of known operating system types. 12138032Speter 12264562Sgshapiro DOMAIN(`CS.Berkeley.EDU')dnl 12338032Speter 12438032SpeterThis example is specific to the Computer Science Division at Berkeley. 12564562SgshapiroYou can use "DOMAIN(`generic')" to get a sufficiently bland definition 12638032Speterthat may well work for you, or you can create a customized domain 12738032Speterdefinition appropriate for your environment. 12838032Speter 12964562Sgshapiro MAILER(`local') 13064562Sgshapiro MAILER(`smtp') 13138032Speter 13290792SgshapiroThese describe the mailers used at the default CS site. The local 13390792Sgshapiromailer is always included automatically. Beware: MAILER declarations 134132943Sgshapiroshould only be followed by LOCAL_* sections. The general rules are 135132943Sgshapirothat the order should be: 13638032Speter 13738032Speter VERSIONID 13838032Speter OSTYPE 13938032Speter DOMAIN 14038032Speter FEATURE 14138032Speter local macro definitions 14238032Speter MAILER 14390792Sgshapiro LOCAL_CONFIG 14464562Sgshapiro LOCAL_RULE_* 14564562Sgshapiro LOCAL_RULESETS 14638032Speter 14764562SgshapiroThere are a few exceptions to this rule. Local macro definitions which 14864562Sgshapiroinfluence a FEATURE() should be done before that feature. For example, 14964562Sgshapiroa define(`PROCMAIL_MAILER_PATH', ...) should be done before 15064562SgshapiroFEATURE(`local_procmail'). 15138032Speter 15290792Sgshapiro******************************************************************* 15390792Sgshapiro*** BE SURE YOU CUSTOMIZE THESE FILES! They have some *** 15490792Sgshapiro*** Berkeley-specific assumptions built in, such as the name *** 15590792Sgshapiro*** of their UUCP-relay. You'll want to create your own *** 15690792Sgshapiro*** domain description, and use that in place of *** 15790792Sgshapiro*** domain/Berkeley.EDU.m4. *** 15890792Sgshapiro******************************************************************* 15964562Sgshapiro 16090792Sgshapiro 161285229SgshapiroNote: 162285229SgshapiroSome rulesets, features, and options are only useful if the sendmail 163285229Sgshapirobinary has been compiled with the appropriate options, e.g., the 164285229Sgshapiroruleset tls_server is only invoked if sendmail has been compiled 165285229Sgshapirowith STARTTLS. This is usually obvious from the context and hence 166285229Sgshapironot further specified here. 167285229SgshapiroThere are also so called "For Future Releases" (FFR) compile time 168285229Sgshapirooptions which might be included in a subsequent version or might 169285229Sgshapirosimply be removed as they turned out not to be really useful. 170285229SgshapiroThese are generally not documented but if they are, then the required 171285229Sgshapirocompile time options are listed in doc/op/op.* for rulesets and 172285229Sgshapiromacros, and for mc/cf specific options they are usually listed here. 173285229SgshapiroIn addition to compile time options for the sendmail binary, there 174285229Sgshapirocan also be FFRs for mc/cf which in general can be enabled when the 175285229Sgshapiroconfiguration file is generated by defining them at the top of your 176285229Sgshapiro.mc file: 177285229Sgshapiro 178285229Sgshapirodefine(`_FFR_NAME_HERE', 1) 179285229Sgshapiro 180285229Sgshapiro 18138032Speter+----------------------------+ 18238032Speter| A BRIEF INTRODUCTION TO M4 | 18338032Speter+----------------------------+ 18438032Speter 18538032SpeterSendmail uses the M4 macro processor to ``compile'' the configuration 18638032Speterfiles. The most important thing to know is that M4 is stream-based, 18738032Speterthat is, it doesn't understand about lines. For this reason, in some 18838032Speterplaces you may see the word ``dnl'', which stands for ``delete 18938032Speterthrough newline''; essentially, it deletes all characters starting 19038032Speterat the ``dnl'' up to and including the next newline character. In 19138032Spetermost cases sendmail uses this only to avoid lots of unnecessary 19238032Speterblank lines in the output. 19338032Speter 19438032SpeterOther important directives are define(A, B) which defines the macro 19538032Speter``A'' to have value ``B''. Macros are expanded as they are read, so 19638032Speterone normally quotes both values to prevent expansion. For example, 19738032Speter 19838032Speter define(`SMART_HOST', `smart.foo.com') 19938032Speter 20038032SpeterOne word of warning: M4 macros are expanded even in lines that appear 20138032Speterto be comments. For example, if you have 20238032Speter 20364562Sgshapiro # See FEATURE(`foo') above 20438032Speter 20564562Sgshapiroit will not do what you expect, because the FEATURE(`foo') will be 20638032Speterexpanded. This also applies to 20738032Speter 20838032Speter # And then define the $X macro to be the return address 20938032Speter 21038032Speterbecause ``define'' is an M4 keyword. If you want to use them, surround 21138032Speterthem with directed quotes, `like this'. 21238032Speter 213110560SgshapiroSince m4 uses single quotes (opening "`" and closing "'") to quote 214110560Sgshapiroarguments, those quotes can't be used in arguments. For example, 215110560Sgshapiroit is not possible to define a rejection message containing a single 216110560Sgshapiroquote. Usually there are simple workarounds by changing those 217110560Sgshapiromessages; in the worst case it might be ok to change the value 218110560Sgshapirodirectly in the generated .cf file, which however is not advised. 21990792Sgshapiro 220110560Sgshapiro 22190792SgshapiroNotice: 22290792Sgshapiro------- 22390792Sgshapiro 22490792SgshapiroThis package requires a post-V7 version of m4; if you are running the 22590792Sgshapiro4.2bsd, SysV.2, or 7th Edition version. SunOS's /usr/5bin/m4 or 22690792SgshapiroBSD-Net/2's m4 both work. GNU m4 version 1.1 or later also works. 22790792SgshapiroUnfortunately, the M4 on BSDI 1.0 doesn't work -- you'll have to use a 22890792SgshapiroNet/2 or GNU version. GNU m4 is available from 22990792Sgshapiroftp://ftp.gnu.org/pub/gnu/m4/m4-1.4.tar.gz (check for the latest version). 23090792SgshapiroEXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken (3.x is fine). Use GNU 23190792Sgshapirom4 on this platform. 23290792Sgshapiro 23390792Sgshapiro 23438032Speter+----------------+ 23538032Speter| FILE LOCATIONS | 23638032Speter+----------------+ 23738032Speter 23838032Spetersendmail 8.9 has introduced a new configuration directory for sendmail 23938032Speterrelated files, /etc/mail. The new files available for sendmail 8.9 -- 24064562Sgshapirothe class {R} /etc/mail/relay-domains and the access database 24164562Sgshapiro/etc/mail/access -- take advantage of this new directory. Beginning with 24264562Sgshapiro8.10, all files will use this directory by default (some options may be 24364562Sgshapiroset by OSTYPE() files). This new directory should help to restore 24464562Sgshapirouniformity to sendmail's file locations. 24538032Speter 24664562SgshapiroBelow is a table of some of the common changes: 24764562Sgshapiro 24864562SgshapiroOld filename New filename 24964562Sgshapiro------------ ------------ 25064562Sgshapiro/etc/bitdomain /etc/mail/bitdomain 25164562Sgshapiro/etc/domaintable /etc/mail/domaintable 25264562Sgshapiro/etc/genericstable /etc/mail/genericstable 25364562Sgshapiro/etc/uudomain /etc/mail/uudomain 25464562Sgshapiro/etc/virtusertable /etc/mail/virtusertable 25564562Sgshapiro/etc/userdb /etc/mail/userdb 25664562Sgshapiro 25764562Sgshapiro/etc/aliases /etc/mail/aliases 25864562Sgshapiro/etc/sendmail/aliases /etc/mail/aliases 25964562Sgshapiro/etc/ucbmail/aliases /etc/mail/aliases 26064562Sgshapiro/usr/adm/sendmail/aliases /etc/mail/aliases 26164562Sgshapiro/usr/lib/aliases /etc/mail/aliases 26264562Sgshapiro/usr/lib/mail/aliases /etc/mail/aliases 26364562Sgshapiro/usr/ucblib/aliases /etc/mail/aliases 26464562Sgshapiro 26564562Sgshapiro/etc/sendmail.cw /etc/mail/local-host-names 26664562Sgshapiro/etc/mail/sendmail.cw /etc/mail/local-host-names 26764562Sgshapiro/etc/sendmail/sendmail.cw /etc/mail/local-host-names 26864562Sgshapiro 26964562Sgshapiro/etc/sendmail.ct /etc/mail/trusted-users 27064562Sgshapiro 27164562Sgshapiro/etc/sendmail.oE /etc/mail/error-header 27264562Sgshapiro 27364562Sgshapiro/etc/sendmail.hf /etc/mail/helpfile 27464562Sgshapiro/etc/mail/sendmail.hf /etc/mail/helpfile 27564562Sgshapiro/usr/ucblib/sendmail.hf /etc/mail/helpfile 27664562Sgshapiro/etc/ucbmail/sendmail.hf /etc/mail/helpfile 27764562Sgshapiro/usr/lib/sendmail.hf /etc/mail/helpfile 27864562Sgshapiro/usr/share/lib/sendmail.hf /etc/mail/helpfile 27964562Sgshapiro/usr/share/misc/sendmail.hf /etc/mail/helpfile 28064562Sgshapiro/share/misc/sendmail.hf /etc/mail/helpfile 28164562Sgshapiro 28264562Sgshapiro/etc/service.switch /etc/mail/service.switch 28364562Sgshapiro 28464562Sgshapiro/etc/sendmail.st /etc/mail/statistics 28564562Sgshapiro/etc/mail/sendmail.st /etc/mail/statistics 28664562Sgshapiro/etc/mailer/sendmail.st /etc/mail/statistics 28764562Sgshapiro/etc/sendmail/sendmail.st /etc/mail/statistics 28864562Sgshapiro/usr/lib/sendmail.st /etc/mail/statistics 28964562Sgshapiro/usr/ucblib/sendmail.st /etc/mail/statistics 29064562Sgshapiro 29164562SgshapiroNote that all of these paths actually use a new m4 macro MAIL_SETTINGS_DIR 29264562Sgshapiroto create the pathnames. The default value of this variable is 29364562Sgshapiro`/etc/mail/'. If you set this macro to a different value, you MUST include 29464562Sgshapiroa trailing slash. 29564562Sgshapiro 29680785SgshapiroNotice: all filenames used in a .mc (or .cf) file should be absolute 29780785Sgshapiro(starting at the root, i.e., with '/'). Relative filenames most 29880785Sgshapirolikely cause surprises during operations (unless otherwise noted). 29980785Sgshapiro 30080785Sgshapiro 30138032Speter+--------+ 30238032Speter| OSTYPE | 30338032Speter+--------+ 30438032Speter 30538032SpeterYou MUST define an operating system environment, or the configuration 30638032Speterfile build will puke. There are several environments available; look 30738032Speterat the "ostype" directory for the current list. This macro changes 30838032Speterthings like the location of the alias file and queue directory. Some 30938032Speterof these files are identical to one another. 31038032Speter 31138032SpeterIt is IMPERATIVE that the OSTYPE occur before any MAILER definitions. 31238032SpeterIn general, the OSTYPE macro should go immediately after any version 31338032Speterinformation, and MAILER definitions should always go last. 31438032Speter 31538032SpeterOperating system definitions are usually easy to write. They may define 31638032Speterthe following variables (everything defaults, so an ostype file may be 31738032Speterempty). Unfortunately, the list of configuration-supported systems is 31838032Speternot as broad as the list of source-supported systems, since many of 31938032Speterthe source contributors do not include corresponding ostype files. 32038032Speter 32164562SgshapiroALIAS_FILE [/etc/mail/aliases] The location of the text version 32238032Speter of the alias file(s). It can be a comma-separated 32338032Speter list of names (but be sure you quote values with 32438032Speter commas in them -- for example, use 32538032Speter define(`ALIAS_FILE', `a,b') 32638032Speter to get "a" and "b" both listed as alias files; 32738032Speter otherwise the define() primitive only sees "a"). 32864562SgshapiroHELP_FILE [/etc/mail/helpfile] The name of the file 32938032Speter containing information printed in response to 33038032Speter the SMTP HELP command. 33138032SpeterQUEUE_DIR [/var/spool/mqueue] The directory containing 33264562Sgshapiro queue files. To use multiple queues, supply 33364562Sgshapiro a value ending with an asterisk. For 33473188Sgshapiro example, /var/spool/mqueue/qd* will use all of the 33564562Sgshapiro directories or symbolic links to directories 33673188Sgshapiro beginning with 'qd' in /var/spool/mqueue as queue 33764562Sgshapiro directories. The names 'qf', 'df', and 'xf' are 33873188Sgshapiro reserved as specific subdirectories for the 33973188Sgshapiro corresponding queue file types as explained in 34090792Sgshapiro doc/op/op.me. See also QUEUE GROUP DEFINITIONS. 34190792SgshapiroMSP_QUEUE_DIR [/var/spool/clientmqueue] The directory containing 34290792Sgshapiro queue files for the MSP (Mail Submission Program, 34390792Sgshapiro see sendmail/SECURITY). 34464562SgshapiroSTATUS_FILE [/etc/mail/statistics] The file containing status 34538032Speter information. 34638032SpeterLOCAL_MAILER_PATH [/bin/mail] The program used to deliver local mail. 34764562SgshapiroLOCAL_MAILER_FLAGS [Prmn9] The flags used by the local mailer. The 34864562Sgshapiro flags lsDFMAw5:/|@q are always included. 34938032SpeterLOCAL_MAILER_ARGS [mail -d $u] The arguments passed to deliver local 35038032Speter mail. 35138032SpeterLOCAL_MAILER_MAX [undefined] If defined, the maximum size of local 35238032Speter mail that you are willing to accept. 35364562SgshapiroLOCAL_MAILER_MAXMSGS [undefined] If defined, the maximum number of 35464562Sgshapiro messages to deliver in a single connection. Only 35564562Sgshapiro useful for LMTP local mailers. 35638032SpeterLOCAL_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 35738032Speter that ARRIVE from an address that resolves to the 35838032Speter local mailer and which are converted to MIME will be 35938032Speter labeled with this character set. 36064562SgshapiroLOCAL_MAILER_EOL [undefined] If defined, the string to use as the 36164562Sgshapiro end of line for the local mailer. 36264562SgshapiroLOCAL_MAILER_DSN_DIAGNOSTIC_CODE 36364562Sgshapiro [X-Unix] The DSN Diagnostic-Code value for the 36464562Sgshapiro local mailer. This should be changed with care. 36538032SpeterLOCAL_SHELL_PATH [/bin/sh] The shell used to deliver piped email. 36638032SpeterLOCAL_SHELL_FLAGS [eu9] The flags used by the shell mailer. The 36738032Speter flags lsDFM are always included. 36838032SpeterLOCAL_SHELL_ARGS [sh -c $u] The arguments passed to deliver "prog" 36938032Speter mail. 37038032SpeterLOCAL_SHELL_DIR [$z:/] The directory search path in which the 37138032Speter shell should run. 37290792SgshapiroLOCAL_MAILER_QGRP [undefined] The queue group for the local mailer. 37338032SpeterUSENET_MAILER_PATH [/usr/lib/news/inews] The name of the program 37438032Speter used to submit news. 37564562SgshapiroUSENET_MAILER_FLAGS [rsDFMmn] The mailer flags for the usenet mailer. 37638032SpeterUSENET_MAILER_ARGS [-m -h -n] The command line arguments for the 37790792Sgshapiro usenet mailer. NOTE: Some versions of inews 37890792Sgshapiro (such as those shipped with newer versions of INN) 37990792Sgshapiro use different flags. Double check the defaults 38090792Sgshapiro against the inews man page. 381102528SgshapiroUSENET_MAILER_MAX [undefined] The maximum size of messages that will 38238032Speter be accepted by the usenet mailer. 38390792SgshapiroUSENET_MAILER_QGRP [undefined] The queue group for the usenet mailer. 38438032SpeterSMTP_MAILER_FLAGS [undefined] Flags added to SMTP mailer. Default 38564562Sgshapiro flags are `mDFMuX' for all SMTP-based mailers; the 38664562Sgshapiro "esmtp" mailer adds `a'; "smtp8" adds `8'; and 38764562Sgshapiro "dsmtp" adds `%'. 38864562SgshapiroRELAY_MAILER_FLAGS [undefined] Flags added to the relay mailer. Default 38964562Sgshapiro flags are `mDFMuX' for all SMTP-based mailers; the 39064562Sgshapiro relay mailer adds `a8'. If this is not defined, 39164562Sgshapiro then SMTP_MAILER_FLAGS is used. 39238032SpeterSMTP_MAILER_MAX [undefined] The maximum size of messages that will 39364562Sgshapiro be transported using the smtp, smtp8, esmtp, or dsmtp 39438032Speter mailers. 39564562SgshapiroSMTP_MAILER_MAXMSGS [undefined] If defined, the maximum number of 39664562Sgshapiro messages to deliver in a single connection for the 39764562Sgshapiro smtp, smtp8, esmtp, or dsmtp mailers. 39894334SgshapiroSMTP_MAILER_MAXRCPTS [undefined] If defined, the maximum number of 39994334Sgshapiro recipients to deliver in a single connection for the 40094334Sgshapiro smtp, smtp8, esmtp, or dsmtp mailers. 40166494SgshapiroSMTP_MAILER_ARGS [TCP $h] The arguments passed to the smtp mailer. 40238032Speter About the only reason you would want to change this 40338032Speter would be to change the default port. 40466494SgshapiroESMTP_MAILER_ARGS [TCP $h] The arguments passed to the esmtp mailer. 40566494SgshapiroSMTP8_MAILER_ARGS [TCP $h] The arguments passed to the smtp8 mailer. 40666494SgshapiroDSMTP_MAILER_ARGS [TCP $h] The arguments passed to the dsmtp mailer. 40766494SgshapiroRELAY_MAILER_ARGS [TCP $h] The arguments passed to the relay mailer. 40890792SgshapiroSMTP_MAILER_QGRP [undefined] The queue group for the smtp mailer. 40990792SgshapiroESMTP_MAILER_QGRP [undefined] The queue group for the esmtp mailer. 41090792SgshapiroSMTP8_MAILER_QGRP [undefined] The queue group for the smtp8 mailer. 41190792SgshapiroDSMTP_MAILER_QGRP [undefined] The queue group for the dsmtp mailer. 41290792SgshapiroRELAY_MAILER_QGRP [undefined] The queue group for the relay mailer. 41364562SgshapiroRELAY_MAILER_MAXMSGS [undefined] If defined, the maximum number of 41464562Sgshapiro messages to deliver in a single connection for the 41564562Sgshapiro relay mailer. 41638032SpeterSMTP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 41738032Speter that ARRIVE from an address that resolves to one of 41838032Speter the SMTP mailers and which are converted to MIME will 41938032Speter be labeled with this character set. 420285229SgshapiroRELAY_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 421285229Sgshapiro that ARRIVE from an address that resolves to the 422285229Sgshapiro relay mailers and which are converted to MIME will 423285229Sgshapiro be labeled with this character set. 424168515SgshapiroSMTP_MAILER_LL [990] The maximum line length for SMTP mailers 425168515Sgshapiro (except the relay mailer). 426168515SgshapiroRELAY_MAILER_LL [2040] The maximum line length for the relay mailer. 42738032SpeterUUCP_MAILER_PATH [/usr/bin/uux] The program used to send UUCP mail. 42838032SpeterUUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer. Default 42938032Speter flags are `DFMhuU' (and `m' for uucp-new mailer, 43038032Speter minus `U' for uucp-dom mailer). 43138032SpeterUUCP_MAILER_ARGS [uux - -r -z -a$g -gC $h!rmail ($u)] The arguments 43238032Speter passed to the UUCP mailer. 43338032SpeterUUCP_MAILER_MAX [100000] The maximum size message accepted for 43438032Speter transmission by the UUCP mailers. 43538032SpeterUUCP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 43638032Speter that ARRIVE from an address that resolves to one of 43738032Speter the UUCP mailers and which are converted to MIME will 43838032Speter be labeled with this character set. 43990792SgshapiroUUCP_MAILER_QGRP [undefined] The queue group for the UUCP mailers. 44038032SpeterFAX_MAILER_PATH [/usr/local/lib/fax/mailfax] The program used to 44138032Speter submit FAX messages. 44238032SpeterFAX_MAILER_ARGS [mailfax $u $h $f] The arguments passed to the FAX 44338032Speter mailer. 44438032SpeterFAX_MAILER_MAX [100000] The maximum size message accepted for 44538032Speter transmission by FAX. 44638032SpeterPOP_MAILER_PATH [/usr/lib/mh/spop] The pathname of the POP mailer. 44764562SgshapiroPOP_MAILER_FLAGS [Penu] Flags added to POP mailer. Flags lsDFMq 44838032Speter are always added. 44938032SpeterPOP_MAILER_ARGS [pop $u] The arguments passed to the POP mailer. 45090792SgshapiroPOP_MAILER_QGRP [undefined] The queue group for the pop mailer. 45138032SpeterPROCMAIL_MAILER_PATH [/usr/local/bin/procmail] The path to the procmail 45243730Speter program. This is also used by 45343730Speter FEATURE(`local_procmail'). 45438032SpeterPROCMAIL_MAILER_FLAGS [SPhnu9] Flags added to Procmail mailer. Flags 45564562Sgshapiro DFM are always set. This is NOT used by 45643730Speter FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS 45738032Speter instead. 45838032SpeterPROCMAIL_MAILER_ARGS [procmail -Y -m $h $f $u] The arguments passed to 45938032Speter the Procmail mailer. This is NOT used by 46043730Speter FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS 46138032Speter instead. 46238032SpeterPROCMAIL_MAILER_MAX [undefined] If set, the maximum size message that 46338032Speter will be accepted by the procmail mailer. 46490792SgshapiroPROCMAIL_MAILER_QGRP [undefined] The queue group for the procmail mailer. 46538032SpeterMAIL11_MAILER_PATH [/usr/etc/mail11] The path to the mail11 mailer. 46638032SpeterMAIL11_MAILER_FLAGS [nsFx] Flags for the mail11 mailer. 46738032SpeterMAIL11_MAILER_ARGS [mail11 $g $x $h $u] Arguments passed to the mail11 46838032Speter mailer. 46990792SgshapiroMAIL11_MAILER_QGRP [undefined] The queue group for the mail11 mailer. 47038032SpeterPH_MAILER_PATH [/usr/local/etc/phquery] The path to the phquery 47138032Speter program. 47264562SgshapiroPH_MAILER_FLAGS [ehmu] Flags for the phquery mailer. Flags nrDFM 47364562Sgshapiro are always set. 47438032SpeterPH_MAILER_ARGS [phquery -- $u] -- arguments to the phquery mailer. 47590792SgshapiroPH_MAILER_QGRP [undefined] The queue group for the ph mailer. 47664562SgshapiroCYRUS_MAILER_FLAGS [Ah5@/:|] The flags used by the cyrus mailer. The 47738032Speter flags lsDFMnPq are always included. 47838032SpeterCYRUS_MAILER_PATH [/usr/cyrus/bin/deliver] The program used to deliver 47938032Speter cyrus mail. 48038032SpeterCYRUS_MAILER_ARGS [deliver -e -m $h -- $u] The arguments passed 48138032Speter to deliver cyrus mail. 48238032SpeterCYRUS_MAILER_MAX [undefined] If set, the maximum size message that 48338032Speter will be accepted by the cyrus mailer. 48438032SpeterCYRUS_MAILER_USER [cyrus:mail] The user and group to become when 48538032Speter running the cyrus mailer. 48690792SgshapiroCYRUS_MAILER_QGRP [undefined] The queue group for the cyrus mailer. 48764562SgshapiroCYRUS_BB_MAILER_FLAGS [u] The flags used by the cyrusbb mailer. 48864562Sgshapiro The flags lsDFMnP are always included. 48938032SpeterCYRUS_BB_MAILER_ARGS [deliver -e -m $u] The arguments passed 49038032Speter to deliver cyrusbb mail. 49198121SgshapiroCYRUSV2_MAILER_FLAGS [A@/:|m] The flags used by the cyrusv2 mailer. The 49298121Sgshapiro flags lsDFMnqXz are always included. 49398121SgshapiroCYRUSV2_MAILER_MAXMSGS [undefined] If defined, the maximum number of 49498121Sgshapiro messages to deliver in a single connection for the 49598121Sgshapiro cyrusv2 mailer. 49698121SgshapiroCYRUSV2_MAILER_MAXRCPTS [undefined] If defined, the maximum number of 49798121Sgshapiro recipients to deliver in a single connection for the 49898121Sgshapiro cyrusv2 mailer. 49998121SgshapiroCYRUSV2_MAILER_ARGS [FILE /var/imap/socket/lmtp] The arguments passed 50098121Sgshapiro to the cyrusv2 mailer. This can be used to 50198121Sgshapiro change the name of the Unix domain socket, or 50298121Sgshapiro to switch to delivery via TCP (e.g., `TCP $h lmtp') 50398121SgshapiroCYRUSV2_MAILER_QGRP [undefined] The queue group for the cyrusv2 mailer. 504110560SgshapiroCYRUSV2_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 505110560Sgshapiro that ARRIVE from an address that resolves to one the 506110560Sgshapiro Cyrus mailer and which are converted to MIME will 507110560Sgshapiro be labeled with this character set. 50838032SpeterconfEBINDIR [/usr/libexec] The directory for executables. 50943730Speter Currently used for FEATURE(`local_lmtp') and 51043730Speter FEATURE(`smrsh'). 51164562SgshapiroQPAGE_MAILER_FLAGS [mDFMs] The flags used by the qpage mailer. 51264562SgshapiroQPAGE_MAILER_PATH [/usr/local/bin/qpage] The program used to deliver 51364562Sgshapiro qpage mail. 51464562SgshapiroQPAGE_MAILER_ARGS [qpage -l0 -m -P$u] The arguments passed 51564562Sgshapiro to deliver qpage mail. 51664562SgshapiroQPAGE_MAILER_MAX [4096] If set, the maximum size message that 51764562Sgshapiro will be accepted by the qpage mailer. 51890792SgshapiroQPAGE_MAILER_QGRP [undefined] The queue group for the qpage mailer. 51990792SgshapiroLOCAL_PROG_QGRP [undefined] The queue group for the prog mailer. 52038032Speter 52164562SgshapiroNote: to tweak Name_MAILER_FLAGS use the macro MODIFY_MAILER_FLAGS: 522157001SgshapiroMODIFY_MAILER_FLAGS(`Name', `change') where Name is the first part 523157001Sgshapiroof the macro Name_MAILER_FLAGS (note: that means Name is entirely in 524157001Sgshapiroupper case) and change can be: flags that should be used directly 525157001Sgshapiro(thus overriding the default value), or if it starts with `+' (`-') 526157001Sgshapirothen those flags are added to (removed from) the default value. 527157001SgshapiroExample: 52838032Speter 52964562Sgshapiro MODIFY_MAILER_FLAGS(`LOCAL', `+e') 53038032Speter 53190792Sgshapirowill add the flag `e' to LOCAL_MAILER_FLAGS. Notice: there are 53290792Sgshapiroseveral smtp mailers all of which are manipulated individually. 53390792SgshapiroSee the section MAILERS for the available mailer names. 53464562SgshapiroWARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS 53564562Sgshapirounconditionally, i.e., without respecting any definitions in an 53664562SgshapiroOSTYPE setting. 53764562Sgshapiro 53864562Sgshapiro 53938032Speter+---------+ 54038032Speter| DOMAINS | 54138032Speter+---------+ 54238032Speter 54338032SpeterYou will probably want to collect domain-dependent defines into one 54464562Sgshapirofile, referenced by the DOMAIN macro. For example, the Berkeley 54538032Speterdomain file includes definitions for several internal distinguished 54638032Speterhosts: 54738032Speter 54838032SpeterUUCP_RELAY The host that will accept UUCP-addressed email. 54938032Speter If not defined, all UUCP sites must be directly 55038032Speter connected. 55138032SpeterBITNET_RELAY The host that will accept BITNET-addressed email. 55238032Speter If not defined, the .BITNET pseudo-domain won't work. 55338032SpeterDECNET_RELAY The host that will accept DECNET-addressed email. 55438032Speter If not defined, the .DECNET pseudo-domain and addresses 55538032Speter of the form node::user will not work. 55638032SpeterFAX_RELAY The host that will accept mail to the .FAX pseudo-domain. 55738032Speter The "fax" mailer overrides this value. 55871345SgshapiroLOCAL_RELAY The site that will handle unqualified names -- that 55982017Sgshapiro is, names without an @domain extension. 56071345Sgshapiro Normally MAIL_HUB is preferred for this function. 56171345Sgshapiro LOCAL_RELAY is mostly useful in conjunction with 56290792Sgshapiro FEATURE(`stickyhost') -- see the discussion of 56371345Sgshapiro stickyhost below. If not set, they are assumed to 56471345Sgshapiro belong on this machine. This allows you to have a 56571345Sgshapiro central site to store a company- or department-wide 56671345Sgshapiro alias database. This only works at small sites, 56771345Sgshapiro and only with some user agents. 56838032SpeterLUSER_RELAY The site that will handle lusers -- that is, apparently 56964562Sgshapiro local names that aren't local accounts or aliases. To 57064562Sgshapiro specify a local user instead of a site, set this to 57164562Sgshapiro ``local:username''. 57238032Speter 57338032SpeterAny of these can be either ``mailer:hostname'' (in which case the 57438032Spetermailer is the internal mailer name, such as ``uucp-new'' and the hostname 57538032Speteris the name of the host as appropriate for that mailer) or just a 57638032Speter``hostname'', in which case a default mailer type (usually ``relay'', 57738032Spetera variant on SMTP) is used. WARNING: if you have a wildcard MX 57838032Speterrecord matching your domain, you probably want to define these to 57938032Speterhave a trailing dot so that you won't get the mail diverted back 58038032Speterto yourself. 58138032Speter 58238032SpeterThe domain file can also be used to define a domain name, if needed 58338032Speter(using "DD<domain>") and set certain site-wide features. If all hosts 58438032Speterat your site masquerade behind one email name, you could also use 58538032SpeterMASQUERADE_AS here. 58638032Speter 58738032SpeterYou do not have to define a domain -- in particular, if you are a 58838032Spetersingle machine sitting off somewhere, it is probably more work than 58938032Speterit's worth. This is just a mechanism for combining "domain dependent 59038032Speterknowledge" into one place. 59138032Speter 59290792Sgshapiro 59338032Speter+---------+ 59438032Speter| MAILERS | 59538032Speter+---------+ 59638032Speter 59738032SpeterThere are fewer mailers supported in this version than the previous 59838032Speterversion, owing mostly to a simpler world. As a general rule, put the 59990792SgshapiroMAILER definitions last in your .mc file. 60038032Speter 60138032Speterlocal The local and prog mailers. You will almost always 60238032Speter need these; the only exception is if you relay ALL 60338032Speter your mail to another site. This mailer is included 60438032Speter automatically. 60538032Speter 60638032Spetersmtp The Simple Mail Transport Protocol mailer. This does 60738032Speter not hide hosts behind a gateway or another other 60838032Speter such hack; it assumes a world where everyone is 60938032Speter running the name server. This file actually defines 61064562Sgshapiro five mailers: "smtp" for regular (old-style) SMTP to 61138032Speter other servers, "esmtp" for extended SMTP to other 61238032Speter servers, "smtp8" to do SMTP to other servers without 61338032Speter converting 8-bit data to MIME (essentially, this is 61438032Speter your statement that you know the other end is 8-bit 61564562Sgshapiro clean even if it doesn't say so), "dsmtp" to do on 61664562Sgshapiro demand delivery, and "relay" for transmission to the 61764562Sgshapiro RELAY_HOST, LUSER_RELAY, or MAIL_HUB. 61838032Speter 61966494Sgshapirouucp The UNIX-to-UNIX Copy Program mailer. Actually, this 62038032Speter defines two mailers, "uucp-old" (a.k.a. "uucp") and 62138032Speter "uucp-new" (a.k.a. "suucp"). The latter is for when you 62238032Speter know that the UUCP mailer at the other end can handle 62338032Speter multiple recipients in one transfer. If the smtp mailer 62490792Sgshapiro is included in your configuration, two other mailers 62590792Sgshapiro ("uucp-dom" and "uucp-uudom") are also defined [warning: you 62690792Sgshapiro MUST specify MAILER(`smtp') before MAILER(`uucp')]. When you 62738032Speter include the uucp mailer, sendmail looks for all names in 62864562Sgshapiro class {U} and sends them to the uucp-old mailer; all 62964562Sgshapiro names in class {Y} are sent to uucp-new; and all 63064562Sgshapiro names in class {Z} are sent to uucp-uudom. Note that 63138032Speter this is a function of what version of rmail runs on 63238032Speter the receiving end, and hence may be out of your control. 63338032Speter See the section below describing UUCP mailers in more 63438032Speter detail. 63538032Speter 63638032Speterusenet Usenet (network news) delivery. If this is specified, 63738032Speter an extra rule is added to ruleset 0 that forwards all 63838032Speter local email for users named ``group.usenet'' to the 63938032Speter ``inews'' program. Note that this works for all groups, 64038032Speter and may be considered a security problem. 64138032Speter 64238032Speterfax Facsimile transmission. This is experimental and based 64338032Speter on Sam Leffler's HylaFAX software. For more information, 64471345Sgshapiro see http://www.hylafax.org/. 64538032Speter 64638032Speterpop Post Office Protocol. 64738032Speter 64838032Speterprocmail An interface to procmail (does not come with sendmail). 64938032Speter This is designed to be used in mailertables. For example, 65038032Speter a common question is "how do I forward all mail for a given 65138032Speter domain to a single person?". If you have this mailer 65238032Speter defined, you could set up a mailertable reading: 65338032Speter 65438032Speter host.com procmail:/etc/procmailrcs/host.com 65538032Speter 65638032Speter with the file /etc/procmailrcs/host.com reading: 65738032Speter 65838032Speter :0 # forward mail for host.com 65938032Speter ! -oi -f $1 person@other.host 66038032Speter 66138032Speter This would arrange for (anything)@host.com to be sent 662111823Sgshapiro to person@other.host. In a procmail script, $1 is the 663111823Sgshapiro name of the sender and $2 is the name of the recipient. 66443730Speter If you use this with FEATURE(`local_procmail'), the FEATURE 66538032Speter should be listed first. 66638032Speter 66790792Sgshapiro Of course there are other ways to solve this particular 66890792Sgshapiro problem, e.g., a catch-all entry in a virtusertable. 66990792Sgshapiro 67038032Spetermail11 The DECnet mail11 mailer, useful only if you have the mail11 67138032Speter program from gatekeeper.dec.com:/pub/DEC/gwtools (and 67238032Speter DECnet, of course). This is for Phase IV DECnet support; 67338032Speter if you have Phase V at your site you may have additional 67438032Speter problems. 67538032Speter 67638032Speterphquery The phquery program. This is somewhat counterintuitively 67738032Speter referenced as the "ph" mailer internally. It can be used 67838032Speter to do CCSO name server lookups. The phquery program, which 67938032Speter this mailer uses, is distributed with the ph client. 68038032Speter 68138032Spetercyrus The cyrus and cyrusbb mailers. The cyrus mailer delivers to 68238032Speter a local cyrus user. this mailer can make use of the 68390792Sgshapiro "user+detail@local.host" syntax (see 68490792Sgshapiro FEATURE(`preserve_local_plus_detail')); it will deliver the 68590792Sgshapiro mail to the user's "detail" mailbox if the mailbox's ACL 68690792Sgshapiro permits. The cyrusbb mailer delivers to a system-wide 68790792Sgshapiro cyrus mailbox if the mailbox's ACL permits. The cyrus 68890792Sgshapiro mailer must be defined after the local mailer. 68938032Speter 69098121Sgshapirocyrusv2 The mailer for Cyrus v2.x. The cyrusv2 mailer delivers to 69198121Sgshapiro local cyrus users via LMTP. This mailer can make use of the 69298121Sgshapiro "user+detail@local.host" syntax (see 69398121Sgshapiro FEATURE(`preserve_local_plus_detail')); it will deliver the 69498121Sgshapiro mail to the user's "detail" mailbox if the mailbox's ACL 69598121Sgshapiro permits. The cyrusv2 mailer must be defined after the 69698121Sgshapiro local mailer. 69798121Sgshapiro 69864562Sgshapiroqpage A mailer for QuickPage, a pager interface. See 69964562Sgshapiro http://www.qpage.org/ for further information. 70038032Speter 70138032SpeterThe local mailer accepts addresses of the form "user+detail", where 70238032Speterthe "+detail" is not used for mailbox matching but is available 70343730Speterto certain local mail programs (in particular, see 70443730SpeterFEATURE(`local_procmail')). For example, "eric", "eric+sendmail", and 70543730Speter"eric+sww" all indicate the same user, but additional arguments <null>, 70643730Speter"sendmail", and "sww" may be provided for use in sorting mail. 70738032Speter 70838032Speter 70938032Speter+----------+ 71038032Speter| FEATURES | 71138032Speter+----------+ 71238032Speter 71338032SpeterSpecial features can be requested using the "FEATURE" macro. For 71438032Speterexample, the .mc line: 71538032Speter 71643730Speter FEATURE(`use_cw_file') 71738032Speter 71864562Sgshapirotells sendmail that you want to have it read an /etc/mail/local-host-names 71990792Sgshapirofile to get values for class {w}. A FEATURE may contain up to 9 72064562Sgshapirooptional parameters -- for example: 72138032Speter 72243730Speter FEATURE(`mailertable', `dbm /usr/lib/mailertable') 72338032Speter 72438032SpeterThe default database map type for the table features can be set with 72564562Sgshapiro 72638032Speter define(`DATABASE_MAP_TYPE', `dbm') 72738032Speter 72838032Speterwhich would set it to use ndbm databases. The default is the Berkeley DB 72938032Speterhash database format. Note that you must still declare a database map type 73038032Speterif you specify an argument to a FEATURE. DATABASE_MAP_TYPE is only used 73164562Sgshapiroif no argument is given for the FEATURE. It must be specified before any 73264562Sgshapirofeature that uses a map. 73338032Speter 73490792SgshapiroAlso, features which can take a map definition as an argument can also take 73590792Sgshapirothe special keyword `LDAP'. If that keyword is used, the map will use the 73690792SgshapiroLDAP definition described in the ``USING LDAP FOR ALIASES, MAPS, AND 73790792SgshapiroCLASSES'' section below. 73890792Sgshapiro 73938032SpeterAvailable features are: 74038032Speter 74164562Sgshapirouse_cw_file Read the file /etc/mail/local-host-names file to get 74264562Sgshapiro alternate names for this host. This might be used if you 74364562Sgshapiro were on a host that MXed for a dynamic set of other hosts. 74464562Sgshapiro If the set is static, just including the line "Cw<name1> 74564562Sgshapiro <name2> ..." (where the names are fully qualified domain 74664562Sgshapiro names) is probably superior. The actual filename can be 74764562Sgshapiro overridden by redefining confCW_FILE. 74838032Speter 74964562Sgshapirouse_ct_file Read the file /etc/mail/trusted-users file to get the 75064562Sgshapiro names of users that will be ``trusted'', that is, able to 75164562Sgshapiro set their envelope from address using -f without generating 75264562Sgshapiro a warning message. The actual filename can be overridden 75364562Sgshapiro by redefining confCT_FILE. 75438032Speter 75538032Speterredirect Reject all mail addressed to "address.REDIRECT" with 75664562Sgshapiro a ``551 User has moved; please try <address>'' message. 75738032Speter If this is set, you can alias people who have left 75838032Speter to their new address with ".REDIRECT" appended. 75938032Speter 76064562Sgshapironouucp Don't route UUCP addresses. This feature takes one 76164562Sgshapiro parameter: 76264562Sgshapiro `reject': reject addresses which have "!" in the local 76364562Sgshapiro part unless it originates from a system 76464562Sgshapiro that is allowed to relay. 76564562Sgshapiro `nospecial': don't do anything special with "!". 76690792Sgshapiro Warnings: 1. See the notice in the anti-spam section. 76764562Sgshapiro 2. don't remove "!" from OperatorChars if `reject' is 76864562Sgshapiro given as parameter. 76938032Speter 770285229Sgshapironopercenthack Don't treat % as routing character. This feature takes one 771285229Sgshapiro parameter: 772285229Sgshapiro `reject': reject addresses which have % in the local 773285229Sgshapiro part unless it originates from a system 774285229Sgshapiro that is allowed to relay. 775285229Sgshapiro `nospecial': don't do anything special with %. 776285229Sgshapiro Warnings: 1. See the notice in the anti-spam section. 777285229Sgshapiro 2. Don't remove % from OperatorChars if `reject' is 778285229Sgshapiro given as parameter. 779285229Sgshapiro 78064562Sgshapironocanonify Don't pass addresses to $[ ... $] for canonification 78171345Sgshapiro by default, i.e., host/domain names are considered canonical, 78271345Sgshapiro except for unqualified names, which must not be used in this 78371345Sgshapiro mode (violation of the standard). It can be changed by 78471345Sgshapiro setting the DaemonPortOptions modifiers (M=). That is, 78564562Sgshapiro FEATURE(`nocanonify') will be overridden by setting the 78664562Sgshapiro 'c' flag. Conversely, if FEATURE(`nocanonify') is not used, 78764562Sgshapiro it can be emulated by setting the 'C' flag 78864562Sgshapiro (DaemonPortOptions=Modifiers=C). This would generally only 78964562Sgshapiro be used by sites that only act as mail gateways or which have 79064562Sgshapiro user agents that do full canonification themselves. You may 79164562Sgshapiro also want to use 79264562Sgshapiro "define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')" to turn off 79364562Sgshapiro the usual resolver options that do a similar thing. 79438032Speter 79564562Sgshapiro An exception list for FEATURE(`nocanonify') can be 79664562Sgshapiro specified with CANONIFY_DOMAIN or CANONIFY_DOMAIN_FILE, 79764562Sgshapiro i.e., a list of domains which are nevertheless passed to 79864562Sgshapiro $[ ... $] for canonification. This is useful to turn on 79964562Sgshapiro canonification for local domains, e.g., use 80064562Sgshapiro CANONIFY_DOMAIN(`my.domain my') to canonify addresses 80164562Sgshapiro which end in "my.domain" or "my". 80264562Sgshapiro Another way to require canonification in the local 80364562Sgshapiro domain is CANONIFY_DOMAIN(`$=m'). 80464562Sgshapiro 80564562Sgshapiro A trailing dot is added to addresses with more than 80664562Sgshapiro one component in it such that other features which 80764562Sgshapiro expect a trailing dot (e.g., virtusertable) will 80864562Sgshapiro still work. 80964562Sgshapiro 81064562Sgshapiro If `canonify_hosts' is specified as parameter, i.e., 81164562Sgshapiro FEATURE(`nocanonify', `canonify_hosts'), then 81264562Sgshapiro addresses which have only a hostname, e.g., 81364562Sgshapiro <user@host>, will be canonified (and hopefully fully 81464562Sgshapiro qualified), too. 81564562Sgshapiro 81671345Sgshapirostickyhost This feature is sometimes used with LOCAL_RELAY, 81771345Sgshapiro although it can be used for a different effect with 81871345Sgshapiro MAIL_HUB. 81938032Speter 82073188Sgshapiro When used without MAIL_HUB, email sent to 82171345Sgshapiro "user@local.host" are marked as "sticky" -- that 82271345Sgshapiro is, the local addresses aren't matched against UDB, 82371345Sgshapiro don't go through ruleset 5, and are not forwarded to 82471345Sgshapiro the LOCAL_RELAY (if defined). 82571345Sgshapiro 82671345Sgshapiro With MAIL_HUB, mail addressed to "user@local.host" 82771345Sgshapiro is forwarded to the mail hub, with the envelope 82871345Sgshapiro address still remaining "user@local.host". 82971345Sgshapiro Without stickyhost, the envelope would be changed 83071345Sgshapiro to "user@mail_hub", in order to protect against 83171345Sgshapiro mailing loops. 83271345Sgshapiro 83338032Spetermailertable Include a "mailer table" which can be used to override 83464562Sgshapiro routing for particular domains (which are not in class {w}, 83564562Sgshapiro i.e. local host names). The argument of the FEATURE may be 83664562Sgshapiro the key definition. If none is specified, the definition 83764562Sgshapiro used is: 83843730Speter 83964562Sgshapiro hash /etc/mail/mailertable 84043730Speter 84138032Speter Keys in this database are fully qualified domain names 84238032Speter or partial domains preceded by a dot -- for example, 84364562Sgshapiro "vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU". As a 84464562Sgshapiro special case of the latter, "." matches any domain not 84564562Sgshapiro covered by other keys. Values must be of the form: 84638032Speter mailer:domain 84738032Speter where "mailer" is the internal mailer name, and "domain" 84838032Speter is where to send the message. These maps are not 84938032Speter reflected into the message header. As a special case, 85038032Speter the forms: 85138032Speter local:user 85238032Speter will forward to the indicated user using the local mailer, 85338032Speter local: 85438032Speter will forward to the original user in the e-mail address 85538032Speter using the local mailer, and 85638032Speter error:code message 85764562Sgshapiro error:D.S.N:code message 85864562Sgshapiro will give an error message with the indicated SMTP reply 85964562Sgshapiro code and message, where D.S.N is an RFC 1893 compliant 86064562Sgshapiro error code. 86138032Speter 86238032Speterdomaintable Include a "domain table" which can be used to provide 86338032Speter domain name mapping. Use of this should really be 86438032Speter limited to your own domains. It may be useful if you 86538032Speter change names (e.g., your company changes names from 86638032Speter oldname.com to newname.com). The argument of the 86738032Speter FEATURE may be the key definition. If none is specified, 86838032Speter the definition used is: 86943730Speter 87064562Sgshapiro hash /etc/mail/domaintable 87143730Speter 87238032Speter The key in this table is the domain name; the value is 87338032Speter the new (fully qualified) domain. Anything in the 87438032Speter domaintable is reflected into headers; that is, this 87538032Speter is done in ruleset 3. 87638032Speter 87738032Speterbitdomain Look up bitnet hosts in a table to try to turn them into 87838032Speter internet addresses. The table can be built using the 87938032Speter bitdomain program contributed by John Gardiner Myers. 88038032Speter The argument of the FEATURE may be the key definition; if 88138032Speter none is specified, the definition used is: 88243730Speter 88364562Sgshapiro hash /etc/mail/bitdomain 88443730Speter 88538032Speter Keys are the bitnet hostname; values are the corresponding 88638032Speter internet hostname. 88738032Speter 88838032Speteruucpdomain Similar feature for UUCP hosts. The default map definition 88938032Speter is: 89043730Speter 89164562Sgshapiro hash /etc/mail/uudomain 89243730Speter 89338032Speter At the moment there is no automagic tool to build this 89438032Speter database. 89538032Speter 89638032Speteralways_add_domain 89738032Speter Include the local host domain even on locally delivered 89838032Speter mail. Normally it is not added on unqualified names. 89938032Speter However, if you use a shared message store but do not use 90038032Speter the same user name space everywhere, you may need the host 90190792Sgshapiro name on local names. An optional argument specifies 90290792Sgshapiro another domain to be added than the local. 90338032Speter 90438032Speterallmasquerade If masquerading is enabled (using MASQUERADE_AS), this 90538032Speter feature will cause recipient addresses to also masquerade 90638032Speter as being from the masquerade host. Normally they get 90738032Speter the local hostname. Although this may be right for 90838032Speter ordinary users, it can break local aliases. For example, 90938032Speter if you send to "localalias", the originating sendmail will 91038032Speter find that alias and send to all members, but send the 91138032Speter message with "To: localalias@masqueradehost". Since that 91238032Speter alias likely does not exist, replies will fail. Use this 91338032Speter feature ONLY if you can guarantee that the ENTIRE 91438032Speter namespace on your masquerade host supersets all the 91538032Speter local entries. 91638032Speter 91738032Speterlimited_masquerade 91864562Sgshapiro Normally, any hosts listed in class {w} are masqueraded. If 91964562Sgshapiro this feature is given, only the hosts listed in class {M} (see 92064562Sgshapiro below: MASQUERADE_DOMAIN) are masqueraded. This is useful 92164562Sgshapiro if you have several domains with disjoint namespaces hosted 92264562Sgshapiro on the same machine. 92338032Speter 92438032Spetermasquerade_entire_domain 92564562Sgshapiro If masquerading is enabled (using MASQUERADE_AS) and 92638032Speter MASQUERADE_DOMAIN (see below) is set, this feature will 92738032Speter cause addresses to be rewritten such that the masquerading 92838032Speter domains are actually entire domains to be hidden. All 92938032Speter hosts within the masquerading domains will be rewritten 93038032Speter to the masquerade name (used in MASQUERADE_AS). For example, 93138032Speter if you have: 93238032Speter 93364562Sgshapiro MASQUERADE_AS(`masq.com') 93464562Sgshapiro MASQUERADE_DOMAIN(`foo.org') 93564562Sgshapiro MASQUERADE_DOMAIN(`bar.com') 93638032Speter 93738032Speter then *foo.org and *bar.com are converted to masq.com. Without 93838032Speter this feature, only foo.org and bar.com are masqueraded. 93938032Speter 94038032Speter NOTE: only domains within your jurisdiction and 94138032Speter current hierarchy should be masqueraded using this. 94238032Speter 94390792Sgshapirolocal_no_masquerade 94490792Sgshapiro This feature prevents the local mailer from masquerading even 94590792Sgshapiro if MASQUERADE_AS is used. MASQUERADE_AS will only have effect 94690792Sgshapiro on addresses of mail going outside the local domain. 94790792Sgshapiro 948110560Sgshapiromasquerade_envelope 949110560Sgshapiro If masquerading is enabled (using MASQUERADE_AS) or the 950110560Sgshapiro genericstable is in use, this feature will cause envelope 951110560Sgshapiro addresses to also masquerade as being from the masquerade 952110560Sgshapiro host. Normally only the header addresses are masqueraded. 953110560Sgshapiro 95464562Sgshapirogenericstable This feature will cause unqualified addresses (i.e., without 95564562Sgshapiro a domain) and addresses with a domain listed in class {G} 95664562Sgshapiro to be looked up in a map and turned into another ("generic") 95764562Sgshapiro form, which can change both the domain name and the user name. 95890792Sgshapiro Notice: if you use an MSP (as it is default starting with 95990792Sgshapiro 8.12), the MTA will only receive qualified addresses from the 96090792Sgshapiro MSP (as required by the RFCs). Hence you need to add your 96190792Sgshapiro domain to class {G}. This feature is similar to the userdb 96290792Sgshapiro functionality. The same types of addresses as for 96390792Sgshapiro masquerading are looked up, i.e., only header sender 96490792Sgshapiro addresses unless the allmasquerade and/or masquerade_envelope 96590792Sgshapiro features are given. Qualified addresses must have the domain 96690792Sgshapiro part in class {G}; entries can be added to this class by the 96790792Sgshapiro macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE (analogously 96890792Sgshapiro to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below). 96938032Speter 97043730Speter The argument of FEATURE(`genericstable') may be the map 97138032Speter definition; the default map definition is: 97238032Speter 97364562Sgshapiro hash /etc/mail/genericstable 97438032Speter 97564562Sgshapiro The key for this table is either the full address, the domain 97664562Sgshapiro (with a leading @; the localpart is passed as first argument) 97764562Sgshapiro or the unqualified username (tried in the order mentioned); 97864562Sgshapiro the value is the new user address. If the new user address 97964562Sgshapiro does not include a domain, it will be qualified in the standard 98064562Sgshapiro manner, i.e., using $j or the masquerade name. Note that the 98138032Speter address being looked up must be fully qualified. For local 98243730Speter mail, it is necessary to use FEATURE(`always_add_domain') 98343730Speter for the addresses to be qualified. 98464562Sgshapiro The "+detail" of an address is passed as %1, so entries like 98538032Speter 98664562Sgshapiro old+*@foo.org new+%1@example.com 98764562Sgshapiro gen+*@foo.org %1@example.com 98864562Sgshapiro 98964562Sgshapiro and other forms are possible. 99064562Sgshapiro 99164562Sgshapirogenerics_entire_domain 99264562Sgshapiro If the genericstable is enabled and GENERICS_DOMAIN or 99364562Sgshapiro GENERICS_DOMAIN_FILE is used, this feature will cause 99464562Sgshapiro addresses to be searched in the map if their domain 99564562Sgshapiro parts are subdomains of elements in class {G}. 99664562Sgshapiro 99738032Spetervirtusertable A domain-specific form of aliasing, allowing multiple 99838032Speter virtual domains to be hosted on one machine. For example, 999157001Sgshapiro if the virtuser table contains: 100038032Speter 100138032Speter info@foo.com foo-info 100238032Speter info@bar.com bar-info 100390792Sgshapiro joe@bar.com error:nouser 550 No such user here 100490792Sgshapiro jax@bar.com error:5.7.0:550 Address invalid 100564562Sgshapiro @baz.org jane@example.net 100638032Speter 100738032Speter then mail addressed to info@foo.com will be sent to the 100838032Speter address foo-info, mail addressed to info@bar.com will be 100964562Sgshapiro delivered to bar-info, and mail addressed to anyone at baz.org 101064562Sgshapiro will be sent to jane@example.net, mail to joe@bar.com will 101164562Sgshapiro be rejected with the specified error message, and mail to 101264562Sgshapiro jax@bar.com will also have a RFC 1893 compliant error code 101390792Sgshapiro 5.7.0. 101438032Speter 101564562Sgshapiro The username from the original address is passed 101664562Sgshapiro as %1 allowing: 101738032Speter 101864562Sgshapiro @foo.org %1@example.com 101938032Speter 102064562Sgshapiro meaning someone@foo.org will be sent to someone@example.com. 102164562Sgshapiro Additionally, if the local part consists of "user+detail" 102290792Sgshapiro then "detail" is passed as %2 and "+detail" is passed as %3 102390792Sgshapiro when a match against user+* is attempted, so entries like 102464562Sgshapiro 102564562Sgshapiro old+*@foo.org new+%2@example.com 102664562Sgshapiro gen+*@foo.org %2@example.com 102790792Sgshapiro +*@foo.org %1%3@example.com 102890792Sgshapiro X++@foo.org Z%3@example.com 102990792Sgshapiro @bar.org %1%3 103064562Sgshapiro 103164562Sgshapiro and other forms are possible. Note: to preserve "+detail" 103290792Sgshapiro for a default case (@domain) %1%3 must be used as RHS. 103390792Sgshapiro There are two wildcards after "+": "+" matches only a non-empty 103490792Sgshapiro detail, "*" matches also empty details, e.g., user+@foo.org 103590792Sgshapiro matches +*@foo.org but not ++@foo.org. This can be used 103690792Sgshapiro to ensure that the parameters %2 and %3 are not empty. 103764562Sgshapiro 103838032Speter All the host names on the left hand side (foo.com, bar.com, 103990792Sgshapiro and baz.org) must be in class {w} or class {VirtHost}. The 104064562Sgshapiro latter can be defined by the macros VIRTUSER_DOMAIN or 104164562Sgshapiro VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 104264562Sgshapiro MASQUERADE_DOMAIN_FILE, see below). If VIRTUSER_DOMAIN or 104364562Sgshapiro VIRTUSER_DOMAIN_FILE is used, then the entries of class 104464562Sgshapiro {VirtHost} are added to class {R}, i.e., relaying is allowed 1045182352Sgshapiro to (and from) those domains, which by default includes also 1046182352Sgshapiro all subdomains (see relay_hosts_only). The default map 1047182352Sgshapiro definition is: 104838032Speter 104964562Sgshapiro hash /etc/mail/virtusertable 105038032Speter 105138032Speter A new definition can be specified as the second argument of 105238032Speter the FEATURE macro, such as 105338032Speter 105464562Sgshapiro FEATURE(`virtusertable', `dbm /etc/mail/virtusers') 105538032Speter 105664562Sgshapirovirtuser_entire_domain 105764562Sgshapiro If the virtusertable is enabled and VIRTUSER_DOMAIN or 105864562Sgshapiro VIRTUSER_DOMAIN_FILE is used, this feature will cause 105964562Sgshapiro addresses to be searched in the map if their domain 106064562Sgshapiro parts are subdomains of elements in class {VirtHost}. 106164562Sgshapiro 106264562Sgshapiroldap_routing Implement LDAP-based e-mail recipient routing according to 106364562Sgshapiro the Internet Draft draft-lachman-laser-ldap-mail-routing-01. 106464562Sgshapiro This provides a method to re-route addresses with a 106564562Sgshapiro domain portion in class {LDAPRoute} to either a 106664562Sgshapiro different mail host or a different address. Hosts can 106764562Sgshapiro be added to this class using LDAPROUTE_DOMAIN and 106864562Sgshapiro LDAPROUTE_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 106964562Sgshapiro MASQUERADE_DOMAIN_FILE, see below). 107064562Sgshapiro 107164562Sgshapiro See the LDAP ROUTING section below for more information. 107264562Sgshapiro 107364562Sgshapironullclient This is a special case -- it creates a configuration file 107464562Sgshapiro containing nothing but support for forwarding all mail to a 107564562Sgshapiro central hub via a local SMTP-based network. The argument 107664562Sgshapiro is the name of that hub. 107764562Sgshapiro 107838032Speter The only other feature that should be used in conjunction 107964562Sgshapiro with this one is FEATURE(`nocanonify'). No mailers 108038032Speter should be defined. No aliasing or forwarding is done. 108138032Speter 108238032Speterlocal_lmtp Use an LMTP capable local mailer. The argument to this 108338032Speter feature is the pathname of an LMTP capable mailer. By 108438032Speter default, mail.local is used. This is expected to be the 108538032Speter mail.local which came with the 8.9 distribution which is 108638032Speter LMTP capable. The path to mail.local is set by the 108738032Speter confEBINDIR m4 variable -- making the default 108838032Speter LOCAL_MAILER_PATH /usr/libexec/mail.local. 1089132943Sgshapiro If a different LMTP capable mailer is used, its pathname 1090132943Sgshapiro can be specified as second parameter and the arguments 1091132943Sgshapiro passed to it (A=) as third parameter, e.g., 1092132943Sgshapiro 1093132943Sgshapiro FEATURE(`local_lmtp', `/usr/local/bin/lmtp', `lmtp') 1094132943Sgshapiro 109564562Sgshapiro WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally, 109664562Sgshapiro i.e., without respecting any definitions in an OSTYPE setting. 109738032Speter 109864562Sgshapirolocal_procmail Use procmail or another delivery agent as the local mailer. 109964562Sgshapiro The argument to this feature is the pathname of the 110064562Sgshapiro delivery agent, which defaults to PROCMAIL_MAILER_PATH. 110164562Sgshapiro Note that this does NOT use PROCMAIL_MAILER_FLAGS or 110264562Sgshapiro PROCMAIL_MAILER_ARGS for the local mailer; tweak 110364562Sgshapiro LOCAL_MAILER_FLAGS and LOCAL_MAILER_ARGS instead, or 110464562Sgshapiro specify the appropriate parameters. When procmail is used, 110564562Sgshapiro the local mailer can make use of the 110664562Sgshapiro "user+indicator@local.host" syntax; normally the +indicator 110764562Sgshapiro is just tossed, but by default it is passed as the -a 110864562Sgshapiro argument to procmail. 110938032Speter 111064562Sgshapiro This feature can take up to three arguments: 111164562Sgshapiro 111264562Sgshapiro 1. Path to the mailer program 111364562Sgshapiro [default: /usr/local/bin/procmail] 111464562Sgshapiro 2. Argument vector including name of the program 111564562Sgshapiro [default: procmail -Y -a $h -d $u] 111664562Sgshapiro 3. Flags for the mailer [default: SPfhn9] 111764562Sgshapiro 111864562Sgshapiro Empty arguments cause the defaults to be taken. 1119110560Sgshapiro Note that if you are on a system with a broken 1120110560Sgshapiro setreuid() call, you may need to add -f $f to the procmail 1121110560Sgshapiro argument vector to pass the proper sender to procmail. 112264562Sgshapiro 112364562Sgshapiro For example, this allows it to use the maildrop 112464562Sgshapiro (http://www.flounder.net/~mrsam/maildrop/) mailer instead 112564562Sgshapiro by specifying: 112664562Sgshapiro 112764562Sgshapiro FEATURE(`local_procmail', `/usr/local/bin/maildrop', 112864562Sgshapiro `maildrop -d $u') 112964562Sgshapiro 113064562Sgshapiro or scanmails using: 113164562Sgshapiro 113264562Sgshapiro FEATURE(`local_procmail', `/usr/local/bin/scanmails') 113364562Sgshapiro 113464562Sgshapiro WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally, 113564562Sgshapiro i.e., without respecting any definitions in an OSTYPE setting. 113664562Sgshapiro 113738032Speterbestmx_is_local Accept mail as though locally addressed for any host that 113838032Speter lists us as the best possible MX record. This generates 113938032Speter additional DNS traffic, but should be OK for low to 114038032Speter medium traffic hosts. The argument may be a set of 114138032Speter domains, which will limit the feature to only apply to 114238032Speter these domains -- this will reduce unnecessary DNS 114338032Speter traffic. THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH 114438032Speter WILDCARD MX RECORDS!!! If you have a wildcard MX record 114538032Speter that matches your domain, you cannot use this feature. 114638032Speter 114738032Spetersmrsh Use the SendMail Restricted SHell (smrsh) provided 114838032Speter with the distribution instead of /bin/sh for mailing 114938032Speter to programs. This improves the ability of the local 115038032Speter system administrator to control what gets run via 115138032Speter e-mail. If an argument is provided it is used as the 115238032Speter pathname to smrsh; otherwise, the path defined by 115338032Speter confEBINDIR is used for the smrsh binary -- by default, 115438032Speter /usr/libexec/smrsh is assumed. 115538032Speter 115638032Speterpromiscuous_relay 115738032Speter By default, the sendmail configuration files do not permit 115838032Speter mail relaying (that is, accepting mail from outside your 115964562Sgshapiro local host (class {w}) and sending it to another host than 116064562Sgshapiro your local host). This option sets your site to allow 116164562Sgshapiro mail relaying from any site to any site. In almost all 116264562Sgshapiro cases, it is better to control relaying more carefully 116364562Sgshapiro with the access map, class {R}, or authentication. Domains 116464562Sgshapiro can be added to class {R} by the macros RELAY_DOMAIN or 116564562Sgshapiro RELAY_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 116664562Sgshapiro MASQUERADE_DOMAIN_FILE, see below). 116738032Speter 116838032Speterrelay_entire_domain 116998121Sgshapiro This option allows any host in your domain as defined by 117098121Sgshapiro class {m} to use your server for relaying. Notice: make 117198121Sgshapiro sure that your domain is not just a top level domain, 117298121Sgshapiro e.g., com. This can happen if you give your host a name 117398121Sgshapiro like example.com instead of host.example.com. 117438032Speter 117538032Speterrelay_hosts_only 117638032Speter By default, names that are listed as RELAY in the access 117798121Sgshapiro db and class {R} are treated as domain names, not host names. 117838032Speter For example, if you specify ``foo.com'', then mail to or 117938032Speter from foo.com, abc.foo.com, or a.very.deep.domain.foo.com 118038032Speter will all be accepted for relaying. This feature changes 1181244833Sgshapiro the behaviour to look up individual host names only. 118238032Speter 118338032Speterrelay_based_on_MX 118438032Speter Turns on the ability to allow relaying based on the MX 118542575Speter records of the host portion of an incoming recipient; that 118642575Speter is, if an MX record for host foo.com points to your site, 118742575Speter you will accept and relay mail addressed to foo.com. See 118838032Speter description below for more information before using this 118942575Speter feature. Also, see the KNOWNBUGS entry regarding bestmx 119042575Speter map lookups. 119138032Speter 119243730Speter FEATURE(`relay_based_on_MX') does not necessarily allow 119342575Speter routing of these messages which you expect to be allowed, 119442575Speter if route address syntax (or %-hack syntax) is used. If 119542575Speter this is a problem, add entries to the access-table or use 119643730Speter FEATURE(`loose_relay_check'). 119742575Speter 119864562Sgshapirorelay_mail_from 119964562Sgshapiro Allows relaying if the mail sender is listed as RELAY in 1200110560Sgshapiro the access map. If an optional argument `domain' (this 1201110560Sgshapiro is the literal word `domain', not a placeholder) is given, 120290792Sgshapiro relaying can be allowed just based on the domain portion 120390792Sgshapiro of the sender address. This feature should only be used if 120490792Sgshapiro absolutely necessary as the sender address can be easily 120598121Sgshapiro forged. Use of this feature requires the "From:" tag to 120698121Sgshapiro be used for the key in the access map; see the discussion 120790792Sgshapiro of tags and FEATURE(`relay_mail_from') in the section on 120890792Sgshapiro anti-spam configuration control. 120964562Sgshapiro 121038032Speterrelay_local_from 121138032Speter Allows relaying if the domain portion of the mail sender 121238032Speter is a local host. This should only be used if absolutely 121342575Speter necessary as it opens a window for spammers. Specifically, 121442575Speter they can send mail to your mail server that claims to be 121542575Speter from your domain (either directly or via a routed address), 121642575Speter and you will go ahead and relay it out to arbitrary hosts 121742575Speter on the Internet. 121864562Sgshapiro 121938032Speteraccept_unqualified_senders 122038032Speter Normally, MAIL FROM: commands in the SMTP session will be 122138032Speter refused if the connection is a network connection and the 122238032Speter sender address does not include a domain name. If your 1223157001Sgshapiro setup sends local mail unqualified (i.e., MAIL FROM:<joe>), 122438032Speter you will need to use this feature to accept unqualified 122564562Sgshapiro sender addresses. Setting the DaemonPortOptions modifier 122664562Sgshapiro 'u' overrides the default behavior, i.e., unqualified 122764562Sgshapiro addresses are accepted even without this FEATURE. 122864562Sgshapiro If this FEATURE is not used, the DaemonPortOptions modifier 122964562Sgshapiro 'f' can be used to enforce fully qualified addresses. 123064562Sgshapiro 123138032Speteraccept_unresolvable_domains 123238032Speter Normally, MAIL FROM: commands in the SMTP session will be 123364562Sgshapiro refused if the host part of the argument to MAIL FROM: 123464562Sgshapiro cannot be located in the host name service (e.g., an A or 123564562Sgshapiro MX record in DNS). If you are inside a firewall that has 123664562Sgshapiro only a limited view of the Internet host name space, this 123764562Sgshapiro could cause problems. In this case you probably want to 123864562Sgshapiro use this feature to accept all domains on input, even if 123964562Sgshapiro they are unresolvable. 124038032Speter 124138032Speteraccess_db Turns on the access database feature. The access db gives 124238032Speter you the ability to allow or refuse to accept mail from 124390792Sgshapiro specified domains for administrative reasons. Moreover, 124490792Sgshapiro it can control the behavior of sendmail in various situations. 124590792Sgshapiro By default, the access database specification is: 124638032Speter 124790792Sgshapiro hash -T<TMPF> /etc/mail/access 124843730Speter 124990792Sgshapiro See the anti-spam configuration control section for further 125090792Sgshapiro important information about this feature. Notice: 125190792Sgshapiro "-T<TMPF>" is meant literal, do not replace it by anything. 125243730Speter 125338032Speterblacklist_recipients 125438032Speter Turns on the ability to block incoming mail for certain 125538032Speter recipient usernames, hostnames, or addresses. For 125638032Speter example, you can block incoming mail to user nobody, 125738032Speter host foo.mydomain.com, or guest@bar.mydomain.com. 125838032Speter These specifications are put in the access db as 125964562Sgshapiro described in the anti-spam configuration control section 126064562Sgshapiro later in this document. 126138032Speter 126271345Sgshapirodelay_checks The rulesets check_mail and check_relay will not be called 126371345Sgshapiro when a client connects or issues a MAIL command, respectively. 126471345Sgshapiro Instead, those rulesets will be called by the check_rcpt 126571345Sgshapiro ruleset; they will be skipped under certain circumstances. 126690792Sgshapiro See "Delay all checks" in the anti-spam configuration control 126790792Sgshapiro section. Note: this feature is incompatible to the versions 126890792Sgshapiro in 8.10 and 8.11. 126971345Sgshapiro 1270132943Sgshapirouse_client_ptr If this feature is enabled then check_relay will override 1271132943Sgshapiro its first argument with $&{client_ptr}. This is useful for 1272132943Sgshapiro rejections based on the unverified hostname of client, 1273132943Sgshapiro which turns on the same behavior as in earlier sendmail 1274132943Sgshapiro versions when delay_checks was not in use. See doc/op/op.* 1275132943Sgshapiro about check_relay, {client_name}, and {client_ptr}. 1276132943Sgshapiro 1277168515Sgshapirodnsbl Turns on rejection, discarding, or quarantining of hosts 1278168515Sgshapiro found in a DNS based list. The first argument is used as 1279168515Sgshapiro the domain in which blocked hosts are listed. A second 1280168515Sgshapiro argument can be used to change the default error message, 1281168515Sgshapiro or select one of the operations `discard' and `quarantine'. 1282168515Sgshapiro Without that second argument, the error message will be 1283168515Sgshapiro 128498841Sgshapiro Rejected: IP-ADDRESS listed at SERVER 1285168515Sgshapiro 128690792Sgshapiro where IP-ADDRESS and SERVER are replaced by the appropriate 128790792Sgshapiro information. By default, temporary lookup failures are 128890792Sgshapiro ignored. This behavior can be changed by specifying a 128990792Sgshapiro third argument, which must be either `t' or a full error 129090792Sgshapiro message. See the anti-spam configuration control section for 129190792Sgshapiro an example. The dnsbl feature can be included several times 129290792Sgshapiro to query different DNS based rejection lists. See also 129390792Sgshapiro enhdnsbl for an enhanced version. 129464562Sgshapiro 1295110560Sgshapiro Set the DNSBL_MAP mc option to change the default map 1296110560Sgshapiro definition from `host'. Set the DNSBL_MAP_OPT mc option 1297110560Sgshapiro to add additional options to the map specification used. 1298110560Sgshapiro 129998121Sgshapiro Some DNS based rejection lists cause failures if asked 130098121Sgshapiro for AAAA records. If your sendmail version is compiled 130198121Sgshapiro with IPv6 support (NETINET6) and you experience this 130298121Sgshapiro problem, add 130398121Sgshapiro 130498121Sgshapiro define(`DNSBL_MAP', `dns -R A') 130598121Sgshapiro 130698121Sgshapiro before the first use of this feature. Alternatively you 1307111823Sgshapiro can use enhdnsbl instead (see below). Moreover, this 1308111823Sgshapiro statement can be used to reduce the number of DNS retries, 1309111823Sgshapiro e.g., 131098121Sgshapiro 1311111823Sgshapiro define(`DNSBL_MAP', `dns -R A -r2') 1312111823Sgshapiro 1313111823Sgshapiro See below (EDNSBL_TO) for an explanation. 1314111823Sgshapiro 131590792Sgshapiroenhdnsbl Enhanced version of dnsbl (see above). Further arguments 131690792Sgshapiro (up to 5) can be used to specify specific return values 131790792Sgshapiro from lookups. Temporary lookup failures are ignored unless 131890792Sgshapiro a third argument is given, which must be either `t' or a full 131990792Sgshapiro error message. By default, any successful lookup will 132090792Sgshapiro generate an error. Otherwise the result of the lookup is 132190792Sgshapiro compared with the supplied argument(s), and only if a match 132290792Sgshapiro occurs an error is generated. For example, 132390792Sgshapiro 132490792Sgshapiro FEATURE(`enhdnsbl', `dnsbl.example.com', `', `t', `127.0.0.2.') 132590792Sgshapiro 132690792Sgshapiro will reject the e-mail if the lookup returns the value 132790792Sgshapiro ``127.0.0.2.'', or generate a 451 response if the lookup 132890792Sgshapiro temporarily failed. The arguments can contain metasymbols 132990792Sgshapiro as they are allowed in the LHS of rules. As the example 133090792Sgshapiro shows, the default values are also used if an empty argument, 133190792Sgshapiro i.e., `', is specified. This feature requires that sendmail 133290792Sgshapiro has been compiled with the flag DNSMAP (see sendmail/README). 133390792Sgshapiro 1334110560Sgshapiro Set the EDNSBL_TO mc option to change the DNS retry count 1335111823Sgshapiro from the default value of 5, this can be very useful when 1336111823Sgshapiro a DNS server is not responding, which in turn may cause 1337111823Sgshapiro clients to time out (an entry stating 1338110560Sgshapiro 1339111823Sgshapiro did not issue MAIL/EXPN/VRFY/ETRN 1340111823Sgshapiro 1341111823Sgshapiro will be logged). 1342111823Sgshapiro 1343132943Sgshapiroratecontrol Enable simple ruleset to do connection rate control 1344132943Sgshapiro checking. This requires entries in access_db of the form 1345132943Sgshapiro 1346132943Sgshapiro ClientRate:IP.ADD.RE.SS LIMIT 1347132943Sgshapiro 1348132943Sgshapiro The RHS specifies the maximum number of connections 1349132943Sgshapiro (an integer number) over the time interval defined 1350132943Sgshapiro by ConnectionRateWindowSize, where 0 means unlimited. 1351132943Sgshapiro 1352132943Sgshapiro Take the following example: 1353132943Sgshapiro 1354132943Sgshapiro ClientRate:10.1.2.3 4 1355132943Sgshapiro ClientRate:127.0.0.1 0 1356132943Sgshapiro ClientRate: 10 1357132943Sgshapiro 1358132943Sgshapiro 10.1.2.3 can only make up to 4 connections, the 1359132943Sgshapiro general limit it 10, and 127.0.0.1 can make an unlimited 1360132943Sgshapiro number of connections per ConnectionRateWindowSize. 1361132943Sgshapiro 1362132943Sgshapiro See also CONNECTION CONTROL. 1363132943Sgshapiro 1364132943Sgshapiroconncontrol Enable a simple check of the number of incoming SMTP 1365132943Sgshapiro connections. This requires entries in access_db of the 1366132943Sgshapiro form 1367132943Sgshapiro 1368132943Sgshapiro ClientConn:IP.ADD.RE.SS LIMIT 1369132943Sgshapiro 1370132943Sgshapiro The RHS specifies the maximum number of open connections 1371132943Sgshapiro (an integer number). 1372132943Sgshapiro 1373132943Sgshapiro Take the following example: 1374132943Sgshapiro 1375132943Sgshapiro ClientConn:10.1.2.3 4 1376132943Sgshapiro ClientConn:127.0.0.1 0 1377132943Sgshapiro ClientConn: 10 1378132943Sgshapiro 1379132943Sgshapiro 10.1.2.3 can only have up to 4 open connections, the 1380132943Sgshapiro general limit it 10, and 127.0.0.1 does not have any 1381132943Sgshapiro explicit limit. 1382132943Sgshapiro 1383132943Sgshapiro See also CONNECTION CONTROL. 1384132943Sgshapiro 1385132943Sgshapiromtamark Experimental support for "Marking Mail Transfer Agents in 1386132943Sgshapiro Reverse DNS with TXT RRs" (MTAMark), see 1387132943Sgshapiro draft-stumpf-dns-mtamark-01. Optional arguments are: 1388132943Sgshapiro 1389132943Sgshapiro 1. Error message, default: 1390132943Sgshapiro 1391132943Sgshapiro 550 Rejected: $&{client_addr} not listed as MTA 1392132943Sgshapiro 1393132943Sgshapiro 2. Temporary lookup failures are ignored unless a second 1394132943Sgshapiro argument is given, which must be either `t' or a full 1395132943Sgshapiro error message. 1396132943Sgshapiro 1397132943Sgshapiro 3. Lookup prefix, default: _perm._smtp._srv. This should 1398132943Sgshapiro not be changed unless the draft changes it. 1399132943Sgshapiro 1400132943Sgshapiro Example: 1401132943Sgshapiro 1402132943Sgshapiro FEATURE(`mtamark', `', `t') 1403132943Sgshapiro 140490792Sgshapirolookupdotdomain Look up also .domain in the access map. This allows to 140590792Sgshapiro match only subdomains. It does not work well with 140690792Sgshapiro FEATURE(`relay_hosts_only'), because most lookups for 140790792Sgshapiro subdomains are suppressed by the latter feature. 140890792Sgshapiro 140938032Speterloose_relay_check 141064562Sgshapiro Normally, if % addressing is used for a recipient, e.g. 141164562Sgshapiro user%site@othersite, and othersite is in class {R}, the 141238032Speter check_rcpt ruleset will strip @othersite and recheck 141338032Speter user@site for relaying. This feature changes that 141438032Speter behavior. It should not be needed for most installations. 141538032Speter 141690792Sgshapiroauthinfo Provide a separate map for client side authentication 141790792Sgshapiro information. See SMTP AUTHENTICATION for details. 141890792Sgshapiro By default, the authinfo database specification is: 141990792Sgshapiro 142090792Sgshapiro hash /etc/mail/authinfo 142190792Sgshapiro 142290792Sgshapiropreserve_luser_host 142390792Sgshapiro Preserve the name of the recipient host if LUSER_RELAY is 142490792Sgshapiro used. Without this option, the domain part of the 142590792Sgshapiro recipient address will be replaced by the host specified as 142690792Sgshapiro LUSER_RELAY. This feature only works if the hostname is 142790792Sgshapiro passed to the mailer (see mailer triple in op.me). Note 142890792Sgshapiro that in the default configuration the local mailer does not 142990792Sgshapiro receive the hostname, i.e., the mailer triple has an empty 143090792Sgshapiro hostname. 143190792Sgshapiro 143290792Sgshapiropreserve_local_plus_detail 143390792Sgshapiro Preserve the +detail portion of the address when passing 143490792Sgshapiro address to local delivery agent. Disables alias and 143590792Sgshapiro .forward +detail stripping (e.g., given user+detail, only 143690792Sgshapiro that address will be looked up in the alias file; user+* and 143790792Sgshapiro user will not be looked up). Only use if the local 143890792Sgshapiro delivery agent in use supports +detail addressing. 1439261194Sgshapiro Moreover, this will most likely not work if the 'w' flag 1440261194Sgshapiro for the local mailer is set as the entire local address 1441261194Sgshapiro including +detail is passed to the user lookup function. 144290792Sgshapiro 144390792Sgshapirocompat_check Enable ruleset check_compat to look up pairs of addresses 144490792Sgshapiro with the Compat: tag -- Compat:sender<@>recipient -- in the 144590792Sgshapiro access map. Valid values for the RHS include 144690792Sgshapiro DISCARD silently discard recipient 144790792Sgshapiro TEMP: return a temporary error 144890792Sgshapiro ERROR: return a permanent error 144990792Sgshapiro In the last two cases, a 4xy/5xy SMTP reply code should 145090792Sgshapiro follow the colon. 145190792Sgshapiro 145264562Sgshapirono_default_msa Don't generate the default MSA daemon, i.e., 145364562Sgshapiro DAEMON_OPTIONS(`Port=587,Name=MSA,M=E') 145464562Sgshapiro To define a MSA daemon with other parameters, use this 145564562Sgshapiro FEATURE and introduce new settings via DAEMON_OPTIONS(). 145638032Speter 145790792Sgshapiromsp Defines config file for Message Submission Program. 145894334Sgshapiro See sendmail/SECURITY for details and cf/cf/submit.mc how 145994334Sgshapiro to use it. An optional argument can be used to override 146094334Sgshapiro the default of `[localhost]' to use as host to send all 146194334Sgshapiro e-mails to. Note that MX records will be used if the 146294334Sgshapiro specified hostname is not in square brackets (e.g., 146394334Sgshapiro [hostname]). If `MSA' is specified as second argument then 146494334Sgshapiro port 587 is used to contact the server. Example: 146590792Sgshapiro 146690792Sgshapiro FEATURE(`msp', `', `MSA') 146790792Sgshapiro 146890792Sgshapiro Some more hints about possible changes can be found below 146990792Sgshapiro in the section MESSAGE SUBMISSION PROGRAM. 147090792Sgshapiro 1471110560Sgshapiro Note: Due to many problems, submit.mc uses 147298121Sgshapiro 147398121Sgshapiro FEATURE(`msp', `[127.0.0.1]') 147498121Sgshapiro 1475110560Sgshapiro by default. If you have a machine with IPv6 only, 1476110560Sgshapiro change it to 1477110560Sgshapiro 1478285229Sgshapiro FEATURE(`msp', `[IPv6:0:0:0:0:0:0:0:1]') 1479110560Sgshapiro 1480110560Sgshapiro If you want to continue using '[localhost]', (the behavior 1481110560Sgshapiro up to 8.12.6), use 1482110560Sgshapiro 1483110560Sgshapiro FEATURE(`msp') 1484110560Sgshapiro 148590792Sgshapiroqueuegroup A simple example how to select a queue group based 148690792Sgshapiro on the full e-mail address or the domain of the 148790792Sgshapiro recipient. Selection is done via entries in the 148890792Sgshapiro access map using the tag QGRP:, for example: 148990792Sgshapiro 149090792Sgshapiro QGRP:example.com main 149190792Sgshapiro QGRP:friend@some.org others 149290792Sgshapiro QGRP:my.domain local 149390792Sgshapiro 149490792Sgshapiro where "main", "others", and "local" are names of 149590792Sgshapiro queue groups. If an argument is specified, it is used 149690792Sgshapiro as default queue group. 149790792Sgshapiro 149894334Sgshapiro Note: please read the warning in doc/op/op.me about 149994334Sgshapiro queue groups and possible queue manipulations. 150094334Sgshapiro 1501132943Sgshapirogreet_pause Adds the greet_pause ruleset which enables open proxy 1502132943Sgshapiro and SMTP slamming protection. The feature can take an 1503132943Sgshapiro argument specifying the milliseconds to wait: 1504132943Sgshapiro 1505132943Sgshapiro FEATURE(`greet_pause', `5000') dnl 5 seconds 1506132943Sgshapiro 1507132943Sgshapiro If FEATURE(`access_db') is enabled, an access database 1508132943Sgshapiro lookup with the GreetPause tag is done using client 1509132943Sgshapiro hostname, domain, IP address, or subnet to determine the 1510132943Sgshapiro pause time: 1511132943Sgshapiro 1512132943Sgshapiro GreetPause:my.domain 0 1513132943Sgshapiro GreetPause:example.com 5000 1514132943Sgshapiro GreetPause:10.1.2 2000 1515132943Sgshapiro GreetPause:127.0.0.1 0 1516132943Sgshapiro 1517132943Sgshapiro When using FEATURE(`access_db'), the optional 1518132943Sgshapiro FEATURE(`greet_pause') argument becomes the default if 1519132943Sgshapiro nothing is found in the access database. A ruleset called 1520132943Sgshapiro Local_greet_pause can be used for local modifications, e.g., 1521132943Sgshapiro 1522132943Sgshapiro LOCAL_RULESETS 1523132943Sgshapiro SLocal_greet_pause 1524132943Sgshapiro R$* $: $&{daemon_flags} 1525132943Sgshapiro R$* a $* $# 0 1526132943Sgshapiro 1527168515Sgshapiroblock_bad_helo Reject messages from SMTP clients which provide a HELO/EHLO 1528168515Sgshapiro argument which is either unqualified, or is one of our own 1529168515Sgshapiro names (i.e., the server name instead of the client name). 1530168515Sgshapiro This check is performed at RCPT stage and disabled for the 1531168515Sgshapiro following cases: 1532168515Sgshapiro - authenticated sessions, 1533168515Sgshapiro - connections from IP addresses in class $={R}. 1534168515Sgshapiro Currently access_db lookups can not be used to 1535168515Sgshapiro (selectively) disable this test, moreover, 1536285229Sgshapiro 1537168515Sgshapiro FEATURE(`delay_checks') 1538168515Sgshapiro 1539285229Sgshapiro is required. Note, the block_bad_helo feature automatically 1540285229Sgshapiro adds the IPv6 and IPv4 localhost IP addresses to $={w} (local 1541285229Sgshapiro host names) and $={R} (relay permitted). 1542285229Sgshapiro 1543168515Sgshapirorequire_rdns Reject mail from connecting SMTP clients without proper 1544168515Sgshapiro rDNS (reverse DNS), functional gethostbyaddr() resolution. 1545168515Sgshapiro Note: this feature will cause false positives, i.e., there 1546168515Sgshapiro are legitimate MTAs that do not have proper DNS entries. 1547168515Sgshapiro Rejecting mails from those MTAs is a local policy decision. 1548168515Sgshapiro 1549168515Sgshapiro The basic policy is to reject message with a 5xx error if 1550168515Sgshapiro the IP address fails to resolve. However, if this is a 1551168515Sgshapiro temporary failure, a 4xx temporary failure is returned. 1552168515Sgshapiro If the look-up succeeds, but returns an apparently forged 1553168515Sgshapiro value, this is treated as a temporary failure with a 4xx 1554168515Sgshapiro error code. 1555168515Sgshapiro 1556168515Sgshapiro EXCEPTIONS: 1557168515Sgshapiro 1558168515Sgshapiro Exceptions based on access entries are discussed below. 1559168515Sgshapiro Any IP address matched using $=R (the "relay-domains" file) 1560168515Sgshapiro is excepted from the rules. Since we have explicitly 1561168515Sgshapiro allowed relaying for this host, based on IP address, we 1562168515Sgshapiro ignore the rDNS failure. 1563168515Sgshapiro 1564168515Sgshapiro The philosophical assumption here is that most users do 1565168515Sgshapiro not control their rDNS. They should be able to send mail 1566168515Sgshapiro through their ISP, whether or not they have valid rDNS. 1567168515Sgshapiro The class $=R, roughly speaking, contains those IP addresses 1568168515Sgshapiro and address ranges for which we are the ISP, or are acting 1569168515Sgshapiro as if the ISP. 1570168515Sgshapiro 1571168515Sgshapiro If `delay_checks' is in effect (recommended), then any 1572168515Sgshapiro sender who has authenticated is also excepted from the 1573168515Sgshapiro restrictions. This happens because the rules produced by 1574168515Sgshapiro this FEATURE() will not be applied to authenticated senders 1575168515Sgshapiro (assuming `delay_checks'). 1576168515Sgshapiro 1577168515Sgshapiro ACCESS MAP ENTRIES: 1578168515Sgshapiro 1579168515Sgshapiro Entries such as 1580168515Sgshapiro Connect:1.2.3.4 OK 1581168515Sgshapiro Connect:1.2 RELAY 1582168515Sgshapiro will whitelist IP address 1.2.3.4, so that the rDNS 1583168515Sgshapiro blocking does apply to that IP address 1584168515Sgshapiro 1585168515Sgshapiro Entries such as 1586168515Sgshapiro Connect:1.2.3.4 REJECT 1587168515Sgshapiro will have the effect of forcing a temporary failure for 1588168515Sgshapiro that address to be treated as a permanent failure. 1589168515Sgshapiro 1590168515Sgshapirobadmx Reject envelope sender addresses (MAIL) whose domain part 1591168515Sgshapiro resolves to a "bad" MX record. By default these are 1592168515Sgshapiro MX records which resolve to A records that match the 1593168515Sgshapiro regular expression: 1594168515Sgshapiro 1595168515Sgshapiro ^(127\.|10\.|0\.0\.0\.0) 1596168515Sgshapiro 1597168515Sgshapiro This default regular expression can be overridden by 1598168515Sgshapiro specifying an argument, e.g., 1599168515Sgshapiro 1600168515Sgshapiro FEATURE(`badmx', `^127\.0\.0\.1') 1601168515Sgshapiro 1602168515Sgshapiro Note: this feature requires that the sendmail binary 1603168515Sgshapiro has been compiled with the options MAP_REGEX and 1604168515Sgshapiro DNSMAP. 1605168515Sgshapiro 160638032Speter+-------+ 160738032Speter| HACKS | 160838032Speter+-------+ 160938032Speter 161038032SpeterSome things just can't be called features. To make this clear, 161138032Speterthey go in the hack subdirectory and are referenced using the HACK 161238032Spetermacro. These will tend to be site-dependent. The release 161338032Speterincludes the Berkeley-dependent "cssubdomain" hack (that makes 161438032Spetersendmail accept local names in either Berkeley.EDU or CS.Berkeley.EDU; 161564562Sgshapirothis is intended as a short-term aid while moving hosts into 161638032Spetersubdomains. 161738032Speter 161838032Speter 161938032Speter+--------------------+ 162038032Speter| SITE CONFIGURATION | 162138032Speter+--------------------+ 162238032Speter 162338032Speter ***************************************************** 162438032Speter * This section is really obsolete, and is preserved * 162538032Speter * only for back compatibility. You should plan on * 162690792Sgshapiro * using mailertables for new installations. In * 162738032Speter * particular, it doesn't work for the newer forms * 162838032Speter * of UUCP mailers, such as uucp-uudom. * 162938032Speter ***************************************************** 163038032Speter 163138032SpeterComplex sites will need more local configuration information, such as 163238032Speterlists of UUCP hosts they speak with directly. This can get a bit more 163338032Spetertricky. For an example of a "complex" site, see cf/ucbvax.mc. 163438032Speter 163538032SpeterThe SITECONFIG macro allows you to indirectly reference site-dependent 163638032Speterconfiguration information stored in the siteconfig subdirectory. For 163738032Speterexample, the line 163838032Speter 163964562Sgshapiro SITECONFIG(`uucp.ucbvax', `ucbvax', `U') 164038032Speter 164138032Speterreads the file uucp.ucbvax for local connection information. The 164238032Spetersecond parameter is the local name (in this case just "ucbvax" since 164338032Speterit is locally connected, and hence a UUCP hostname). The third 164438032Speterparameter is the name of both a macro to store the local name (in 164564562Sgshapirothis case, {U}) and the name of the class (e.g., {U}) in which to store 164638032Speterthe host information read from the file. Another SITECONFIG line reads 164738032Speter 164864562Sgshapiro SITECONFIG(`uucp.ucbarpa', `ucbarpa.Berkeley.EDU', `W') 164938032Speter 165038032SpeterThis says that the file uucp.ucbarpa contains the list of UUCP sites 165164562Sgshapiroconnected to ucbarpa.Berkeley.EDU. Class {W} will be used to 165238032Speterstore this list, and $W is defined to be ucbarpa.Berkeley.EDU, that 165338032Speteris, the name of the relay to which the hosts listed in uucp.ucbarpa 165464562Sgshapiroare connected. [The machine ucbarpa is gone now, but this 165564562Sgshapiroout-of-date configuration file has been left around to demonstrate 165664562Sgshapirohow you might do this.] 165738032Speter 165838032SpeterNote that the case of SITECONFIG with a third parameter of ``U'' is 165938032Speterspecial; the second parameter is assumed to be the UUCP name of the 166038032Speterlocal site, rather than the name of a remote site, and the UUCP name 166164562Sgshapirois entered into class {w} (the list of local hostnames) as $U.UUCP. 166238032Speter 166338032SpeterThe siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing 166438032Spetermore than a sequence of SITE macros describing connectivity. For 166538032Speterexample: 166638032Speter 166764562Sgshapiro SITE(`cnmat') 166864562Sgshapiro SITE(`sgi olympus') 166938032Speter 167038032SpeterThe second example demonstrates that you can use two names on the 167138032Spetersame line; these are usually aliases for the same host (or are at 167238032Speterleast in the same company). 167338032Speter 1674132943SgshapiroThe macro LOCAL_UUCP can be used to add rules into the generated 1675132943Sgshapirocf file at the place where MAILER(`uucp') inserts its rules. This 1676132943Sgshapiroshould only be used if really necessary. 167738032Speter 167838032Speter+--------------------+ 167938032Speter| USING UUCP MAILERS | 168038032Speter+--------------------+ 168138032Speter 168238032SpeterIt's hard to get UUCP mailers right because of the extremely ad hoc 168338032Speternature of UUCP addressing. These config files are really designed 168438032Speterfor domain-based addressing, even for UUCP sites. 168538032Speter 168638032SpeterThere are four UUCP mailers available. The choice of which one to 168738032Speteruse is partly a matter of local preferences and what is running at 168838032Speterthe other end of your UUCP connection. Unlike good protocols that 168938032Speterdefine what will go over the wire, UUCP uses the policy that you 169038032Spetershould do what is right for the other end; if they change, you have 169138032Speterto change. This makes it hard to do the right thing, and discourages 169238032Speterpeople from updating their software. In general, if you can avoid 169338032SpeterUUCP, please do. 169438032Speter 169538032SpeterThe major choice is whether to go for a domainized scheme or a 169638032Speternon-domainized scheme. This depends entirely on what the other 169738032Speterend will recognize. If at all possible, you should encourage the 169838032Speterother end to go to a domain-based system -- non-domainized addresses 169938032Speterdon't work entirely properly. 170038032Speter 170138032SpeterThe four mailers are: 170238032Speter 170338032Speter uucp-old (obsolete name: "uucp") 170438032Speter This is the oldest, the worst (but the closest to UUCP) way of 1705147078Sgshapiro sending messages across UUCP connections. It does bangify 170638032Speter everything and prepends $U (your UUCP name) to the sender's 170738032Speter address (which can already be a bang path itself). It can 170838032Speter only send to one address at a time, so it spends a lot of 170938032Speter time copying duplicates of messages. Avoid this if at all 171038032Speter possible. 171138032Speter 171238032Speter uucp-new (obsolete name: "suucp") 171338032Speter The same as above, except that it assumes that in one rmail 171438032Speter command you can specify several recipients. It still has a 171538032Speter lot of other problems. 171638032Speter 171738032Speter uucp-dom 171838032Speter This UUCP mailer keeps everything as domain addresses. 171938032Speter Basically, it uses the SMTP mailer rewriting rules. This mailer 172090792Sgshapiro is only included if MAILER(`smtp') is specified before 172190792Sgshapiro MAILER(`uucp'). 172238032Speter 172338032Speter Unfortunately, a lot of UUCP mailer transport agents require 172438032Speter bangified addresses in the envelope, although you can use 172538032Speter domain-based addresses in the message header. (The envelope 172638032Speter shows up as the From_ line on UNIX mail.) So.... 172738032Speter 172838032Speter uucp-uudom 172938032Speter This is a cross between uucp-new (for the envelope addresses) 173038032Speter and uucp-dom (for the header addresses). It bangifies the 173138032Speter envelope sender (From_ line in messages) without adding the 173238032Speter local hostname, unless there is no host name on the address 173338032Speter at all (e.g., "wolf") or the host component is a UUCP host name 173438032Speter instead of a domain name ("somehost!wolf" instead of 173564562Sgshapiro "some.dom.ain!wolf"). This is also included only if MAILER(`smtp') 173690792Sgshapiro is also specified earlier. 173738032Speter 173838032SpeterExamples: 173938032Speter 174064562SgshapiroOn host grasp.insa-lyon.fr (UUCP host name "grasp"), the following 174164562Sgshapirosummarizes the sender rewriting for various mailers. 174238032Speter 174366494SgshapiroMailer sender rewriting in the envelope 174438032Speter------ ------ ------------------------- 174538032Speteruucp-{old,new} wolf grasp!wolf 174638032Speteruucp-dom wolf wolf@grasp.insa-lyon.fr 174738032Speteruucp-uudom wolf grasp.insa-lyon.fr!wolf 174838032Speter 174938032Speteruucp-{old,new} wolf@fr.net grasp!fr.net!wolf 175038032Speteruucp-dom wolf@fr.net wolf@fr.net 175138032Speteruucp-uudom wolf@fr.net fr.net!wolf 175238032Speter 175338032Speteruucp-{old,new} somehost!wolf grasp!somehost!wolf 175438032Speteruucp-dom somehost!wolf somehost!wolf@grasp.insa-lyon.fr 175538032Speteruucp-uudom somehost!wolf grasp.insa-lyon.fr!somehost!wolf 175638032Speter 175738032SpeterIf you are using one of the domainized UUCP mailers, you really want 175838032Speterto convert all UUCP addresses to domain format -- otherwise, it will 175938032Speterdo it for you (and probably not the way you expected). For example, 176038032Speterif you have the address foo!bar!baz (and you are not sending to foo), 176138032Speterthe heuristics will add the @uucp.relay.name or @local.host.name to 176238032Speterthis address. However, if you map foo to foo.host.name first, it 176338032Speterwill not add the local hostname. You can do this using the uucpdomain 176438032Speterfeature. 176538032Speter 176638032Speter 176738032Speter+-------------------+ 176838032Speter| TWEAKING RULESETS | 176938032Speter+-------------------+ 177038032Speter 177138032SpeterFor more complex configurations, you can define special rules. 177238032SpeterThe macro LOCAL_RULE_3 introduces rules that are used in canonicalizing 177338032Speterthe names. Any modifications made here are reflected in the header. 177438032Speter 177538032SpeterA common use is to convert old UUCP addresses to SMTP addresses using 177638032Speterthe UUCPSMTP macro. For example: 177738032Speter 177838032Speter LOCAL_RULE_3 177964562Sgshapiro UUCPSMTP(`decvax', `decvax.dec.com') 178064562Sgshapiro UUCPSMTP(`research', `research.att.com') 178138032Speter 178238032Speterwill cause addresses of the form "decvax!user" and "research!user" 178338032Speterto be converted to "user@decvax.dec.com" and "user@research.att.com" 178438032Speterrespectively. 178538032Speter 178638032SpeterThis could also be used to look up hosts in a database map: 178738032Speter 178838032Speter LOCAL_RULE_3 178938032Speter R$* < @ $+ > $* $: $1 < @ $(hostmap $2 $) > $3 179038032Speter 179138032SpeterThis map would be defined in the LOCAL_CONFIG portion, as shown below. 179238032Speter 179338032SpeterSimilarly, LOCAL_RULE_0 can be used to introduce new parsing rules. 179438032SpeterFor example, new rules are needed to parse hostnames that you accept 179538032Spetervia MX records. For example, you might have: 179638032Speter 179738032Speter LOCAL_RULE_0 179838032Speter R$+ <@ host.dom.ain.> $#uucp $@ cnmat $: $1 < @ host.dom.ain.> 179938032Speter 180038032SpeterYou would use this if you had installed an MX record for cnmat.Berkeley.EDU 180138032Speterpointing at this host; this rule catches the message and forwards it on 180238032Speterusing UUCP. 180338032Speter 180438032SpeterYou can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2. 180538032SpeterThese rulesets are normally empty. 180638032Speter 180738032SpeterA similar macro is LOCAL_CONFIG. This introduces lines added after the 180864562Sgshapiroboilerplate option setting but before rulesets. Do not declare rulesets in 180964562Sgshapirothe LOCAL_CONFIG section. It can be used to declare local database maps or 181064562Sgshapirowhatever. For example: 181138032Speter 181238032Speter LOCAL_CONFIG 181364562Sgshapiro Khostmap hash /etc/mail/hostmap 181438032Speter Kyplocal nis -m hosts.byname 181538032Speter 181638032Speter 181738032Speter+---------------------------+ 181838032Speter| MASQUERADING AND RELAYING | 181938032Speter+---------------------------+ 182038032Speter 182138032SpeterYou can have your host masquerade as another using 182238032Speter 182364562Sgshapiro MASQUERADE_AS(`host.domain') 182438032Speter 182538032SpeterThis causes mail being sent to be labeled as coming from the 182638032Speterindicated host.domain, rather than $j. One normally masquerades as 182764562Sgshapiroone of one's own subdomains (for example, it's unlikely that 182864562SgshapiroBerkeley would choose to masquerade as an MIT site). This 182964562Sgshapirobehaviour is modified by a plethora of FEATUREs; in particular, see 183064562Sgshapiromasquerade_envelope, allmasquerade, limited_masquerade, and 183164562Sgshapiromasquerade_entire_domain. 183238032Speter 183338032SpeterThe masquerade name is not normally canonified, so it is important 183438032Speterthat it be your One True Name, that is, fully qualified and not a 183538032SpeterCNAME. However, if you use a CNAME, the receiving side may canonify 183638032Speterit for you, so don't think you can cheat CNAME mapping this way. 183738032Speter 183838032SpeterNormally the only addresses that are masqueraded are those that come 183964562Sgshapirofrom this host (that is, are either unqualified or in class {w}, the list 184064562Sgshapiroof local domain names). You can augment this list, which is realized 184164562Sgshapiroby class {M} using 184238032Speter 184364562Sgshapiro MASQUERADE_DOMAIN(`otherhost.domain') 184438032Speter 184538032SpeterThe effect of this is that although mail to user@otherhost.domain 184638032Speterwill not be delivered locally, any mail including any user@otherhost.domain 184738032Speterwill, when relayed, be rewritten to have the MASQUERADE_AS address. 184838032SpeterThis can be a space-separated list of names. 184938032Speter 185038032SpeterIf these names are in a file, you can use 185138032Speter 185264562Sgshapiro MASQUERADE_DOMAIN_FILE(`filename') 185338032Speter 185464562Sgshapiroto read the list of names from the indicated file (i.e., to add 185564562Sgshapiroelements to class {M}). 185638032Speter 185764562SgshapiroTo exempt hosts or subdomains from being masqueraded, you can use 185864562Sgshapiro 185964562Sgshapiro MASQUERADE_EXCEPTION(`host.domain') 186064562Sgshapiro 186164562SgshapiroThis can come handy if you want to masquerade a whole domain 186290792Sgshapiroexcept for one (or a few) host(s). If these names are in a file, 186390792Sgshapiroyou can use 186464562Sgshapiro 186590792Sgshapiro MASQUERADE_EXCEPTION_FILE(`filename') 186690792Sgshapiro 186738032SpeterNormally only header addresses are masqueraded. If you want to 186838032Spetermasquerade the envelope as well, use 186938032Speter 187043730Speter FEATURE(`masquerade_envelope') 187138032Speter 187238032SpeterThere are always users that need to be "exposed" -- that is, their 187338032Speterinternal site name should be displayed instead of the masquerade name. 187464562SgshapiroRoot is an example (which has been "exposed" by default prior to 8.10). 187564562SgshapiroYou can add users to this list using 187638032Speter 187764562Sgshapiro EXPOSED_USER(`usernames') 187838032Speter 187990792SgshapiroThis adds users to class {E}; you could also use 188038032Speter 188190792Sgshapiro EXPOSED_USER_FILE(`filename') 188238032Speter 188338032SpeterYou can also arrange to relay all unqualified names (that is, names 188438032Speterwithout @host) to a relay host. For example, if you have a central 188538032Speteremail server, you might relay to that host so that users don't have 188638032Speterto have .forward files or aliases. You can do this using 188738032Speter 188843730Speter define(`LOCAL_RELAY', `mailer:hostname') 188938032Speter 189038032SpeterThe ``mailer:'' can be omitted, in which case the mailer defaults to 189138032Speter"relay". There are some user names that you don't want relayed, perhaps 189238032Speterbecause of local aliases. A common example is root, which may be 189338032Speterlocally aliased. You can add entries to this list using 189438032Speter 189564562Sgshapiro LOCAL_USER(`usernames') 189638032Speter 189790792SgshapiroThis adds users to class {L}; you could also use 189838032Speter 189990792Sgshapiro LOCAL_USER_FILE(`filename') 190038032Speter 190138032SpeterIf you want all incoming mail sent to a centralized hub, as for a 190238032Spetershared /var/spool/mail scheme, use 190338032Speter 190443730Speter define(`MAIL_HUB', `mailer:hostname') 190538032Speter 190638032SpeterAgain, ``mailer:'' defaults to "relay". If you define both LOCAL_RELAY 190743730Speterand MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will 190838032Speterbe sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB. 190964562SgshapiroNote: there is a (long standing) bug which keeps this combination from 191064562Sgshapiroworking for addresses of the form user+detail. 191164562SgshapiroNames in class {L} will be delivered locally, so you MUST have aliases or 191238032Speter.forward files for them. 191338032Speter 191438032SpeterFor example, if you are on machine mastodon.CS.Berkeley.EDU and you have 191543730SpeterFEATURE(`stickyhost'), the following combinations of settings will have the 191638032Speterindicated effects: 191738032Speter 191838032Speteremail sent to.... eric eric@mastodon.CS.Berkeley.EDU 191938032Speter 192038032SpeterLOCAL_RELAY set to mail.CS.Berkeley.EDU (delivered locally) 192138032Spetermail.CS.Berkeley.EDU (no local aliasing) (aliasing done) 192238032Speter 192338032SpeterMAIL_HUB set to mammoth.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU 192438032Spetermammoth.CS.Berkeley.EDU (aliasing done) (aliasing done) 192538032Speter 192638032SpeterBoth LOCAL_RELAY and mail.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU 192738032SpeterMAIL_HUB set as above (no local aliasing) (aliasing done) 192838032Speter 192943730SpeterIf you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and 193038032SpeterMAIL_HUB act identically, with MAIL_HUB taking precedence. 193138032Speter 193238032SpeterIf you want all outgoing mail to go to a central relay site, define 193338032SpeterSMART_HOST as well. Briefly: 193438032Speter 193538032Speter LOCAL_RELAY applies to unqualified names (e.g., "eric"). 193638032Speter MAIL_HUB applies to names qualified with the name of the 193738032Speter local host (e.g., "eric@mastodon.CS.Berkeley.EDU"). 193864562Sgshapiro SMART_HOST applies to names qualified with other hosts or 193964562Sgshapiro bracketed addresses (e.g., "eric@mastodon.CS.Berkeley.EDU" 194064562Sgshapiro or "eric@[127.0.0.1]"). 194138032Speter 194238032SpeterHowever, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY, 194338032SpeterDECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you 194438032Speterreally want absolutely everything to go to a single central site you will 194538032Speterneed to unset all the other relays -- or better yet, find or build a 194638032Speterminimal config file that does this. 194738032Speter 194838032SpeterFor duplicate suppression to work properly, the host name is best 194938032Speterspecified with a terminal dot: 195038032Speter 195138032Speter define(`MAIL_HUB', `host.domain.') 195238032Speter note the trailing dot ---^ 195338032Speter 195438032Speter 195590792Sgshapiro+-------------------------------------------+ 195690792Sgshapiro| USING LDAP FOR ALIASES, MAPS, AND CLASSES | 195790792Sgshapiro+-------------------------------------------+ 195890792Sgshapiro 195990792SgshapiroLDAP can be used for aliases, maps, and classes by either specifying your 196090792Sgshapiroown LDAP map specification or using the built-in default LDAP map 196190792Sgshapirospecification. The built-in default specifications all provide lookups 196290792Sgshapirowhich match against either the machine's fully qualified hostname (${j}) or 196390792Sgshapiroa "cluster". The cluster allows you to share LDAP entries among a large 196490792Sgshapironumber of machines without having to enter each of the machine names into 196590792Sgshapiroeach LDAP entry. To set the LDAP cluster name to use for a particular 196690792Sgshapiromachine or set of machines, set the confLDAP_CLUSTER m4 variable to a 196790792Sgshapirounique name. For example: 196890792Sgshapiro 196990792Sgshapiro define(`confLDAP_CLUSTER', `Servers') 197090792Sgshapiro 197190792SgshapiroHere, the word `Servers' will be the cluster name. As an example, assume 197290792Sgshapirothat smtp.sendmail.org, etrn.sendmail.org, and mx.sendmail.org all belong 197390792Sgshapiroto the Servers cluster. 197490792Sgshapiro 197590792SgshapiroSome of the LDAP LDIF examples below show use of the Servers cluster. 197690792SgshapiroEvery entry must have either a sendmailMTAHost or sendmailMTACluster 197790792Sgshapiroattribute or it will be ignored. Be careful as mixing clusters and 197890792Sgshapiroindividual host records can have surprising results (see the CAUTION 197990792Sgshapirosections below). 198090792Sgshapiro 198190792SgshapiroSee the file cf/sendmail.schema for the actual LDAP schemas. Note that 198290792Sgshapirothis schema (and therefore the lookups and examples below) is experimental 198390792Sgshapiroat this point as it has had little public review. Therefore, it may change 1984157001Sgshapiroin future versions. Feedback via sendmail-YYYY@support.sendmail.org is 1985157001Sgshapiroencouraged (replace YYYY with the current year, e.g., 2005). 198690792Sgshapiro 198790792Sgshapiro------- 198890792SgshapiroAliases 198990792Sgshapiro------- 199090792Sgshapiro 199190792SgshapiroThe ALIAS_FILE (O AliasFile) option can be set to use LDAP for alias 199290792Sgshapirolookups. To use the default schema, simply use: 199390792Sgshapiro 199490792Sgshapiro define(`ALIAS_FILE', `ldap:') 199590792Sgshapiro 199690792SgshapiroBy doing so, you will use the default schema which expands to a map 199790792Sgshapirodeclared as follows: 199890792Sgshapiro 199990792Sgshapiro ldap -k (&(objectClass=sendmailMTAAliasObject) 200090792Sgshapiro (sendmailMTAAliasGrouping=aliases) 200190792Sgshapiro (|(sendmailMTACluster=${sendmailMTACluster}) 200290792Sgshapiro (sendmailMTAHost=$j)) 200390792Sgshapiro (sendmailMTAKey=%0)) 2004132943Sgshapiro -v sendmailMTAAliasValue,sendmailMTAAliasSearch:FILTER:sendmailMTAAliasObject,sendmailMTAAliasURL:URL:sendmailMTAAliasObject 200590792Sgshapiro 2006132943Sgshapiro 200790792SgshapiroNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually 200890792Sgshapiroused when the binary expands the `ldap:' token as the AliasFile option is 200990792Sgshapironot actually macro-expanded when read from the sendmail.cf file. 201090792Sgshapiro 201190792SgshapiroExample LDAP LDIF entries might be: 201290792Sgshapiro 201390792Sgshapiro dn: sendmailMTAKey=sendmail-list, dc=sendmail, dc=org 201490792Sgshapiro objectClass: sendmailMTA 201590792Sgshapiro objectClass: sendmailMTAAlias 201690792Sgshapiro objectClass: sendmailMTAAliasObject 201790792Sgshapiro sendmailMTAAliasGrouping: aliases 201890792Sgshapiro sendmailMTAHost: etrn.sendmail.org 201990792Sgshapiro sendmailMTAKey: sendmail-list 202090792Sgshapiro sendmailMTAAliasValue: ca@example.org 202190792Sgshapiro sendmailMTAAliasValue: eric 202290792Sgshapiro sendmailMTAAliasValue: gshapiro@example.com 202390792Sgshapiro 202490792Sgshapiro dn: sendmailMTAKey=owner-sendmail-list, dc=sendmail, dc=org 202590792Sgshapiro objectClass: sendmailMTA 202690792Sgshapiro objectClass: sendmailMTAAlias 202790792Sgshapiro objectClass: sendmailMTAAliasObject 202890792Sgshapiro sendmailMTAAliasGrouping: aliases 202990792Sgshapiro sendmailMTAHost: etrn.sendmail.org 203090792Sgshapiro sendmailMTAKey: owner-sendmail-list 203190792Sgshapiro sendmailMTAAliasValue: eric 203290792Sgshapiro 203390792Sgshapiro dn: sendmailMTAKey=postmaster, dc=sendmail, dc=org 203490792Sgshapiro objectClass: sendmailMTA 203590792Sgshapiro objectClass: sendmailMTAAlias 203690792Sgshapiro objectClass: sendmailMTAAliasObject 203790792Sgshapiro sendmailMTAAliasGrouping: aliases 203890792Sgshapiro sendmailMTACluster: Servers 203990792Sgshapiro sendmailMTAKey: postmaster 204090792Sgshapiro sendmailMTAAliasValue: eric 204190792Sgshapiro 204290792SgshapiroHere, the aliases sendmail-list and owner-sendmail-list will be available 204390792Sgshapiroonly on etrn.sendmail.org but the postmaster alias will be available on 204490792Sgshapiroevery machine in the Servers cluster (including etrn.sendmail.org). 204590792Sgshapiro 204690792SgshapiroCAUTION: aliases are additive so that entries like these: 204790792Sgshapiro 204890792Sgshapiro dn: sendmailMTAKey=bob, dc=sendmail, dc=org 204990792Sgshapiro objectClass: sendmailMTA 205090792Sgshapiro objectClass: sendmailMTAAlias 205190792Sgshapiro objectClass: sendmailMTAAliasObject 205290792Sgshapiro sendmailMTAAliasGrouping: aliases 205390792Sgshapiro sendmailMTACluster: Servers 205490792Sgshapiro sendmailMTAKey: bob 205590792Sgshapiro sendmailMTAAliasValue: eric 205690792Sgshapiro 205794334Sgshapiro dn: sendmailMTAKey=bobetrn, dc=sendmail, dc=org 205890792Sgshapiro objectClass: sendmailMTA 205990792Sgshapiro objectClass: sendmailMTAAlias 206090792Sgshapiro objectClass: sendmailMTAAliasObject 206190792Sgshapiro sendmailMTAAliasGrouping: aliases 206290792Sgshapiro sendmailMTAHost: etrn.sendmail.org 206390792Sgshapiro sendmailMTAKey: bob 206490792Sgshapiro sendmailMTAAliasValue: gshapiro 206590792Sgshapiro 206690792Sgshapirowould mean that on all of the hosts in the cluster, mail to bob would go to 206790792Sgshapiroeric EXCEPT on etrn.sendmail.org in which case it would go to BOTH eric and 206890792Sgshapirogshapiro. 206990792Sgshapiro 207090792SgshapiroIf you prefer not to use the default LDAP schema for your aliases, you can 207190792Sgshapirospecify the map parameters when setting ALIAS_FILE. For example: 207290792Sgshapiro 207390792Sgshapiro define(`ALIAS_FILE', `ldap:-k (&(objectClass=mailGroup)(mail=%0)) -v mgrpRFC822MailMember') 207490792Sgshapiro 207590792Sgshapiro---- 207690792SgshapiroMaps 207790792Sgshapiro---- 207890792Sgshapiro 207990792SgshapiroFEATURE()'s which take an optional map definition argument (e.g., access, 208090792Sgshapiromailertable, virtusertable, etc.) can instead take the special keyword 208190792Sgshapiro`LDAP', e.g.: 208290792Sgshapiro 208390792Sgshapiro FEATURE(`access_db', `LDAP') 208490792Sgshapiro FEATURE(`virtusertable', `LDAP') 208590792Sgshapiro 208690792SgshapiroWhen this keyword is given, that map will use LDAP lookups consisting of 208790792Sgshapirothe objectClass sendmailMTAClassObject, the attribute sendmailMTAMapName 208890792Sgshapirowith the map name, a search attribute of sendmailMTAKey, and the value 208990792Sgshapiroattribute sendmailMTAMapValue. 209090792Sgshapiro 209190792SgshapiroThe values for sendmailMTAMapName are: 209290792Sgshapiro 209390792Sgshapiro FEATURE() sendmailMTAMapName 209490792Sgshapiro --------- ------------------ 209590792Sgshapiro access_db access 209690792Sgshapiro authinfo authinfo 209790792Sgshapiro bitdomain bitdomain 209890792Sgshapiro domaintable domain 209990792Sgshapiro genericstable generics 210090792Sgshapiro mailertable mailer 210190792Sgshapiro uucpdomain uucpdomain 210290792Sgshapiro virtusertable virtuser 210390792Sgshapiro 210490792SgshapiroFor example, FEATURE(`mailertable', `LDAP') would use the map definition: 210590792Sgshapiro 210690792Sgshapiro Kmailertable ldap -k (&(objectClass=sendmailMTAMapObject) 210790792Sgshapiro (sendmailMTAMapName=mailer) 210890792Sgshapiro (|(sendmailMTACluster=${sendmailMTACluster}) 210990792Sgshapiro (sendmailMTAHost=$j)) 211090792Sgshapiro (sendmailMTAKey=%0)) 2111132943Sgshapiro -1 -v sendmailMTAMapValue,sendmailMTAMapSearch:FILTER:sendmailMTAMapObject,sendmailMTAMapURL:URL:sendmailMTAMapObject 211290792Sgshapiro 211390792SgshapiroAn example LDAP LDIF entry using this map might be: 211490792Sgshapiro 211590792Sgshapiro dn: sendmailMTAMapName=mailer, dc=sendmail, dc=org 211690792Sgshapiro objectClass: sendmailMTA 211790792Sgshapiro objectClass: sendmailMTAMap 211890792Sgshapiro sendmailMTACluster: Servers 211990792Sgshapiro sendmailMTAMapName: mailer 212090792Sgshapiro 212190792Sgshapiro dn: sendmailMTAKey=example.com, sendmailMTAMapName=mailer, dc=sendmail, dc=org 212290792Sgshapiro objectClass: sendmailMTA 212390792Sgshapiro objectClass: sendmailMTAMap 212490792Sgshapiro objectClass: sendmailMTAMapObject 212590792Sgshapiro sendmailMTAMapName: mailer 212690792Sgshapiro sendmailMTACluster: Servers 212790792Sgshapiro sendmailMTAKey: example.com 212890792Sgshapiro sendmailMTAMapValue: relay:[smtp.example.com] 212990792Sgshapiro 213090792SgshapiroCAUTION: If your LDAP database contains the record above and *ALSO* a host 213190792Sgshapirospecific record such as: 213290792Sgshapiro 213390792Sgshapiro dn: sendmailMTAKey=example.com@etrn, sendmailMTAMapName=mailer, dc=sendmail, dc=org 213490792Sgshapiro objectClass: sendmailMTA 213590792Sgshapiro objectClass: sendmailMTAMap 213690792Sgshapiro objectClass: sendmailMTAMapObject 213790792Sgshapiro sendmailMTAMapName: mailer 213890792Sgshapiro sendmailMTAHost: etrn.sendmail.org 213990792Sgshapiro sendmailMTAKey: example.com 214090792Sgshapiro sendmailMTAMapValue: relay:[mx.example.com] 214190792Sgshapiro 214290792Sgshapirothen these entries will give unexpected results. When the lookup is done 214390792Sgshapiroon etrn.sendmail.org, the effect is that there is *NO* match at all as maps 214490792Sgshapirorequire a single match. Since the host etrn.sendmail.org is also in the 214590792SgshapiroServers cluster, LDAP would return two answers for the example.com map key 214690792Sgshapiroin which case sendmail would treat this as no match at all. 214790792Sgshapiro 214890792SgshapiroIf you prefer not to use the default LDAP schema for your maps, you can 214990792Sgshapirospecify the map parameters when using the FEATURE(). For example: 215090792Sgshapiro 215190792Sgshapiro FEATURE(`access_db', `ldap:-1 -k (&(objectClass=mapDatabase)(key=%0)) -v value') 215290792Sgshapiro 215390792Sgshapiro------- 215490792SgshapiroClasses 215590792Sgshapiro------- 215690792Sgshapiro 215790792SgshapiroNormally, classes can be filled via files or programs. As of 8.12, they 215890792Sgshapirocan also be filled via map lookups using a new syntax: 215990792Sgshapiro 216090792Sgshapiro F{ClassName}mapkey@mapclass:mapspec 216190792Sgshapiro 216290792Sgshapiromapkey is optional and if not provided the map key will be empty. This can 216390792Sgshapirobe used with LDAP to read classes from LDAP. Note that the lookup is only 216490792Sgshapirodone when sendmail is initially started. Use the special value `@LDAP' to 216590792Sgshapirouse the default LDAP schema. For example: 216690792Sgshapiro 216790792Sgshapiro RELAY_DOMAIN_FILE(`@LDAP') 216890792Sgshapiro 216990792Sgshapirowould put all of the attribute sendmailMTAClassValue values of LDAP records 217090792Sgshapirowith objectClass sendmailMTAClass and an attribute sendmailMTAClassName of 217190792Sgshapiro'R' into class $={R}. In other words, it is equivalent to the LDAP map 217290792Sgshapirospecification: 217390792Sgshapiro 217490792Sgshapiro F{R}@ldap:-k (&(objectClass=sendmailMTAClass) 217590792Sgshapiro (sendmailMTAClassName=R) 217690792Sgshapiro (|(sendmailMTACluster=${sendmailMTACluster}) 217790792Sgshapiro (sendmailMTAHost=$j))) 2178132943Sgshapiro -v sendmailMTAClassValue,sendmailMTAClassSearch:FILTER:sendmailMTAClass,sendmailMTAClassURL:URL:sendmailMTAClass 217990792Sgshapiro 218090792SgshapiroNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually 218190792Sgshapiroused when the binary expands the `@LDAP' token as class declarations are 218290792Sgshapironot actually macro-expanded when read from the sendmail.cf file. 218390792Sgshapiro 218490792SgshapiroThis can be used with class related commands such as RELAY_DOMAIN_FILE(), 218590792SgshapiroMASQUERADE_DOMAIN_FILE(), etc: 218690792Sgshapiro 218790792Sgshapiro Command sendmailMTAClassName 218890792Sgshapiro ------- -------------------- 218990792Sgshapiro CANONIFY_DOMAIN_FILE() Canonify 219090792Sgshapiro EXPOSED_USER_FILE() E 219190792Sgshapiro GENERICS_DOMAIN_FILE() G 219290792Sgshapiro LDAPROUTE_DOMAIN_FILE() LDAPRoute 219390792Sgshapiro LDAPROUTE_EQUIVALENT_FILE() LDAPRouteEquiv 219490792Sgshapiro LOCAL_USER_FILE() L 219590792Sgshapiro MASQUERADE_DOMAIN_FILE() M 219690792Sgshapiro MASQUERADE_EXCEPTION_FILE() N 219790792Sgshapiro RELAY_DOMAIN_FILE() R 219890792Sgshapiro VIRTUSER_DOMAIN_FILE() VirtHost 219990792Sgshapiro 220090792SgshapiroYou can also add your own as any 'F'ile class of the form: 220190792Sgshapiro 220290792Sgshapiro F{ClassName}@LDAP 220390792Sgshapiro ^^^^^^^^^ 220490792Sgshapirowill use "ClassName" for the sendmailMTAClassName. 220590792Sgshapiro 220690792SgshapiroAn example LDAP LDIF entry would look like: 220790792Sgshapiro 220890792Sgshapiro dn: sendmailMTAClassName=R, dc=sendmail, dc=org 220990792Sgshapiro objectClass: sendmailMTA 221090792Sgshapiro objectClass: sendmailMTAClass 221190792Sgshapiro sendmailMTACluster: Servers 221290792Sgshapiro sendmailMTAClassName: R 221390792Sgshapiro sendmailMTAClassValue: sendmail.org 221490792Sgshapiro sendmailMTAClassValue: example.com 221590792Sgshapiro sendmailMTAClassValue: 10.56.23 221690792Sgshapiro 221790792SgshapiroCAUTION: If your LDAP database contains the record above and *ALSO* a host 221890792Sgshapirospecific record such as: 221990792Sgshapiro 222090792Sgshapiro dn: sendmailMTAClassName=R@etrn.sendmail.org, dc=sendmail, dc=org 222190792Sgshapiro objectClass: sendmailMTA 222290792Sgshapiro objectClass: sendmailMTAClass 222390792Sgshapiro sendmailMTAHost: etrn.sendmail.org 222490792Sgshapiro sendmailMTAClassName: R 222590792Sgshapiro sendmailMTAClassValue: example.com 222690792Sgshapiro 222790792Sgshapirothe result will be similar to the aliases caution above. When the lookup 222890792Sgshapirois done on etrn.sendmail.org, $={R} would contain all of the entries (from 222990792Sgshapiroboth the cluster match and the host match). In other words, the effective 223090792Sgshapirois additive. 223190792Sgshapiro 223290792SgshapiroIf you prefer not to use the default LDAP schema for your classes, you can 223390792Sgshapirospecify the map parameters when using the class command. For example: 223490792Sgshapiro 223590792Sgshapiro VIRTUSER_DOMAIN_FILE(`@ldap:-k (&(objectClass=virtHosts)(host=*)) -v host') 223690792Sgshapiro 223790792SgshapiroRemember, macros can not be used in a class declaration as the binary does 223890792Sgshapironot expand them. 223990792Sgshapiro 224090792Sgshapiro 224164562Sgshapiro+--------------+ 224264562Sgshapiro| LDAP ROUTING | 224364562Sgshapiro+--------------+ 224464562Sgshapiro 224564562SgshapiroFEATURE(`ldap_routing') can be used to implement the IETF Internet Draft 224664562SgshapiroLDAP Schema for Intranet Mail Routing 224764562Sgshapiro(draft-lachman-laser-ldap-mail-routing-01). This feature enables 224864562SgshapiroLDAP-based rerouting of a particular address to either a different host 224964562Sgshapiroor a different address. The LDAP lookup is first attempted on the full 225064562Sgshapiroaddress (e.g., user@example.com) and then on the domain portion 225164562Sgshapiro(e.g., @example.com). Be sure to setup your domain for LDAP routing using 225264562SgshapiroLDAPROUTE_DOMAIN(), e.g.: 225364562Sgshapiro 225464562Sgshapiro LDAPROUTE_DOMAIN(`example.com') 225564562Sgshapiro 225690792SgshapiroAdditionally, you can specify equivalent domains for LDAP routing using 225790792SgshapiroLDAPROUTE_EQUIVALENT() and LDAPROUTE_EQUIVALENT_FILE(). 'Equivalent' 225890792Sgshapirohostnames are mapped to $M (the masqueraded hostname for the server) before 225990792Sgshapirothe LDAP query. For example, if the mail is addressed to 226090792Sgshapirouser@host1.example.com, normally the LDAP lookup would only be done for 226190792Sgshapiro'user@host1.example.com' and '@host1.example.com'. However, if 226290792SgshapiroLDAPROUTE_EQUIVALENT(`host1.example.com') is used, the lookups would also be 226390792Sgshapirodone on 'user@example.com' and '@example.com' after attempting the 226490792Sgshapirohost1.example.com lookups. 226590792Sgshapiro 226664562SgshapiroBy default, the feature will use the schemas as specified in the draft 226764562Sgshapiroand will not reject addresses not found by the LDAP lookup. However, 226864562Sgshapirothis behavior can be changed by giving additional arguments to the FEATURE() 226964562Sgshapirocommand: 227064562Sgshapiro 2271132943Sgshapiro FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>, 2272132943Sgshapiro <detail>, <nodomain>, <tempfail>) 227364562Sgshapiro 2274244833Sgshapirowhere <mailHost> is a map definition describing how to look up an alternative 227564562Sgshapiromail host for a particular address; <mailRoutingAddress> is a map definition 2276244833Sgshapirodescribing how to look up an alternative address for a particular address; 227764562Sgshapirothe <bounce> argument, if present and not the word "passthru", dictates 227864562Sgshapirothat mail should be bounced if neither a mailHost nor mailRoutingAddress 2279132943Sgshapirois found, if set to "sendertoo", the sender will be rejected if not 2280132943Sgshapirofound in LDAP; and <detail> indicates what actions to take if the address 228190792Sgshapirocontains +detail information -- `strip' tries the lookup with the +detail 228290792Sgshapiroand if no matches are found, strips the +detail and tries the lookup again; 228390792Sgshapiro`preserve', does the same as `strip' but if a mailRoutingAddress match is 2284132943Sgshapirofound, the +detail information is copied to the new address; the <nodomain> 2285132943Sgshapiroargument, if present, will prevent the @domain lookup if the full 2286132943Sgshapiroaddress is not found in LDAP; the <tempfail> argument, if set to 2287132943Sgshapiro"tempfail", instructs the rules to give an SMTP 4XX temporary 2288132943Sgshapiroerror if the LDAP server gives the MTA a temporary failure, or if set to 2289132943Sgshapiro"queue" (the default), the MTA will locally queue the mail. 229064562Sgshapiro 229164562SgshapiroThe default <mailHost> map definition is: 229264562Sgshapiro 229394334Sgshapiro ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient) 229464562Sgshapiro (mailLocalAddress=%0)) 229564562Sgshapiro 229664562SgshapiroThe default <mailRoutingAddress> map definition is: 229764562Sgshapiro 229894334Sgshapiro ldap -1 -T<TMPF> -v mailRoutingAddress 229994334Sgshapiro -k (&(objectClass=inetLocalMailRecipient) 230094334Sgshapiro (mailLocalAddress=%0)) 230164562Sgshapiro 230264562SgshapiroNote that neither includes the LDAP server hostname (-h server) or base DN 230364562Sgshapiro(-b o=org,c=COUNTRY), both necessary for LDAP queries. It is presumed that 230464562Sgshapiroyour .mc file contains a setting for the confLDAP_DEFAULT_SPEC option with 230564562Sgshapirothese settings. If this is not the case, the map definitions should be 230694334Sgshapirochanged as described above. The "-T<TMPF>" is required in any user 230794334Sgshapirospecified map definition to catch temporary errors. 230864562Sgshapiro 230964562SgshapiroThe following possibilities exist as a result of an LDAP lookup on an 231064562Sgshapiroaddress: 231164562Sgshapiro 231264562Sgshapiro mailHost is mailRoutingAddress is Results in 231364562Sgshapiro ----------- --------------------- ---------- 231464562Sgshapiro set to a set mail delivered to 231564562Sgshapiro "local" host mailRoutingAddress 231664562Sgshapiro 231764562Sgshapiro set to a not set delivered to 231864562Sgshapiro "local" host original address 231964562Sgshapiro 232064562Sgshapiro set to a set mailRoutingAddress 232164562Sgshapiro remote host relayed to mailHost 232264562Sgshapiro 232364562Sgshapiro set to a not set original address 232464562Sgshapiro remote host relayed to mailHost 232564562Sgshapiro 232664562Sgshapiro not set set mail delivered to 232764562Sgshapiro mailRoutingAddress 232864562Sgshapiro 232964562Sgshapiro not set not set delivered to 233064562Sgshapiro original address *OR* 233164562Sgshapiro bounced as unknown user 233264562Sgshapiro 233390792SgshapiroThe term "local" host above means the host specified is in class {w}. If 233490792Sgshapirothe result would mean sending the mail to a different host, that host is 233590792Sgshapirolooked up in the mailertable before delivery. 233690792Sgshapiro 233764562SgshapiroNote that the last case depends on whether the third argument is given 233864562Sgshapiroto the FEATURE() command. The default is to deliver the message to the 233964562Sgshapirooriginal address. 234064562Sgshapiro 234164562SgshapiroThe LDAP entries should be set up with an objectClass of 234264562SgshapiroinetLocalMailRecipient and the address be listed in a mailLocalAddress 234364562Sgshapiroattribute. If present, there must be only one mailHost attribute and it 234464562Sgshapiromust contain a fully qualified host name as its value. Similarly, if 234564562Sgshapiropresent, there must be only one mailRoutingAddress attribute and it must 234690792Sgshapirocontain an RFC 822 compliant address. Some example LDAP records (in LDIF 234764562Sgshapiroformat): 234864562Sgshapiro 234964562Sgshapiro dn: uid=tom, o=example.com, c=US 235064562Sgshapiro objectClass: inetLocalMailRecipient 235164562Sgshapiro mailLocalAddress: tom@example.com 235264562Sgshapiro mailRoutingAddress: thomas@mailhost.example.com 235364562Sgshapiro 235464562SgshapiroThis would deliver mail for tom@example.com to thomas@mailhost.example.com. 235564562Sgshapiro 235664562Sgshapiro dn: uid=dick, o=example.com, c=US 235764562Sgshapiro objectClass: inetLocalMailRecipient 235864562Sgshapiro mailLocalAddress: dick@example.com 235964562Sgshapiro mailHost: eng.example.com 236064562Sgshapiro 236164562SgshapiroThis would relay mail for dick@example.com to the same address but redirect 236290792Sgshapirothe mail to MX records listed for the host eng.example.com (unless the 236390792Sgshapiromailertable overrides). 236464562Sgshapiro 236564562Sgshapiro dn: uid=harry, o=example.com, c=US 236664562Sgshapiro objectClass: inetLocalMailRecipient 236764562Sgshapiro mailLocalAddress: harry@example.com 236864562Sgshapiro mailHost: mktmail.example.com 236964562Sgshapiro mailRoutingAddress: harry@mkt.example.com 237064562Sgshapiro 237164562SgshapiroThis would relay mail for harry@example.com to the MX records listed for 237264562Sgshapirothe host mktmail.example.com using the new address harry@mkt.example.com 237364562Sgshapirowhen talking to that host. 237464562Sgshapiro 237564562Sgshapiro dn: uid=virtual.example.com, o=example.com, c=US 237664562Sgshapiro objectClass: inetLocalMailRecipient 237764562Sgshapiro mailLocalAddress: @virtual.example.com 237864562Sgshapiro mailHost: server.example.com 237964562Sgshapiro mailRoutingAddress: virtual@example.com 238064562Sgshapiro 238164562SgshapiroThis would send all mail destined for any username @virtual.example.com to 238264562Sgshapirothe machine server.example.com's MX servers and deliver to the address 238364562Sgshapirovirtual@example.com on that relay machine. 238464562Sgshapiro 238564562Sgshapiro 238638032Speter+---------------------------------+ 238738032Speter| ANTI-SPAM CONFIGURATION CONTROL | 238838032Speter+---------------------------------+ 238938032Speter 239038032SpeterThe primary anti-spam features available in sendmail are: 239138032Speter 239238032Speter* Relaying is denied by default. 239338032Speter* Better checking on sender information. 239438032Speter* Access database. 239538032Speter* Header checks. 239638032Speter 239764562SgshapiroRelaying (transmission of messages from a site outside your host (class 239864562Sgshapiro{w}) to another site except yours) is denied by default. Note that this 239964562Sgshapirochanged in sendmail 8.9; previous versions allowed relaying by default. 240064562SgshapiroIf you really want to revert to the old behaviour, you will need to use 240164562SgshapiroFEATURE(`promiscuous_relay'). You can allow certain domains to relay 240264562Sgshapirothrough your server by adding their domain name or IP address to class 240364562Sgshapiro{R} using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database 240490792Sgshapiro(described below). Note that IPv6 addresses must be prefaced with "IPv6:". 240590792SgshapiroThe file consists (like any other file based class) of entries listed on 240690792Sgshapiroseparate lines, e.g., 240738032Speter 240864562Sgshapiro sendmail.org 240964562Sgshapiro 128.32 241090792Sgshapiro IPv6:2002:c0a8:02c7 241190792Sgshapiro IPv6:2002:c0a8:51d2::23f4 241264562Sgshapiro host.mydomain.com 241390792Sgshapiro [UNIX:localhost] 241464562Sgshapiro 241590792SgshapiroNotice: the last entry allows relaying for connections via a UNIX 241690792Sgshapirosocket to the MTA/MSP. This might be necessary if your configuration 241790792Sgshapirodoesn't allow relaying by other means in that case, e.g., by having 241890792Sgshapirolocalhost.$m in class {R} (make sure $m is not just a top level 241990792Sgshapirodomain). 242090792Sgshapiro 242138032SpeterIf you use 242238032Speter 242343730Speter FEATURE(`relay_entire_domain') 242438032Speter 242564562Sgshapirothen any host in any of your local domains (that is, class {m}) 242642575Speterwill be relayed (that is, you will accept mail either to or from any 242742575Speterhost in your domain). 242838032Speter 242938032SpeterYou can also allow relaying based on the MX records of the host 243038032Speterportion of an incoming recipient address by using 243138032Speter 243243730Speter FEATURE(`relay_based_on_MX') 243338032Speter 243438032SpeterFor example, if your server receives a recipient of user@domain.com 243538032Speterand domain.com lists your server in its MX records, the mail will be 243690792Sgshapiroaccepted for relay to domain.com. This feature may cause problems 243790792Sgshapiroif MX lookups for the recipient domain are slow or time out. In that 243890792Sgshapirocase, mail will be temporarily rejected. It is usually better to 243990792Sgshapiromaintain a list of hosts/domains for which the server acts as relay. 244090792SgshapiroNote also that this feature will stop spammers from using your host 244190792Sgshapiroto relay spam but it will not stop outsiders from using your server 244290792Sgshapiroas a relay for their site (that is, they set up an MX record pointing 244390792Sgshapiroto your mail server, and you will relay mail addressed to them 244490792Sgshapirowithout any prior arrangement). Along the same lines, 244538032Speter 244643730Speter FEATURE(`relay_local_from') 244738032Speter 244838032Speterwill allow relaying if the sender specifies a return path (i.e. 2449157001SgshapiroMAIL FROM:<user@domain>) domain which is a local domain. This is a 245038032Speterdangerous feature as it will allow spammers to spam using your mail 245138032Speterserver by simply specifying a return address of user@your.domain.com. 245238032SpeterIt should not be used unless absolutely necessary. 245364562SgshapiroA slightly better solution is 245438032Speter 245564562Sgshapiro FEATURE(`relay_mail_from') 245664562Sgshapiro 245764562Sgshapirowhich allows relaying if the mail sender is listed as RELAY in the 2458110560Sgshapiroaccess map. If an optional argument `domain' (this is the literal 2459110560Sgshapiroword `domain', not a placeholder) is given, the domain portion of 2460110560Sgshapirothe mail sender is also checked to allowing relaying. This option 2461110560Sgshapiroonly works together with the tag From: for the LHS of the access 2462132943Sgshapiromap entries. This feature allows spammers to abuse your mail server 2463132943Sgshapiroby specifying a return address that you enabled in your access file. 2464132943SgshapiroThis may be harder to figure out for spammers, but it should not 2465132943Sgshapirobe used unless necessary. Instead use SMTP AUTH or STARTTLS to 2466132943Sgshapiroallow relaying for roaming users. 246764562Sgshapiro 246864562Sgshapiro 246990792SgshapiroIf source routing is used in the recipient address (e.g., 2470157001SgshapiroRCPT TO:<user%site.com@othersite.com>), sendmail will check 247138032Speteruser@site.com for relaying if othersite.com is an allowed relay host 247264562Sgshapiroin either class {R}, class {m} if FEATURE(`relay_entire_domain') is used, 247343730Speteror the access database if FEATURE(`access_db') is used. To prevent 247438032Speterthe address from being stripped down, use: 247538032Speter 247643730Speter FEATURE(`loose_relay_check') 247738032Speter 247838032SpeterIf you think you need to use this feature, you probably do not. This 247938032Spetershould only be used for sites which have no control over the addresses 248038032Speterthat they provide a gateway for. Use this FEATURE with caution as it 248138032Spetercan allow spammers to relay through your server if not setup properly. 248238032Speter 2483285229SgshapiroNOTICE: It is possible to relay mail through a system which the 2484285229Sgshapiroanti-relay rules do not prevent: the case of a system that does use 2485285229SgshapiroFEATURE(`nouucp', `nospecial') / FEATURE(`nopercenthack', `nospecial') 2486285229Sgshapiro(system A) and relays local messages to a mail hub (e.g., via 2487285229SgshapiroLOCAL_RELAY or LUSER_RELAY) (system B). If system B doesn't use the 2488285229Sgshapirosame feature (nouucp / nopercenthack) at all, addresses of the form 2489285229Sgshapiro<example.net!user@local.host> / <user%example.net@local.host> 2490285229Sgshapirowould be relayed to <user@example.net>. 2491285229SgshapiroSystem A doesn't recognize `!' / `%' as an address separator and 2492285229Sgshapirotherefore forwards it to the mail hub which in turns relays it 2493285229Sgshapirobecause it came from a trusted local host. So if a mailserver 2494285229Sgshapiroallows UUCP (bang-format) / %-hack addresses, all systems from which 2495285229Sgshapiroit allows relaying should do the same or reject those addresses. 249664562Sgshapiro 249738032SpeterAs of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has 249838032Speteran unresolvable domain (i.e., one that DNS, your local name service, 249990792Sgshapiroor special case rules in ruleset 3 cannot locate). This also applies 250090792Sgshapiroto addresses that use domain literals, e.g., <user@[1.2.3.4]>, if the 250190792SgshapiroIP address can't be mapped to a host name. If you want to continue 250290792Sgshapiroto accept such domains, e.g., because you are inside a firewall that 250390792Sgshapirohas only a limited view of the Internet host name space (note that you 250490792Sgshapirowill not be able to return mail to them unless you have some "smart 250590792Sgshapirohost" forwarder), use 250638032Speter 250743730Speter FEATURE(`accept_unresolvable_domains') 250838032Speter 250990792SgshapiroAlternatively, you can allow specific addresses by adding them to 251090792Sgshapirothe access map, e.g., 251190792Sgshapiro 251290792Sgshapiro From:unresolvable.domain OK 251390792Sgshapiro From:[1.2.3.4] OK 251490792Sgshapiro From:[1.2.4] OK 251590792Sgshapiro 251690792SgshapiroNotice: domains which are temporarily unresolvable are (temporarily) 251790792Sgshapirorejected with a 451 reply code. If those domains should be accepted 251890792Sgshapiro(which is discouraged) then you can use 251990792Sgshapiro 252090792Sgshapiro LOCAL_CONFIG 252190792Sgshapiro C{ResOk}TEMP 252290792Sgshapiro 252338032Spetersendmail will also refuse mail if the MAIL FROM: parameter is not 252438032Speterfully qualified (i.e., contains a domain as well as a user). If you 252538032Speterwant to continue to accept such senders, use 252638032Speter 252743730Speter FEATURE(`accept_unqualified_senders') 252838032Speter 252964562SgshapiroSetting the DaemonPortOptions modifier 'u' overrides the default behavior, 253064562Sgshapiroi.e., unqualified addresses are accepted even without this FEATURE. If 253164562Sgshapirothis FEATURE is not used, the DaemonPortOptions modifier 'f' can be used 253290792Sgshapiroto enforce fully qualified domain names. 253364562Sgshapiro 253438032SpeterAn ``access'' database can be created to accept or reject mail from 253538032Speterselected domains. For example, you may choose to reject all mail 253638032Speteroriginating from known spammers. To enable such a database, use 253738032Speter 253843730Speter FEATURE(`access_db') 253938032Speter 254090792SgshapiroNotice: the access database is applied to the envelope addresses 254190792Sgshapiroand the connection information, not to the header. 254290792Sgshapiro 254390792SgshapiroThe FEATURE macro can accept as second parameter the key file 254438032Speterdefinition for the database; for example 254538032Speter 254690792Sgshapiro FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access_map') 254738032Speter 254890792SgshapiroNotice: If a second argument is specified it must contain the option 2549168515Sgshapiro`-T<TMPF>' as shown above. The optional parameters may be 255090792Sgshapiro 2551168515Sgshapiro `skip' enables SKIP as value part (see below). 2552168515Sgshapiro `lookupdotdomain' another way to enable the feature of the 2553168515Sgshapiro same name (see above). 2554168515Sgshapiro `relaytofulladdress' enable entries of the form 2555168515Sgshapiro To:user@example.com RELAY 2556168515Sgshapiro to allow relaying to just a specific 2557168515Sgshapiro e-mail address instead of an entire domain. 2558168515Sgshapiro 255942575SpeterRemember, since /etc/mail/access is a database, after creating the text 256042575Speterfile as described below, you must use makemap to create the database 256142575Spetermap. For example: 256242575Speter 256343730Speter makemap hash /etc/mail/access < /etc/mail/access 256442575Speter 256538032SpeterThe table itself uses e-mail addresses, domain names, and network 256690792Sgshapironumbers as keys. Note that IPv6 addresses must be prefaced with "IPv6:". 256790792SgshapiroFor example, 256838032Speter 2569132943Sgshapiro From:spammer@aol.com REJECT 2570132943Sgshapiro From:cyberspammer.com REJECT 2571132943Sgshapiro Connect:cyberspammer.com REJECT 2572132943Sgshapiro Connect:TLD REJECT 2573132943Sgshapiro Connect:192.168.212 REJECT 2574132943Sgshapiro Connect:IPv6:2002:c0a8:02c7 RELAY 2575132943Sgshapiro Connect:IPv6:2002:c0a8:51d2::23f4 REJECT 257638032Speter 257738032Speterwould refuse mail from spammer@aol.com, any user from cyberspammer.com 257894334Sgshapiro(or any host within the cyberspammer.com domain), any host in the entire 257994334Sgshapirotop level domain TLD, 192.168.212.* network, and the IPv6 address 258094334Sgshapiro2002:c0a8:51d2::23f4. It would allow relay for the IPv6 network 258194334Sgshapiro2002:c0a8:02c7::/48. 258238032Speter 2583132943SgshapiroEntries in the access map should be tagged according to their type. 2584132943SgshapiroThree tags are available: 2585132943Sgshapiro 2586132943Sgshapiro Connect: connection information (${client_addr}, ${client_name}) 2587132943Sgshapiro From: envelope sender 2588132943Sgshapiro To: envelope recipient 2589132943Sgshapiro 2590132943SgshapiroNotice: untagged entries are deprecated. 2591132943Sgshapiro 2592132943SgshapiroIf the required item is looked up in a map, it will be tried first 2593132943Sgshapirowith the corresponding tag in front, then (as fallback to enable 2594132943Sgshapirobackward compatibility) without any tag, unless the specific feature 2595132943Sgshapirorequires a tag. For example, 2596132943Sgshapiro 2597132943Sgshapiro From:spammer@some.dom REJECT 2598132943Sgshapiro To:friend.domain RELAY 2599132943Sgshapiro Connect:friend.domain OK 2600132943Sgshapiro Connect:from.domain RELAY 2601132943Sgshapiro From:good@another.dom OK 2602132943Sgshapiro From:another.dom REJECT 2603132943Sgshapiro 2604132943SgshapiroThis would deny mails from spammer@some.dom but you could still 2605132943Sgshapirosend mail to that address even if FEATURE(`blacklist_recipients') 2606132943Sgshapirois enabled. Your system will allow relaying to friend.domain, but 2607132943Sgshapironot from it (unless enabled by other means). Connections from that 2608132943Sgshapirodomain will be allowed even if it ends up in one of the DNS based 2609132943Sgshapirorejection lists. Relaying is enabled from from.domain but not to 2610132943Sgshapiroit (since relaying is based on the connection information for 2611132943Sgshapirooutgoing relaying, the tag Connect: must be used; for incoming 2612132943Sgshapirorelaying, which is based on the recipient address, To: must be 2613132943Sgshapiroused). The last two entries allow mails from good@another.dom but 2614132943Sgshapiroreject mail from all other addresses with another.dom as domain 2615132943Sgshapiropart. 2616132943Sgshapiro 2617132943Sgshapiro 261838032SpeterThe value part of the map can contain: 261938032Speter 262090792Sgshapiro OK Accept mail even if other rules in the running 262190792Sgshapiro ruleset would reject it, for example, if the domain 262290792Sgshapiro name is unresolvable. "Accept" does not mean 262390792Sgshapiro "relay", but at most acceptance for local 262490792Sgshapiro recipients. That is, OK allows less than RELAY. 2625168515Sgshapiro RELAY Accept mail addressed to the indicated domain 2626168515Sgshapiro (or address if `relaytofulladdress' is set) or 262742575Speter received from the indicated domain for relaying 262842575Speter through your SMTP server. RELAY also serves as 262942575Speter an implicit OK for the other checks. 263042575Speter REJECT Reject the sender or recipient with a general 263138032Speter purpose message. 263242575Speter DISCARD Discard the message completely using the 263371345Sgshapiro $#discard mailer. If it is used in check_compat, 263471345Sgshapiro it affects only the designated recipient, not 263571345Sgshapiro the whole message as it does in all other cases. 263671345Sgshapiro This should only be used if really necessary. 263790792Sgshapiro SKIP This can only be used for host/domain names 263890792Sgshapiro and IP addresses/nets. It will abort the current 263990792Sgshapiro search for this entry without accepting or rejecting 264090792Sgshapiro it but causing the default action. 264166494Sgshapiro ### any text where ### is an RFC 821 compliant error code and 264266494Sgshapiro "any text" is a message to return for the command. 2643157001Sgshapiro The entire string should be quoted to avoid 2644157001Sgshapiro surprises: 2645157001Sgshapiro 2646157001Sgshapiro "### any text" 2647157001Sgshapiro 2648157001Sgshapiro Otherwise sendmail formats the text as email 2649157001Sgshapiro addresses, e.g., it may remove spaces. 2650132943Sgshapiro This type is deprecated, use one of the two 265190792Sgshapiro ERROR: entries below instead. 265264562Sgshapiro ERROR:### any text 265364562Sgshapiro as above, but useful to mark error messages as such. 2654157001Sgshapiro If quotes need to be used to avoid modifications 2655157001Sgshapiro (see above), they should be placed like this: 2656157001Sgshapiro 2657157001Sgshapiro ERROR:"### any text" 2658157001Sgshapiro 265964562Sgshapiro ERROR:D.S.N:### any text 266064562Sgshapiro where D.S.N is an RFC 1893 compliant error code 2661157001Sgshapiro and the rest as above. If quotes need to be used 2662157001Sgshapiro to avoid modifications, they should be placed 2663157001Sgshapiro like this: 2664157001Sgshapiro 2665157001Sgshapiro ERROR:D.S.N:"### any text" 2666157001Sgshapiro 2667132943Sgshapiro QUARANTINE:any text 2668132943Sgshapiro Quarantine the message using the given text as the 2669132943Sgshapiro quarantining reason. 267038032Speter 267138032SpeterFor example: 267238032Speter 2673132943Sgshapiro From:cyberspammer.com ERROR:"550 We don't accept mail from spammers" 2674132943Sgshapiro From:okay.cyberspammer.com OK 2675132943Sgshapiro Connect:sendmail.org RELAY 2676132943Sgshapiro To:sendmail.org RELAY 2677132943Sgshapiro Connect:128.32 RELAY 2678132943Sgshapiro Connect:128.32.2 SKIP 2679132943Sgshapiro Connect:IPv6:1:2:3:4:5:6:7 RELAY 2680132943Sgshapiro Connect:suspicious.example.com QUARANTINE:Mail from suspicious host 2681132943Sgshapiro Connect:[127.0.0.3] OK 2682132943Sgshapiro Connect:[IPv6:1:2:3:4:5:6:7:8] OK 268338032Speter 2684132943Sgshapirowould accept mail from okay.cyberspammer.com, but would reject mail 2685132943Sgshapirofrom all other hosts at cyberspammer.com with the indicated message. 2686132943SgshapiroIt would allow relaying mail from and to any hosts in the sendmail.org 2687132943Sgshapirodomain, and allow relaying from the IPv6 1:2:3:4:5:6:7:* network 2688132943Sgshapiroand from the 128.32.*.* network except for the 128.32.2.* network, 2689132943Sgshapirowhich shows how SKIP is useful to exempt subnets/subdomains. The 2690132943Sgshapirolast two entries are for checks against ${client_name} if the IP 2691132943Sgshapiroaddress doesn't resolve to a hostname (or is considered as "may be 2692132943Sgshapiroforged"). That is, using square brackets means these are host 2693132943Sgshapironames, not network numbers. 269438032Speter 269564562SgshapiroWarning: if you change the RFC 821 compliant error code from the default 269664562Sgshapirovalue of 550, then you should probably also change the RFC 1893 compliant 269764562Sgshapiroerror code to match it. For example, if you use 269864562Sgshapiro 2699132943Sgshapiro To:user@example.com ERROR:450 mailbox full 270064562Sgshapiro 270190792Sgshapirothe error returned would be "450 5.0.0 mailbox full" which is wrong. 270290792SgshapiroUse "ERROR:4.2.2:450 mailbox full" instead. 270364562Sgshapiro 270464562SgshapiroNote, UUCP users may need to add hostname.UUCP to the access database 270590792Sgshapiroor class {R}. 270664562Sgshapiro 270790792SgshapiroIf you also use: 270890792Sgshapiro 270943730Speter FEATURE(`relay_hosts_only') 271038032Speter 271138032Speterthen the above example will allow relaying for sendmail.org, but not 271238032Speterhosts within the sendmail.org domain. Note that this will also require 271364562Sgshapirohosts listed in class {R} to be fully qualified host names. 271438032Speter 271538032SpeterYou can also use the access database to block sender addresses based on 271638032Speterthe username portion of the address. For example: 271738032Speter 2718132943Sgshapiro From:FREE.STEALTH.MAILER@ ERROR:550 Spam not accepted 271938032Speter 272038032SpeterNote that you must include the @ after the username to signify that 272138032Speterthis database entry is for checking only the username portion of the 272238032Spetersender address. 272338032Speter 272438032SpeterIf you use: 272538032Speter 272643730Speter FEATURE(`blacklist_recipients') 272738032Speter 272838032Speterthen you can add entries to the map for local users, hosts in your 272938032Speterdomains, or addresses in your domain which should not receive mail: 273038032Speter 2731132943Sgshapiro To:badlocaluser@ ERROR:550 Mailbox disabled for badlocaluser 2732132943Sgshapiro To:host.my.TLD ERROR:550 That host does not accept mail 2733132943Sgshapiro To:user@other.my.TLD ERROR:550 Mailbox disabled for this recipient 273438032Speter 2735132943SgshapiroThis would prevent a recipient of badlocaluser in any of the local 2736132943Sgshapirodomains (class {w}), any user at host.my.TLD, and the single address 2737132943Sgshapirouser@other.my.TLD from receiving mail. Please note: a local username 2738132943Sgshapiromust be now tagged with an @ (this is consistent with the check of 2739132943Sgshapirothe sender address, and hence it is possible to distinguish between 2740132943Sgshapirohostnames and usernames). Enabling this feature will keep you from 2741132943Sgshapirosending mails to all addresses that have an error message or REJECT 2742132943Sgshapiroas value part in the access map. Taking the example from above: 274338032Speter 274442575Speter spammer@aol.com REJECT 274542575Speter cyberspammer.com REJECT 274642575Speter 274742575SpeterMail can't be sent to spammer@aol.com or anyone at cyberspammer.com. 2748132943SgshapiroThat's why tagged entries should be used. 274942575Speter 2750159609SgshapiroThere are several DNS based blacklists which can be found by 2751159609Sgshapiroquerying a search engine. These are databases of spammers 275290792Sgshapiromaintained in DNS. To use such a database, specify 275338032Speter 2754159609Sgshapiro FEATURE(`dnsbl', `dnsbl.example.com') 275538032Speter 2756159609SgshapiroThis will cause sendmail to reject mail from any site listed in the 2757168515SgshapiroDNS based blacklist. You must select a DNS based blacklist domain 2758159609Sgshapiroto check by specifying an argument to the FEATURE. The default 2759159609Sgshapiroerror message is 276038032Speter 276198841Sgshapiro Rejected: IP-ADDRESS listed at SERVER 276280785Sgshapiro 276390792Sgshapirowhere IP-ADDRESS and SERVER are replaced by the appropriate 276490792Sgshapiroinformation. A second argument can be used to specify a different 2765168515Sgshapirotext or action. For example, 276671345Sgshapiro 2767168515Sgshapiro FEATURE(`dnsbl', `dnsbl.example.com', `quarantine') 2768168515Sgshapiro 2769168515Sgshapirowould quarantine the message if the client IP address is listed 2770168515Sgshapiroat `dnsbl.example.com'. 2771168515Sgshapiro 2772168515SgshapiroBy default, temporary lookup failures are ignored 2773168515Sgshapiroand hence cause the connection not to be rejected by the DNS based 2774168515Sgshapirorejection list. This behavior can be changed by specifying a third 2775168515Sgshapiroargument, which must be either `t' or a full error message. For 2776168515Sgshapiroexample: 2777168515Sgshapiro 277890792Sgshapiro FEATURE(`dnsbl', `dnsbl.example.com', `', 277990792Sgshapiro `"451 Temporary lookup failure for " $&{client_addr} " in dnsbl.example.com"') 278071345Sgshapiro 278190792SgshapiroIf `t' is used, the error message is: 278290792Sgshapiro 278390792Sgshapiro 451 Temporary lookup failure of IP-ADDRESS at SERVER 278490792Sgshapiro 278590792Sgshapirowhere IP-ADDRESS and SERVER are replaced by the appropriate 278690792Sgshapiroinformation. 278790792Sgshapiro 278890792SgshapiroThis FEATURE can be included several times to query different 2789159609SgshapiroDNS based rejection lists. 279090792Sgshapiro 279190792SgshapiroNotice: to avoid checking your own local domains against those 279290792Sgshapiroblacklists, use the access_db feature and add: 279390792Sgshapiro 279490792Sgshapiro Connect:10.1 OK 279590792Sgshapiro Connect:127.0.0.1 RELAY 279690792Sgshapiro 279790792Sgshapiroto the access map, where 10.1 is your local network. You may 279890792Sgshapirowant to use "RELAY" instead of "OK" to allow also relaying 2799147078Sgshapiroinstead of just disabling the DNS lookups in the blacklists. 280090792Sgshapiro 280190792Sgshapiro 280238032SpeterThe features described above make use of the check_relay, check_mail, 2803110560Sgshapiroand check_rcpt rulesets. Note that check_relay checks the SMTP 2804110560Sgshapiroclient hostname and IP address when the connection is made to your 2805110560Sgshapiroserver. It does not check if a mail message is being relayed to 2806110560Sgshapiroanother server. That check is done in check_rcpt. If you wish to 2807110560Sgshapiroinclude your own checks, you can put your checks in the rulesets 2808110560SgshapiroLocal_check_relay, Local_check_mail, and Local_check_rcpt. For 2809110560Sgshapiroexample if you wanted to block senders with all numeric usernames 2810110560Sgshapiro(i.e. 2312343@bigisp.com), you would use Local_check_mail and the 2811110560Sgshapiroregex map: 281238032Speter 281364562Sgshapiro LOCAL_CONFIG 281464562Sgshapiro Kallnumbers regex -a@MATCH ^[0-9]+$ 281564562Sgshapiro 281664562Sgshapiro LOCAL_RULESETS 281764562Sgshapiro SLocal_check_mail 281864562Sgshapiro # check address against various regex checks 281938032Speter R$* $: $>Parse0 $>3 $1 282064562Sgshapiro R$+ < @ bigisp.com. > $* $: $(allnumbers $1 $) 282164562Sgshapiro R@MATCH $#error $: 553 Header Error 282238032Speter 282338032SpeterThese rules are called with the original arguments of the corresponding 282438032Spetercheck_* ruleset. If the local ruleset returns $#OK, no further checking 2825132943Sgshapirois done by the features described above and the mail is accepted. If 2826132943Sgshapirothe local ruleset resolves to a mailer (such as $#error or $#discard), 2827132943Sgshapirothe appropriate action is taken. Other results starting with $# are 2828132943Sgshapirointerpreted by sendmail and may lead to unspecified behavior. Note: do 2829132943SgshapiroNOT create a mailer with the name OK. Return values that do not start 2830132943Sgshapirowith $# are ignored, i.e., normal processing continues. 283138032Speter 283264562SgshapiroDelay all checks 283390792Sgshapiro---------------- 283464562Sgshapiro 283564562SgshapiroBy using FEATURE(`delay_checks') the rulesets check_mail and check_relay 283664562Sgshapirowill not be called when a client connects or issues a MAIL command, 283764562Sgshapirorespectively. Instead, those rulesets will be called by the check_rcpt 283864562Sgshapiroruleset; they will be skipped if a sender has been authenticated using 283964562Sgshapiroa "trusted" mechanism, i.e., one that is defined via TRUST_AUTH_MECH(). 284064562SgshapiroIf check_mail returns an error then the RCPT TO command will be rejected 284164562Sgshapirowith that error. If it returns some other result starting with $# then 284264562Sgshapirocheck_relay will be skipped. If the sender address (or a part of it) is 284364562Sgshapirolisted in the access map and it has a RHS of OK or RELAY, then check_relay 284464562Sgshapirowill be skipped. This has an interesting side effect: if your domain is 284564562Sgshapiromy.domain and you have 284664562Sgshapiro 284764562Sgshapiro my.domain RELAY 284864562Sgshapiro 2849125820Sgshapiroin the access map, then any e-mail with a sender address of 2850125820Sgshapiro<user@my.domain> will not be rejected by check_relay even though 2851125820Sgshapiroit would match the hostname or IP address. This allows spammers 285264562Sgshapiroto get around DNS based blacklist by faking the sender address. To 285364562Sgshapiroavoid this problem you have to use tagged entries: 285464562Sgshapiro 285564562Sgshapiro To:my.domain RELAY 285664562Sgshapiro Connect:my.domain RELAY 285764562Sgshapiro 285864562Sgshapiroif you need those entries at all (class {R} may take care of them). 285973188Sgshapiro 286064562SgshapiroFEATURE(`delay_checks') can take an optional argument: 286164562Sgshapiro 286264562Sgshapiro FEATURE(`delay_checks', `friend') 286364562Sgshapiro enables spamfriend test 286464562Sgshapiro FEATURE(`delay_checks', `hater') 286564562Sgshapiro enables spamhater test 286664562Sgshapiro 286794334SgshapiroIf such an argument is given, the recipient will be looked up in the 286894334Sgshapiroaccess map (using the tag Spam:). If the argument is `friend', then 286994334Sgshapirothe default behavior is to apply the other rulesets and make a SPAM 287094334Sgshapirofriend the exception. The rulesets check_mail and check_relay will be 287194334Sgshapiroskipped only if the recipient address is found and has RHS FRIEND. If 287294334Sgshapirothe argument is `hater', then the default behavior is to skip the rulesets 287394334Sgshapirocheck_mail and check_relay and make a SPAM hater the exception. The 287494334Sgshapiroother two rulesets will be applied only if the recipient address is 287594334Sgshapirofound and has RHS HATER. 287664562Sgshapiro 287764562SgshapiroThis allows for simple exceptions from the tests, e.g., by activating 287890792Sgshapirothe friend option and having 287964562Sgshapiro 288090792Sgshapiro Spam:abuse@ FRIEND 288164562Sgshapiro 2882110560Sgshapiroin the access map, mail to abuse@localdomain will get through (where 2883110560Sgshapiro"localdomain" is any domain in class {w}). It is also possible to 2884110560Sgshapirospecify a full address or an address with +detail: 288564562Sgshapiro 288690792Sgshapiro Spam:abuse@my.domain FRIEND 288790792Sgshapiro Spam:me+abuse@ FRIEND 288890792Sgshapiro Spam:spam.domain FRIEND 288964562Sgshapiro 289090792SgshapiroNote: The required tag has been changed in 8.12 from To: to Spam:. 289190792SgshapiroThis change is incompatible to previous versions. However, you can 289290792Sgshapiro(for now) simply add the new entries to the access map, the old 289390792Sgshapiroones will be ignored. As soon as you removed the old entries from 289490792Sgshapirothe access map, specify a third parameter (`n') to this feature and 289590792Sgshapirothe backward compatibility rules will not be in the generated .cf 289690792Sgshapirofile. 289764562Sgshapiro 289864562SgshapiroHeader Checks 289990792Sgshapiro------------- 290064562Sgshapiro 290138032SpeterYou can also reject mail on the basis of the contents of headers. 290238032SpeterThis is done by adding a ruleset call to the 'H' header definition command 290338032Speterin sendmail.cf. For example, this can be used to check the validity of 290438032Spetera Message-ID: header: 290538032Speter 2906110560Sgshapiro LOCAL_CONFIG 290738032Speter HMessage-Id: $>CheckMessageId 290838032Speter 2909110560Sgshapiro LOCAL_RULESETS 291038032Speter SCheckMessageId 291138032Speter R< $+ @ $+ > $@ OK 291238032Speter R$* $#error $: 553 Header Error 291338032Speter 291464562SgshapiroThe alternative format: 291538032Speter 291664562Sgshapiro HSubject: $>+CheckSubject 291742575Speter 291864562Sgshapirothat is, $>+ instead of $>, gives the full Subject: header including 291964562Sgshapirocomments to the ruleset (comments in parentheses () are stripped 292064562Sgshapiroby default). 292142575Speter 292264562SgshapiroA default ruleset for headers which don't have a specific ruleset 292364562Sgshapirodefined for them can be given by: 292442575Speter 292564562Sgshapiro H*: $>CheckHdr 292643730Speter 292790792SgshapiroNotice: 292890792Sgshapiro1. All rules act on tokens as explained in doc/op/op.{me,ps,txt}. 292973188SgshapiroThat may cause problems with simple header checks due to the 293090792Sgshapirotokenization. It might be simpler to use a regex map and apply it 293173188Sgshapiroto $&{currHeader}. 293290792Sgshapiro2. There are no default rulesets coming with this distribution of 2933157001Sgshapirosendmail. You can write your own, can search the WWW for examples, 2934157001Sgshapiroor take a look at cf/cf/knecht.mc. 2935157001Sgshapiro3. When using a default ruleset for headers, the name of the header 2936132943Sgshapirocurrently being checked can be found in the $&{hdr_name} macro. 293773188Sgshapiro 293864562SgshapiroAfter all of the headers are read, the check_eoh ruleset will be called for 293964562Sgshapiroany final header-related checks. The ruleset is called with the number of 294064562Sgshapiroheaders and the size of all of the headers in bytes separated by $|. One 294164562Sgshapiroexample usage is to reject messages which do not have a Message-Id: 294264562Sgshapiroheader. However, the Message-Id: header is *NOT* a required header and is 294364562Sgshapironot a guaranteed spam indicator. This ruleset is an example and should 294464562Sgshapiroprobably not be used in production. 294564562Sgshapiro 294664562Sgshapiro LOCAL_CONFIG 294764562Sgshapiro Kstorage macro 2948110560Sgshapiro HMessage-Id: $>CheckMessageId 294964562Sgshapiro 295064562Sgshapiro LOCAL_RULESETS 295164562Sgshapiro SCheckMessageId 295264562Sgshapiro # Record the presence of the header 295364562Sgshapiro R$* $: $(storage {MessageIdCheck} $@ OK $) $1 295464562Sgshapiro R< $+ @ $+ > $@ OK 295564562Sgshapiro R$* $#error $: 553 Header Error 295664562Sgshapiro 295764562Sgshapiro Scheck_eoh 295864562Sgshapiro # Check the macro 295964562Sgshapiro R$* $: < $&{MessageIdCheck} > 296064562Sgshapiro # Clear the macro for the next message 296164562Sgshapiro R$* $: $(storage {MessageIdCheck} $) $1 296264562Sgshapiro # Has a Message-Id: header 296364562Sgshapiro R< $+ > $@ OK 296464562Sgshapiro # Allow missing Message-Id: from local mail 296564562Sgshapiro R$* $: < $&{client_name} > 296664562Sgshapiro R< > $@ OK 296764562Sgshapiro R< $=w > $@ OK 296864562Sgshapiro # Otherwise, reject the mail 296964562Sgshapiro R$* $#error $: 553 Header Error 297064562Sgshapiro 2971132943Sgshapiro 2972132943Sgshapiro+--------------------+ 2973132943Sgshapiro| CONNECTION CONTROL | 2974132943Sgshapiro+--------------------+ 2975132943Sgshapiro 2976132943SgshapiroThe features ratecontrol and conncontrol allow to establish connection 2977132943Sgshapirolimits per client IP address or net. These features can limit the 2978132943Sgshapirorate of connections (connections per time unit) or the number of 2979132943Sgshapiroincoming SMTP connections, respectively. If enabled, appropriate 2980132943Sgshapirorulesets are called at the end of check_relay, i.e., after DNS 2981132943Sgshapiroblacklists and generic access_db operations. The features require 2982132943SgshapiroFEATURE(`access_db') to be listed earlier in the mc file. 2983132943Sgshapiro 2984132943SgshapiroNote: FEATURE(`delay_checks') delays those connection control checks 2985132943Sgshapiroafter a recipient address has been received, hence making these 2986132943Sgshapiroconnection control features less useful. To run the checks as early 2987132943Sgshapiroas possible, specify the parameter `nodelay', e.g., 2988132943Sgshapiro 2989132943Sgshapiro FEATURE(`ratecontrol', `nodelay') 2990132943Sgshapiro 2991132943SgshapiroIn that case, FEATURE(`delay_checks') has no effect on connection 2992132943Sgshapirocontrol (and it must be specified earlier in the mc file). 2993132943Sgshapiro 2994132943SgshapiroAn optional second argument `terminate' specifies whether the 2995132943Sgshapirorulesets should return the error code 421 which will cause 2996132943Sgshapirosendmail to terminate the session with that error if it is 2997132943Sgshapiroreturned from check_relay, i.e., not delayed as explained in 2998132943Sgshapirothe previous paragraph. Example: 2999132943Sgshapiro 3000132943Sgshapiro FEATURE(`ratecontrol', `nodelay', `terminate') 3001132943Sgshapiro 3002132943Sgshapiro 300366494Sgshapiro+----------+ 300466494Sgshapiro| STARTTLS | 300566494Sgshapiro+----------+ 300664562Sgshapiro 3007147078SgshapiroIn this text, cert will be used as an abbreviation for X.509 certificate, 300890792SgshapiroDN (CN) is the distinguished (common) name of a cert, and CA is a 300990792Sgshapirocertification authority, which signs (issues) certs. 301064562Sgshapiro 301180785SgshapiroFor STARTTLS to be offered by sendmail you need to set at least 3012147078Sgshapirothese variables (the file names and paths are just examples): 301380785Sgshapiro 301480785Sgshapiro define(`confCACERT_PATH', `/etc/mail/certs/') 301580785Sgshapiro define(`confCACERT', `/etc/mail/certs/CA.cert.pem') 301680785Sgshapiro define(`confSERVER_CERT', `/etc/mail/certs/my.cert.pem') 301780785Sgshapiro define(`confSERVER_KEY', `/etc/mail/certs/my.key.pem') 301880785Sgshapiro 301980785SgshapiroOn systems which do not have the compile flag HASURANDOM set (see 302080785Sgshapirosendmail/README) you also must set confRAND_FILE. 302180785Sgshapiro 302290792SgshapiroSee doc/op/op.{me,ps,txt} for more information about these options, 302390792Sgshapiroespecially the sections ``Certificates for STARTTLS'' and ``PRNG for 302480785SgshapiroSTARTTLS''. 302580785Sgshapiro 302664562SgshapiroMacros related to STARTTLS are: 302764562Sgshapiro 302864562Sgshapiro${cert_issuer} holds the DN of the CA (the cert issuer). 302964562Sgshapiro${cert_subject} holds the DN of the cert (called the cert subject). 303090792Sgshapiro${cn_issuer} holds the CN of the CA (the cert issuer). 303190792Sgshapiro${cn_subject} holds the CN of the cert (called the cert subject). 303264562Sgshapiro${tls_version} the TLS/SSL version used for the connection, e.g., TLSv1, 303390792Sgshapiro TLSv1/SSLv3, SSLv3, SSLv2. 303464562Sgshapiro${cipher} the cipher used for the connection, e.g., EDH-DSS-DES-CBC3-SHA, 303564562Sgshapiro EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA. 303664562Sgshapiro${cipher_bits} the keylength (in bits) of the symmetric encryption algorithm 303764562Sgshapiro used for the connection. 303890792Sgshapiro${verify} holds the result of the verification of the presented cert. 303990792Sgshapiro Possible values are: 304090792Sgshapiro OK verification succeeded. 304190792Sgshapiro NO no cert presented. 304290792Sgshapiro NOT no cert requested. 304390792Sgshapiro FAIL cert presented but could not be verified, 304490792Sgshapiro e.g., the cert of the signing CA is missing. 304590792Sgshapiro NONE STARTTLS has not been performed. 304690792Sgshapiro TEMP temporary error occurred. 304790792Sgshapiro PROTOCOL protocol error occurred (SMTP level). 304864562Sgshapiro SOFTWARE STARTTLS handshake failed. 304990792Sgshapiro${server_name} the name of the server of the current outgoing SMTP 305064562Sgshapiro connection. 305190792Sgshapiro${server_addr} the address of the server of the current outgoing SMTP 305264562Sgshapiro connection. 305364562Sgshapiro 305464562SgshapiroRelaying 305590792Sgshapiro-------- 305664562Sgshapiro 3057110560SgshapiroSMTP STARTTLS can allow relaying for remote SMTP clients which have 3058120256Sgshapirosuccessfully authenticated themselves. If the verification of the cert 3059120256Sgshapirofailed (${verify} != OK), relaying is subject to the usual rules. 3060120256SgshapiroOtherwise the DN of the issuer is looked up in the access map using the 3061120256Sgshapirotag CERTISSUER. If the resulting value is RELAY, relaying is allowed. 3062120256SgshapiroIf it is SUBJECT, the DN of the cert subject is looked up next in the 3063120256Sgshapiroaccess map using the tag CERTSUBJECT. If the value is RELAY, relaying 3064120256Sgshapirois allowed. 3065110560Sgshapiro 3066132943SgshapiroTo make things a bit more flexible (or complicated), the values for 306764562Sgshapiro${cert_issuer} and ${cert_subject} can be optionally modified by regular 306864562Sgshapiroexpressions defined in the m4 variables _CERT_REGEX_ISSUER_ and 306990792Sgshapiro_CERT_REGEX_SUBJECT_, respectively. To avoid problems with those macros in 307064562Sgshapirorulesets and map lookups, they are modified as follows: each non-printable 3071110560Sgshapirocharacter and the characters '<', '>', '(', ')', '"', '+', ' ' are replaced 3072110560Sgshapiroby their HEX value with a leading '+'. For example: 307364562Sgshapiro 307464562Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/Email= 307564562Sgshapirodarth+cert@endmail.org 307664562Sgshapiro 307764562Sgshapirois encoded as: 307864562Sgshapiro 307964562Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN= 308064562SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 308164562Sgshapiro 308264562Sgshapiro(line breaks have been inserted for readability). 308364562Sgshapiro 3084110560SgshapiroThe macros which are subject to this encoding are ${cert_subject}, 3085110560Sgshapiro${cert_issuer}, ${cn_subject}, and ${cn_issuer}. 3086110560Sgshapiro 308790792SgshapiroExamples: 308890792Sgshapiro 308990792SgshapiroTo allow relaying for everyone who can present a cert signed by 309090792Sgshapiro 309190792Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN= 309290792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 309390792Sgshapiro 309490792Sgshapirosimply use: 309590792Sgshapiro 3096110560SgshapiroCertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN= 309790792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org RELAY 309890792Sgshapiro 309990792SgshapiroTo allow relaying only for a subset of machines that have a cert signed by 310090792Sgshapiro 310190792Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN= 310290792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 310390792Sgshapiro 310490792Sgshapirouse: 310590792Sgshapiro 3106110560SgshapiroCertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN= 310790792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org SUBJECT 3108110560SgshapiroCertSubject:/C=US/ST=California/O=endmail.org/OU=private/CN= 310990792SgshapiroDeathStar/Email=deathstar@endmail.org RELAY 311090792Sgshapiro 3111132943SgshapiroNotes: 3112132943Sgshapiro- line breaks have been inserted after "CN=" for readability, 3113132943Sgshapiro each tagged entry must be one (long) line in the access map. 3114132943Sgshapiro- if OpenSSL 0.9.7 or newer is used then the "Email=" part of a DN 3115132943Sgshapiro is replaced by "emailAddress=". 311690792Sgshapiro 311790792SgshapiroOf course it is also possible to write a simple ruleset that allows 311864562Sgshapirorelaying for everyone who can present a cert that can be verified, e.g., 311964562Sgshapiro 312064562SgshapiroLOCAL_RULESETS 312164562SgshapiroSLocal_check_rcpt 312264562SgshapiroR$* $: $&{verify} 312364562SgshapiroROK $# OK 312464562Sgshapiro 312564562SgshapiroAllowing Connections 312690792Sgshapiro-------------------- 312764562Sgshapiro 312890792SgshapiroThe rulesets tls_server, tls_client, and tls_rcpt are used to decide whether 312990792Sgshapiroan SMTP connection is accepted (or should continue). 313064562Sgshapiro 313164562Sgshapirotls_server is called when sendmail acts as client after a STARTTLS command 313290792Sgshapiro(should) have been issued. The parameter is the value of ${verify}. 313364562Sgshapiro 313464562Sgshapirotls_client is called when sendmail acts as server, after a STARTTLS command 313590792Sgshapirohas been issued, and from check_mail. The parameter is the value of 313664562Sgshapiro${verify} and STARTTLS or MAIL, respectively. 313764562Sgshapiro 313890792SgshapiroBoth rulesets behave the same. If no access map is in use, the connection 313964562Sgshapirowill be accepted unless ${verify} is SOFTWARE, in which case the connection 314090792Sgshapirois always aborted. For tls_server/tls_client, ${client_name}/${server_name} 314190792Sgshapirois looked up in the access map using the tag TLS_Srv/TLS_Clt, which is done 314290792Sgshapirowith the ruleset LookUpDomain. If no entry is found, ${client_addr} 314364562Sgshapiro(${server_addr}) is looked up in the access map (same tag, ruleset 314490792SgshapiroLookUpAddr). If this doesn't result in an entry either, just the tag is 314590792Sgshapirolooked up in the access map (included the trailing colon). Notice: 314690792Sgshapirorequiring that e-mail is sent to a server only encrypted, e.g., via 314764562Sgshapiro 314890792SgshapiroTLS_Srv:secure.domain ENCR:112 314990792Sgshapiro 315090792Sgshapirodoesn't necessarily mean that e-mail sent to that domain is encrypted. 315190792SgshapiroIf the domain has multiple MX servers, e.g., 315290792Sgshapiro 315390792Sgshapirosecure.domain. IN MX 10 mail.secure.domain. 315490792Sgshapirosecure.domain. IN MX 50 mail.other.domain. 315590792Sgshapiro 315690792Sgshapirothen mail to user@secure.domain may go unencrypted to mail.other.domain. 315790792Sgshapirotls_rcpt can be used to address this problem. 315890792Sgshapiro 315990792Sgshapirotls_rcpt is called before a RCPT TO: command is sent. The parameter is the 316090792Sgshapirocurrent recipient. This ruleset is only defined if FEATURE(`access_db') 316190792Sgshapirois selected. A recipient address user@domain is looked up in the access 316290792Sgshapiromap in four formats: TLS_Rcpt:user@domain, TLS_Rcpt:user@, TLS_Rcpt:domain, 316390792Sgshapiroand TLS_Rcpt:; the first match is taken. 316490792Sgshapiro 316590792SgshapiroThe result of the lookups is then used to call the ruleset TLS_connection, 316690792Sgshapirowhich checks the requirement specified by the RHS in the access map against 316790792Sgshapirothe actual parameters of the current TLS connection, esp. ${verify} and 316890792Sgshapiro${cipher_bits}. Legal RHSs in the access map are: 316990792Sgshapiro 317064562SgshapiroVERIFY verification must have succeeded 317164562SgshapiroVERIFY:bits verification must have succeeded and ${cipher_bits} must 317264562Sgshapiro be greater than or equal bits. 317364562SgshapiroENCR:bits ${cipher_bits} must be greater than or equal bits. 317464562Sgshapiro 317564562SgshapiroThe RHS can optionally be prefixed by TEMP+ or PERM+ to select a temporary 317690792Sgshapiroor permanent error. The default is a temporary error code (403 4.7.0) 317764562Sgshapirounless the macro TLS_PERM_ERR is set during generation of the .cf file. 317864562Sgshapiro 317964562SgshapiroIf a certain level of encryption is required, then it might also be 318064562Sgshapiropossible that this level is provided by the security layer from a SASL 318164562Sgshapiroalgorithm, e.g., DIGEST-MD5. 318264562Sgshapiro 318390792SgshapiroFurthermore, there can be a list of extensions added. Such a list 318490792Sgshapirostarts with '+' and the items are separated by '++'. Allowed 318590792Sgshapiroextensions are: 318690792Sgshapiro 318790792SgshapiroCN:name name must match ${cn_subject} 3188203004SgshapiroCN ${client_name}/${server_name} must match ${cn_subject} 318990792SgshapiroCS:name name must match ${cert_subject} 319090792SgshapiroCI:name name must match ${cert_issuer} 319190792Sgshapiro 319282017SgshapiroExample: e-mail sent to secure.example.com should only use an encrypted 319390792Sgshapiroconnection. E-mail received from hosts within the laptop.example.com domain 319490792Sgshapiroshould only be accepted if they have been authenticated. The host which 319590792Sgshapiroreceives e-mail for darth@endmail.org must present a cert that uses the 319690792SgshapiroCN smtp.endmail.org. 319790792Sgshapiro 319864562SgshapiroTLS_Srv:secure.example.com ENCR:112 319964562SgshapiroTLS_Clt:laptop.example.com PERM+VERIFY:112 320090792SgshapiroTLS_Rcpt:darth@endmail.org ENCR:112+CN:smtp.endmail.org 320164562Sgshapiro 320273188Sgshapiro 3203285229SgshapiroTLS Options per Session 3204285229Sgshapiro----------------------- 320573188Sgshapiro 320690792SgshapiroBy default STARTTLS is used whenever possible. However, there are 3207285229SgshapiroMTAs with STARTTLS interoperability issues. To be able to send to 3208285229Sgshapiro(or receive from) those MTAs several features are available: 320973188Sgshapiro 3210285229Sgshapiro1) Various TLS options be be set per IP/domain. 3211285229Sgshapiro2) STARTTLS can be turned off for specific IP addresses/domains. 3212285229Sgshapiro 3213285229SgshapiroAbout 1): the rulesets tls_srv_features and tls_clt_features can 3214285229Sgshapirobe used to return a (semicolon separated) list of TLS related 3215285229Sgshapirooptions: 3216285229Sgshapiro 3217285229Sgshapiro- Options: compare {Server,Client}SSLOptions. 3218285229Sgshapiro- CipherList: same as the global option. 3219285229Sgshapiro- CertFile, KeyFile: {Server,Client}{Cert,Key}File 3220285229Sgshapiro 3221285229SgshapiroIf FEATURE(`tls_session_features') is used, then default rulesets 3222285229Sgshapiroare activated which look up entries in the access map with the tags 3223285229SgshapiroTLS_Srv_features and TLS_Clt_features, respectively. 3224285229SgshapiroFor example, these entries: 3225285229Sgshapiro 3226285229Sgshapiro TLS_Srv_features:10.0.2.4 CipherList=MEDIUM+aRSA; 3227285229Sgshapiro TLS_Clt_features:10.1.0.1 Options=SSL_OP_NO_TLSv1_2; CipherList=ALL:-EXPORT 3228285229Sgshapiro 3229285229Sgshapirospecify a cipherlist with MEDIUM strength ciphers that use RSA 3230285229Sgshapirocertificates only for the client with the IP address 10.0.2.4, 3231285229Sgshapiroand turn off TLSv1.2 when connecting to the server with the IP 3232285229Sgshapiroaddress 10.1.0.1 as well as setting a specific cipherlist. 3233285229SgshapiroIf FEATURE(`tls_session_features') is not used the user can provide 3234285229Sgshapirotheir own rulesets which must return the appropriate data. 3235285229SgshapiroIf the rulesets are not defined or do not return a value, the 3236285229Sgshapirodefault TLS options are not modified. 3237285229Sgshapiro(These rulesets require the sendmail binary to be built with 3238285229Sgshapiro_FFR_TLS_SE_OPTS enabled.) 3239285229Sgshapiro 3240285229SgshapiroAbout 2): the ruleset try_tls (srv_features) can be used that work 3241285229Sgshapirotogether with the access map. Entries for the access map must be 3242285229Sgshapirotagged with Try_TLS (Srv_Features) and refer to the hostname or IP 3243285229Sgshapiroaddress of the connecting system. A default case can be specified 3244285229Sgshapiroby using just the tag. For example, the following entries in the 3245285229Sgshapiroaccess map: 3246285229Sgshapiro 324790792Sgshapiro Try_TLS:broken.server NO 324890792Sgshapiro Srv_Features:my.domain v 324990792Sgshapiro Srv_Features: V 325073188Sgshapiro 325190792Sgshapirowill turn off STARTTLS when sending to broken.server (or any host 325290792Sgshapiroin that domain), and request a client certificate during the TLS 325390792Sgshapirohandshake only for hosts in my.domain. The valid entries on the RHS 325490792Sgshapirofor Srv_Features are listed in the Sendmail Installation and 325590792SgshapiroOperations Guide. 325673188Sgshapiro 325773188Sgshapiro 325864562SgshapiroReceived: Header 325990792Sgshapiro---------------- 326064562Sgshapiro 326190792SgshapiroThe Received: header reveals whether STARTTLS has been used. It contains an 326264562Sgshapiroextra line: 326364562Sgshapiro 326490792Sgshapiro(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify}) 326564562Sgshapiro 326690792Sgshapiro 326766494Sgshapiro+---------------------+ 326866494Sgshapiro| SMTP AUTHENTICATION | 326966494Sgshapiro+---------------------+ 327064562Sgshapiro 327164562SgshapiroThe macros ${auth_authen}, ${auth_author}, and ${auth_type} can be 327264562Sgshapiroused in anti-relay rulesets to allow relaying for those users that 327364562Sgshapiroauthenticated themselves. A very simple example is: 327464562Sgshapiro 327564562SgshapiroSLocal_check_rcpt 327664562SgshapiroR$* $: $&{auth_type} 327764562SgshapiroR$+ $# OK 327864562Sgshapiro 327964562Sgshapirowhich checks whether a user has successfully authenticated using 3280132943Sgshapiroany available mechanism. Depending on the setup of the Cyrus SASL 328164562Sgshapirolibrary, more sophisticated rulesets might be required, e.g., 328264562Sgshapiro 328364562SgshapiroSLocal_check_rcpt 328464562SgshapiroR$* $: $&{auth_type} $| $&{auth_authen} 328564562SgshapiroRDIGEST-MD5 $| $+@$=w $# OK 328664562Sgshapiro 328764562Sgshapiroto allow relaying for users that authenticated using DIGEST-MD5 328864562Sgshapiroand have an identity in the local domains. 328964562Sgshapiro 329090792SgshapiroThe ruleset trust_auth is used to determine whether a given AUTH= 329164562Sgshapiroparameter (that is passed to this ruleset) should be trusted. This 329264562Sgshapiroruleset may make use of the other ${auth_*} macros. Only if the 329364562Sgshapiroruleset resolves to the error mailer, the AUTH= parameter is not 329464562Sgshapirotrusted. A user supplied ruleset Local_trust_auth can be written 329564562Sgshapiroto modify the default behavior, which only trust the AUTH= 329664562Sgshapiroparameter if it is identical to the authenticated user. 329764562Sgshapiro 329864562SgshapiroPer default, relaying is allowed for any user who authenticated 329964562Sgshapirovia a "trusted" mechanism, i.e., one that is defined via 330064562SgshapiroTRUST_AUTH_MECH(`list of mechanisms') 330171345SgshapiroFor example: 330271345SgshapiroTRUST_AUTH_MECH(`KERBEROS_V4 DIGEST-MD5') 330364562Sgshapiro 330464562SgshapiroIf the selected mechanism provides a security layer the number of 330564562Sgshapirobits used for the key of the symmetric cipher is stored in the 330664562Sgshapiromacro ${auth_ssf}. 330764562Sgshapiro 3308132943SgshapiroProviding SMTP AUTH Data when sendmail acts as Client 3309132943Sgshapiro----------------------------------------------------- 3310132943Sgshapiro 331190792SgshapiroIf sendmail acts as client, it needs some information how to 331290792Sgshapiroauthenticate against another MTA. This information can be provided 331390792Sgshapiroby the ruleset authinfo or by the option DefaultAuthInfo. The 331490792Sgshapiroauthinfo ruleset looks up {server_name} using the tag AuthInfo: in 331590792Sgshapirothe access map. If no entry is found, {server_addr} is looked up 331690792Sgshapiroin the same way and finally just the tag AuthInfo: to provide 3317111823Sgshapirodefault values. Note: searches for domain parts or IP nets are 3318111823Sgshapiroonly performed if the access map is used; if the authinfo feature 3319111823Sgshapirois used then only up to three lookups are performed (two exact 3320111823Sgshapiromatches, one default). 332190792Sgshapiro 3322132943SgshapiroNote: If your daemon does client authentication when sending, and 3323132943Sgshapiroif it uses either PLAIN or LOGIN authentication, then you *must* 3324132943Sgshapiroprevent ordinary users from seeing verbose output. Do NOT install 3325132943Sgshapirosendmail set-user-ID. Use PrivacyOptions to turn off verbose output 3326132943Sgshapiro("goaway" works for this). 3327132943Sgshapiro 332890792SgshapiroNotice: the default configuration file causes the option DefaultAuthInfo 332990792Sgshapiroto fail since the ruleset authinfo is in the .cf file. If you really 333090792Sgshapirowant to use DefaultAuthInfo (it is deprecated) then you have to 333190792Sgshapiroremove the ruleset. 333290792Sgshapiro 333390792SgshapiroThe RHS for an AuthInfo: entry in the access map should consists of a 333490792Sgshapirolist of tokens, each of which has the form: "TDstring" (including 333590792Sgshapirothe quotes). T is a tag which describes the item, D is a delimiter, 333690792Sgshapiroeither ':' for simple text or '=' for a base64 encoded string. 333790792SgshapiroValid values for the tag are: 333890792Sgshapiro 333990792Sgshapiro U user (authorization) id 334090792Sgshapiro I authentication id 334190792Sgshapiro P password 334290792Sgshapiro R realm 334390792Sgshapiro M list of mechanisms delimited by spaces 334490792Sgshapiro 334590792SgshapiroExample entries are: 334690792Sgshapiro 334790792SgshapiroAuthInfo:other.dom "U:user" "I:user" "P:secret" "R:other.dom" "M:DIGEST-MD5" 3348111823SgshapiroAuthInfo:host.more.dom "U:user" "P=c2VjcmV0" 334990792Sgshapiro 3350111823SgshapiroUser id or authentication id must exist as well as the password. All 335190792Sgshapiroother entries have default values. If one of user or authentication 335290792Sgshapiroid is missing, the existing value is used for the missing item. 335390792SgshapiroIf "R:" is not specified, realm defaults to $j. The list of mechanisms 335490792Sgshapirodefaults to those specified by AuthMechanisms. 335590792Sgshapiro 335690792SgshapiroSince this map contains sensitive information, either the access 335790792Sgshapiromap must be unreadable by everyone but root (or the trusted user) 335890792Sgshapiroor FEATURE(`authinfo') must be used which provides a separate map. 335990792SgshapiroNotice: It is not checked whether the map is actually 336090792Sgshapirogroup/world-unreadable, this is left to the user. 336190792Sgshapiro 336264562Sgshapiro+--------------------------------+ 336338032Speter| ADDING NEW MAILERS OR RULESETS | 336438032Speter+--------------------------------+ 336538032Speter 336638032SpeterSometimes you may need to add entirely new mailers or rulesets. They 336738032Spetershould be introduced with the constructs MAILER_DEFINITIONS and 336838032SpeterLOCAL_RULESETS respectively. For example: 336938032Speter 337038032Speter MAILER_DEFINITIONS 337138032Speter Mmymailer, ... 337238032Speter ... 337338032Speter 337438032Speter LOCAL_RULESETS 337538032Speter Smyruleset 337638032Speter ... 337738032Speter 337890792SgshapiroLocal additions for the rulesets srv_features, try_tls, tls_rcpt, 337990792Sgshapirotls_client, and tls_server can be made using LOCAL_SRV_FEATURES, 338090792SgshapiroLOCAL_TRY_TLS, LOCAL_TLS_RCPT, LOCAL_TLS_CLIENT, and LOCAL_TLS_SERVER, 338190792Sgshapirorespectively. For example, to add a local ruleset that decides 338290792Sgshapirowhether to try STARTTLS in a sendmail client, use: 338338032Speter 338490792Sgshapiro LOCAL_TRY_TLS 338590792Sgshapiro R... 338690792Sgshapiro 338790792SgshapiroNote: you don't need to add a name for the ruleset, it is implicitly 338890792Sgshapirodefined by using the appropriate macro. 338990792Sgshapiro 339090792Sgshapiro 339171345Sgshapiro+-------------------------+ 339271345Sgshapiro| ADDING NEW MAIL FILTERS | 339371345Sgshapiro+-------------------------+ 339464562Sgshapiro 339564562SgshapiroSendmail supports mail filters to filter incoming SMTP messages according 339664562Sgshapiroto the "Sendmail Mail Filter API" documentation. These filters can be 339764562Sgshapiroconfigured in your mc file using the two commands: 339864562Sgshapiro 339964562Sgshapiro MAIL_FILTER(`name', `equates') 340064562Sgshapiro INPUT_MAIL_FILTER(`name', `equates') 340164562Sgshapiro 340264562SgshapiroThe first command, MAIL_FILTER(), simply defines a filter with the given 340364562Sgshapironame and equates. For example: 340464562Sgshapiro 340564562Sgshapiro MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 340664562Sgshapiro 340764562SgshapiroThis creates the equivalent sendmail.cf entry: 340864562Sgshapiro 340964562Sgshapiro Xarchive, S=local:/var/run/archivesock, F=R 341064562Sgshapiro 341164562SgshapiroThe INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER 341264562Sgshapirobut also populates the m4 variable `confINPUT_MAIL_FILTERS' with the name 341364562Sgshapiroof the filter such that the filter will actually be called by sendmail. 341464562Sgshapiro 341564562SgshapiroFor example, the two commands: 341664562Sgshapiro 341764562Sgshapiro INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 341864562Sgshapiro INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T') 341964562Sgshapiro 342064562Sgshapiroare equivalent to the three commands: 342164562Sgshapiro 342264562Sgshapiro MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 342364562Sgshapiro MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T') 342464562Sgshapiro define(`confINPUT_MAIL_FILTERS', `archive, spamcheck') 342564562Sgshapiro 342664562SgshapiroIn general, INPUT_MAIL_FILTER() should be used unless you need to define 342764562Sgshapiromore filters than you want to use for `confINPUT_MAIL_FILTERS'. 342864562Sgshapiro 342964562SgshapiroNote that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER() 343064562Sgshapirocommands will clear the list created by the prior INPUT_MAIL_FILTER() 343164562Sgshapirocommands. 343264562Sgshapiro 343364562Sgshapiro 343490792Sgshapiro+-------------------------+ 343590792Sgshapiro| QUEUE GROUP DEFINITIONS | 343690792Sgshapiro+-------------------------+ 343790792Sgshapiro 343890792SgshapiroIn addition to the queue directory (which is the default queue group 343990792Sgshapirocalled "mqueue"), sendmail can deal with multiple queue groups, which 344090792Sgshapiroare collections of queue directories with the same behaviour. Queue 344190792Sgshapirogroups can be defined using the command: 344290792Sgshapiro 344390792Sgshapiro QUEUE_GROUP(`name', `equates') 344490792Sgshapiro 344590792SgshapiroFor details about queue groups, please see doc/op/op.{me,ps,txt}. 344690792Sgshapiro 344738032Speter+-------------------------------+ 344838032Speter| NON-SMTP BASED CONFIGURATIONS | 344938032Speter+-------------------------------+ 345038032Speter 345164562SgshapiroThese configuration files are designed primarily for use by 345264562SgshapiroSMTP-based sites. They may not be well tuned for UUCP-only or 345338032SpeterUUCP-primarily nodes (the latter is defined as a small local net 345464562Sgshapiroconnected to the rest of the world via UUCP). However, there is 345564562Sgshapiroone hook to handle some special cases. 345638032Speter 345738032SpeterYou can define a ``smart host'' that understands a richer address syntax 345838032Speterusing: 345938032Speter 346043730Speter define(`SMART_HOST', `mailer:hostname') 346138032Speter 346238032SpeterIn this case, the ``mailer:'' defaults to "relay". Any messages that 346338032Spetercan't be handled using the usual UUCP rules are passed to this host. 346438032Speter 346538032SpeterIf you are on a local SMTP-based net that connects to the outside 346638032Speterworld via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules. 346738032SpeterFor example: 346838032Speter 346964562Sgshapiro define(`SMART_HOST', `uucp-new:uunet') 347038032Speter LOCAL_NET_CONFIG 347138032Speter R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 347238032Speter 347394334SgshapiroThis will cause all names that end in your domain name ($m) to be sent 347494334Sgshapirovia SMTP; anything else will be sent via uucp-new (smart UUCP) to uunet. 347543730SpeterIf you have FEATURE(`nocanonify'), you may need to omit the dots after 347638032Speterthe $m. If you are running a local DNS inside your domain which is 347738032Speternot otherwise connected to the outside world, you probably want to 347838032Speteruse: 347938032Speter 348043730Speter define(`SMART_HOST', `smtp:fire.wall.com') 348138032Speter LOCAL_NET_CONFIG 348238032Speter R$* < @ $* . > $* $#smtp $@ $2. $: $1 < @ $2. > $3 348338032Speter 348438032SpeterThat is, send directly only to things you found in your DNS lookup; 348538032Speteranything else goes through SMART_HOST. 348638032Speter 348738032SpeterYou may need to turn off the anti-spam rules in order to accept 348843730SpeterUUCP mail with FEATURE(`promiscuous_relay') and 348943730SpeterFEATURE(`accept_unresolvable_domains'). 349038032Speter 349138032Speter 349238032Speter+-----------+ 349338032Speter| WHO AM I? | 349438032Speter+-----------+ 349538032Speter 349638032SpeterNormally, the $j macro is automatically defined to be your fully 349738032Speterqualified domain name (FQDN). Sendmail does this by getting your 349838032Speterhost name using gethostname and then calling gethostbyname on the 349938032Speterresult. For example, in some environments gethostname returns 350038032Speteronly the root of the host name (such as "foo"); gethostbyname is 350138032Spetersupposed to return the FQDN ("foo.bar.com"). In some (fairly rare) 350238032Spetercases, gethostbyname may fail to return the FQDN. In this case 350338032Speteryou MUST define confDOMAIN_NAME to be your fully qualified domain 350438032Spetername. This is usually done using: 350538032Speter 350638032Speter Dmbar.com 350738032Speter define(`confDOMAIN_NAME', `$w.$m')dnl 350838032Speter 350938032Speter 351064562Sgshapiro+-----------------------------------+ 351164562Sgshapiro| ACCEPTING MAIL FOR MULTIPLE NAMES | 351264562Sgshapiro+-----------------------------------+ 351364562Sgshapiro 351464562SgshapiroIf your host is known by several different names, you need to augment 351564562Sgshapiroclass {w}. This is a list of names by which your host is known, and 351664562Sgshapiroanything sent to an address using a host name in this list will be 351764562Sgshapirotreated as local mail. You can do this in two ways: either create the 351864562Sgshapirofile /etc/mail/local-host-names containing a list of your aliases (one per 351964562Sgshapiroline), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add 352064562Sgshapiro``LOCAL_DOMAIN(`alias.host.name')''. Be sure you use the fully-qualified 352164562Sgshapironame of the host, rather than a short name. 352264562Sgshapiro 352364562SgshapiroIf you want to have different address in different domains, take 352464562Sgshapiroa look at the virtusertable feature, which is also explained at 352564562Sgshapirohttp://www.sendmail.org/virtual-hosting.html 352664562Sgshapiro 352764562Sgshapiro 352838032Speter+--------------------+ 352938032Speter| USING MAILERTABLES | 353038032Speter+--------------------+ 353138032Speter 353243730SpeterTo use FEATURE(`mailertable'), you will have to create an external 353338032Speterdatabase containing the routing information for various domains. 353438032SpeterFor example, a mailertable file in text format might be: 353538032Speter 353638032Speter .my.domain xnet:%1.my.domain 353764562Sgshapiro uuhost1.my.domain uucp-new:uuhost1 353838032Speter .bitnet smtp:relay.bit.net 353938032Speter 354064562SgshapiroThis should normally be stored in /etc/mail/mailertable. The actual 354138032Speterdatabase version of the mailertable is built using: 354238032Speter 354364562Sgshapiro makemap hash /etc/mail/mailertable < /etc/mail/mailertable 354438032Speter 354538032SpeterThe semantics are simple. Any LHS entry that does not begin with 354638032Spetera dot matches the full host name indicated. LHS entries beginning 354766494Sgshapirowith a dot match anything ending with that domain name (including 354866494Sgshapirothe leading dot) -- that is, they can be thought of as having a 354966494Sgshapiroleading ".+" regular expression pattern for a non-empty sequence of 355066494Sgshapirocharacters. Matching is done in order of most-to-least qualified 355166494Sgshapiro-- for example, even though ".my.domain" is listed first in the 355266494Sgshapiroabove example, an entry of "uuhost1.my.domain" will match the second 355366494Sgshapiroentry since it is more explicit. Note: e-mail to "user@my.domain" 355466494Sgshapirodoes not match any entry in the above table. You need to have 355566494Sgshapirosomething like: 355638032Speter 355764562Sgshapiro my.domain esmtp:host.my.domain 355864562Sgshapiro 355938032SpeterThe RHS should always be a "mailer:host" pair. The mailer is the 356090792Sgshapiroconfiguration name of a mailer (that is, an M line in the 356138032Spetersendmail.cf file). The "host" will be the hostname passed to 356238032Speterthat mailer. In domain-based matches (that is, those with leading 356338032Speterdots) the "%1" may be used to interpolate the wildcarded part of 356438032Speterthe host name. For example, the first line above sends everything 356538032Speteraddressed to "anything.my.domain" to that same host name, but using 356638032Speterthe (presumably experimental) xnet mailer. 356738032Speter 356838032SpeterIn some cases you may want to temporarily turn off MX records, 356938032Speterparticularly on gateways. For example, you may want to MX 357038032Spetereverything in a domain to one machine that then forwards it 357138032Speterdirectly. To do this, you might use the DNS configuration: 357238032Speter 357338032Speter *.domain. IN MX 0 relay.machine 357438032Speter 357538032Speterand on relay.machine use the mailertable: 357638032Speter 357738032Speter .domain smtp:[gateway.domain] 357838032Speter 357938032SpeterThe [square brackets] turn off MX records for this host only. 358038032SpeterIf you didn't do this, the mailertable would use the MX record 3581120256Sgshapiroagain, which would give you an MX loop. Note that the use of 3582120256Sgshapirowildcard MX records is almost always a bad idea. Please avoid 3583120256Sgshapirousing them if possible. 358438032Speter 358538032Speter 358638032Speter+--------------------------------+ 358738032Speter| USING USERDB TO MAP FULL NAMES | 358838032Speter+--------------------------------+ 358938032Speter 359038032SpeterThe user database was not originally intended for mapping full names 359138032Speterto login names (e.g., Eric.Allman => eric), but some people are using 359264562Sgshapiroit that way. (it is recommended that you set up aliases for this 359338032Speterpurpose instead -- since you can specify multiple alias files, this 359438032Speteris fairly easy.) The intent was to locate the default maildrop at 359538032Spetera site, but allow you to override this by sending to a specific host. 359638032Speter 359738032SpeterIf you decide to set up the user database in this fashion, it is 359843730Speterimperative that you not use FEATURE(`stickyhost') -- otherwise, 359938032Spetere-mail sent to Full.Name@local.host.name will be rejected. 360038032Speter 360138032SpeterTo build the internal form of the user database, use: 360238032Speter 360364562Sgshapiro makemap btree /etc/mail/userdb < /etc/mail/userdb.txt 360438032Speter 360564562SgshapiroAs a general rule, it is an extremely bad idea to using full names 360664562Sgshapiroas e-mail addresses, since they are not in any sense unique. For 360766494Sgshapiroexample, the UNIX software-development community has at least two 360864562Sgshapirowell-known Peter Deutsches, and at one time Bell Labs had two 360964562SgshapiroStephen R. Bournes with offices along the same hallway. Which one 361064562Sgshapirowill be forced to suffer the indignity of being Stephen_R_Bourne_2? 361164562SgshapiroThe less famous of the two, or the one that was hired later? 361238032Speter 361338032SpeterFinger should handle full names (and be fuzzy). Mail should use 361464562Sgshapirohandles, and not be fuzzy. 361538032Speter 361638032Speter 361738032Speter+--------------------------------+ 361838032Speter| MISCELLANEOUS SPECIAL FEATURES | 361938032Speter+--------------------------------+ 362038032Speter 362138032SpeterPlussed users 362238032Speter Sometimes it is convenient to merge configuration on a 362338032Speter centralized mail machine, for example, to forward all 362438032Speter root mail to a mail server. In this case it might be 362538032Speter useful to be able to treat the root addresses as a class 362638032Speter of addresses with subtle differences. You can do this 362738032Speter using plussed users. For example, a client might include 362838032Speter the alias: 362938032Speter 363038032Speter root: root+client1@server 363138032Speter 363238032Speter On the server, this will match an alias for "root+client1". 363338032Speter If that is not found, the alias "root+*" will be tried, 363438032Speter then "root". 363538032Speter 363638032Speter 363738032Speter+----------------+ 363838032Speter| SECURITY NOTES | 363938032Speter+----------------+ 364038032Speter 364138032SpeterA lot of sendmail security comes down to you. Sendmail 8 is much 364238032Spetermore careful about checking for security problems than previous 364338032Speterversions, but there are some things that you still need to watch 364438032Speterfor. In particular: 364538032Speter 364698121Sgshapiro* Make sure the aliases file is not writable except by trusted 364738032Speter system personnel. This includes both the text and database 364838032Speter version. 364938032Speter 365038032Speter* Make sure that other files that sendmail reads, such as the 365138032Speter mailertable, are only writable by trusted system personnel. 365238032Speter 365338032Speter* The queue directory should not be world writable PARTICULARLY 365438032Speter if your system allows "file giveaways" (that is, if a non-root 365538032Speter user can chown any file they own to any other user). 365638032Speter 365738032Speter* If your system allows file giveaways, DO NOT create a publically 365838032Speter writable directory for forward files. This will allow anyone 365938032Speter to steal anyone else's e-mail. Instead, create a script that 366038032Speter copies the .forward file from users' home directories once a 366138032Speter night (if you want the non-NFS-mounted forward directory). 366238032Speter 366338032Speter* If your system allows file giveaways, you'll find that 366438032Speter sendmail is much less trusting of :include: files -- in 366538032Speter particular, you'll have to have /SENDMAIL/ANY/SHELL/ in 366638032Speter /etc/shells before they will be trusted (that is, before 366738032Speter files and programs listed in them will be honored). 366838032Speter 366938032SpeterIn general, file giveaways are a mistake -- if you can turn them 367064562Sgshapirooff, do so. 367138032Speter 367238032Speter 367338032Speter+--------------------------------+ 367438032Speter| TWEAKING CONFIGURATION OPTIONS | 367538032Speter+--------------------------------+ 367638032Speter 367738032SpeterThere are a large number of configuration options that don't normally 3678132943Sgshapironeed to be changed. However, if you feel you need to tweak them, 3679132943Sgshapiroyou can define the following M4 variables. Note that some of these 3680132943Sgshapirovariables require formats that are defined in RFC 2821 or RFC 2822. 3681132943SgshapiroBefore changing them you need to make sure you do not violate those 3682132943Sgshapiro(and other relevant) RFCs. 368338032Speter 3684132943SgshapiroThis list is shown in four columns: the name you define, the default 3685132943Sgshapirovalue for that definition, the option or macro that is affected 3686132943Sgshapiro(either Ox for an option or Dx for a macro), and a brief description. 3687132943SgshapiroGreater detail of the semantics can be found in the Installation 3688132943Sgshapiroand Operations Guide. 3689132943Sgshapiro 369038032SpeterSome options are likely to be deprecated in future versions -- that is, 369138032Speterthe option is only included to provide back-compatibility. These are 369238032Spetermarked with "*". 369338032Speter 369438032SpeterRemember that these options are M4 variables, and hence may need to 369538032Speterbe quoted. In particular, arguments with commas will usually have to 369638032Speterbe ``double quoted, like this phrase'' to avoid having the comma 369738032Speterconfuse things. This is common for alias file definitions and for 369838032Speterthe read timeout. 369938032Speter 3700132943SgshapiroM4 Variable Name Configuration [Default] & Description 370138032Speter================ ============= ======================= 370238032SpeterconfMAILER_NAME $n macro [MAILER-DAEMON] The sender name used 370338032Speter for internally generated outgoing 370438032Speter messages. 370538032SpeterconfDOMAIN_NAME $j macro If defined, sets $j. This should 370638032Speter only be done if your system cannot 370738032Speter determine your local domain name, 370838032Speter and then it should be set to 370938032Speter $w.Foo.COM, where Foo.COM is your 371038032Speter domain name. 371138032SpeterconfCF_VERSION $Z macro If defined, this is appended to the 371238032Speter configuration version name. 371390792SgshapiroconfLDAP_CLUSTER ${sendmailMTACluster} macro 371490792Sgshapiro If defined, this is the LDAP 371590792Sgshapiro cluster to use for LDAP searches 371690792Sgshapiro as described above in ``USING LDAP 371790792Sgshapiro FOR ALIASES, MAPS, AND CLASSES''. 371864562SgshapiroconfFROM_HEADER From: [$?x$x <$g>$|$g$.] The format of an 371938032Speter internally generated From: address. 372038032SpeterconfRECEIVED_HEADER Received: 372138032Speter [$?sfrom $s $.$?_($?s$|from $.$_) 372264562Sgshapiro $.$?{auth_type}(authenticated) 372338032Speter $.by $j ($v/$Z)$?r with $r$. id $i$?u 372438032Speter for $u; $|; 372538032Speter $.$b] 372638032Speter The format of the Received: header 372738032Speter in messages passed through this host. 372838032Speter It is unwise to try to change this. 3729132943SgshapiroconfMESSAGEID_HEADER Message-Id: [<$t.$i@$j>] The format of an 3730132943Sgshapiro internally generated Message-Id: 3731132943Sgshapiro header. 373264562SgshapiroconfCW_FILE Fw class [/etc/mail/local-host-names] Name 373364562Sgshapiro of file used to get the local 373464562Sgshapiro additions to class {w} (local host 373564562Sgshapiro names). 373664562SgshapiroconfCT_FILE Ft class [/etc/mail/trusted-users] Name of 373764562Sgshapiro file used to get the local additions 373864562Sgshapiro to class {t} (trusted users). 373938032SpeterconfCR_FILE FR class [/etc/mail/relay-domains] Name of 374038032Speter file used to get the local additions 374164562Sgshapiro to class {R} (hosts allowed to relay). 374238032SpeterconfTRUSTED_USERS Ct class [no default] Names of users to add to 374338032Speter the list of trusted users. This list 374438032Speter always includes root, uucp, and daemon. 374543730Speter See also FEATURE(`use_ct_file'). 374664562SgshapiroconfTRUSTED_USER TrustedUser [no default] Trusted user for file 374764562Sgshapiro ownership and starting the daemon. 374864562Sgshapiro Not to be confused with 374964562Sgshapiro confTRUSTED_USERS (see above). 375038032SpeterconfSMTP_MAILER - [esmtp] The mailer name used when 375138032Speter SMTP connectivity is required. 375264562Sgshapiro One of "smtp", "smtp8", 375364562Sgshapiro "esmtp", or "dsmtp". 375438032SpeterconfUUCP_MAILER - [uucp-old] The mailer to be used by 375538032Speter default for bang-format recipient 375638032Speter addresses. See also discussion of 375764562Sgshapiro class {U}, class {Y}, and class {Z} 375864562Sgshapiro in the MAILER(`uucp') section. 375938032SpeterconfLOCAL_MAILER - [local] The mailer name used when 376038032Speter local connectivity is required. 376138032Speter Almost always "local". 376238032SpeterconfRELAY_MAILER - [relay] The default mailer name used 376338032Speter for relaying any mail (e.g., to a 376438032Speter BITNET_RELAY, a SMART_HOST, or 376538032Speter whatever). This can reasonably be 376638032Speter "uucp-new" if you are on a 376738032Speter UUCP-connected site. 376838032SpeterconfSEVEN_BIT_INPUT SevenBitInput [False] Force input to seven bits? 376938032SpeterconfEIGHT_BIT_HANDLING EightBitMode [pass8] 8-bit data handling 377038032SpeterconfALIAS_WAIT AliasWait [10m] Time to wait for alias file 377138032Speter rebuild until you get bored and 377238032Speter decide that the apparently pending 377338032Speter rebuild failed. 377438032SpeterconfMIN_FREE_BLOCKS MinFreeBlocks [100] Minimum number of free blocks on 377538032Speter queue filesystem to accept SMTP mail. 377638032Speter (Prior to 8.7 this was minfree/maxsize, 377738032Speter where minfree was the number of free 377838032Speter blocks and maxsize was the maximum 377938032Speter message size. Use confMAX_MESSAGE_SIZE 378038032Speter for the second value now.) 378138032SpeterconfMAX_MESSAGE_SIZE MaxMessageSize [infinite] The maximum size of messages 378238032Speter that will be accepted (in bytes). 378338032SpeterconfBLANK_SUB BlankSub [.] Blank (space) substitution 378438032Speter character. 378538032SpeterconfCON_EXPENSIVE HoldExpensive [False] Avoid connecting immediately 378664562Sgshapiro to mailers marked expensive. 378738032SpeterconfCHECKPOINT_INTERVAL CheckpointInterval 378838032Speter [10] Checkpoint queue files every N 378938032Speter recipients. 379038032SpeterconfDELIVERY_MODE DeliveryMode [background] Default delivery mode. 379138032SpeterconfERROR_MODE ErrorMode [print] Error message mode. 379238032SpeterconfERROR_MESSAGE ErrorHeader [undefined] Error message header/file. 379342575SpeterconfSAVE_FROM_LINES SaveFromLine Save extra leading From_ lines. 379438032SpeterconfTEMP_FILE_MODE TempFileMode [0600] Temporary file mode. 379538032SpeterconfMATCH_GECOS MatchGECOS [False] Match GECOS field. 379638032SpeterconfMAX_HOP MaxHopCount [25] Maximum hop count. 379764562SgshapiroconfIGNORE_DOTS* IgnoreDots [False; always False in -bs or -bd 379864562Sgshapiro mode] Ignore dot as terminator for 379964562Sgshapiro incoming messages? 380038032SpeterconfBIND_OPTS ResolverOptions [undefined] Default options for DNS 380138032Speter resolver. 380238032SpeterconfMIME_FORMAT_ERRORS* SendMimeErrors [True] Send error messages as MIME- 380338032Speter encapsulated messages per RFC 1344. 380438032SpeterconfFORWARD_PATH ForwardPath [$z/.forward.$w:$z/.forward] 380538032Speter The colon-separated list of places to 380638032Speter search for .forward files. N.B.: see 380738032Speter the Security Notes section. 380838032SpeterconfMCI_CACHE_SIZE ConnectionCacheSize 380938032Speter [2] Size of open connection cache. 381038032SpeterconfMCI_CACHE_TIMEOUT ConnectionCacheTimeout 381138032Speter [5m] Open connection cache timeout. 381238032SpeterconfHOST_STATUS_DIRECTORY HostStatusDirectory 381338032Speter [undefined] If set, host status is kept 381438032Speter on disk between sendmail runs in the 381538032Speter named directory tree. This need not be 381638032Speter a full pathname, in which case it is 381738032Speter interpreted relative to the queue 381838032Speter directory. 381938032SpeterconfSINGLE_THREAD_DELIVERY SingleThreadDelivery 382038032Speter [False] If this option and the 382138032Speter HostStatusDirectory option are both 382238032Speter set, single thread deliveries to other 382338032Speter hosts. That is, don't allow any two 382438032Speter sendmails on this host to connect 382538032Speter simultaneously to any other single 382638032Speter host. This can slow down delivery in 382738032Speter some cases, in particular since a 382838032Speter cached but otherwise idle connection 382938032Speter to a host will prevent other sendmails 383038032Speter from connecting to the other host. 3831285229SgshapiroconfUSE_COMPRESSED_IPV6_ADDRESSES 3832285229Sgshapiro UseCompressedIPv6Addresses 3833285229Sgshapiro [undefined] If set, use the compressed 3834285229Sgshapiro form of IPv6 addresses, such as 3835285229Sgshapiro IPV6:::1, instead of the uncompressed 3836285229Sgshapiro form, such as IPv6:0:0:0:0:0:0:0:1. 383764562SgshapiroconfUSE_ERRORS_TO* UseErrorsTo [False] Use the Errors-To: header to 383838032Speter deliver error messages. This should 383938032Speter not be necessary because of general 384038032Speter acceptance of the envelope/header 384138032Speter distinction. 384238032SpeterconfLOG_LEVEL LogLevel [9] Log level. 384364562SgshapiroconfME_TOO MeToo [True] Include sender in group 384464562Sgshapiro expansions. This option is 384564562Sgshapiro deprecated and will be removed from 384664562Sgshapiro a future version. 384738032SpeterconfCHECK_ALIASES CheckAliases [False] Check RHS of aliases when 384838032Speter running newaliases. Since this does 384938032Speter DNS lookups on every address, it can 385038032Speter slow down the alias rebuild process 385138032Speter considerably on large alias files. 385238032SpeterconfOLD_STYLE_HEADERS* OldStyleHeaders [True] Assume that headers without 385338032Speter special chars are old style. 385438032SpeterconfPRIVACY_FLAGS PrivacyOptions [authwarnings] Privacy flags. 385538032SpeterconfCOPY_ERRORS_TO PostmasterCopy [undefined] Address for additional 385638032Speter copies of all error messages. 385738032SpeterconfQUEUE_FACTOR QueueFactor [600000] Slope of queue-only function. 385890792SgshapiroconfQUEUE_FILE_MODE QueueFileMode [undefined] Default permissions for 385990792Sgshapiro queue files (octal). If not set, 386090792Sgshapiro sendmail uses 0600 unless its real 386190792Sgshapiro and effective uid are different in 386290792Sgshapiro which case it uses 0644. 386338032SpeterconfDONT_PRUNE_ROUTES DontPruneRoutes [False] Don't prune down route-addr 386438032Speter syntax addresses to the minimum 386538032Speter possible. 386638032SpeterconfSAFE_QUEUE* SuperSafe [True] Commit all messages to disk 386738032Speter before forking. 386838032SpeterconfTO_INITIAL Timeout.initial [5m] The timeout waiting for a response 386938032Speter on the initial connect. 387038032SpeterconfTO_CONNECT Timeout.connect [0] The timeout waiting for an initial 387138032Speter connect() to complete. This can only 387238032Speter shorten connection timeouts; the kernel 387338032Speter silently enforces an absolute maximum 387438032Speter (which varies depending on the system). 387538032SpeterconfTO_ICONNECT Timeout.iconnect 387638032Speter [undefined] Like Timeout.connect, but 387738032Speter applies only to the very first attempt 387838032Speter to connect to a host in a message. 387938032Speter This allows a single very fast pass 388038032Speter followed by more careful delivery 388138032Speter attempts in the future. 388290792SgshapiroconfTO_ACONNECT Timeout.aconnect 388390792Sgshapiro [0] The overall timeout waiting for 388490792Sgshapiro all connection for a single delivery 388590792Sgshapiro attempt to succeed. If 0, no overall 388690792Sgshapiro limit is applied. 388738032SpeterconfTO_HELO Timeout.helo [5m] The timeout waiting for a response 388838032Speter to a HELO or EHLO command. 388938032SpeterconfTO_MAIL Timeout.mail [10m] The timeout waiting for a 389038032Speter response to the MAIL command. 389138032SpeterconfTO_RCPT Timeout.rcpt [1h] The timeout waiting for a response 389238032Speter to the RCPT command. 389338032SpeterconfTO_DATAINIT Timeout.datainit 389438032Speter [5m] The timeout waiting for a 354 389538032Speter response from the DATA command. 389638032SpeterconfTO_DATABLOCK Timeout.datablock 389738032Speter [1h] The timeout waiting for a block 389838032Speter during DATA phase. 389938032SpeterconfTO_DATAFINAL Timeout.datafinal 390038032Speter [1h] The timeout waiting for a response 390138032Speter to the final "." that terminates a 390238032Speter message. 390338032SpeterconfTO_RSET Timeout.rset [5m] The timeout waiting for a response 390438032Speter to the RSET command. 390538032SpeterconfTO_QUIT Timeout.quit [2m] The timeout waiting for a response 390638032Speter to the QUIT command. 390738032SpeterconfTO_MISC Timeout.misc [2m] The timeout waiting for a response 390838032Speter to other SMTP commands. 390964562SgshapiroconfTO_COMMAND Timeout.command [1h] In server SMTP, the timeout 391064562Sgshapiro waiting for a command to be issued. 391164562SgshapiroconfTO_IDENT Timeout.ident [5s] The timeout waiting for a 391264562Sgshapiro response to an IDENT query. 391338032SpeterconfTO_FILEOPEN Timeout.fileopen 391438032Speter [60s] The timeout waiting for a file 391538032Speter (e.g., :include: file) to be opened. 391690792SgshapiroconfTO_LHLO Timeout.lhlo [2m] The timeout waiting for a response 391790792Sgshapiro to an LMTP LHLO command. 391890792SgshapiroconfTO_AUTH Timeout.auth [10m] The timeout waiting for a 391990792Sgshapiro response in an AUTH dialogue. 392090792SgshapiroconfTO_STARTTLS Timeout.starttls 392190792Sgshapiro [1h] The timeout waiting for a 392290792Sgshapiro response to an SMTP STARTTLS command. 392364562SgshapiroconfTO_CONTROL Timeout.control 392464562Sgshapiro [2m] The timeout for a complete 392564562Sgshapiro control socket transaction to complete. 392638032SpeterconfTO_QUEUERETURN Timeout.queuereturn 392738032Speter [5d] The timeout before a message is 392838032Speter returned as undeliverable. 392938032SpeterconfTO_QUEUERETURN_NORMAL 393038032Speter Timeout.queuereturn.normal 393138032Speter [undefined] As above, for normal 393238032Speter priority messages. 393338032SpeterconfTO_QUEUERETURN_URGENT 393438032Speter Timeout.queuereturn.urgent 393538032Speter [undefined] As above, for urgent 393638032Speter priority messages. 393738032SpeterconfTO_QUEUERETURN_NONURGENT 393838032Speter Timeout.queuereturn.non-urgent 393938032Speter [undefined] As above, for non-urgent 394038032Speter (low) priority messages. 3941132943SgshapiroconfTO_QUEUERETURN_DSN 3942132943Sgshapiro Timeout.queuereturn.dsn 3943132943Sgshapiro [undefined] As above, for delivery 3944132943Sgshapiro status notification messages. 394538032SpeterconfTO_QUEUEWARN Timeout.queuewarn 394638032Speter [4h] The timeout before a warning 394738032Speter message is sent to the sender telling 394864562Sgshapiro them that the message has been 394964562Sgshapiro deferred. 395038032SpeterconfTO_QUEUEWARN_NORMAL Timeout.queuewarn.normal 395138032Speter [undefined] As above, for normal 395238032Speter priority messages. 395338032SpeterconfTO_QUEUEWARN_URGENT Timeout.queuewarn.urgent 395438032Speter [undefined] As above, for urgent 395538032Speter priority messages. 395638032SpeterconfTO_QUEUEWARN_NONURGENT 395738032Speter Timeout.queuewarn.non-urgent 395838032Speter [undefined] As above, for non-urgent 395938032Speter (low) priority messages. 3960132943SgshapiroconfTO_QUEUEWARN_DSN 3961132943Sgshapiro Timeout.queuewarn.dsn 3962132943Sgshapiro [undefined] As above, for delivery 3963132943Sgshapiro status notification messages. 396438032SpeterconfTO_HOSTSTATUS Timeout.hoststatus 396538032Speter [30m] How long information about host 396638032Speter statuses will be maintained before it 396738032Speter is considered stale and the host should 396838032Speter be retried. This applies both within 396938032Speter a single queue run and to persistent 397038032Speter information (see below). 397164562SgshapiroconfTO_RESOLVER_RETRANS Timeout.resolver.retrans 397264562Sgshapiro [varies] Sets the resolver's 397398121Sgshapiro retransmission time interval (in 397464562Sgshapiro seconds). Sets both 397564562Sgshapiro Timeout.resolver.retrans.first and 397664562Sgshapiro Timeout.resolver.retrans.normal. 397764562SgshapiroconfTO_RESOLVER_RETRANS_FIRST Timeout.resolver.retrans.first 397864562Sgshapiro [varies] Sets the resolver's 397998121Sgshapiro retransmission time interval (in 398064562Sgshapiro seconds) for the first attempt to 398164562Sgshapiro deliver a message. 398264562SgshapiroconfTO_RESOLVER_RETRANS_NORMAL Timeout.resolver.retrans.normal 398364562Sgshapiro [varies] Sets the resolver's 398498121Sgshapiro retransmission time interval (in 398564562Sgshapiro seconds) for all resolver lookups 398664562Sgshapiro except the first delivery attempt. 398764562SgshapiroconfTO_RESOLVER_RETRY Timeout.resolver.retry 398864562Sgshapiro [varies] Sets the number of times 398964562Sgshapiro to retransmit a resolver query. 399064562Sgshapiro Sets both 399164562Sgshapiro Timeout.resolver.retry.first and 399264562Sgshapiro Timeout.resolver.retry.normal. 399364562SgshapiroconfTO_RESOLVER_RETRY_FIRST Timeout.resolver.retry.first 399464562Sgshapiro [varies] Sets the number of times 399564562Sgshapiro to retransmit a resolver query for 399664562Sgshapiro the first attempt to deliver a 399764562Sgshapiro message. 399864562SgshapiroconfTO_RESOLVER_RETRY_NORMAL Timeout.resolver.retry.normal 399964562Sgshapiro [varies] Sets the number of times 400064562Sgshapiro to retransmit a resolver query for 400164562Sgshapiro all resolver lookups except the 400264562Sgshapiro first delivery attempt. 400338032SpeterconfTIME_ZONE TimeZoneSpec [USE_SYSTEM] Time zone info -- can be 400438032Speter USE_SYSTEM to use the system's idea, 400538032Speter USE_TZ to use the user's TZ envariable, 400638032Speter or something else to force that value. 400738032SpeterconfDEF_USER_ID DefaultUser [1:1] Default user id. 400838032SpeterconfUSERDB_SPEC UserDatabaseSpec 400964562Sgshapiro [undefined] User database 401064562Sgshapiro specification. 401138032SpeterconfFALLBACK_MX FallbackMXhost [undefined] Fallback MX host. 4012132943SgshapiroconfFALLBACK_SMARTHOST FallbackSmartHost 4013132943Sgshapiro [undefined] Fallback smart host. 401464562SgshapiroconfTRY_NULL_MX_LIST TryNullMXList [False] If this host is the best MX 401564562Sgshapiro for a host and other arrangements 401664562Sgshapiro haven't been made, try connecting 401764562Sgshapiro to the host directly; normally this 401864562Sgshapiro would be a config error. 401964562SgshapiroconfQUEUE_LA QueueLA [varies] Load average at which 402064562Sgshapiro queue-only function kicks in. 402164562Sgshapiro Default values is (8 * numproc) 402264562Sgshapiro where numproc is the number of 402364562Sgshapiro processors online (if that can be 402464562Sgshapiro determined). 402564562SgshapiroconfREFUSE_LA RefuseLA [varies] Load average at which 402664562Sgshapiro incoming SMTP connections are 402764562Sgshapiro refused. Default values is (12 * 402864562Sgshapiro numproc) where numproc is the 402964562Sgshapiro number of processors online (if 403064562Sgshapiro that can be determined). 4031132943SgshapiroconfREJECT_LOG_INTERVAL RejectLogInterval [3h] Log interval when 4032132943Sgshapiro refusing connections for this long. 403390792SgshapiroconfDELAY_LA DelayLA [0] Load average at which sendmail 403490792Sgshapiro will sleep for one second on most 403590792Sgshapiro SMTP commands and before accepting 403690792Sgshapiro connections. 0 means no limit. 403764562SgshapiroconfMAX_ALIAS_RECURSION MaxAliasRecursion 403864562Sgshapiro [10] Maximum depth of alias recursion. 403938032SpeterconfMAX_DAEMON_CHILDREN MaxDaemonChildren 404038032Speter [undefined] The maximum number of 404138032Speter children the daemon will permit. After 404238032Speter this number, connections will be 404338032Speter rejected. If not set or <= 0, there is 404438032Speter no limit. 404564562SgshapiroconfMAX_HEADERS_LENGTH MaxHeadersLength 404671345Sgshapiro [32768] Maximum length of the sum 404764562Sgshapiro of all headers. 404864562SgshapiroconfMAX_MIME_HEADER_LENGTH MaxMimeHeaderLength 404964562Sgshapiro [undefined] Maximum length of 405064562Sgshapiro certain MIME header field values. 405138032SpeterconfCONNECTION_RATE_THROTTLE ConnectionRateThrottle 405238032Speter [undefined] The maximum number of 405390792Sgshapiro connections permitted per second per 405490792Sgshapiro daemon. After this many connections 405590792Sgshapiro are accepted, further connections 405690792Sgshapiro will be delayed. If not set or <= 0, 405790792Sgshapiro there is no limit. 4058132943SgshapiroconfCONNECTION_RATE_WINDOW_SIZE ConnectionRateWindowSize 4059132943Sgshapiro [60s] Define the length of the 4060132943Sgshapiro interval for which the number of 4061132943Sgshapiro incoming connections is maintained. 406238032SpeterconfWORK_RECIPIENT_FACTOR 406338032Speter RecipientFactor [30000] Cost of each recipient. 406464562SgshapiroconfSEPARATE_PROC ForkEachJob [False] Run all deliveries in a 406564562Sgshapiro separate process. 406638032SpeterconfWORK_CLASS_FACTOR ClassFactor [1800] Priority multiplier for class. 406738032SpeterconfWORK_TIME_FACTOR RetryFactor [90000] Cost of each delivery attempt. 406838032SpeterconfQUEUE_SORT_ORDER QueueSortOrder [Priority] Queue sort algorithm: 406990792Sgshapiro Priority, Host, Filename, Random, 407090792Sgshapiro Modification, or Time. 4071285229SgshapiroconfMAX_QUEUE_AGE MaxQueueAge [undefined] If set to a value greater 4072285229Sgshapiro than zero, entries in the queue 4073285229Sgshapiro will be retried during a queue run 4074285229Sgshapiro only if the individual retry time 4075285229Sgshapiro has been reached which is doubled 4076285229Sgshapiro for each attempt. The maximum retry 4077285229Sgshapiro time is limited by the specified value. 407838032SpeterconfMIN_QUEUE_AGE MinQueueAge [0] The minimum amount of time a job 407938032Speter must sit in the queue between queue 408038032Speter runs. This allows you to set the 408138032Speter queue run interval low for better 408238032Speter responsiveness without trying all 408338032Speter jobs in each run. 408438032SpeterconfDEF_CHAR_SET DefaultCharSet [unknown-8bit] When converting 408538032Speter unlabeled 8 bit input to MIME, the 408638032Speter character set to use by default. 408738032SpeterconfSERVICE_SWITCH_FILE ServiceSwitchFile 408864562Sgshapiro [/etc/mail/service.switch] The file 408964562Sgshapiro to use for the service switch on 409064562Sgshapiro systems that do not have a 409164562Sgshapiro system-defined switch. 409238032SpeterconfHOSTS_FILE HostsFile [/etc/hosts] The file to use when doing 409338032Speter "file" type access of hosts names. 409438032SpeterconfDIAL_DELAY DialDelay [0s] If a connection fails, wait this 409538032Speter long and try again. Zero means "don't 409638032Speter retry". This is to allow "dial on 409738032Speter demand" connections to have enough time 409838032Speter to complete a connection. 409938032SpeterconfNO_RCPT_ACTION NoRecipientAction 410038032Speter [none] What to do if there are no legal 410138032Speter recipient fields (To:, Cc: or Bcc:) 410238032Speter in the message. Legal values can 410338032Speter be "none" to just leave the 410438032Speter nonconforming message as is, "add-to" 410538032Speter to add a To: header with all the 410638032Speter known recipients (which may expose 410738032Speter blind recipients), "add-apparently-to" 410838032Speter to do the same but use Apparently-To: 410990792Sgshapiro instead of To: (strongly discouraged 411090792Sgshapiro in accordance with IETF standards), 411190792Sgshapiro "add-bcc" to add an empty Bcc: 411290792Sgshapiro header, or "add-to-undisclosed" to 411390792Sgshapiro add the header 411438032Speter ``To: undisclosed-recipients:;''. 411538032SpeterconfSAFE_FILE_ENV SafeFileEnvironment 411638032Speter [undefined] If set, sendmail will do a 411738032Speter chroot() into this directory before 411838032Speter writing files. 411938032SpeterconfCOLON_OK_IN_ADDR ColonOkInAddr [True unless Configuration Level > 6] 412038032Speter If set, colons are treated as a regular 412138032Speter character in addresses. If not set, 412238032Speter they are treated as the introducer to 412338032Speter the RFC 822 "group" syntax. Colons are 412438032Speter handled properly in route-addrs. This 412538032Speter option defaults on for V5 and lower 412638032Speter configuration files. 412738032SpeterconfMAX_QUEUE_RUN_SIZE MaxQueueRunSize [0] If set, limit the maximum size of 412838032Speter any given queue run to this number of 412938032Speter entries. Essentially, this will stop 413064562Sgshapiro reading each queue directory after this 413138032Speter number of entries are reached; it does 413238032Speter _not_ pick the highest priority jobs, 413338032Speter so this should be as large as your 413438032Speter system can tolerate. If not set, there 413538032Speter is no limit. 413690792SgshapiroconfMAX_QUEUE_CHILDREN MaxQueueChildren 413790792Sgshapiro [undefined] Limits the maximum number 413890792Sgshapiro of concurrent queue runners active. 413990792Sgshapiro This is to keep system resources used 414090792Sgshapiro within a reasonable limit. Relates to 4141132943Sgshapiro Queue Groups and ForkEachJob. 414290792SgshapiroconfMAX_RUNNERS_PER_QUEUE MaxRunnersPerQueue 414390792Sgshapiro [1] Only active when MaxQueueChildren 414490792Sgshapiro defined. Controls the maximum number 414590792Sgshapiro of queue runners (aka queue children) 414690792Sgshapiro active at the same time in a work 414790792Sgshapiro group. See also MaxQueueChildren. 414838032SpeterconfDONT_EXPAND_CNAMES DontExpandCnames 414938032Speter [False] If set, $[ ... $] lookups that 415038032Speter do DNS based lookups do not expand 415138032Speter CNAME records. This currently violates 415238032Speter the published standards, but the IETF 415338032Speter seems to be moving toward legalizing 415438032Speter this. For example, if "FTP.Foo.ORG" 415538032Speter is a CNAME for "Cruft.Foo.ORG", then 415638032Speter with this option set a lookup of 415738032Speter "FTP" will return "FTP.Foo.ORG"; if 415838032Speter clear it returns "Cruft.FOO.ORG". N.B. 415938032Speter you may not see any effect until your 416038032Speter downstream neighbors stop doing CNAME 416138032Speter lookups as well. 416264562SgshapiroconfFROM_LINE UnixFromLine [From $g $d] The From_ line used 416338032Speter when sending to files or programs. 416438032SpeterconfSINGLE_LINE_FROM_HEADER SingleLineFromHeader 416538032Speter [False] From: lines that have 416638032Speter embedded newlines are unwrapped 416738032Speter onto one line. 416838032SpeterconfALLOW_BOGUS_HELO AllowBogusHELO [False] Allow HELO SMTP command that 416938032Speter does not include a host name. 417038032SpeterconfMUST_QUOTE_CHARS MustQuoteChars [.'] Characters to be quoted in a full 417138032Speter name phrase (@,;:\()[] are automatic). 417238032SpeterconfOPERATORS OperatorChars [.:%@!^/[]+] Address operator 417338032Speter characters. 417438032SpeterconfSMTP_LOGIN_MSG SmtpGreetingMessage 417538032Speter [$j Sendmail $v/$Z; $b] 417638032Speter The initial (spontaneous) SMTP 417738032Speter greeting message. The word "ESMTP" 417838032Speter will be inserted between the first and 417938032Speter second words to convince other 418038032Speter sendmails to try to speak ESMTP. 418138032SpeterconfDONT_INIT_GROUPS DontInitGroups [False] If set, the initgroups(3) 418238032Speter routine will never be invoked. You 418338032Speter might want to do this if you are 418438032Speter running NIS and you have a large group 418538032Speter map, since this call does a sequential 418638032Speter scan of the map; in a large site this 418738032Speter can cause your ypserv to run 418838032Speter essentially full time. If you set 418938032Speter this, agents run on behalf of users 419038032Speter will only have their primary 419138032Speter (/etc/passwd) group permissions. 419238032SpeterconfUNSAFE_GROUP_WRITES UnsafeGroupWrites 4193157001Sgshapiro [True] If set, group-writable 419438032Speter :include: and .forward files are 419538032Speter considered "unsafe", that is, programs 419638032Speter and files cannot be directly referenced 419738032Speter from such files. World-writable files 419838032Speter are always considered unsafe. 4199157001Sgshapiro Notice: this option is deprecated and 4200157001Sgshapiro will be removed in future versions; 4201157001Sgshapiro Set GroupWritableForwardFileSafe 4202157001Sgshapiro and GroupWritableIncludeFileSafe in 4203157001Sgshapiro DontBlameSendmail if required. 420464562SgshapiroconfCONNECT_ONLY_TO ConnectOnlyTo [undefined] override connection 420564562Sgshapiro address (for testing). 420664562SgshapiroconfCONTROL_SOCKET_NAME ControlSocketName 420764562Sgshapiro [undefined] Control socket for daemon 420864562Sgshapiro management. 420938032SpeterconfDOUBLE_BOUNCE_ADDRESS DoubleBounceAddress 421038032Speter [postmaster] If an error occurs when 421138032Speter sending an error message, send that 421238032Speter "double bounce" error message to this 421390792Sgshapiro address. If it expands to an empty 421490792Sgshapiro string, double bounces are dropped. 4215168515SgshapiroconfSOFT_BOUNCE SoftBounce [False] If set, issue temporary errors 4216168515Sgshapiro (4xy) instead of permanent errors 4217168515Sgshapiro (5xy). This can be useful during 4218168515Sgshapiro testing of a new configuration to 4219168515Sgshapiro avoid erroneous bouncing of mails. 422064562SgshapiroconfDEAD_LETTER_DROP DeadLetterDrop [undefined] Filename to save bounce 422164562Sgshapiro messages which could not be returned 422264562Sgshapiro to the user or sent to postmaster. 422364562Sgshapiro If not set, the queue file will 422464562Sgshapiro be renamed. 422564562SgshapiroconfRRT_IMPLIES_DSN RrtImpliesDsn [False] Return-Receipt-To: header 422664562Sgshapiro implies DSN request. 422738032SpeterconfRUN_AS_USER RunAsUser [undefined] If set, become this user 422838032Speter when reading and delivering mail. 422938032Speter Causes all file reads (e.g., .forward 423038032Speter and :include: files) to be done as 423138032Speter this user. Also, all programs will 423238032Speter be run as this user, and all output 423338032Speter files will be written as this user. 423438032SpeterconfMAX_RCPTS_PER_MESSAGE MaxRecipientsPerMessage 423538032Speter [infinite] If set, allow no more than 423638032Speter the specified number of recipients in 423738032Speter an SMTP envelope. Further recipients 423838032Speter receive a 452 error code (i.e., they 423938032Speter are deferred for the next delivery 424038032Speter attempt). 4241125820SgshapiroconfBAD_RCPT_THROTTLE BadRcptThrottle [infinite] If set and the specified 4242125820Sgshapiro number of recipients in a single SMTP 4243125820Sgshapiro transaction have been rejected, sleep 4244125820Sgshapiro for one second after each subsequent 4245125820Sgshapiro RCPT command in that transaction. 424638032SpeterconfDONT_PROBE_INTERFACES DontProbeInterfaces 424738032Speter [False] If set, sendmail will _not_ 424838032Speter insert the names and addresses of any 424964562Sgshapiro local interfaces into class {w} 425038032Speter (list of known "equivalent" addresses). 425138032Speter If you set this, you must also include 425238032Speter some support for these addresses (e.g., 425338032Speter in a mailertable entry) -- otherwise, 425438032Speter mail to addresses in this list will 425538032Speter bounce with a configuration error. 425690792Sgshapiro If set to "loopback" (without 425790792Sgshapiro quotes), sendmail will skip 425890792Sgshapiro loopback interfaces (e.g., "lo0"). 425964562SgshapiroconfPID_FILE PidFile [system dependent] Location of pid 426064562Sgshapiro file. 426164562SgshapiroconfPROCESS_TITLE_PREFIX ProcessTitlePrefix 426264562Sgshapiro [undefined] Prefix string for the 426364562Sgshapiro process title shown on 'ps' listings. 426438032SpeterconfDONT_BLAME_SENDMAIL DontBlameSendmail 426538032Speter [safe] Override sendmail's file 426638032Speter safety checks. This will definitely 426738032Speter compromise system security and should 426838032Speter not be used unless absolutely 426938032Speter necessary. 427038032SpeterconfREJECT_MSG - [550 Access denied] The message 427138032Speter given if the access database contains 427238032Speter REJECT in the value portion. 427390792SgshapiroconfRELAY_MSG - [550 Relaying denied] The message 427490792Sgshapiro given if an unauthorized relaying 427590792Sgshapiro attempt is rejected. 427664562SgshapiroconfDF_BUFFER_SIZE DataFileBufferSize 427764562Sgshapiro [4096] The maximum size of a 427864562Sgshapiro memory-buffered data (df) file 427964562Sgshapiro before a disk-based file is used. 428064562SgshapiroconfXF_BUFFER_SIZE XScriptFileBufferSize 428164562Sgshapiro [4096] The maximum size of a 428264562Sgshapiro memory-buffered transcript (xf) 428364562Sgshapiro file before a disk-based file is 428464562Sgshapiro used. 428564562SgshapiroconfAUTH_MECHANISMS AuthMechanisms [GSSAPI KERBEROS_V4 DIGEST-MD5 428664562Sgshapiro CRAM-MD5] List of authentication 428764562Sgshapiro mechanisms for AUTH (separated by 428864562Sgshapiro spaces). The advertised list of 428964562Sgshapiro authentication mechanisms will be the 429064562Sgshapiro intersection of this list and the list 429164562Sgshapiro of available mechanisms as determined 4292132943Sgshapiro by the Cyrus SASL library. 4293132943SgshapiroconfAUTH_REALM AuthRealm [undefined] The authentication realm 4294132943Sgshapiro that is passed to the Cyrus SASL 4295132943Sgshapiro library. If no realm is specified, 4296285229Sgshapiro $j is used. See KNOWNBUGS. 429773188SgshapiroconfDEF_AUTH_INFO DefaultAuthInfo [undefined] Name of file that contains 429864562Sgshapiro authentication information for 429990792Sgshapiro outgoing connections. This file must 430090792Sgshapiro contain the user id, the authorization 430190792Sgshapiro id, the password (plain text), the 430290792Sgshapiro realm to use, and the list of 430390792Sgshapiro mechanisms to try, each on a separate 430490792Sgshapiro line and must be readable by root (or 430590792Sgshapiro the trusted user) only. If no realm 430690792Sgshapiro is specified, $j is used. If no 430790792Sgshapiro mechanisms are given in the file, 430890792Sgshapiro AuthMechanisms is used. Notice: this 430990792Sgshapiro option is deprecated and will be 431090792Sgshapiro removed in future versions; it doesn't 431190792Sgshapiro work for the MSP since it can't read 431290792Sgshapiro the file. Use the authinfo ruleset 431390792Sgshapiro instead. See also the section SMTP 431490792Sgshapiro AUTHENTICATION. 431590792SgshapiroconfAUTH_OPTIONS AuthOptions [undefined] If this option is 'A' 431664562Sgshapiro then the AUTH= parameter for the 431764562Sgshapiro MAIL FROM command is only issued 431864562Sgshapiro when authentication succeeded. 4319147078Sgshapiro See doc/op/op.me for more options 4320147078Sgshapiro and details. 432190792SgshapiroconfAUTH_MAX_BITS AuthMaxBits [INT_MAX] Limit the maximum encryption 432290792Sgshapiro strength for the security layer in 432390792Sgshapiro SMTP AUTH (SASL). Default is 432490792Sgshapiro essentially unlimited. 432590792SgshapiroconfTLS_SRV_OPTIONS TLSSrvOptions If this option is 'V' no client 432690792Sgshapiro verification is performed, i.e., 432790792Sgshapiro the server doesn't ask for a 432890792Sgshapiro certificate. 4329285229SgshapiroconfSERVER_SSL_OPTIONS ServerSSLOptions [undefined] SSL related 4330285229Sgshapiro options for server side. See 4331285229Sgshapiro SSL_CTX_set_options(3) for a list. 4332285229SgshapiroconfCLIENT_SSL_OPTIONS ClientSSLOptions [undefined] SSL related 4333285229Sgshapiro options for client side. See 4334285229Sgshapiro SSL_CTX_set_options(3) for a list. 4335285229SgshapiroconfCIPHER_LIST CipherList [undefined] Cipher list for TLS. 4336285229Sgshapiro See ciphers(1) for possible values. 433764562SgshapiroconfLDAP_DEFAULT_SPEC LDAPDefaultSpec [undefined] Default map 433864562Sgshapiro specification for LDAP maps. The 433964562Sgshapiro value should only contain LDAP 434064562Sgshapiro specific settings such as "-h host 434164562Sgshapiro -p port -d bindDN", etc. The 434264562Sgshapiro settings will be used for all LDAP 434364562Sgshapiro maps unless they are specified in 434464562Sgshapiro the individual map specification 434564562Sgshapiro ('K' command). 4346285229SgshapiroconfCACERT_PATH CACertPath [undefined] Path to directory with 4347285229Sgshapiro certificates of CAs which must contain 4348285229Sgshapiro their hashes as filenames or links. 4349285229SgshapiroconfCACERT CACertFile [undefined] File containing at least 4350285229Sgshapiro one CA certificate. 435164562SgshapiroconfSERVER_CERT ServerCertFile [undefined] File containing the 435264562Sgshapiro cert of the server, i.e., this cert 435364562Sgshapiro is used when sendmail acts as 435464562Sgshapiro server. 435564562SgshapiroconfSERVER_KEY ServerKeyFile [undefined] File containing the 435664562Sgshapiro private key belonging to the server 435764562Sgshapiro cert. 435864562SgshapiroconfCLIENT_CERT ClientCertFile [undefined] File containing the 435964562Sgshapiro cert of the client, i.e., this cert 436064562Sgshapiro is used when sendmail acts as 436164562Sgshapiro client. 436264562SgshapiroconfCLIENT_KEY ClientKeyFile [undefined] File containing the 436364562Sgshapiro private key belonging to the client 436464562Sgshapiro cert. 4365132943SgshapiroconfCRL CRLFile [undefined] File containing certificate 4366132943Sgshapiro revocation status, useful for X.509v3 4367132943Sgshapiro authentication. Note that CRL requires 4368132943Sgshapiro at least OpenSSL version 0.9.7. 436964562SgshapiroconfDH_PARAMETERS DHParameters [undefined] File containing the 437064562Sgshapiro DH parameters. 437164562SgshapiroconfRAND_FILE RandFile [undefined] File containing random 437266494Sgshapiro data (use prefix file:) or the 437366494Sgshapiro name of the UNIX socket if EGD is 437466494Sgshapiro used (use prefix egd:). STARTTLS 437566494Sgshapiro requires this option if the compile 437666494Sgshapiro flag HASURANDOM is not set (see 437764562Sgshapiro sendmail/README). 4378285229SgshapiroconfCERT_FINGERPRINT_ALGORITHM CertFingerprintAlgorithm 4379285229Sgshapiro [undefined] The fingerprint algorithm 4380285229Sgshapiro (digest) to use for the presented 4381285229Sgshapiro cert. 438290792SgshapiroconfNICE_QUEUE_RUN NiceQueueRun [undefined] If set, the priority of 438390792Sgshapiro queue runners is set the given value 438490792Sgshapiro (nice(3)). 438590792SgshapiroconfDIRECT_SUBMISSION_MODIFIERS DirectSubmissionModifiers 438690792Sgshapiro [undefined] Defines {daemon_flags} 438790792Sgshapiro for direct submissions. 4388157001SgshapiroconfUSE_MSP UseMSP [undefined] Use as mail submission 438990792Sgshapiro program, see sendmail/SECURITY. 439090792SgshapiroconfDELIVER_BY_MIN DeliverByMin [0] Minimum time for Deliver By 439190792Sgshapiro SMTP Service Extension (RFC 2852). 4392132943SgshapiroconfREQUIRES_DIR_FSYNC RequiresDirfsync [true] RequiresDirfsync can 4393132943Sgshapiro be used to turn off the compile time 4394132943Sgshapiro flag REQUIRES_DIR_FSYNC at runtime. 4395132943Sgshapiro See sendmail/README for details. 439690792SgshapiroconfSHARED_MEMORY_KEY SharedMemoryKey [0] Key for shared memory. 4397168515SgshapiroconfSHARED_MEMORY_KEY_FILE 4398168515Sgshapiro SharedMemoryKeyFile 4399168515Sgshapiro [undefined] File where the 4400168515Sgshapiro automatically selected key for 4401168515Sgshapiro shared memory is stored. 440290792SgshapiroconfFAST_SPLIT FastSplit [1] If set to a value greater than 440390792Sgshapiro zero, the initial MX lookups on 440490792Sgshapiro addresses is suppressed when they 440590792Sgshapiro are sorted which may result in 440690792Sgshapiro faster envelope splitting. If the 440790792Sgshapiro mail is submitted directly from the 440890792Sgshapiro command line, then the value also 440990792Sgshapiro limits the number of processes to 441090792Sgshapiro deliver the envelopes. 441190792SgshapiroconfMAILBOX_DATABASE MailboxDatabase [pw] Type of lookup to find 441290792Sgshapiro information about local mailboxes. 441390792SgshapiroconfDEQUOTE_OPTS - [empty] Additional options for the 441490792Sgshapiro dequote map. 4415168515SgshapiroconfMAX_NOOP_COMMANDS MaxNOOPCommands [20] Maximum number of "useless" 4416168515Sgshapiro commands before the SMTP server 4417168515Sgshapiro will slow down responding. 4418168515SgshapiroconfHELO_NAME HeloName If defined, use as name for EHLO/HELO 4419168515Sgshapiro command (instead of $j). 442090792SgshapiroconfINPUT_MAIL_FILTERS InputMailFilters 442190792Sgshapiro A comma separated list of filters 442290792Sgshapiro which determines which filters and 442390792Sgshapiro the invocation sequence are 442490792Sgshapiro contacted for incoming SMTP 442590792Sgshapiro messages. If none are set, no 442690792Sgshapiro filters will be contacted. 442790792SgshapiroconfMILTER_LOG_LEVEL Milter.LogLevel [9] Log level for input mail filter 442890792Sgshapiro actions, defaults to LogLevel. 442990792SgshapiroconfMILTER_MACROS_CONNECT Milter.macros.connect 4430110560Sgshapiro [j, _, {daemon_name}, {if_name}, 4431110560Sgshapiro {if_addr}] Macros to transmit to 4432110560Sgshapiro milters when a session connection 4433110560Sgshapiro starts. 443490792SgshapiroconfMILTER_MACROS_HELO Milter.macros.helo 4435110560Sgshapiro [{tls_version}, {cipher}, 4436110560Sgshapiro {cipher_bits}, {cert_subject}, 4437110560Sgshapiro {cert_issuer}] Macros to transmit to 4438110560Sgshapiro milters after HELO/EHLO command. 443990792SgshapiroconfMILTER_MACROS_ENVFROM Milter.macros.envfrom 4440110560Sgshapiro [i, {auth_type}, {auth_authen}, 4441110560Sgshapiro {auth_ssf}, {auth_author}, 4442110560Sgshapiro {mail_mailer}, {mail_host}, 4443110560Sgshapiro {mail_addr}] Macros to transmit to 4444110560Sgshapiro milters after MAIL FROM command. 444590792SgshapiroconfMILTER_MACROS_ENVRCPT Milter.macros.envrcpt 4446110560Sgshapiro [{rcpt_mailer}, {rcpt_host}, 4447110560Sgshapiro {rcpt_addr}] Macros to transmit to 4448110560Sgshapiro milters after RCPT TO command. 4449132943SgshapiroconfMILTER_MACROS_EOM Milter.macros.eom 4450132943Sgshapiro [{msg_id}] Macros to transmit to 4451168515Sgshapiro milters after the terminating 4452168515Sgshapiro DATA '.' is received. 4453168515SgshapiroconfMILTER_MACROS_EOH Milter.macros.eoh 4454168515Sgshapiro Macros to transmit to milters 4455168515Sgshapiro after the end of headers. 4456168515SgshapiroconfMILTER_MACROS_DATA Milter.macros.data 4457168515Sgshapiro Macros to transmit to milters 4458168515Sgshapiro after DATA command is received. 445964562Sgshapiro 446090792Sgshapiro 446138032SpeterSee also the description of OSTYPE for some parameters that can be 446238032Spetertweaked (generally pathnames to mailers). 446338032Speter 446490792SgshapiroClientPortOptions and DaemonPortOptions are special cases since multiple 446590792Sgshapiroclients/daemons can be defined. This can be done via 446638032Speter 446790792Sgshapiro CLIENT_OPTIONS(`field1=value1,field2=value2,...') 446864562Sgshapiro DAEMON_OPTIONS(`field1=value1,field2=value2,...') 446964562Sgshapiro 447090792SgshapiroNote that multiple CLIENT_OPTIONS() commands (and therefore multiple 447190792SgshapiroClientPortOptions settings) are allowed in order to give settings for each 447290792Sgshapiroprotocol family (e.g., one for Family=inet and one for Family=inet6). A 447390792Sgshapirorestriction placed on one family only affects outgoing connections on that 447490792Sgshapiroparticular family. 447590792Sgshapiro 447664562SgshapiroIf DAEMON_OPTIONS is not used, then the default is 447764562Sgshapiro 447864562Sgshapiro DAEMON_OPTIONS(`Port=smtp, Name=MTA') 447964562Sgshapiro DAEMON_OPTIONS(`Port=587, Name=MSA, M=E') 448064562Sgshapiro 448164562SgshapiroIf you use one DAEMON_OPTIONS macro, it will alter the parameters 448264562Sgshapiroof the first of these. The second will still be defaulted; it 448364562Sgshapirorepresents a "Message Submission Agent" (MSA) as defined by RFC 448464562Sgshapiro2476 (see below). To turn off the default definition for the MSA, 448564562Sgshapirouse FEATURE(`no_default_msa') (see also FEATURES). If you use 448664562Sgshapiroadditional DAEMON_OPTIONS macros, they will add additional daemons. 448764562Sgshapiro 448864562SgshapiroExample 1: To change the port for the SMTP listener, while 448964562Sgshapirostill using the MSA default, use 449064562Sgshapiro DAEMON_OPTIONS(`Port=925, Name=MTA') 449164562Sgshapiro 449264562SgshapiroExample 2: To change the port for the MSA daemon, while still 449364562Sgshapirousing the default SMTP port, use 449464562Sgshapiro FEATURE(`no_default_msa') 449564562Sgshapiro DAEMON_OPTIONS(`Name=MTA') 449664562Sgshapiro DAEMON_OPTIONS(`Port=987, Name=MSA, M=E') 449764562Sgshapiro 449864562SgshapiroNote that if the first of those DAEMON_OPTIONS lines were omitted, then 449964562Sgshapirothere would be no listener on the standard SMTP port. 450064562Sgshapiro 450164562SgshapiroExample 3: To listen on both IPv4 and IPv6 interfaces, use 450264562Sgshapiro 450364562Sgshapiro DAEMON_OPTIONS(`Name=MTA-v4, Family=inet') 450464562Sgshapiro DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6') 450564562Sgshapiro 450664562SgshapiroA "Message Submission Agent" still uses all of the same rulesets for 450764562Sgshapiroprocessing the message (and therefore still allows message rejection via 450864562Sgshapirothe check_* rulesets). In accordance with the RFC, the MSA will ensure 4509110560Sgshapirothat all domains in envelope addresses are fully qualified if the message 4510110560Sgshapirois relayed to another MTA. It will also enforce the normal address syntax 4511110560Sgshapirorules and log error messages. Additionally, by using the M=a modifier you 4512110560Sgshapirocan require authentication before messages are accepted by the MSA. 4513110560SgshapiroNotice: Do NOT use the 'a' modifier on a public accessible MTA! Finally, 4514110560Sgshapirothe M=E modifier shown above disables ETRN as required by RFC 2476. 451564562Sgshapiro 451690792SgshapiroMail filters can be defined using the INPUT_MAIL_FILTER() and MAIL_FILTER() 451790792Sgshapirocommands: 451864562Sgshapiro 451990792Sgshapiro INPUT_MAIL_FILTER(`sample', `S=local:/var/run/f1.sock') 452090792Sgshapiro MAIL_FILTER(`myfilter', `S=inet:3333@localhost') 452138032Speter 452290792SgshapiroThe INPUT_MAIL_FILTER() command causes the filter(s) to be called in the 452390792Sgshapirosame order they were specified by also setting confINPUT_MAIL_FILTERS. A 452490792Sgshapirofilter can be defined without adding it to the input filter list by using 452590792SgshapiroMAIL_FILTER() instead of INPUT_MAIL_FILTER() in your .mc file. 452690792SgshapiroAlternatively, you can reset the list of filters and their order by setting 452790792SgshapiroconfINPUT_MAIL_FILTERS option after all INPUT_MAIL_FILTER() commands in 452890792Sgshapiroyour .mc file. 452990792Sgshapiro 453090792Sgshapiro 453190792Sgshapiro+----------------------------+ 453290792Sgshapiro| MESSAGE SUBMISSION PROGRAM | 453390792Sgshapiro+----------------------------+ 453490792Sgshapiro 453590792SgshapiroThe purpose of the message submission program (MSP) is explained 453690792Sgshapiroin sendmail/SECURITY. This section contains a list of caveats and 453790792Sgshapiroa few hints how for those who want to tweak the default configuration 453890792Sgshapirofor it (which is installed as submit.cf). 453990792Sgshapiro 454090792SgshapiroNotice: do not add options/features to submit.mc unless you are 454190792Sgshapiroabsolutely sure you need them. Options you may want to change 454290792Sgshapiroinclude: 454390792Sgshapiro 454494334Sgshapiro- confTRUSTED_USERS, FEATURE(`use_ct_file'), and confCT_FILE for 454598121Sgshapiro avoiding X-Authentication warnings. 454694334Sgshapiro- confTIME_ZONE to change it from the default `USE_TZ'. 454790792Sgshapiro- confDELIVERY_MODE is set to interactive in msp.m4 instead 454890792Sgshapiro of the default background mode. 454998121Sgshapiro- FEATURE(stickyhost) and LOCAL_RELAY to send unqualified addresses 455098121Sgshapiro to the LOCAL_RELAY instead of the default relay. 455198121Sgshapiro- confRAND_FILE if you use STARTTLS and sendmail is not compiled with 455298121Sgshapiro the flag HASURANDOM. 455390792Sgshapiro 455498121SgshapiroThe MSP performs hostname canonicalization by default. As also 455598121Sgshapiroexplained in sendmail/SECURITY, mail may end up for various DNS 455698121Sgshapirorelated reasons in the MSP queue. This problem can be minimized by 455798121Sgshapirousing 455898121Sgshapiro 455998121Sgshapiro FEATURE(`nocanonify', `canonify_hosts') 456098121Sgshapiro define(`confDIRECT_SUBMISSION_MODIFIERS', `C') 456198121Sgshapiro 456298121SgshapiroSee the discussion about nocanonify for possible side effects. 456398121Sgshapiro 456490792SgshapiroSome things are not intended to work with the MSP. These include 456590792Sgshapirofeatures that influence the delivery process (e.g., mailertable, 456690792Sgshapiroaliases), or those that are only important for a SMTP server (e.g., 456790792Sgshapirovirtusertable, DaemonPortOptions, multiple queues). Moreover, 456890792Sgshapirorelaxing certain restrictions (RestrictQueueRun, permissions on 456990792Sgshapiroqueue directory) or adding features (e.g., enabling prog/file mailer) 457090792Sgshapirocan cause security problems. 457190792Sgshapiro 457290792SgshapiroOther things don't work well with the MSP and require tweaking or 457390792Sgshapiroworkarounds. For example, to allow for client authentication it 457490792Sgshapirois not just sufficient to provide a client certificate and the 457590792Sgshapirocorresponding key, but it is also necessary to make the key group 457690792Sgshapiro(smmsp) readable and tell sendmail not to complain about that, i.e., 457790792Sgshapiro 457890792Sgshapiro define(`confDONT_BLAME_SENDMAIL', `GroupReadableKeyFile') 457990792Sgshapiro 458090792SgshapiroIf the MSP should actually use AUTH then the necessary data 458190792Sgshapiroshould be placed in a map as explained in SMTP AUTHENTICATION: 458290792Sgshapiro 458390792SgshapiroFEATURE(`authinfo', `DATABASE_MAP_TYPE /etc/mail/msp-authinfo') 458490792Sgshapiro 458590792Sgshapiro/etc/mail/msp-authinfo should contain an entry like: 458690792Sgshapiro 458790792Sgshapiro AuthInfo:127.0.0.1 "U:smmsp" "P:secret" "M:DIGEST-MD5" 458890792Sgshapiro 458990792SgshapiroThe file and the map created by makemap should be owned by smmsp, 459090792Sgshapiroits group should be smmsp, and it should have mode 640. The database 459190792Sgshapiroused by the MTA for AUTH must have a corresponding entry. 459290792SgshapiroAdditionally the MTA must trust this authentication data so the AUTH= 459390792Sgshapiropart will be relayed on to the next hop. This can be achieved by 459490792Sgshapiroadding the following to your sendmail.mc file: 459590792Sgshapiro 459690792Sgshapiro LOCAL_RULESETS 459790792Sgshapiro SLocal_trust_auth 459890792Sgshapiro R$* $: $&{auth_authen} 459990792Sgshapiro Rsmmsp $# OK 460090792Sgshapiro 4601132943SgshapiroNote: the authentication data can leak to local users who invoke 4602132943Sgshapirothe MSP with debug options or even with -v. For that reason either 4603132943Sgshapiroan authentication mechanism that does not show the password in the 4604132943SgshapiroAUTH dialogue (e.g., DIGEST-MD5) or a different authentication 4605132943Sgshapiromethod like STARTTLS should be used. 4606132943Sgshapiro 460790792Sgshapirofeature/msp.m4 defines almost all settings for the MSP. Most of 460890792Sgshapirothose should not be changed at all. Some of the features and options 460990792Sgshapirocan be overridden if really necessary. It is a bit tricky to do 461090792Sgshapirothis, because it depends on the actual way the option is defined 461190792Sgshapiroin feature/msp.m4. If it is directly defined (i.e., define()) then 461290792Sgshapirothe modified value must be defined after 461390792Sgshapiro 461490792Sgshapiro FEATURE(`msp') 461590792Sgshapiro 461690792SgshapiroIf it is conditionally defined (i.e., ifdef()) then the desired 461790792Sgshapirovalue must be defined before the FEATURE line in the .mc file. 461890792SgshapiroTo see how the options are defined read feature/msp.m4. 461990792Sgshapiro 462090792Sgshapiro 462190792Sgshapiro+--------------------------+ 462290792Sgshapiro| FORMAT OF FILES AND MAPS | 462390792Sgshapiro+--------------------------+ 462490792Sgshapiro 462590792SgshapiroFiles that define classes, i.e., F{classname}, consist of lines 462690792Sgshapiroeach of which contains a single element of the class. For example, 462790792Sgshapiro/etc/mail/local-host-names may have the following content: 462890792Sgshapiro 462990792Sgshapiromy.domain 463090792Sgshapiroanother.domain 463190792Sgshapiro 463290792SgshapiroMaps must be created using makemap(8) , e.g., 463390792Sgshapiro 463490792Sgshapiro makemap hash MAP < MAP 463590792Sgshapiro 463690792SgshapiroIn general, a text file from which a map is created contains lines 463790792Sgshapiroof the form 463890792Sgshapiro 463990792Sgshapirokey value 464090792Sgshapiro 464190792Sgshapirowhere 'key' and 'value' are also called LHS and RHS, respectively. 464290792SgshapiroBy default, the delimiter between LHS and RHS is a non-empty sequence 464390792Sgshapiroof white space characters. 464490792Sgshapiro 464590792Sgshapiro 464690792Sgshapiro+------------------+ 464790792Sgshapiro| DIRECTORY LAYOUT | 464890792Sgshapiro+------------------+ 464990792Sgshapiro 465038032SpeterWithin this directory are several subdirectories, to wit: 465138032Speter 465238032Speterm4 General support routines. These are typically 465338032Speter very important and should not be changed without 465438032Speter very careful consideration. 465538032Speter 465638032Spetercf The configuration files themselves. They have 465738032Speter ".mc" suffixes, and must be run through m4 to 465838032Speter become complete. The resulting output should 465938032Speter have a ".cf" suffix. 466038032Speter 466138032Speterostype Definitions describing a particular operating 466238032Speter system type. These should always be referenced 466338032Speter using the OSTYPE macro in the .mc file. Examples 466438032Speter include "bsd4.3", "bsd4.4", "sunos3.5", and 466538032Speter "sunos4.1". 466638032Speter 466738032Speterdomain Definitions describing a particular domain, referenced 466838032Speter using the DOMAIN macro in the .mc file. These are 466938032Speter site dependent; for example, "CS.Berkeley.EDU.m4" 467038032Speter describes hosts in the CS.Berkeley.EDU subdomain. 467138032Speter 467266494Sgshapiromailer Descriptions of mailers. These are referenced using 467338032Speter the MAILER macro in the .mc file. 467438032Speter 467538032Spetersh Shell files used when building the .cf file from the 467638032Speter .mc file in the cf subdirectory. 467738032Speter 467838032Speterfeature These hold special orthogonal features that you might 467938032Speter want to include. They should be referenced using 468038032Speter the FEATURE macro. 468138032Speter 468238032Speterhack Local hacks. These can be referenced using the HACK 468338032Speter macro. They shouldn't be of more than voyeuristic 468438032Speter interest outside the .Berkeley.EDU domain, but who knows? 468538032Speter 468638032Spetersiteconfig Site configuration -- e.g., tables of locally connected 468738032Speter UUCP sites. 468838032Speter 468938032Speter 469038032Speter+------------------------+ 469138032Speter| ADMINISTRATIVE DETAILS | 469238032Speter+------------------------+ 469338032Speter 469438032SpeterThe following sections detail usage of certain internal parts of the 469538032Spetersendmail.cf file. Read them carefully if you are trying to modify 469638032Speterthe current model. If you find the above descriptions adequate, these 469738032Spetershould be {boring, confusing, tedious, ridiculous} (pick one or more). 469838032Speter 469938032SpeterRULESETS (* means built in to sendmail) 470038032Speter 470138032Speter 0 * Parsing 470238032Speter 1 * Sender rewriting 470338032Speter 2 * Recipient rewriting 470438032Speter 3 * Canonicalization 470538032Speter 4 * Post cleanup 470638032Speter 5 * Local address rewrite (after aliasing) 470738032Speter 1x mailer rules (sender qualification) 470838032Speter 2x mailer rules (recipient qualification) 470938032Speter 3x mailer rules (sender header qualification) 471038032Speter 4x mailer rules (recipient header qualification) 471138032Speter 5x mailer subroutines (general) 471238032Speter 6x mailer subroutines (general) 471338032Speter 7x mailer subroutines (general) 471438032Speter 8x reserved 471538032Speter 90 Mailertable host stripping 471638032Speter 96 Bottom half of Ruleset 3 (ruleset 6 in old sendmail) 471738032Speter 97 Hook for recursive ruleset 0 call (ruleset 7 in old sendmail) 471838032Speter 98 Local part of ruleset 0 (ruleset 8 in old sendmail) 471938032Speter 472038032Speter 472138032SpeterMAILERS 472238032Speter 472338032Speter 0 local, prog local and program mailers 472438032Speter 1 [e]smtp, relay SMTP channel 472538032Speter 2 uucp-* UNIX-to-UNIX Copy Program 472638032Speter 3 netnews Network News delivery 472738032Speter 4 fax Sam Leffler's HylaFAX software 472838032Speter 5 mail11 DECnet mailer 472938032Speter 473038032Speter 473138032SpeterMACROS 473238032Speter 473338032Speter A 473438032Speter B Bitnet Relay 473538032Speter C DECnet Relay 473638032Speter D The local domain -- usually not needed 473738032Speter E reserved for X.400 Relay 473838032Speter F FAX Relay 473938032Speter G 474038032Speter H mail Hub (for mail clusters) 474138032Speter I 474238032Speter J 474338032Speter K 474438032Speter L Luser Relay 474564562Sgshapiro M Masquerade (who you claim to be) 474638032Speter N 474738032Speter O 474838032Speter P 474938032Speter Q 475038032Speter R Relay (for unqualified names) 475138032Speter S Smart Host 475238032Speter T 475364562Sgshapiro U my UUCP name (if you have a UUCP connection) 475464562Sgshapiro V UUCP Relay (class {V} hosts) 475564562Sgshapiro W UUCP Relay (class {W} hosts) 475664562Sgshapiro X UUCP Relay (class {X} hosts) 475738032Speter Y UUCP Relay (all other hosts) 475838032Speter Z Version number 475938032Speter 476038032Speter 476138032SpeterCLASSES 476238032Speter 476338032Speter A 476438032Speter B domains that are candidates for bestmx lookup 476538032Speter C 476638032Speter D 476738032Speter E addresses that should not seem to come from $M 476864562Sgshapiro F hosts this system forward for 476938032Speter G domains that should be looked up in genericstable 477038032Speter H 477138032Speter I 477238032Speter J 477338032Speter K 477438032Speter L addresses that should not be forwarded to $R 477538032Speter M domains that should be mapped to $M 477664562Sgshapiro N host/domains that should not be mapped to $M 477738032Speter O operators that indicate network operations (cannot be in local names) 477838032Speter P top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc. 477938032Speter Q 478064562Sgshapiro R domains this system is willing to relay (pass anti-spam filters) 478138032Speter S 478238032Speter T 478338032Speter U locally connected UUCP hosts 478438032Speter V UUCP hosts connected to relay $V 478538032Speter W UUCP hosts connected to relay $W 478638032Speter X UUCP hosts connected to relay $X 478738032Speter Y locally connected smart UUCP hosts 478838032Speter Z locally connected domain-ized UUCP hosts 478938032Speter . the class containing only a dot 479038032Speter [ the class containing only a left bracket 479138032Speter 479238032Speter 479338032SpeterM4 DIVERSIONS 479438032Speter 479538032Speter 1 Local host detection and resolution 479638032Speter 2 Local Ruleset 3 additions 479738032Speter 3 Local Ruleset 0 additions 479838032Speter 4 UUCP Ruleset 0 additions 479938032Speter 5 locally interpreted names (overrides $R) 480038032Speter 6 local configuration (at top of file) 480138032Speter 7 mailer definitions 480264562Sgshapiro 8 DNS based blacklists 480338032Speter 9 special local rulesets (1 and 2) 480464562Sgshapiro 4805266527Sgshapiro$Revision: 8.730 $, Last updated $Date: 2014-01-16 15:55:51 $ 4806