README revision 159609
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 # 80157001Sgshapiro # Copyright (c) 1998-2005 Sendmail, 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 16138032Speter+----------------------------+ 16238032Speter| A BRIEF INTRODUCTION TO M4 | 16338032Speter+----------------------------+ 16438032Speter 16538032SpeterSendmail uses the M4 macro processor to ``compile'' the configuration 16638032Speterfiles. The most important thing to know is that M4 is stream-based, 16738032Speterthat is, it doesn't understand about lines. For this reason, in some 16838032Speterplaces you may see the word ``dnl'', which stands for ``delete 16938032Speterthrough newline''; essentially, it deletes all characters starting 17038032Speterat the ``dnl'' up to and including the next newline character. In 17138032Spetermost cases sendmail uses this only to avoid lots of unnecessary 17238032Speterblank lines in the output. 17338032Speter 17438032SpeterOther important directives are define(A, B) which defines the macro 17538032Speter``A'' to have value ``B''. Macros are expanded as they are read, so 17638032Speterone normally quotes both values to prevent expansion. For example, 17738032Speter 17838032Speter define(`SMART_HOST', `smart.foo.com') 17938032Speter 18038032SpeterOne word of warning: M4 macros are expanded even in lines that appear 18138032Speterto be comments. For example, if you have 18238032Speter 18364562Sgshapiro # See FEATURE(`foo') above 18438032Speter 18564562Sgshapiroit will not do what you expect, because the FEATURE(`foo') will be 18638032Speterexpanded. This also applies to 18738032Speter 18838032Speter # And then define the $X macro to be the return address 18938032Speter 19038032Speterbecause ``define'' is an M4 keyword. If you want to use them, surround 19138032Speterthem with directed quotes, `like this'. 19238032Speter 193110560SgshapiroSince m4 uses single quotes (opening "`" and closing "'") to quote 194110560Sgshapiroarguments, those quotes can't be used in arguments. For example, 195110560Sgshapiroit is not possible to define a rejection message containing a single 196110560Sgshapiroquote. Usually there are simple workarounds by changing those 197110560Sgshapiromessages; in the worst case it might be ok to change the value 198110560Sgshapirodirectly in the generated .cf file, which however is not advised. 19990792Sgshapiro 200110560Sgshapiro 20190792SgshapiroNotice: 20290792Sgshapiro------- 20390792Sgshapiro 20490792SgshapiroThis package requires a post-V7 version of m4; if you are running the 20590792Sgshapiro4.2bsd, SysV.2, or 7th Edition version. SunOS's /usr/5bin/m4 or 20690792SgshapiroBSD-Net/2's m4 both work. GNU m4 version 1.1 or later also works. 20790792SgshapiroUnfortunately, the M4 on BSDI 1.0 doesn't work -- you'll have to use a 20890792SgshapiroNet/2 or GNU version. GNU m4 is available from 20990792Sgshapiroftp://ftp.gnu.org/pub/gnu/m4/m4-1.4.tar.gz (check for the latest version). 21090792SgshapiroEXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken (3.x is fine). Use GNU 21190792Sgshapirom4 on this platform. 21290792Sgshapiro 21390792Sgshapiro 21438032Speter+----------------+ 21538032Speter| FILE LOCATIONS | 21638032Speter+----------------+ 21738032Speter 21838032Spetersendmail 8.9 has introduced a new configuration directory for sendmail 21938032Speterrelated files, /etc/mail. The new files available for sendmail 8.9 -- 22064562Sgshapirothe class {R} /etc/mail/relay-domains and the access database 22164562Sgshapiro/etc/mail/access -- take advantage of this new directory. Beginning with 22264562Sgshapiro8.10, all files will use this directory by default (some options may be 22364562Sgshapiroset by OSTYPE() files). This new directory should help to restore 22464562Sgshapirouniformity to sendmail's file locations. 22538032Speter 22664562SgshapiroBelow is a table of some of the common changes: 22764562Sgshapiro 22864562SgshapiroOld filename New filename 22964562Sgshapiro------------ ------------ 23064562Sgshapiro/etc/bitdomain /etc/mail/bitdomain 23164562Sgshapiro/etc/domaintable /etc/mail/domaintable 23264562Sgshapiro/etc/genericstable /etc/mail/genericstable 23364562Sgshapiro/etc/uudomain /etc/mail/uudomain 23464562Sgshapiro/etc/virtusertable /etc/mail/virtusertable 23564562Sgshapiro/etc/userdb /etc/mail/userdb 23664562Sgshapiro 23764562Sgshapiro/etc/aliases /etc/mail/aliases 23864562Sgshapiro/etc/sendmail/aliases /etc/mail/aliases 23964562Sgshapiro/etc/ucbmail/aliases /etc/mail/aliases 24064562Sgshapiro/usr/adm/sendmail/aliases /etc/mail/aliases 24164562Sgshapiro/usr/lib/aliases /etc/mail/aliases 24264562Sgshapiro/usr/lib/mail/aliases /etc/mail/aliases 24364562Sgshapiro/usr/ucblib/aliases /etc/mail/aliases 24464562Sgshapiro 24564562Sgshapiro/etc/sendmail.cw /etc/mail/local-host-names 24664562Sgshapiro/etc/mail/sendmail.cw /etc/mail/local-host-names 24764562Sgshapiro/etc/sendmail/sendmail.cw /etc/mail/local-host-names 24864562Sgshapiro 24964562Sgshapiro/etc/sendmail.ct /etc/mail/trusted-users 25064562Sgshapiro 25164562Sgshapiro/etc/sendmail.oE /etc/mail/error-header 25264562Sgshapiro 25364562Sgshapiro/etc/sendmail.hf /etc/mail/helpfile 25464562Sgshapiro/etc/mail/sendmail.hf /etc/mail/helpfile 25564562Sgshapiro/usr/ucblib/sendmail.hf /etc/mail/helpfile 25664562Sgshapiro/etc/ucbmail/sendmail.hf /etc/mail/helpfile 25764562Sgshapiro/usr/lib/sendmail.hf /etc/mail/helpfile 25864562Sgshapiro/usr/share/lib/sendmail.hf /etc/mail/helpfile 25964562Sgshapiro/usr/share/misc/sendmail.hf /etc/mail/helpfile 26064562Sgshapiro/share/misc/sendmail.hf /etc/mail/helpfile 26164562Sgshapiro 26264562Sgshapiro/etc/service.switch /etc/mail/service.switch 26364562Sgshapiro 26464562Sgshapiro/etc/sendmail.st /etc/mail/statistics 26564562Sgshapiro/etc/mail/sendmail.st /etc/mail/statistics 26664562Sgshapiro/etc/mailer/sendmail.st /etc/mail/statistics 26764562Sgshapiro/etc/sendmail/sendmail.st /etc/mail/statistics 26864562Sgshapiro/usr/lib/sendmail.st /etc/mail/statistics 26964562Sgshapiro/usr/ucblib/sendmail.st /etc/mail/statistics 27064562Sgshapiro 27164562SgshapiroNote that all of these paths actually use a new m4 macro MAIL_SETTINGS_DIR 27264562Sgshapiroto create the pathnames. The default value of this variable is 27364562Sgshapiro`/etc/mail/'. If you set this macro to a different value, you MUST include 27464562Sgshapiroa trailing slash. 27564562Sgshapiro 27680785SgshapiroNotice: all filenames used in a .mc (or .cf) file should be absolute 27780785Sgshapiro(starting at the root, i.e., with '/'). Relative filenames most 27880785Sgshapirolikely cause surprises during operations (unless otherwise noted). 27980785Sgshapiro 28080785Sgshapiro 28138032Speter+--------+ 28238032Speter| OSTYPE | 28338032Speter+--------+ 28438032Speter 28538032SpeterYou MUST define an operating system environment, or the configuration 28638032Speterfile build will puke. There are several environments available; look 28738032Speterat the "ostype" directory for the current list. This macro changes 28838032Speterthings like the location of the alias file and queue directory. Some 28938032Speterof these files are identical to one another. 29038032Speter 29138032SpeterIt is IMPERATIVE that the OSTYPE occur before any MAILER definitions. 29238032SpeterIn general, the OSTYPE macro should go immediately after any version 29338032Speterinformation, and MAILER definitions should always go last. 29438032Speter 29538032SpeterOperating system definitions are usually easy to write. They may define 29638032Speterthe following variables (everything defaults, so an ostype file may be 29738032Speterempty). Unfortunately, the list of configuration-supported systems is 29838032Speternot as broad as the list of source-supported systems, since many of 29938032Speterthe source contributors do not include corresponding ostype files. 30038032Speter 30164562SgshapiroALIAS_FILE [/etc/mail/aliases] The location of the text version 30238032Speter of the alias file(s). It can be a comma-separated 30338032Speter list of names (but be sure you quote values with 30438032Speter commas in them -- for example, use 30538032Speter define(`ALIAS_FILE', `a,b') 30638032Speter to get "a" and "b" both listed as alias files; 30738032Speter otherwise the define() primitive only sees "a"). 30864562SgshapiroHELP_FILE [/etc/mail/helpfile] The name of the file 30938032Speter containing information printed in response to 31038032Speter the SMTP HELP command. 31138032SpeterQUEUE_DIR [/var/spool/mqueue] The directory containing 31264562Sgshapiro queue files. To use multiple queues, supply 31364562Sgshapiro a value ending with an asterisk. For 31473188Sgshapiro example, /var/spool/mqueue/qd* will use all of the 31564562Sgshapiro directories or symbolic links to directories 31673188Sgshapiro beginning with 'qd' in /var/spool/mqueue as queue 31764562Sgshapiro directories. The names 'qf', 'df', and 'xf' are 31873188Sgshapiro reserved as specific subdirectories for the 31973188Sgshapiro corresponding queue file types as explained in 32090792Sgshapiro doc/op/op.me. See also QUEUE GROUP DEFINITIONS. 32190792SgshapiroMSP_QUEUE_DIR [/var/spool/clientmqueue] The directory containing 32290792Sgshapiro queue files for the MSP (Mail Submission Program, 32390792Sgshapiro see sendmail/SECURITY). 32464562SgshapiroSTATUS_FILE [/etc/mail/statistics] The file containing status 32538032Speter information. 32638032SpeterLOCAL_MAILER_PATH [/bin/mail] The program used to deliver local mail. 32764562SgshapiroLOCAL_MAILER_FLAGS [Prmn9] The flags used by the local mailer. The 32864562Sgshapiro flags lsDFMAw5:/|@q are always included. 32938032SpeterLOCAL_MAILER_ARGS [mail -d $u] The arguments passed to deliver local 33038032Speter mail. 33138032SpeterLOCAL_MAILER_MAX [undefined] If defined, the maximum size of local 33238032Speter mail that you are willing to accept. 33364562SgshapiroLOCAL_MAILER_MAXMSGS [undefined] If defined, the maximum number of 33464562Sgshapiro messages to deliver in a single connection. Only 33564562Sgshapiro useful for LMTP local mailers. 33638032SpeterLOCAL_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 33738032Speter that ARRIVE from an address that resolves to the 33838032Speter local mailer and which are converted to MIME will be 33938032Speter labeled with this character set. 34064562SgshapiroLOCAL_MAILER_EOL [undefined] If defined, the string to use as the 34164562Sgshapiro end of line for the local mailer. 34264562SgshapiroLOCAL_MAILER_DSN_DIAGNOSTIC_CODE 34364562Sgshapiro [X-Unix] The DSN Diagnostic-Code value for the 34464562Sgshapiro local mailer. This should be changed with care. 34538032SpeterLOCAL_SHELL_PATH [/bin/sh] The shell used to deliver piped email. 34638032SpeterLOCAL_SHELL_FLAGS [eu9] The flags used by the shell mailer. The 34738032Speter flags lsDFM are always included. 34838032SpeterLOCAL_SHELL_ARGS [sh -c $u] The arguments passed to deliver "prog" 34938032Speter mail. 35038032SpeterLOCAL_SHELL_DIR [$z:/] The directory search path in which the 35138032Speter shell should run. 35290792SgshapiroLOCAL_MAILER_QGRP [undefined] The queue group for the local mailer. 35338032SpeterUSENET_MAILER_PATH [/usr/lib/news/inews] The name of the program 35438032Speter used to submit news. 35564562SgshapiroUSENET_MAILER_FLAGS [rsDFMmn] The mailer flags for the usenet mailer. 35638032SpeterUSENET_MAILER_ARGS [-m -h -n] The command line arguments for the 35790792Sgshapiro usenet mailer. NOTE: Some versions of inews 35890792Sgshapiro (such as those shipped with newer versions of INN) 35990792Sgshapiro use different flags. Double check the defaults 36090792Sgshapiro against the inews man page. 361102528SgshapiroUSENET_MAILER_MAX [undefined] The maximum size of messages that will 36238032Speter be accepted by the usenet mailer. 36390792SgshapiroUSENET_MAILER_QGRP [undefined] The queue group for the usenet mailer. 36438032SpeterSMTP_MAILER_FLAGS [undefined] Flags added to SMTP mailer. Default 36564562Sgshapiro flags are `mDFMuX' for all SMTP-based mailers; the 36664562Sgshapiro "esmtp" mailer adds `a'; "smtp8" adds `8'; and 36764562Sgshapiro "dsmtp" adds `%'. 36864562SgshapiroRELAY_MAILER_FLAGS [undefined] Flags added to the relay mailer. Default 36964562Sgshapiro flags are `mDFMuX' for all SMTP-based mailers; the 37064562Sgshapiro relay mailer adds `a8'. If this is not defined, 37164562Sgshapiro then SMTP_MAILER_FLAGS is used. 37238032SpeterSMTP_MAILER_MAX [undefined] The maximum size of messages that will 37364562Sgshapiro be transported using the smtp, smtp8, esmtp, or dsmtp 37438032Speter mailers. 37564562SgshapiroSMTP_MAILER_MAXMSGS [undefined] If defined, the maximum number of 37664562Sgshapiro messages to deliver in a single connection for the 37764562Sgshapiro smtp, smtp8, esmtp, or dsmtp mailers. 37894334SgshapiroSMTP_MAILER_MAXRCPTS [undefined] If defined, the maximum number of 37994334Sgshapiro recipients to deliver in a single connection for the 38094334Sgshapiro smtp, smtp8, esmtp, or dsmtp mailers. 38166494SgshapiroSMTP_MAILER_ARGS [TCP $h] The arguments passed to the smtp mailer. 38238032Speter About the only reason you would want to change this 38338032Speter would be to change the default port. 38466494SgshapiroESMTP_MAILER_ARGS [TCP $h] The arguments passed to the esmtp mailer. 38566494SgshapiroSMTP8_MAILER_ARGS [TCP $h] The arguments passed to the smtp8 mailer. 38666494SgshapiroDSMTP_MAILER_ARGS [TCP $h] The arguments passed to the dsmtp mailer. 38766494SgshapiroRELAY_MAILER_ARGS [TCP $h] The arguments passed to the relay mailer. 38890792SgshapiroSMTP_MAILER_QGRP [undefined] The queue group for the smtp mailer. 38990792SgshapiroESMTP_MAILER_QGRP [undefined] The queue group for the esmtp mailer. 39090792SgshapiroSMTP8_MAILER_QGRP [undefined] The queue group for the smtp8 mailer. 39190792SgshapiroDSMTP_MAILER_QGRP [undefined] The queue group for the dsmtp mailer. 39290792SgshapiroRELAY_MAILER_QGRP [undefined] The queue group for the relay mailer. 39364562SgshapiroRELAY_MAILER_MAXMSGS [undefined] If defined, the maximum number of 39464562Sgshapiro messages to deliver in a single connection for the 39564562Sgshapiro relay mailer. 39638032SpeterSMTP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 39738032Speter that ARRIVE from an address that resolves to one of 39838032Speter the SMTP mailers and which are converted to MIME will 39938032Speter be labeled with this character set. 40038032SpeterUUCP_MAILER_PATH [/usr/bin/uux] The program used to send UUCP mail. 40138032SpeterUUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer. Default 40238032Speter flags are `DFMhuU' (and `m' for uucp-new mailer, 40338032Speter minus `U' for uucp-dom mailer). 40438032SpeterUUCP_MAILER_ARGS [uux - -r -z -a$g -gC $h!rmail ($u)] The arguments 40538032Speter passed to the UUCP mailer. 40638032SpeterUUCP_MAILER_MAX [100000] The maximum size message accepted for 40738032Speter transmission by the UUCP mailers. 40838032SpeterUUCP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 40938032Speter that ARRIVE from an address that resolves to one of 41038032Speter the UUCP mailers and which are converted to MIME will 41138032Speter be labeled with this character set. 41290792SgshapiroUUCP_MAILER_QGRP [undefined] The queue group for the UUCP mailers. 41338032SpeterFAX_MAILER_PATH [/usr/local/lib/fax/mailfax] The program used to 41438032Speter submit FAX messages. 41538032SpeterFAX_MAILER_ARGS [mailfax $u $h $f] The arguments passed to the FAX 41638032Speter mailer. 41738032SpeterFAX_MAILER_MAX [100000] The maximum size message accepted for 41838032Speter transmission by FAX. 41938032SpeterPOP_MAILER_PATH [/usr/lib/mh/spop] The pathname of the POP mailer. 42064562SgshapiroPOP_MAILER_FLAGS [Penu] Flags added to POP mailer. Flags lsDFMq 42138032Speter are always added. 42238032SpeterPOP_MAILER_ARGS [pop $u] The arguments passed to the POP mailer. 42390792SgshapiroPOP_MAILER_QGRP [undefined] The queue group for the pop mailer. 42438032SpeterPROCMAIL_MAILER_PATH [/usr/local/bin/procmail] The path to the procmail 42543730Speter program. This is also used by 42643730Speter FEATURE(`local_procmail'). 42738032SpeterPROCMAIL_MAILER_FLAGS [SPhnu9] Flags added to Procmail mailer. Flags 42864562Sgshapiro DFM are always set. This is NOT used by 42943730Speter FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS 43038032Speter instead. 43138032SpeterPROCMAIL_MAILER_ARGS [procmail -Y -m $h $f $u] The arguments passed to 43238032Speter the Procmail mailer. This is NOT used by 43343730Speter FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS 43438032Speter instead. 43538032SpeterPROCMAIL_MAILER_MAX [undefined] If set, the maximum size message that 43638032Speter will be accepted by the procmail mailer. 43790792SgshapiroPROCMAIL_MAILER_QGRP [undefined] The queue group for the procmail mailer. 43838032SpeterMAIL11_MAILER_PATH [/usr/etc/mail11] The path to the mail11 mailer. 43938032SpeterMAIL11_MAILER_FLAGS [nsFx] Flags for the mail11 mailer. 44038032SpeterMAIL11_MAILER_ARGS [mail11 $g $x $h $u] Arguments passed to the mail11 44138032Speter mailer. 44290792SgshapiroMAIL11_MAILER_QGRP [undefined] The queue group for the mail11 mailer. 44338032SpeterPH_MAILER_PATH [/usr/local/etc/phquery] The path to the phquery 44438032Speter program. 44564562SgshapiroPH_MAILER_FLAGS [ehmu] Flags for the phquery mailer. Flags nrDFM 44664562Sgshapiro are always set. 44738032SpeterPH_MAILER_ARGS [phquery -- $u] -- arguments to the phquery mailer. 44890792SgshapiroPH_MAILER_QGRP [undefined] The queue group for the ph mailer. 44964562SgshapiroCYRUS_MAILER_FLAGS [Ah5@/:|] The flags used by the cyrus mailer. The 45038032Speter flags lsDFMnPq are always included. 45138032SpeterCYRUS_MAILER_PATH [/usr/cyrus/bin/deliver] The program used to deliver 45238032Speter cyrus mail. 45338032SpeterCYRUS_MAILER_ARGS [deliver -e -m $h -- $u] The arguments passed 45438032Speter to deliver cyrus mail. 45538032SpeterCYRUS_MAILER_MAX [undefined] If set, the maximum size message that 45638032Speter will be accepted by the cyrus mailer. 45738032SpeterCYRUS_MAILER_USER [cyrus:mail] The user and group to become when 45838032Speter running the cyrus mailer. 45990792SgshapiroCYRUS_MAILER_QGRP [undefined] The queue group for the cyrus mailer. 46064562SgshapiroCYRUS_BB_MAILER_FLAGS [u] The flags used by the cyrusbb mailer. 46164562Sgshapiro The flags lsDFMnP are always included. 46238032SpeterCYRUS_BB_MAILER_ARGS [deliver -e -m $u] The arguments passed 46338032Speter to deliver cyrusbb mail. 46498121SgshapiroCYRUSV2_MAILER_FLAGS [A@/:|m] The flags used by the cyrusv2 mailer. The 46598121Sgshapiro flags lsDFMnqXz are always included. 46698121SgshapiroCYRUSV2_MAILER_MAXMSGS [undefined] If defined, the maximum number of 46798121Sgshapiro messages to deliver in a single connection for the 46898121Sgshapiro cyrusv2 mailer. 46998121SgshapiroCYRUSV2_MAILER_MAXRCPTS [undefined] If defined, the maximum number of 47098121Sgshapiro recipients to deliver in a single connection for the 47198121Sgshapiro cyrusv2 mailer. 47298121SgshapiroCYRUSV2_MAILER_ARGS [FILE /var/imap/socket/lmtp] The arguments passed 47398121Sgshapiro to the cyrusv2 mailer. This can be used to 47498121Sgshapiro change the name of the Unix domain socket, or 47598121Sgshapiro to switch to delivery via TCP (e.g., `TCP $h lmtp') 47698121SgshapiroCYRUSV2_MAILER_QGRP [undefined] The queue group for the cyrusv2 mailer. 477110560SgshapiroCYRUSV2_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 478110560Sgshapiro that ARRIVE from an address that resolves to one the 479110560Sgshapiro Cyrus mailer and which are converted to MIME will 480110560Sgshapiro be labeled with this character set. 48138032SpeterconfEBINDIR [/usr/libexec] The directory for executables. 48243730Speter Currently used for FEATURE(`local_lmtp') and 48343730Speter FEATURE(`smrsh'). 48464562SgshapiroQPAGE_MAILER_FLAGS [mDFMs] The flags used by the qpage mailer. 48564562SgshapiroQPAGE_MAILER_PATH [/usr/local/bin/qpage] The program used to deliver 48664562Sgshapiro qpage mail. 48764562SgshapiroQPAGE_MAILER_ARGS [qpage -l0 -m -P$u] The arguments passed 48864562Sgshapiro to deliver qpage mail. 48964562SgshapiroQPAGE_MAILER_MAX [4096] If set, the maximum size message that 49064562Sgshapiro will be accepted by the qpage mailer. 49190792SgshapiroQPAGE_MAILER_QGRP [undefined] The queue group for the qpage mailer. 49290792SgshapiroLOCAL_PROG_QGRP [undefined] The queue group for the prog mailer. 49338032Speter 49464562SgshapiroNote: to tweak Name_MAILER_FLAGS use the macro MODIFY_MAILER_FLAGS: 495157001SgshapiroMODIFY_MAILER_FLAGS(`Name', `change') where Name is the first part 496157001Sgshapiroof the macro Name_MAILER_FLAGS (note: that means Name is entirely in 497157001Sgshapiroupper case) and change can be: flags that should be used directly 498157001Sgshapiro(thus overriding the default value), or if it starts with `+' (`-') 499157001Sgshapirothen those flags are added to (removed from) the default value. 500157001SgshapiroExample: 50138032Speter 50264562Sgshapiro MODIFY_MAILER_FLAGS(`LOCAL', `+e') 50338032Speter 50490792Sgshapirowill add the flag `e' to LOCAL_MAILER_FLAGS. Notice: there are 50590792Sgshapiroseveral smtp mailers all of which are manipulated individually. 50690792SgshapiroSee the section MAILERS for the available mailer names. 50764562SgshapiroWARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS 50864562Sgshapirounconditionally, i.e., without respecting any definitions in an 50964562SgshapiroOSTYPE setting. 51064562Sgshapiro 51164562Sgshapiro 51238032Speter+---------+ 51338032Speter| DOMAINS | 51438032Speter+---------+ 51538032Speter 51638032SpeterYou will probably want to collect domain-dependent defines into one 51764562Sgshapirofile, referenced by the DOMAIN macro. For example, the Berkeley 51838032Speterdomain file includes definitions for several internal distinguished 51938032Speterhosts: 52038032Speter 52138032SpeterUUCP_RELAY The host that will accept UUCP-addressed email. 52238032Speter If not defined, all UUCP sites must be directly 52338032Speter connected. 52438032SpeterBITNET_RELAY The host that will accept BITNET-addressed email. 52538032Speter If not defined, the .BITNET pseudo-domain won't work. 52638032SpeterDECNET_RELAY The host that will accept DECNET-addressed email. 52738032Speter If not defined, the .DECNET pseudo-domain and addresses 52838032Speter of the form node::user will not work. 52938032SpeterFAX_RELAY The host that will accept mail to the .FAX pseudo-domain. 53038032Speter The "fax" mailer overrides this value. 53171345SgshapiroLOCAL_RELAY The site that will handle unqualified names -- that 53282017Sgshapiro is, names without an @domain extension. 53371345Sgshapiro Normally MAIL_HUB is preferred for this function. 53471345Sgshapiro LOCAL_RELAY is mostly useful in conjunction with 53590792Sgshapiro FEATURE(`stickyhost') -- see the discussion of 53671345Sgshapiro stickyhost below. If not set, they are assumed to 53771345Sgshapiro belong on this machine. This allows you to have a 53871345Sgshapiro central site to store a company- or department-wide 53971345Sgshapiro alias database. This only works at small sites, 54071345Sgshapiro and only with some user agents. 54138032SpeterLUSER_RELAY The site that will handle lusers -- that is, apparently 54264562Sgshapiro local names that aren't local accounts or aliases. To 54364562Sgshapiro specify a local user instead of a site, set this to 54464562Sgshapiro ``local:username''. 54538032Speter 54638032SpeterAny of these can be either ``mailer:hostname'' (in which case the 54738032Spetermailer is the internal mailer name, such as ``uucp-new'' and the hostname 54838032Speteris the name of the host as appropriate for that mailer) or just a 54938032Speter``hostname'', in which case a default mailer type (usually ``relay'', 55038032Spetera variant on SMTP) is used. WARNING: if you have a wildcard MX 55138032Speterrecord matching your domain, you probably want to define these to 55238032Speterhave a trailing dot so that you won't get the mail diverted back 55338032Speterto yourself. 55438032Speter 55538032SpeterThe domain file can also be used to define a domain name, if needed 55638032Speter(using "DD<domain>") and set certain site-wide features. If all hosts 55738032Speterat your site masquerade behind one email name, you could also use 55838032SpeterMASQUERADE_AS here. 55938032Speter 56038032SpeterYou do not have to define a domain -- in particular, if you are a 56138032Spetersingle machine sitting off somewhere, it is probably more work than 56238032Speterit's worth. This is just a mechanism for combining "domain dependent 56338032Speterknowledge" into one place. 56438032Speter 56590792Sgshapiro 56638032Speter+---------+ 56738032Speter| MAILERS | 56838032Speter+---------+ 56938032Speter 57038032SpeterThere are fewer mailers supported in this version than the previous 57138032Speterversion, owing mostly to a simpler world. As a general rule, put the 57290792SgshapiroMAILER definitions last in your .mc file. 57338032Speter 57438032Speterlocal The local and prog mailers. You will almost always 57538032Speter need these; the only exception is if you relay ALL 57638032Speter your mail to another site. This mailer is included 57738032Speter automatically. 57838032Speter 57938032Spetersmtp The Simple Mail Transport Protocol mailer. This does 58038032Speter not hide hosts behind a gateway or another other 58138032Speter such hack; it assumes a world where everyone is 58238032Speter running the name server. This file actually defines 58364562Sgshapiro five mailers: "smtp" for regular (old-style) SMTP to 58438032Speter other servers, "esmtp" for extended SMTP to other 58538032Speter servers, "smtp8" to do SMTP to other servers without 58638032Speter converting 8-bit data to MIME (essentially, this is 58738032Speter your statement that you know the other end is 8-bit 58864562Sgshapiro clean even if it doesn't say so), "dsmtp" to do on 58964562Sgshapiro demand delivery, and "relay" for transmission to the 59064562Sgshapiro RELAY_HOST, LUSER_RELAY, or MAIL_HUB. 59138032Speter 59266494Sgshapirouucp The UNIX-to-UNIX Copy Program mailer. Actually, this 59338032Speter defines two mailers, "uucp-old" (a.k.a. "uucp") and 59438032Speter "uucp-new" (a.k.a. "suucp"). The latter is for when you 59538032Speter know that the UUCP mailer at the other end can handle 59638032Speter multiple recipients in one transfer. If the smtp mailer 59790792Sgshapiro is included in your configuration, two other mailers 59890792Sgshapiro ("uucp-dom" and "uucp-uudom") are also defined [warning: you 59990792Sgshapiro MUST specify MAILER(`smtp') before MAILER(`uucp')]. When you 60038032Speter include the uucp mailer, sendmail looks for all names in 60164562Sgshapiro class {U} and sends them to the uucp-old mailer; all 60264562Sgshapiro names in class {Y} are sent to uucp-new; and all 60364562Sgshapiro names in class {Z} are sent to uucp-uudom. Note that 60438032Speter this is a function of what version of rmail runs on 60538032Speter the receiving end, and hence may be out of your control. 60638032Speter See the section below describing UUCP mailers in more 60738032Speter detail. 60838032Speter 60938032Speterusenet Usenet (network news) delivery. If this is specified, 61038032Speter an extra rule is added to ruleset 0 that forwards all 61138032Speter local email for users named ``group.usenet'' to the 61238032Speter ``inews'' program. Note that this works for all groups, 61338032Speter and may be considered a security problem. 61438032Speter 61538032Speterfax Facsimile transmission. This is experimental and based 61638032Speter on Sam Leffler's HylaFAX software. For more information, 61771345Sgshapiro see http://www.hylafax.org/. 61838032Speter 61938032Speterpop Post Office Protocol. 62038032Speter 62138032Speterprocmail An interface to procmail (does not come with sendmail). 62238032Speter This is designed to be used in mailertables. For example, 62338032Speter a common question is "how do I forward all mail for a given 62438032Speter domain to a single person?". If you have this mailer 62538032Speter defined, you could set up a mailertable reading: 62638032Speter 62738032Speter host.com procmail:/etc/procmailrcs/host.com 62838032Speter 62938032Speter with the file /etc/procmailrcs/host.com reading: 63038032Speter 63138032Speter :0 # forward mail for host.com 63238032Speter ! -oi -f $1 person@other.host 63338032Speter 63438032Speter This would arrange for (anything)@host.com to be sent 635111823Sgshapiro to person@other.host. In a procmail script, $1 is the 636111823Sgshapiro name of the sender and $2 is the name of the recipient. 63743730Speter If you use this with FEATURE(`local_procmail'), the FEATURE 63838032Speter should be listed first. 63938032Speter 64090792Sgshapiro Of course there are other ways to solve this particular 64190792Sgshapiro problem, e.g., a catch-all entry in a virtusertable. 64290792Sgshapiro 64338032Spetermail11 The DECnet mail11 mailer, useful only if you have the mail11 64438032Speter program from gatekeeper.dec.com:/pub/DEC/gwtools (and 64538032Speter DECnet, of course). This is for Phase IV DECnet support; 64638032Speter if you have Phase V at your site you may have additional 64738032Speter problems. 64838032Speter 64938032Speterphquery The phquery program. This is somewhat counterintuitively 65038032Speter referenced as the "ph" mailer internally. It can be used 65138032Speter to do CCSO name server lookups. The phquery program, which 65238032Speter this mailer uses, is distributed with the ph client. 65338032Speter 65438032Spetercyrus The cyrus and cyrusbb mailers. The cyrus mailer delivers to 65538032Speter a local cyrus user. this mailer can make use of the 65690792Sgshapiro "user+detail@local.host" syntax (see 65790792Sgshapiro FEATURE(`preserve_local_plus_detail')); it will deliver the 65890792Sgshapiro mail to the user's "detail" mailbox if the mailbox's ACL 65990792Sgshapiro permits. The cyrusbb mailer delivers to a system-wide 66090792Sgshapiro cyrus mailbox if the mailbox's ACL permits. The cyrus 66190792Sgshapiro mailer must be defined after the local mailer. 66238032Speter 66398121Sgshapirocyrusv2 The mailer for Cyrus v2.x. The cyrusv2 mailer delivers to 66498121Sgshapiro local cyrus users via LMTP. This mailer can make use of the 66598121Sgshapiro "user+detail@local.host" syntax (see 66698121Sgshapiro FEATURE(`preserve_local_plus_detail')); it will deliver the 66798121Sgshapiro mail to the user's "detail" mailbox if the mailbox's ACL 66898121Sgshapiro permits. The cyrusv2 mailer must be defined after the 66998121Sgshapiro local mailer. 67098121Sgshapiro 67164562Sgshapiroqpage A mailer for QuickPage, a pager interface. See 67264562Sgshapiro http://www.qpage.org/ for further information. 67338032Speter 67438032SpeterThe local mailer accepts addresses of the form "user+detail", where 67538032Speterthe "+detail" is not used for mailbox matching but is available 67643730Speterto certain local mail programs (in particular, see 67743730SpeterFEATURE(`local_procmail')). For example, "eric", "eric+sendmail", and 67843730Speter"eric+sww" all indicate the same user, but additional arguments <null>, 67943730Speter"sendmail", and "sww" may be provided for use in sorting mail. 68038032Speter 68138032Speter 68238032Speter+----------+ 68338032Speter| FEATURES | 68438032Speter+----------+ 68538032Speter 68638032SpeterSpecial features can be requested using the "FEATURE" macro. For 68738032Speterexample, the .mc line: 68838032Speter 68943730Speter FEATURE(`use_cw_file') 69038032Speter 69164562Sgshapirotells sendmail that you want to have it read an /etc/mail/local-host-names 69290792Sgshapirofile to get values for class {w}. A FEATURE may contain up to 9 69364562Sgshapirooptional parameters -- for example: 69438032Speter 69543730Speter FEATURE(`mailertable', `dbm /usr/lib/mailertable') 69638032Speter 69738032SpeterThe default database map type for the table features can be set with 69864562Sgshapiro 69938032Speter define(`DATABASE_MAP_TYPE', `dbm') 70038032Speter 70138032Speterwhich would set it to use ndbm databases. The default is the Berkeley DB 70238032Speterhash database format. Note that you must still declare a database map type 70338032Speterif you specify an argument to a FEATURE. DATABASE_MAP_TYPE is only used 70464562Sgshapiroif no argument is given for the FEATURE. It must be specified before any 70564562Sgshapirofeature that uses a map. 70638032Speter 70790792SgshapiroAlso, features which can take a map definition as an argument can also take 70890792Sgshapirothe special keyword `LDAP'. If that keyword is used, the map will use the 70990792SgshapiroLDAP definition described in the ``USING LDAP FOR ALIASES, MAPS, AND 71090792SgshapiroCLASSES'' section below. 71190792Sgshapiro 71238032SpeterAvailable features are: 71338032Speter 71464562Sgshapirouse_cw_file Read the file /etc/mail/local-host-names file to get 71564562Sgshapiro alternate names for this host. This might be used if you 71664562Sgshapiro were on a host that MXed for a dynamic set of other hosts. 71764562Sgshapiro If the set is static, just including the line "Cw<name1> 71864562Sgshapiro <name2> ..." (where the names are fully qualified domain 71964562Sgshapiro names) is probably superior. The actual filename can be 72064562Sgshapiro overridden by redefining confCW_FILE. 72138032Speter 72264562Sgshapirouse_ct_file Read the file /etc/mail/trusted-users file to get the 72364562Sgshapiro names of users that will be ``trusted'', that is, able to 72464562Sgshapiro set their envelope from address using -f without generating 72564562Sgshapiro a warning message. The actual filename can be overridden 72664562Sgshapiro by redefining confCT_FILE. 72738032Speter 72838032Speterredirect Reject all mail addressed to "address.REDIRECT" with 72964562Sgshapiro a ``551 User has moved; please try <address>'' message. 73038032Speter If this is set, you can alias people who have left 73138032Speter to their new address with ".REDIRECT" appended. 73238032Speter 73364562Sgshapironouucp Don't route UUCP addresses. This feature takes one 73464562Sgshapiro parameter: 73564562Sgshapiro `reject': reject addresses which have "!" in the local 73664562Sgshapiro part unless it originates from a system 73764562Sgshapiro that is allowed to relay. 73864562Sgshapiro `nospecial': don't do anything special with "!". 73990792Sgshapiro Warnings: 1. See the notice in the anti-spam section. 74064562Sgshapiro 2. don't remove "!" from OperatorChars if `reject' is 74164562Sgshapiro given as parameter. 74238032Speter 74364562Sgshapironocanonify Don't pass addresses to $[ ... $] for canonification 74471345Sgshapiro by default, i.e., host/domain names are considered canonical, 74571345Sgshapiro except for unqualified names, which must not be used in this 74671345Sgshapiro mode (violation of the standard). It can be changed by 74771345Sgshapiro setting the DaemonPortOptions modifiers (M=). That is, 74864562Sgshapiro FEATURE(`nocanonify') will be overridden by setting the 74964562Sgshapiro 'c' flag. Conversely, if FEATURE(`nocanonify') is not used, 75064562Sgshapiro it can be emulated by setting the 'C' flag 75164562Sgshapiro (DaemonPortOptions=Modifiers=C). This would generally only 75264562Sgshapiro be used by sites that only act as mail gateways or which have 75364562Sgshapiro user agents that do full canonification themselves. You may 75464562Sgshapiro also want to use 75564562Sgshapiro "define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')" to turn off 75664562Sgshapiro the usual resolver options that do a similar thing. 75738032Speter 75864562Sgshapiro An exception list for FEATURE(`nocanonify') can be 75964562Sgshapiro specified with CANONIFY_DOMAIN or CANONIFY_DOMAIN_FILE, 76064562Sgshapiro i.e., a list of domains which are nevertheless passed to 76164562Sgshapiro $[ ... $] for canonification. This is useful to turn on 76264562Sgshapiro canonification for local domains, e.g., use 76364562Sgshapiro CANONIFY_DOMAIN(`my.domain my') to canonify addresses 76464562Sgshapiro which end in "my.domain" or "my". 76564562Sgshapiro Another way to require canonification in the local 76664562Sgshapiro domain is CANONIFY_DOMAIN(`$=m'). 76764562Sgshapiro 76864562Sgshapiro A trailing dot is added to addresses with more than 76964562Sgshapiro one component in it such that other features which 77064562Sgshapiro expect a trailing dot (e.g., virtusertable) will 77164562Sgshapiro still work. 77264562Sgshapiro 77364562Sgshapiro If `canonify_hosts' is specified as parameter, i.e., 77464562Sgshapiro FEATURE(`nocanonify', `canonify_hosts'), then 77564562Sgshapiro addresses which have only a hostname, e.g., 77664562Sgshapiro <user@host>, will be canonified (and hopefully fully 77764562Sgshapiro qualified), too. 77864562Sgshapiro 77971345Sgshapirostickyhost This feature is sometimes used with LOCAL_RELAY, 78071345Sgshapiro although it can be used for a different effect with 78171345Sgshapiro MAIL_HUB. 78238032Speter 78373188Sgshapiro When used without MAIL_HUB, email sent to 78471345Sgshapiro "user@local.host" are marked as "sticky" -- that 78571345Sgshapiro is, the local addresses aren't matched against UDB, 78671345Sgshapiro don't go through ruleset 5, and are not forwarded to 78771345Sgshapiro the LOCAL_RELAY (if defined). 78871345Sgshapiro 78971345Sgshapiro With MAIL_HUB, mail addressed to "user@local.host" 79071345Sgshapiro is forwarded to the mail hub, with the envelope 79171345Sgshapiro address still remaining "user@local.host". 79271345Sgshapiro Without stickyhost, the envelope would be changed 79371345Sgshapiro to "user@mail_hub", in order to protect against 79471345Sgshapiro mailing loops. 79571345Sgshapiro 79638032Spetermailertable Include a "mailer table" which can be used to override 79764562Sgshapiro routing for particular domains (which are not in class {w}, 79864562Sgshapiro i.e. local host names). The argument of the FEATURE may be 79964562Sgshapiro the key definition. If none is specified, the definition 80064562Sgshapiro used is: 80143730Speter 80264562Sgshapiro hash /etc/mail/mailertable 80343730Speter 80438032Speter Keys in this database are fully qualified domain names 80538032Speter or partial domains preceded by a dot -- for example, 80664562Sgshapiro "vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU". As a 80764562Sgshapiro special case of the latter, "." matches any domain not 80864562Sgshapiro covered by other keys. Values must be of the form: 80938032Speter mailer:domain 81038032Speter where "mailer" is the internal mailer name, and "domain" 81138032Speter is where to send the message. These maps are not 81238032Speter reflected into the message header. As a special case, 81338032Speter the forms: 81438032Speter local:user 81538032Speter will forward to the indicated user using the local mailer, 81638032Speter local: 81738032Speter will forward to the original user in the e-mail address 81838032Speter using the local mailer, and 81938032Speter error:code message 82064562Sgshapiro error:D.S.N:code message 82164562Sgshapiro will give an error message with the indicated SMTP reply 82264562Sgshapiro code and message, where D.S.N is an RFC 1893 compliant 82364562Sgshapiro error code. 82438032Speter 82538032Speterdomaintable Include a "domain table" which can be used to provide 82638032Speter domain name mapping. Use of this should really be 82738032Speter limited to your own domains. It may be useful if you 82838032Speter change names (e.g., your company changes names from 82938032Speter oldname.com to newname.com). The argument of the 83038032Speter FEATURE may be the key definition. If none is specified, 83138032Speter the definition used is: 83243730Speter 83364562Sgshapiro hash /etc/mail/domaintable 83443730Speter 83538032Speter The key in this table is the domain name; the value is 83638032Speter the new (fully qualified) domain. Anything in the 83738032Speter domaintable is reflected into headers; that is, this 83838032Speter is done in ruleset 3. 83938032Speter 84038032Speterbitdomain Look up bitnet hosts in a table to try to turn them into 84138032Speter internet addresses. The table can be built using the 84238032Speter bitdomain program contributed by John Gardiner Myers. 84338032Speter The argument of the FEATURE may be the key definition; if 84438032Speter none is specified, the definition used is: 84543730Speter 84664562Sgshapiro hash /etc/mail/bitdomain 84743730Speter 84838032Speter Keys are the bitnet hostname; values are the corresponding 84938032Speter internet hostname. 85038032Speter 85138032Speteruucpdomain Similar feature for UUCP hosts. The default map definition 85238032Speter is: 85343730Speter 85464562Sgshapiro hash /etc/mail/uudomain 85543730Speter 85638032Speter At the moment there is no automagic tool to build this 85738032Speter database. 85838032Speter 85938032Speteralways_add_domain 86038032Speter Include the local host domain even on locally delivered 86138032Speter mail. Normally it is not added on unqualified names. 86238032Speter However, if you use a shared message store but do not use 86338032Speter the same user name space everywhere, you may need the host 86490792Sgshapiro name on local names. An optional argument specifies 86590792Sgshapiro another domain to be added than the local. 86638032Speter 86738032Speterallmasquerade If masquerading is enabled (using MASQUERADE_AS), this 86838032Speter feature will cause recipient addresses to also masquerade 86938032Speter as being from the masquerade host. Normally they get 87038032Speter the local hostname. Although this may be right for 87138032Speter ordinary users, it can break local aliases. For example, 87238032Speter if you send to "localalias", the originating sendmail will 87338032Speter find that alias and send to all members, but send the 87438032Speter message with "To: localalias@masqueradehost". Since that 87538032Speter alias likely does not exist, replies will fail. Use this 87638032Speter feature ONLY if you can guarantee that the ENTIRE 87738032Speter namespace on your masquerade host supersets all the 87838032Speter local entries. 87938032Speter 88038032Speterlimited_masquerade 88164562Sgshapiro Normally, any hosts listed in class {w} are masqueraded. If 88264562Sgshapiro this feature is given, only the hosts listed in class {M} (see 88364562Sgshapiro below: MASQUERADE_DOMAIN) are masqueraded. This is useful 88464562Sgshapiro if you have several domains with disjoint namespaces hosted 88564562Sgshapiro on the same machine. 88638032Speter 88738032Spetermasquerade_entire_domain 88864562Sgshapiro If masquerading is enabled (using MASQUERADE_AS) and 88938032Speter MASQUERADE_DOMAIN (see below) is set, this feature will 89038032Speter cause addresses to be rewritten such that the masquerading 89138032Speter domains are actually entire domains to be hidden. All 89238032Speter hosts within the masquerading domains will be rewritten 89338032Speter to the masquerade name (used in MASQUERADE_AS). For example, 89438032Speter if you have: 89538032Speter 89664562Sgshapiro MASQUERADE_AS(`masq.com') 89764562Sgshapiro MASQUERADE_DOMAIN(`foo.org') 89864562Sgshapiro MASQUERADE_DOMAIN(`bar.com') 89938032Speter 90038032Speter then *foo.org and *bar.com are converted to masq.com. Without 90138032Speter this feature, only foo.org and bar.com are masqueraded. 90238032Speter 90338032Speter NOTE: only domains within your jurisdiction and 90438032Speter current hierarchy should be masqueraded using this. 90538032Speter 90690792Sgshapirolocal_no_masquerade 90790792Sgshapiro This feature prevents the local mailer from masquerading even 90890792Sgshapiro if MASQUERADE_AS is used. MASQUERADE_AS will only have effect 90990792Sgshapiro on addresses of mail going outside the local domain. 91090792Sgshapiro 911110560Sgshapiromasquerade_envelope 912110560Sgshapiro If masquerading is enabled (using MASQUERADE_AS) or the 913110560Sgshapiro genericstable is in use, this feature will cause envelope 914110560Sgshapiro addresses to also masquerade as being from the masquerade 915110560Sgshapiro host. Normally only the header addresses are masqueraded. 916110560Sgshapiro 91764562Sgshapirogenericstable This feature will cause unqualified addresses (i.e., without 91864562Sgshapiro a domain) and addresses with a domain listed in class {G} 91964562Sgshapiro to be looked up in a map and turned into another ("generic") 92064562Sgshapiro form, which can change both the domain name and the user name. 92190792Sgshapiro Notice: if you use an MSP (as it is default starting with 92290792Sgshapiro 8.12), the MTA will only receive qualified addresses from the 92390792Sgshapiro MSP (as required by the RFCs). Hence you need to add your 92490792Sgshapiro domain to class {G}. This feature is similar to the userdb 92590792Sgshapiro functionality. The same types of addresses as for 92690792Sgshapiro masquerading are looked up, i.e., only header sender 92790792Sgshapiro addresses unless the allmasquerade and/or masquerade_envelope 92890792Sgshapiro features are given. Qualified addresses must have the domain 92990792Sgshapiro part in class {G}; entries can be added to this class by the 93090792Sgshapiro macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE (analogously 93190792Sgshapiro to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below). 93238032Speter 93343730Speter The argument of FEATURE(`genericstable') may be the map 93438032Speter definition; the default map definition is: 93538032Speter 93664562Sgshapiro hash /etc/mail/genericstable 93738032Speter 93864562Sgshapiro The key for this table is either the full address, the domain 93964562Sgshapiro (with a leading @; the localpart is passed as first argument) 94064562Sgshapiro or the unqualified username (tried in the order mentioned); 94164562Sgshapiro the value is the new user address. If the new user address 94264562Sgshapiro does not include a domain, it will be qualified in the standard 94364562Sgshapiro manner, i.e., using $j or the masquerade name. Note that the 94438032Speter address being looked up must be fully qualified. For local 94543730Speter mail, it is necessary to use FEATURE(`always_add_domain') 94643730Speter for the addresses to be qualified. 94764562Sgshapiro The "+detail" of an address is passed as %1, so entries like 94838032Speter 94964562Sgshapiro old+*@foo.org new+%1@example.com 95064562Sgshapiro gen+*@foo.org %1@example.com 95164562Sgshapiro 95264562Sgshapiro and other forms are possible. 95364562Sgshapiro 95464562Sgshapirogenerics_entire_domain 95564562Sgshapiro If the genericstable is enabled and GENERICS_DOMAIN or 95664562Sgshapiro GENERICS_DOMAIN_FILE is used, this feature will cause 95764562Sgshapiro addresses to be searched in the map if their domain 95864562Sgshapiro parts are subdomains of elements in class {G}. 95964562Sgshapiro 96038032Spetervirtusertable A domain-specific form of aliasing, allowing multiple 96138032Speter virtual domains to be hosted on one machine. For example, 962157001Sgshapiro if the virtuser table contains: 96338032Speter 96438032Speter info@foo.com foo-info 96538032Speter info@bar.com bar-info 96690792Sgshapiro joe@bar.com error:nouser 550 No such user here 96790792Sgshapiro jax@bar.com error:5.7.0:550 Address invalid 96864562Sgshapiro @baz.org jane@example.net 96938032Speter 97038032Speter then mail addressed to info@foo.com will be sent to the 97138032Speter address foo-info, mail addressed to info@bar.com will be 97264562Sgshapiro delivered to bar-info, and mail addressed to anyone at baz.org 97364562Sgshapiro will be sent to jane@example.net, mail to joe@bar.com will 97464562Sgshapiro be rejected with the specified error message, and mail to 97564562Sgshapiro jax@bar.com will also have a RFC 1893 compliant error code 97690792Sgshapiro 5.7.0. 97738032Speter 97864562Sgshapiro The username from the original address is passed 97964562Sgshapiro as %1 allowing: 98038032Speter 98164562Sgshapiro @foo.org %1@example.com 98238032Speter 98364562Sgshapiro meaning someone@foo.org will be sent to someone@example.com. 98464562Sgshapiro Additionally, if the local part consists of "user+detail" 98590792Sgshapiro then "detail" is passed as %2 and "+detail" is passed as %3 98690792Sgshapiro when a match against user+* is attempted, so entries like 98764562Sgshapiro 98864562Sgshapiro old+*@foo.org new+%2@example.com 98964562Sgshapiro gen+*@foo.org %2@example.com 99090792Sgshapiro +*@foo.org %1%3@example.com 99190792Sgshapiro X++@foo.org Z%3@example.com 99290792Sgshapiro @bar.org %1%3 99364562Sgshapiro 99464562Sgshapiro and other forms are possible. Note: to preserve "+detail" 99590792Sgshapiro for a default case (@domain) %1%3 must be used as RHS. 99690792Sgshapiro There are two wildcards after "+": "+" matches only a non-empty 99790792Sgshapiro detail, "*" matches also empty details, e.g., user+@foo.org 99890792Sgshapiro matches +*@foo.org but not ++@foo.org. This can be used 99990792Sgshapiro to ensure that the parameters %2 and %3 are not empty. 100064562Sgshapiro 100138032Speter All the host names on the left hand side (foo.com, bar.com, 100290792Sgshapiro and baz.org) must be in class {w} or class {VirtHost}. The 100364562Sgshapiro latter can be defined by the macros VIRTUSER_DOMAIN or 100464562Sgshapiro VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 100564562Sgshapiro MASQUERADE_DOMAIN_FILE, see below). If VIRTUSER_DOMAIN or 100664562Sgshapiro VIRTUSER_DOMAIN_FILE is used, then the entries of class 100764562Sgshapiro {VirtHost} are added to class {R}, i.e., relaying is allowed 100864562Sgshapiro to (and from) those domains. The default map definition is: 100938032Speter 101064562Sgshapiro hash /etc/mail/virtusertable 101138032Speter 101238032Speter A new definition can be specified as the second argument of 101338032Speter the FEATURE macro, such as 101438032Speter 101564562Sgshapiro FEATURE(`virtusertable', `dbm /etc/mail/virtusers') 101638032Speter 101764562Sgshapirovirtuser_entire_domain 101864562Sgshapiro If the virtusertable is enabled and VIRTUSER_DOMAIN or 101964562Sgshapiro VIRTUSER_DOMAIN_FILE is used, this feature will cause 102064562Sgshapiro addresses to be searched in the map if their domain 102164562Sgshapiro parts are subdomains of elements in class {VirtHost}. 102264562Sgshapiro 102364562Sgshapiroldap_routing Implement LDAP-based e-mail recipient routing according to 102464562Sgshapiro the Internet Draft draft-lachman-laser-ldap-mail-routing-01. 102564562Sgshapiro This provides a method to re-route addresses with a 102664562Sgshapiro domain portion in class {LDAPRoute} to either a 102764562Sgshapiro different mail host or a different address. Hosts can 102864562Sgshapiro be added to this class using LDAPROUTE_DOMAIN and 102964562Sgshapiro LDAPROUTE_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 103064562Sgshapiro MASQUERADE_DOMAIN_FILE, see below). 103164562Sgshapiro 103264562Sgshapiro See the LDAP ROUTING section below for more information. 103364562Sgshapiro 103464562Sgshapironodns If you aren't running DNS at your site (for example, 103564562Sgshapiro you are UUCP-only connected). It's hard to consider 103638032Speter this a "feature", but hey, it had to go somewhere. 103738032Speter Actually, as of 8.7 this is a no-op -- remove "dns" from 103838032Speter the hosts service switch entry instead. 103938032Speter 104064562Sgshapironullclient This is a special case -- it creates a configuration file 104164562Sgshapiro containing nothing but support for forwarding all mail to a 104264562Sgshapiro central hub via a local SMTP-based network. The argument 104364562Sgshapiro is the name of that hub. 104464562Sgshapiro 104538032Speter The only other feature that should be used in conjunction 104664562Sgshapiro with this one is FEATURE(`nocanonify'). No mailers 104738032Speter should be defined. No aliasing or forwarding is done. 104838032Speter 104938032Speterlocal_lmtp Use an LMTP capable local mailer. The argument to this 105038032Speter feature is the pathname of an LMTP capable mailer. By 105138032Speter default, mail.local is used. This is expected to be the 105238032Speter mail.local which came with the 8.9 distribution which is 105338032Speter LMTP capable. The path to mail.local is set by the 105438032Speter confEBINDIR m4 variable -- making the default 105538032Speter LOCAL_MAILER_PATH /usr/libexec/mail.local. 1056132943Sgshapiro If a different LMTP capable mailer is used, its pathname 1057132943Sgshapiro can be specified as second parameter and the arguments 1058132943Sgshapiro passed to it (A=) as third parameter, e.g., 1059132943Sgshapiro 1060132943Sgshapiro FEATURE(`local_lmtp', `/usr/local/bin/lmtp', `lmtp') 1061132943Sgshapiro 106264562Sgshapiro WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally, 106364562Sgshapiro i.e., without respecting any definitions in an OSTYPE setting. 106438032Speter 106564562Sgshapirolocal_procmail Use procmail or another delivery agent as the local mailer. 106664562Sgshapiro The argument to this feature is the pathname of the 106764562Sgshapiro delivery agent, which defaults to PROCMAIL_MAILER_PATH. 106864562Sgshapiro Note that this does NOT use PROCMAIL_MAILER_FLAGS or 106964562Sgshapiro PROCMAIL_MAILER_ARGS for the local mailer; tweak 107064562Sgshapiro LOCAL_MAILER_FLAGS and LOCAL_MAILER_ARGS instead, or 107164562Sgshapiro specify the appropriate parameters. When procmail is used, 107264562Sgshapiro the local mailer can make use of the 107364562Sgshapiro "user+indicator@local.host" syntax; normally the +indicator 107464562Sgshapiro is just tossed, but by default it is passed as the -a 107564562Sgshapiro argument to procmail. 107638032Speter 107764562Sgshapiro This feature can take up to three arguments: 107864562Sgshapiro 107964562Sgshapiro 1. Path to the mailer program 108064562Sgshapiro [default: /usr/local/bin/procmail] 108164562Sgshapiro 2. Argument vector including name of the program 108264562Sgshapiro [default: procmail -Y -a $h -d $u] 108364562Sgshapiro 3. Flags for the mailer [default: SPfhn9] 108464562Sgshapiro 108564562Sgshapiro Empty arguments cause the defaults to be taken. 1086110560Sgshapiro Note that if you are on a system with a broken 1087110560Sgshapiro setreuid() call, you may need to add -f $f to the procmail 1088110560Sgshapiro argument vector to pass the proper sender to procmail. 108964562Sgshapiro 109064562Sgshapiro For example, this allows it to use the maildrop 109164562Sgshapiro (http://www.flounder.net/~mrsam/maildrop/) mailer instead 109264562Sgshapiro by specifying: 109364562Sgshapiro 109464562Sgshapiro FEATURE(`local_procmail', `/usr/local/bin/maildrop', 109564562Sgshapiro `maildrop -d $u') 109664562Sgshapiro 109764562Sgshapiro or scanmails using: 109864562Sgshapiro 109964562Sgshapiro FEATURE(`local_procmail', `/usr/local/bin/scanmails') 110064562Sgshapiro 110164562Sgshapiro WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally, 110264562Sgshapiro i.e., without respecting any definitions in an OSTYPE setting. 110364562Sgshapiro 110438032Speterbestmx_is_local Accept mail as though locally addressed for any host that 110538032Speter lists us as the best possible MX record. This generates 110638032Speter additional DNS traffic, but should be OK for low to 110738032Speter medium traffic hosts. The argument may be a set of 110838032Speter domains, which will limit the feature to only apply to 110938032Speter these domains -- this will reduce unnecessary DNS 111038032Speter traffic. THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH 111138032Speter WILDCARD MX RECORDS!!! If you have a wildcard MX record 111238032Speter that matches your domain, you cannot use this feature. 111338032Speter 111438032Spetersmrsh Use the SendMail Restricted SHell (smrsh) provided 111538032Speter with the distribution instead of /bin/sh for mailing 111638032Speter to programs. This improves the ability of the local 111738032Speter system administrator to control what gets run via 111838032Speter e-mail. If an argument is provided it is used as the 111938032Speter pathname to smrsh; otherwise, the path defined by 112038032Speter confEBINDIR is used for the smrsh binary -- by default, 112138032Speter /usr/libexec/smrsh is assumed. 112238032Speter 112338032Speterpromiscuous_relay 112438032Speter By default, the sendmail configuration files do not permit 112538032Speter mail relaying (that is, accepting mail from outside your 112664562Sgshapiro local host (class {w}) and sending it to another host than 112764562Sgshapiro your local host). This option sets your site to allow 112864562Sgshapiro mail relaying from any site to any site. In almost all 112964562Sgshapiro cases, it is better to control relaying more carefully 113064562Sgshapiro with the access map, class {R}, or authentication. Domains 113164562Sgshapiro can be added to class {R} by the macros RELAY_DOMAIN or 113264562Sgshapiro RELAY_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 113364562Sgshapiro MASQUERADE_DOMAIN_FILE, see below). 113438032Speter 113538032Speterrelay_entire_domain 113698121Sgshapiro This option allows any host in your domain as defined by 113798121Sgshapiro class {m} to use your server for relaying. Notice: make 113898121Sgshapiro sure that your domain is not just a top level domain, 113998121Sgshapiro e.g., com. This can happen if you give your host a name 114098121Sgshapiro like example.com instead of host.example.com. 114138032Speter 114238032Speterrelay_hosts_only 114338032Speter By default, names that are listed as RELAY in the access 114498121Sgshapiro db and class {R} are treated as domain names, not host names. 114538032Speter For example, if you specify ``foo.com'', then mail to or 114638032Speter from foo.com, abc.foo.com, or a.very.deep.domain.foo.com 114738032Speter will all be accepted for relaying. This feature changes 114838032Speter the behaviour to lookup individual host names only. 114938032Speter 115038032Speterrelay_based_on_MX 115138032Speter Turns on the ability to allow relaying based on the MX 115242575Speter records of the host portion of an incoming recipient; that 115342575Speter is, if an MX record for host foo.com points to your site, 115442575Speter you will accept and relay mail addressed to foo.com. See 115538032Speter description below for more information before using this 115642575Speter feature. Also, see the KNOWNBUGS entry regarding bestmx 115742575Speter map lookups. 115838032Speter 115943730Speter FEATURE(`relay_based_on_MX') does not necessarily allow 116042575Speter routing of these messages which you expect to be allowed, 116142575Speter if route address syntax (or %-hack syntax) is used. If 116242575Speter this is a problem, add entries to the access-table or use 116343730Speter FEATURE(`loose_relay_check'). 116442575Speter 116564562Sgshapirorelay_mail_from 116664562Sgshapiro Allows relaying if the mail sender is listed as RELAY in 1167110560Sgshapiro the access map. If an optional argument `domain' (this 1168110560Sgshapiro is the literal word `domain', not a placeholder) is given, 116990792Sgshapiro relaying can be allowed just based on the domain portion 117090792Sgshapiro of the sender address. This feature should only be used if 117190792Sgshapiro absolutely necessary as the sender address can be easily 117298121Sgshapiro forged. Use of this feature requires the "From:" tag to 117398121Sgshapiro be used for the key in the access map; see the discussion 117490792Sgshapiro of tags and FEATURE(`relay_mail_from') in the section on 117590792Sgshapiro anti-spam configuration control. 117664562Sgshapiro 117738032Speterrelay_local_from 117838032Speter Allows relaying if the domain portion of the mail sender 117938032Speter is a local host. This should only be used if absolutely 118042575Speter necessary as it opens a window for spammers. Specifically, 118142575Speter they can send mail to your mail server that claims to be 118242575Speter from your domain (either directly or via a routed address), 118342575Speter and you will go ahead and relay it out to arbitrary hosts 118442575Speter on the Internet. 118564562Sgshapiro 118638032Speteraccept_unqualified_senders 118738032Speter Normally, MAIL FROM: commands in the SMTP session will be 118838032Speter refused if the connection is a network connection and the 118938032Speter sender address does not include a domain name. If your 1190157001Sgshapiro setup sends local mail unqualified (i.e., MAIL FROM:<joe>), 119138032Speter you will need to use this feature to accept unqualified 119264562Sgshapiro sender addresses. Setting the DaemonPortOptions modifier 119364562Sgshapiro 'u' overrides the default behavior, i.e., unqualified 119464562Sgshapiro addresses are accepted even without this FEATURE. 119564562Sgshapiro If this FEATURE is not used, the DaemonPortOptions modifier 119664562Sgshapiro 'f' can be used to enforce fully qualified addresses. 119764562Sgshapiro 119838032Speteraccept_unresolvable_domains 119938032Speter Normally, MAIL FROM: commands in the SMTP session will be 120064562Sgshapiro refused if the host part of the argument to MAIL FROM: 120164562Sgshapiro cannot be located in the host name service (e.g., an A or 120264562Sgshapiro MX record in DNS). If you are inside a firewall that has 120364562Sgshapiro only a limited view of the Internet host name space, this 120464562Sgshapiro could cause problems. In this case you probably want to 120564562Sgshapiro use this feature to accept all domains on input, even if 120664562Sgshapiro they are unresolvable. 120738032Speter 120838032Speteraccess_db Turns on the access database feature. The access db gives 120938032Speter you the ability to allow or refuse to accept mail from 121090792Sgshapiro specified domains for administrative reasons. Moreover, 121190792Sgshapiro it can control the behavior of sendmail in various situations. 121290792Sgshapiro By default, the access database specification is: 121338032Speter 121490792Sgshapiro hash -T<TMPF> /etc/mail/access 121543730Speter 121690792Sgshapiro See the anti-spam configuration control section for further 121790792Sgshapiro important information about this feature. Notice: 121890792Sgshapiro "-T<TMPF>" is meant literal, do not replace it by anything. 121943730Speter 122038032Speterblacklist_recipients 122138032Speter Turns on the ability to block incoming mail for certain 122238032Speter recipient usernames, hostnames, or addresses. For 122338032Speter example, you can block incoming mail to user nobody, 122438032Speter host foo.mydomain.com, or guest@bar.mydomain.com. 122538032Speter These specifications are put in the access db as 122664562Sgshapiro described in the anti-spam configuration control section 122764562Sgshapiro later in this document. 122838032Speter 122971345Sgshapirodelay_checks The rulesets check_mail and check_relay will not be called 123071345Sgshapiro when a client connects or issues a MAIL command, respectively. 123171345Sgshapiro Instead, those rulesets will be called by the check_rcpt 123271345Sgshapiro ruleset; they will be skipped under certain circumstances. 123390792Sgshapiro See "Delay all checks" in the anti-spam configuration control 123490792Sgshapiro section. Note: this feature is incompatible to the versions 123590792Sgshapiro in 8.10 and 8.11. 123671345Sgshapiro 1237132943Sgshapirouse_client_ptr If this feature is enabled then check_relay will override 1238132943Sgshapiro its first argument with $&{client_ptr}. This is useful for 1239132943Sgshapiro rejections based on the unverified hostname of client, 1240132943Sgshapiro which turns on the same behavior as in earlier sendmail 1241132943Sgshapiro versions when delay_checks was not in use. See doc/op/op.* 1242132943Sgshapiro about check_relay, {client_name}, and {client_ptr}. 1243132943Sgshapiro 124464562Sgshapirodnsbl Turns on rejection of hosts found in an DNS based rejection 1245159609Sgshapiro list. The first is used as the domain in which blocked 1246159609Sgshapiro hosts are listed. A second argument can be used to change 1247159609Sgshapiro the default error message. Without that second argument, 1248159609Sgshapiro the error message will be 124998841Sgshapiro Rejected: IP-ADDRESS listed at SERVER 125090792Sgshapiro where IP-ADDRESS and SERVER are replaced by the appropriate 125190792Sgshapiro information. By default, temporary lookup failures are 125290792Sgshapiro ignored. This behavior can be changed by specifying a 125390792Sgshapiro third argument, which must be either `t' or a full error 125490792Sgshapiro message. See the anti-spam configuration control section for 125590792Sgshapiro an example. The dnsbl feature can be included several times 125690792Sgshapiro to query different DNS based rejection lists. See also 125790792Sgshapiro enhdnsbl for an enhanced version. 125864562Sgshapiro 1259110560Sgshapiro Set the DNSBL_MAP mc option to change the default map 1260110560Sgshapiro definition from `host'. Set the DNSBL_MAP_OPT mc option 1261110560Sgshapiro to add additional options to the map specification used. 1262110560Sgshapiro 126398121Sgshapiro Some DNS based rejection lists cause failures if asked 126498121Sgshapiro for AAAA records. If your sendmail version is compiled 126598121Sgshapiro with IPv6 support (NETINET6) and you experience this 126698121Sgshapiro problem, add 126798121Sgshapiro 126898121Sgshapiro define(`DNSBL_MAP', `dns -R A') 126998121Sgshapiro 127098121Sgshapiro before the first use of this feature. Alternatively you 1271111823Sgshapiro can use enhdnsbl instead (see below). Moreover, this 1272111823Sgshapiro statement can be used to reduce the number of DNS retries, 1273111823Sgshapiro e.g., 127498121Sgshapiro 1275111823Sgshapiro define(`DNSBL_MAP', `dns -R A -r2') 1276111823Sgshapiro 1277111823Sgshapiro See below (EDNSBL_TO) for an explanation. 1278111823Sgshapiro 127990792Sgshapiroenhdnsbl Enhanced version of dnsbl (see above). Further arguments 128090792Sgshapiro (up to 5) can be used to specify specific return values 128190792Sgshapiro from lookups. Temporary lookup failures are ignored unless 128290792Sgshapiro a third argument is given, which must be either `t' or a full 128390792Sgshapiro error message. By default, any successful lookup will 128490792Sgshapiro generate an error. Otherwise the result of the lookup is 128590792Sgshapiro compared with the supplied argument(s), and only if a match 128690792Sgshapiro occurs an error is generated. For example, 128790792Sgshapiro 128890792Sgshapiro FEATURE(`enhdnsbl', `dnsbl.example.com', `', `t', `127.0.0.2.') 128990792Sgshapiro 129090792Sgshapiro will reject the e-mail if the lookup returns the value 129190792Sgshapiro ``127.0.0.2.'', or generate a 451 response if the lookup 129290792Sgshapiro temporarily failed. The arguments can contain metasymbols 129390792Sgshapiro as they are allowed in the LHS of rules. As the example 129490792Sgshapiro shows, the default values are also used if an empty argument, 129590792Sgshapiro i.e., `', is specified. This feature requires that sendmail 129690792Sgshapiro has been compiled with the flag DNSMAP (see sendmail/README). 129790792Sgshapiro 1298110560Sgshapiro Set the EDNSBL_TO mc option to change the DNS retry count 1299111823Sgshapiro from the default value of 5, this can be very useful when 1300111823Sgshapiro a DNS server is not responding, which in turn may cause 1301111823Sgshapiro clients to time out (an entry stating 1302110560Sgshapiro 1303111823Sgshapiro did not issue MAIL/EXPN/VRFY/ETRN 1304111823Sgshapiro 1305111823Sgshapiro will be logged). 1306111823Sgshapiro 1307132943Sgshapiroratecontrol Enable simple ruleset to do connection rate control 1308132943Sgshapiro checking. This requires entries in access_db of the form 1309132943Sgshapiro 1310132943Sgshapiro ClientRate:IP.ADD.RE.SS LIMIT 1311132943Sgshapiro 1312132943Sgshapiro The RHS specifies the maximum number of connections 1313132943Sgshapiro (an integer number) over the time interval defined 1314132943Sgshapiro by ConnectionRateWindowSize, where 0 means unlimited. 1315132943Sgshapiro 1316132943Sgshapiro Take the following example: 1317132943Sgshapiro 1318132943Sgshapiro ClientRate:10.1.2.3 4 1319132943Sgshapiro ClientRate:127.0.0.1 0 1320132943Sgshapiro ClientRate: 10 1321132943Sgshapiro 1322132943Sgshapiro 10.1.2.3 can only make up to 4 connections, the 1323132943Sgshapiro general limit it 10, and 127.0.0.1 can make an unlimited 1324132943Sgshapiro number of connections per ConnectionRateWindowSize. 1325132943Sgshapiro 1326132943Sgshapiro See also CONNECTION CONTROL. 1327132943Sgshapiro 1328132943Sgshapiroconncontrol Enable a simple check of the number of incoming SMTP 1329132943Sgshapiro connections. This requires entries in access_db of the 1330132943Sgshapiro form 1331132943Sgshapiro 1332132943Sgshapiro ClientConn:IP.ADD.RE.SS LIMIT 1333132943Sgshapiro 1334132943Sgshapiro The RHS specifies the maximum number of open connections 1335132943Sgshapiro (an integer number). 1336132943Sgshapiro 1337132943Sgshapiro Take the following example: 1338132943Sgshapiro 1339132943Sgshapiro ClientConn:10.1.2.3 4 1340132943Sgshapiro ClientConn:127.0.0.1 0 1341132943Sgshapiro ClientConn: 10 1342132943Sgshapiro 1343132943Sgshapiro 10.1.2.3 can only have up to 4 open connections, the 1344132943Sgshapiro general limit it 10, and 127.0.0.1 does not have any 1345132943Sgshapiro explicit limit. 1346132943Sgshapiro 1347132943Sgshapiro See also CONNECTION CONTROL. 1348132943Sgshapiro 1349132943Sgshapiromtamark Experimental support for "Marking Mail Transfer Agents in 1350132943Sgshapiro Reverse DNS with TXT RRs" (MTAMark), see 1351132943Sgshapiro draft-stumpf-dns-mtamark-01. Optional arguments are: 1352132943Sgshapiro 1353132943Sgshapiro 1. Error message, default: 1354132943Sgshapiro 1355132943Sgshapiro 550 Rejected: $&{client_addr} not listed as MTA 1356132943Sgshapiro 1357132943Sgshapiro 2. Temporary lookup failures are ignored unless a second 1358132943Sgshapiro argument is given, which must be either `t' or a full 1359132943Sgshapiro error message. 1360132943Sgshapiro 1361132943Sgshapiro 3. Lookup prefix, default: _perm._smtp._srv. This should 1362132943Sgshapiro not be changed unless the draft changes it. 1363132943Sgshapiro 1364132943Sgshapiro Example: 1365132943Sgshapiro 1366132943Sgshapiro FEATURE(`mtamark', `', `t') 1367132943Sgshapiro 136890792Sgshapirolookupdotdomain Look up also .domain in the access map. This allows to 136990792Sgshapiro match only subdomains. It does not work well with 137090792Sgshapiro FEATURE(`relay_hosts_only'), because most lookups for 137190792Sgshapiro subdomains are suppressed by the latter feature. 137290792Sgshapiro 137338032Speterloose_relay_check 137464562Sgshapiro Normally, if % addressing is used for a recipient, e.g. 137564562Sgshapiro user%site@othersite, and othersite is in class {R}, the 137638032Speter check_rcpt ruleset will strip @othersite and recheck 137738032Speter user@site for relaying. This feature changes that 137838032Speter behavior. It should not be needed for most installations. 137938032Speter 138090792Sgshapiroauthinfo Provide a separate map for client side authentication 138190792Sgshapiro information. See SMTP AUTHENTICATION for details. 138290792Sgshapiro By default, the authinfo database specification is: 138390792Sgshapiro 138490792Sgshapiro hash /etc/mail/authinfo 138590792Sgshapiro 138690792Sgshapiropreserve_luser_host 138790792Sgshapiro Preserve the name of the recipient host if LUSER_RELAY is 138890792Sgshapiro used. Without this option, the domain part of the 138990792Sgshapiro recipient address will be replaced by the host specified as 139090792Sgshapiro LUSER_RELAY. This feature only works if the hostname is 139190792Sgshapiro passed to the mailer (see mailer triple in op.me). Note 139290792Sgshapiro that in the default configuration the local mailer does not 139390792Sgshapiro receive the hostname, i.e., the mailer triple has an empty 139490792Sgshapiro hostname. 139590792Sgshapiro 139690792Sgshapiropreserve_local_plus_detail 139790792Sgshapiro Preserve the +detail portion of the address when passing 139890792Sgshapiro address to local delivery agent. Disables alias and 139990792Sgshapiro .forward +detail stripping (e.g., given user+detail, only 140090792Sgshapiro that address will be looked up in the alias file; user+* and 140190792Sgshapiro user will not be looked up). Only use if the local 140290792Sgshapiro delivery agent in use supports +detail addressing. 140390792Sgshapiro 140490792Sgshapirocompat_check Enable ruleset check_compat to look up pairs of addresses 140590792Sgshapiro with the Compat: tag -- Compat:sender<@>recipient -- in the 140690792Sgshapiro access map. Valid values for the RHS include 140790792Sgshapiro DISCARD silently discard recipient 140890792Sgshapiro TEMP: return a temporary error 140990792Sgshapiro ERROR: return a permanent error 141090792Sgshapiro In the last two cases, a 4xy/5xy SMTP reply code should 141190792Sgshapiro follow the colon. 141290792Sgshapiro 141364562Sgshapirono_default_msa Don't generate the default MSA daemon, i.e., 141464562Sgshapiro DAEMON_OPTIONS(`Port=587,Name=MSA,M=E') 141564562Sgshapiro To define a MSA daemon with other parameters, use this 141664562Sgshapiro FEATURE and introduce new settings via DAEMON_OPTIONS(). 141738032Speter 141890792Sgshapiromsp Defines config file for Message Submission Program. 141994334Sgshapiro See sendmail/SECURITY for details and cf/cf/submit.mc how 142094334Sgshapiro to use it. An optional argument can be used to override 142194334Sgshapiro the default of `[localhost]' to use as host to send all 142294334Sgshapiro e-mails to. Note that MX records will be used if the 142394334Sgshapiro specified hostname is not in square brackets (e.g., 142494334Sgshapiro [hostname]). If `MSA' is specified as second argument then 142594334Sgshapiro port 587 is used to contact the server. Example: 142690792Sgshapiro 142790792Sgshapiro FEATURE(`msp', `', `MSA') 142890792Sgshapiro 142990792Sgshapiro Some more hints about possible changes can be found below 143090792Sgshapiro in the section MESSAGE SUBMISSION PROGRAM. 143190792Sgshapiro 1432110560Sgshapiro Note: Due to many problems, submit.mc uses 143398121Sgshapiro 143498121Sgshapiro FEATURE(`msp', `[127.0.0.1]') 143598121Sgshapiro 1436110560Sgshapiro by default. If you have a machine with IPv6 only, 1437110560Sgshapiro change it to 1438110560Sgshapiro 1439110560Sgshapiro FEATURE(`msp', `[IPv6:::1]') 1440110560Sgshapiro 1441110560Sgshapiro If you want to continue using '[localhost]', (the behavior 1442110560Sgshapiro up to 8.12.6), use 1443110560Sgshapiro 1444110560Sgshapiro FEATURE(`msp') 1445110560Sgshapiro 144690792Sgshapiroqueuegroup A simple example how to select a queue group based 144790792Sgshapiro on the full e-mail address or the domain of the 144890792Sgshapiro recipient. Selection is done via entries in the 144990792Sgshapiro access map using the tag QGRP:, for example: 145090792Sgshapiro 145190792Sgshapiro QGRP:example.com main 145290792Sgshapiro QGRP:friend@some.org others 145390792Sgshapiro QGRP:my.domain local 145490792Sgshapiro 145590792Sgshapiro where "main", "others", and "local" are names of 145690792Sgshapiro queue groups. If an argument is specified, it is used 145790792Sgshapiro as default queue group. 145890792Sgshapiro 145994334Sgshapiro Note: please read the warning in doc/op/op.me about 146094334Sgshapiro queue groups and possible queue manipulations. 146194334Sgshapiro 1462132943Sgshapirogreet_pause Adds the greet_pause ruleset which enables open proxy 1463132943Sgshapiro and SMTP slamming protection. The feature can take an 1464132943Sgshapiro argument specifying the milliseconds to wait: 1465132943Sgshapiro 1466132943Sgshapiro FEATURE(`greet_pause', `5000') dnl 5 seconds 1467132943Sgshapiro 1468132943Sgshapiro If FEATURE(`access_db') is enabled, an access database 1469132943Sgshapiro lookup with the GreetPause tag is done using client 1470132943Sgshapiro hostname, domain, IP address, or subnet to determine the 1471132943Sgshapiro pause time: 1472132943Sgshapiro 1473132943Sgshapiro GreetPause:my.domain 0 1474132943Sgshapiro GreetPause:example.com 5000 1475132943Sgshapiro GreetPause:10.1.2 2000 1476132943Sgshapiro GreetPause:127.0.0.1 0 1477132943Sgshapiro 1478132943Sgshapiro When using FEATURE(`access_db'), the optional 1479132943Sgshapiro FEATURE(`greet_pause') argument becomes the default if 1480132943Sgshapiro nothing is found in the access database. A ruleset called 1481132943Sgshapiro Local_greet_pause can be used for local modifications, e.g., 1482132943Sgshapiro 1483132943Sgshapiro LOCAL_RULESETS 1484132943Sgshapiro SLocal_greet_pause 1485132943Sgshapiro R$* $: $&{daemon_flags} 1486132943Sgshapiro R$* a $* $# 0 1487132943Sgshapiro 148838032Speter+-------+ 148938032Speter| HACKS | 149038032Speter+-------+ 149138032Speter 149238032SpeterSome things just can't be called features. To make this clear, 149338032Speterthey go in the hack subdirectory and are referenced using the HACK 149438032Spetermacro. These will tend to be site-dependent. The release 149538032Speterincludes the Berkeley-dependent "cssubdomain" hack (that makes 149638032Spetersendmail accept local names in either Berkeley.EDU or CS.Berkeley.EDU; 149764562Sgshapirothis is intended as a short-term aid while moving hosts into 149838032Spetersubdomains. 149938032Speter 150038032Speter 150138032Speter+--------------------+ 150238032Speter| SITE CONFIGURATION | 150338032Speter+--------------------+ 150438032Speter 150538032Speter ***************************************************** 150638032Speter * This section is really obsolete, and is preserved * 150738032Speter * only for back compatibility. You should plan on * 150890792Sgshapiro * using mailertables for new installations. In * 150938032Speter * particular, it doesn't work for the newer forms * 151038032Speter * of UUCP mailers, such as uucp-uudom. * 151138032Speter ***************************************************** 151238032Speter 151338032SpeterComplex sites will need more local configuration information, such as 151438032Speterlists of UUCP hosts they speak with directly. This can get a bit more 151538032Spetertricky. For an example of a "complex" site, see cf/ucbvax.mc. 151638032Speter 151738032SpeterThe SITECONFIG macro allows you to indirectly reference site-dependent 151838032Speterconfiguration information stored in the siteconfig subdirectory. For 151938032Speterexample, the line 152038032Speter 152164562Sgshapiro SITECONFIG(`uucp.ucbvax', `ucbvax', `U') 152238032Speter 152338032Speterreads the file uucp.ucbvax for local connection information. The 152438032Spetersecond parameter is the local name (in this case just "ucbvax" since 152538032Speterit is locally connected, and hence a UUCP hostname). The third 152638032Speterparameter is the name of both a macro to store the local name (in 152764562Sgshapirothis case, {U}) and the name of the class (e.g., {U}) in which to store 152838032Speterthe host information read from the file. Another SITECONFIG line reads 152938032Speter 153064562Sgshapiro SITECONFIG(`uucp.ucbarpa', `ucbarpa.Berkeley.EDU', `W') 153138032Speter 153238032SpeterThis says that the file uucp.ucbarpa contains the list of UUCP sites 153364562Sgshapiroconnected to ucbarpa.Berkeley.EDU. Class {W} will be used to 153438032Speterstore this list, and $W is defined to be ucbarpa.Berkeley.EDU, that 153538032Speteris, the name of the relay to which the hosts listed in uucp.ucbarpa 153664562Sgshapiroare connected. [The machine ucbarpa is gone now, but this 153764562Sgshapiroout-of-date configuration file has been left around to demonstrate 153864562Sgshapirohow you might do this.] 153938032Speter 154038032SpeterNote that the case of SITECONFIG with a third parameter of ``U'' is 154138032Speterspecial; the second parameter is assumed to be the UUCP name of the 154238032Speterlocal site, rather than the name of a remote site, and the UUCP name 154364562Sgshapirois entered into class {w} (the list of local hostnames) as $U.UUCP. 154438032Speter 154538032SpeterThe siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing 154638032Spetermore than a sequence of SITE macros describing connectivity. For 154738032Speterexample: 154838032Speter 154964562Sgshapiro SITE(`cnmat') 155064562Sgshapiro SITE(`sgi olympus') 155138032Speter 155238032SpeterThe second example demonstrates that you can use two names on the 155338032Spetersame line; these are usually aliases for the same host (or are at 155438032Speterleast in the same company). 155538032Speter 1556132943SgshapiroThe macro LOCAL_UUCP can be used to add rules into the generated 1557132943Sgshapirocf file at the place where MAILER(`uucp') inserts its rules. This 1558132943Sgshapiroshould only be used if really necessary. 155938032Speter 156038032Speter+--------------------+ 156138032Speter| USING UUCP MAILERS | 156238032Speter+--------------------+ 156338032Speter 156438032SpeterIt's hard to get UUCP mailers right because of the extremely ad hoc 156538032Speternature of UUCP addressing. These config files are really designed 156638032Speterfor domain-based addressing, even for UUCP sites. 156738032Speter 156838032SpeterThere are four UUCP mailers available. The choice of which one to 156938032Speteruse is partly a matter of local preferences and what is running at 157038032Speterthe other end of your UUCP connection. Unlike good protocols that 157138032Speterdefine what will go over the wire, UUCP uses the policy that you 157238032Spetershould do what is right for the other end; if they change, you have 157338032Speterto change. This makes it hard to do the right thing, and discourages 157438032Speterpeople from updating their software. In general, if you can avoid 157538032SpeterUUCP, please do. 157638032Speter 157738032SpeterThe major choice is whether to go for a domainized scheme or a 157838032Speternon-domainized scheme. This depends entirely on what the other 157938032Speterend will recognize. If at all possible, you should encourage the 158038032Speterother end to go to a domain-based system -- non-domainized addresses 158138032Speterdon't work entirely properly. 158238032Speter 158338032SpeterThe four mailers are: 158438032Speter 158538032Speter uucp-old (obsolete name: "uucp") 158638032Speter This is the oldest, the worst (but the closest to UUCP) way of 1587147078Sgshapiro sending messages across UUCP connections. It does bangify 158838032Speter everything and prepends $U (your UUCP name) to the sender's 158938032Speter address (which can already be a bang path itself). It can 159038032Speter only send to one address at a time, so it spends a lot of 159138032Speter time copying duplicates of messages. Avoid this if at all 159238032Speter possible. 159338032Speter 159438032Speter uucp-new (obsolete name: "suucp") 159538032Speter The same as above, except that it assumes that in one rmail 159638032Speter command you can specify several recipients. It still has a 159738032Speter lot of other problems. 159838032Speter 159938032Speter uucp-dom 160038032Speter This UUCP mailer keeps everything as domain addresses. 160138032Speter Basically, it uses the SMTP mailer rewriting rules. This mailer 160290792Sgshapiro is only included if MAILER(`smtp') is specified before 160390792Sgshapiro MAILER(`uucp'). 160438032Speter 160538032Speter Unfortunately, a lot of UUCP mailer transport agents require 160638032Speter bangified addresses in the envelope, although you can use 160738032Speter domain-based addresses in the message header. (The envelope 160838032Speter shows up as the From_ line on UNIX mail.) So.... 160938032Speter 161038032Speter uucp-uudom 161138032Speter This is a cross between uucp-new (for the envelope addresses) 161238032Speter and uucp-dom (for the header addresses). It bangifies the 161338032Speter envelope sender (From_ line in messages) without adding the 161438032Speter local hostname, unless there is no host name on the address 161538032Speter at all (e.g., "wolf") or the host component is a UUCP host name 161638032Speter instead of a domain name ("somehost!wolf" instead of 161764562Sgshapiro "some.dom.ain!wolf"). This is also included only if MAILER(`smtp') 161890792Sgshapiro is also specified earlier. 161938032Speter 162038032SpeterExamples: 162138032Speter 162264562SgshapiroOn host grasp.insa-lyon.fr (UUCP host name "grasp"), the following 162364562Sgshapirosummarizes the sender rewriting for various mailers. 162438032Speter 162566494SgshapiroMailer sender rewriting in the envelope 162638032Speter------ ------ ------------------------- 162738032Speteruucp-{old,new} wolf grasp!wolf 162838032Speteruucp-dom wolf wolf@grasp.insa-lyon.fr 162938032Speteruucp-uudom wolf grasp.insa-lyon.fr!wolf 163038032Speter 163138032Speteruucp-{old,new} wolf@fr.net grasp!fr.net!wolf 163238032Speteruucp-dom wolf@fr.net wolf@fr.net 163338032Speteruucp-uudom wolf@fr.net fr.net!wolf 163438032Speter 163538032Speteruucp-{old,new} somehost!wolf grasp!somehost!wolf 163638032Speteruucp-dom somehost!wolf somehost!wolf@grasp.insa-lyon.fr 163738032Speteruucp-uudom somehost!wolf grasp.insa-lyon.fr!somehost!wolf 163838032Speter 163938032SpeterIf you are using one of the domainized UUCP mailers, you really want 164038032Speterto convert all UUCP addresses to domain format -- otherwise, it will 164138032Speterdo it for you (and probably not the way you expected). For example, 164238032Speterif you have the address foo!bar!baz (and you are not sending to foo), 164338032Speterthe heuristics will add the @uucp.relay.name or @local.host.name to 164438032Speterthis address. However, if you map foo to foo.host.name first, it 164538032Speterwill not add the local hostname. You can do this using the uucpdomain 164638032Speterfeature. 164738032Speter 164838032Speter 164938032Speter+-------------------+ 165038032Speter| TWEAKING RULESETS | 165138032Speter+-------------------+ 165238032Speter 165338032SpeterFor more complex configurations, you can define special rules. 165438032SpeterThe macro LOCAL_RULE_3 introduces rules that are used in canonicalizing 165538032Speterthe names. Any modifications made here are reflected in the header. 165638032Speter 165738032SpeterA common use is to convert old UUCP addresses to SMTP addresses using 165838032Speterthe UUCPSMTP macro. For example: 165938032Speter 166038032Speter LOCAL_RULE_3 166164562Sgshapiro UUCPSMTP(`decvax', `decvax.dec.com') 166264562Sgshapiro UUCPSMTP(`research', `research.att.com') 166338032Speter 166438032Speterwill cause addresses of the form "decvax!user" and "research!user" 166538032Speterto be converted to "user@decvax.dec.com" and "user@research.att.com" 166638032Speterrespectively. 166738032Speter 166838032SpeterThis could also be used to look up hosts in a database map: 166938032Speter 167038032Speter LOCAL_RULE_3 167138032Speter R$* < @ $+ > $* $: $1 < @ $(hostmap $2 $) > $3 167238032Speter 167338032SpeterThis map would be defined in the LOCAL_CONFIG portion, as shown below. 167438032Speter 167538032SpeterSimilarly, LOCAL_RULE_0 can be used to introduce new parsing rules. 167638032SpeterFor example, new rules are needed to parse hostnames that you accept 167738032Spetervia MX records. For example, you might have: 167838032Speter 167938032Speter LOCAL_RULE_0 168038032Speter R$+ <@ host.dom.ain.> $#uucp $@ cnmat $: $1 < @ host.dom.ain.> 168138032Speter 168238032SpeterYou would use this if you had installed an MX record for cnmat.Berkeley.EDU 168338032Speterpointing at this host; this rule catches the message and forwards it on 168438032Speterusing UUCP. 168538032Speter 168638032SpeterYou can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2. 168738032SpeterThese rulesets are normally empty. 168838032Speter 168938032SpeterA similar macro is LOCAL_CONFIG. This introduces lines added after the 169064562Sgshapiroboilerplate option setting but before rulesets. Do not declare rulesets in 169164562Sgshapirothe LOCAL_CONFIG section. It can be used to declare local database maps or 169264562Sgshapirowhatever. For example: 169338032Speter 169438032Speter LOCAL_CONFIG 169564562Sgshapiro Khostmap hash /etc/mail/hostmap 169638032Speter Kyplocal nis -m hosts.byname 169738032Speter 169838032Speter 169938032Speter+---------------------------+ 170038032Speter| MASQUERADING AND RELAYING | 170138032Speter+---------------------------+ 170238032Speter 170338032SpeterYou can have your host masquerade as another using 170438032Speter 170564562Sgshapiro MASQUERADE_AS(`host.domain') 170638032Speter 170738032SpeterThis causes mail being sent to be labeled as coming from the 170838032Speterindicated host.domain, rather than $j. One normally masquerades as 170964562Sgshapiroone of one's own subdomains (for example, it's unlikely that 171064562SgshapiroBerkeley would choose to masquerade as an MIT site). This 171164562Sgshapirobehaviour is modified by a plethora of FEATUREs; in particular, see 171264562Sgshapiromasquerade_envelope, allmasquerade, limited_masquerade, and 171364562Sgshapiromasquerade_entire_domain. 171438032Speter 171538032SpeterThe masquerade name is not normally canonified, so it is important 171638032Speterthat it be your One True Name, that is, fully qualified and not a 171738032SpeterCNAME. However, if you use a CNAME, the receiving side may canonify 171838032Speterit for you, so don't think you can cheat CNAME mapping this way. 171938032Speter 172038032SpeterNormally the only addresses that are masqueraded are those that come 172164562Sgshapirofrom this host (that is, are either unqualified or in class {w}, the list 172264562Sgshapiroof local domain names). You can augment this list, which is realized 172364562Sgshapiroby class {M} using 172438032Speter 172564562Sgshapiro MASQUERADE_DOMAIN(`otherhost.domain') 172638032Speter 172738032SpeterThe effect of this is that although mail to user@otherhost.domain 172838032Speterwill not be delivered locally, any mail including any user@otherhost.domain 172938032Speterwill, when relayed, be rewritten to have the MASQUERADE_AS address. 173038032SpeterThis can be a space-separated list of names. 173138032Speter 173238032SpeterIf these names are in a file, you can use 173338032Speter 173464562Sgshapiro MASQUERADE_DOMAIN_FILE(`filename') 173538032Speter 173664562Sgshapiroto read the list of names from the indicated file (i.e., to add 173764562Sgshapiroelements to class {M}). 173838032Speter 173964562SgshapiroTo exempt hosts or subdomains from being masqueraded, you can use 174064562Sgshapiro 174164562Sgshapiro MASQUERADE_EXCEPTION(`host.domain') 174264562Sgshapiro 174364562SgshapiroThis can come handy if you want to masquerade a whole domain 174490792Sgshapiroexcept for one (or a few) host(s). If these names are in a file, 174590792Sgshapiroyou can use 174664562Sgshapiro 174790792Sgshapiro MASQUERADE_EXCEPTION_FILE(`filename') 174890792Sgshapiro 174938032SpeterNormally only header addresses are masqueraded. If you want to 175038032Spetermasquerade the envelope as well, use 175138032Speter 175243730Speter FEATURE(`masquerade_envelope') 175338032Speter 175438032SpeterThere are always users that need to be "exposed" -- that is, their 175538032Speterinternal site name should be displayed instead of the masquerade name. 175664562SgshapiroRoot is an example (which has been "exposed" by default prior to 8.10). 175764562SgshapiroYou can add users to this list using 175838032Speter 175964562Sgshapiro EXPOSED_USER(`usernames') 176038032Speter 176190792SgshapiroThis adds users to class {E}; you could also use 176238032Speter 176390792Sgshapiro EXPOSED_USER_FILE(`filename') 176438032Speter 176538032SpeterYou can also arrange to relay all unqualified names (that is, names 176638032Speterwithout @host) to a relay host. For example, if you have a central 176738032Speteremail server, you might relay to that host so that users don't have 176838032Speterto have .forward files or aliases. You can do this using 176938032Speter 177043730Speter define(`LOCAL_RELAY', `mailer:hostname') 177138032Speter 177238032SpeterThe ``mailer:'' can be omitted, in which case the mailer defaults to 177338032Speter"relay". There are some user names that you don't want relayed, perhaps 177438032Speterbecause of local aliases. A common example is root, which may be 177538032Speterlocally aliased. You can add entries to this list using 177638032Speter 177764562Sgshapiro LOCAL_USER(`usernames') 177838032Speter 177990792SgshapiroThis adds users to class {L}; you could also use 178038032Speter 178190792Sgshapiro LOCAL_USER_FILE(`filename') 178238032Speter 178338032SpeterIf you want all incoming mail sent to a centralized hub, as for a 178438032Spetershared /var/spool/mail scheme, use 178538032Speter 178643730Speter define(`MAIL_HUB', `mailer:hostname') 178738032Speter 178838032SpeterAgain, ``mailer:'' defaults to "relay". If you define both LOCAL_RELAY 178943730Speterand MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will 179038032Speterbe sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB. 179164562SgshapiroNote: there is a (long standing) bug which keeps this combination from 179264562Sgshapiroworking for addresses of the form user+detail. 179364562SgshapiroNames in class {L} will be delivered locally, so you MUST have aliases or 179438032Speter.forward files for them. 179538032Speter 179638032SpeterFor example, if you are on machine mastodon.CS.Berkeley.EDU and you have 179743730SpeterFEATURE(`stickyhost'), the following combinations of settings will have the 179838032Speterindicated effects: 179938032Speter 180038032Speteremail sent to.... eric eric@mastodon.CS.Berkeley.EDU 180138032Speter 180238032SpeterLOCAL_RELAY set to mail.CS.Berkeley.EDU (delivered locally) 180338032Spetermail.CS.Berkeley.EDU (no local aliasing) (aliasing done) 180438032Speter 180538032SpeterMAIL_HUB set to mammoth.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU 180638032Spetermammoth.CS.Berkeley.EDU (aliasing done) (aliasing done) 180738032Speter 180838032SpeterBoth LOCAL_RELAY and mail.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU 180938032SpeterMAIL_HUB set as above (no local aliasing) (aliasing done) 181038032Speter 181143730SpeterIf you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and 181238032SpeterMAIL_HUB act identically, with MAIL_HUB taking precedence. 181338032Speter 181438032SpeterIf you want all outgoing mail to go to a central relay site, define 181538032SpeterSMART_HOST as well. Briefly: 181638032Speter 181738032Speter LOCAL_RELAY applies to unqualified names (e.g., "eric"). 181838032Speter MAIL_HUB applies to names qualified with the name of the 181938032Speter local host (e.g., "eric@mastodon.CS.Berkeley.EDU"). 182064562Sgshapiro SMART_HOST applies to names qualified with other hosts or 182164562Sgshapiro bracketed addresses (e.g., "eric@mastodon.CS.Berkeley.EDU" 182264562Sgshapiro or "eric@[127.0.0.1]"). 182338032Speter 182438032SpeterHowever, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY, 182538032SpeterDECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you 182638032Speterreally want absolutely everything to go to a single central site you will 182738032Speterneed to unset all the other relays -- or better yet, find or build a 182838032Speterminimal config file that does this. 182938032Speter 183038032SpeterFor duplicate suppression to work properly, the host name is best 183138032Speterspecified with a terminal dot: 183238032Speter 183338032Speter define(`MAIL_HUB', `host.domain.') 183438032Speter note the trailing dot ---^ 183538032Speter 183638032Speter 183790792Sgshapiro+-------------------------------------------+ 183890792Sgshapiro| USING LDAP FOR ALIASES, MAPS, AND CLASSES | 183990792Sgshapiro+-------------------------------------------+ 184090792Sgshapiro 184190792SgshapiroLDAP can be used for aliases, maps, and classes by either specifying your 184290792Sgshapiroown LDAP map specification or using the built-in default LDAP map 184390792Sgshapirospecification. The built-in default specifications all provide lookups 184490792Sgshapirowhich match against either the machine's fully qualified hostname (${j}) or 184590792Sgshapiroa "cluster". The cluster allows you to share LDAP entries among a large 184690792Sgshapironumber of machines without having to enter each of the machine names into 184790792Sgshapiroeach LDAP entry. To set the LDAP cluster name to use for a particular 184890792Sgshapiromachine or set of machines, set the confLDAP_CLUSTER m4 variable to a 184990792Sgshapirounique name. For example: 185090792Sgshapiro 185190792Sgshapiro define(`confLDAP_CLUSTER', `Servers') 185290792Sgshapiro 185390792SgshapiroHere, the word `Servers' will be the cluster name. As an example, assume 185490792Sgshapirothat smtp.sendmail.org, etrn.sendmail.org, and mx.sendmail.org all belong 185590792Sgshapiroto the Servers cluster. 185690792Sgshapiro 185790792SgshapiroSome of the LDAP LDIF examples below show use of the Servers cluster. 185890792SgshapiroEvery entry must have either a sendmailMTAHost or sendmailMTACluster 185990792Sgshapiroattribute or it will be ignored. Be careful as mixing clusters and 186090792Sgshapiroindividual host records can have surprising results (see the CAUTION 186190792Sgshapirosections below). 186290792Sgshapiro 186390792SgshapiroSee the file cf/sendmail.schema for the actual LDAP schemas. Note that 186490792Sgshapirothis schema (and therefore the lookups and examples below) is experimental 186590792Sgshapiroat this point as it has had little public review. Therefore, it may change 1866157001Sgshapiroin future versions. Feedback via sendmail-YYYY@support.sendmail.org is 1867157001Sgshapiroencouraged (replace YYYY with the current year, e.g., 2005). 186890792Sgshapiro 186990792Sgshapiro------- 187090792SgshapiroAliases 187190792Sgshapiro------- 187290792Sgshapiro 187390792SgshapiroThe ALIAS_FILE (O AliasFile) option can be set to use LDAP for alias 187490792Sgshapirolookups. To use the default schema, simply use: 187590792Sgshapiro 187690792Sgshapiro define(`ALIAS_FILE', `ldap:') 187790792Sgshapiro 187890792SgshapiroBy doing so, you will use the default schema which expands to a map 187990792Sgshapirodeclared as follows: 188090792Sgshapiro 188190792Sgshapiro ldap -k (&(objectClass=sendmailMTAAliasObject) 188290792Sgshapiro (sendmailMTAAliasGrouping=aliases) 188390792Sgshapiro (|(sendmailMTACluster=${sendmailMTACluster}) 188490792Sgshapiro (sendmailMTAHost=$j)) 188590792Sgshapiro (sendmailMTAKey=%0)) 1886132943Sgshapiro -v sendmailMTAAliasValue,sendmailMTAAliasSearch:FILTER:sendmailMTAAliasObject,sendmailMTAAliasURL:URL:sendmailMTAAliasObject 188790792Sgshapiro 1888132943Sgshapiro 188990792SgshapiroNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually 189090792Sgshapiroused when the binary expands the `ldap:' token as the AliasFile option is 189190792Sgshapironot actually macro-expanded when read from the sendmail.cf file. 189290792Sgshapiro 189390792SgshapiroExample LDAP LDIF entries might be: 189490792Sgshapiro 189590792Sgshapiro dn: sendmailMTAKey=sendmail-list, dc=sendmail, dc=org 189690792Sgshapiro objectClass: sendmailMTA 189790792Sgshapiro objectClass: sendmailMTAAlias 189890792Sgshapiro objectClass: sendmailMTAAliasObject 189990792Sgshapiro sendmailMTAAliasGrouping: aliases 190090792Sgshapiro sendmailMTAHost: etrn.sendmail.org 190190792Sgshapiro sendmailMTAKey: sendmail-list 190290792Sgshapiro sendmailMTAAliasValue: ca@example.org 190390792Sgshapiro sendmailMTAAliasValue: eric 190490792Sgshapiro sendmailMTAAliasValue: gshapiro@example.com 190590792Sgshapiro 190690792Sgshapiro dn: sendmailMTAKey=owner-sendmail-list, dc=sendmail, dc=org 190790792Sgshapiro objectClass: sendmailMTA 190890792Sgshapiro objectClass: sendmailMTAAlias 190990792Sgshapiro objectClass: sendmailMTAAliasObject 191090792Sgshapiro sendmailMTAAliasGrouping: aliases 191190792Sgshapiro sendmailMTAHost: etrn.sendmail.org 191290792Sgshapiro sendmailMTAKey: owner-sendmail-list 191390792Sgshapiro sendmailMTAAliasValue: eric 191490792Sgshapiro 191590792Sgshapiro dn: sendmailMTAKey=postmaster, dc=sendmail, dc=org 191690792Sgshapiro objectClass: sendmailMTA 191790792Sgshapiro objectClass: sendmailMTAAlias 191890792Sgshapiro objectClass: sendmailMTAAliasObject 191990792Sgshapiro sendmailMTAAliasGrouping: aliases 192090792Sgshapiro sendmailMTACluster: Servers 192190792Sgshapiro sendmailMTAKey: postmaster 192290792Sgshapiro sendmailMTAAliasValue: eric 192390792Sgshapiro 192490792SgshapiroHere, the aliases sendmail-list and owner-sendmail-list will be available 192590792Sgshapiroonly on etrn.sendmail.org but the postmaster alias will be available on 192690792Sgshapiroevery machine in the Servers cluster (including etrn.sendmail.org). 192790792Sgshapiro 192890792SgshapiroCAUTION: aliases are additive so that entries like these: 192990792Sgshapiro 193090792Sgshapiro dn: sendmailMTAKey=bob, dc=sendmail, dc=org 193190792Sgshapiro objectClass: sendmailMTA 193290792Sgshapiro objectClass: sendmailMTAAlias 193390792Sgshapiro objectClass: sendmailMTAAliasObject 193490792Sgshapiro sendmailMTAAliasGrouping: aliases 193590792Sgshapiro sendmailMTACluster: Servers 193690792Sgshapiro sendmailMTAKey: bob 193790792Sgshapiro sendmailMTAAliasValue: eric 193890792Sgshapiro 193994334Sgshapiro dn: sendmailMTAKey=bobetrn, dc=sendmail, dc=org 194090792Sgshapiro objectClass: sendmailMTA 194190792Sgshapiro objectClass: sendmailMTAAlias 194290792Sgshapiro objectClass: sendmailMTAAliasObject 194390792Sgshapiro sendmailMTAAliasGrouping: aliases 194490792Sgshapiro sendmailMTAHost: etrn.sendmail.org 194590792Sgshapiro sendmailMTAKey: bob 194690792Sgshapiro sendmailMTAAliasValue: gshapiro 194790792Sgshapiro 194890792Sgshapirowould mean that on all of the hosts in the cluster, mail to bob would go to 194990792Sgshapiroeric EXCEPT on etrn.sendmail.org in which case it would go to BOTH eric and 195090792Sgshapirogshapiro. 195190792Sgshapiro 195290792SgshapiroIf you prefer not to use the default LDAP schema for your aliases, you can 195390792Sgshapirospecify the map parameters when setting ALIAS_FILE. For example: 195490792Sgshapiro 195590792Sgshapiro define(`ALIAS_FILE', `ldap:-k (&(objectClass=mailGroup)(mail=%0)) -v mgrpRFC822MailMember') 195690792Sgshapiro 195790792Sgshapiro---- 195890792SgshapiroMaps 195990792Sgshapiro---- 196090792Sgshapiro 196190792SgshapiroFEATURE()'s which take an optional map definition argument (e.g., access, 196290792Sgshapiromailertable, virtusertable, etc.) can instead take the special keyword 196390792Sgshapiro`LDAP', e.g.: 196490792Sgshapiro 196590792Sgshapiro FEATURE(`access_db', `LDAP') 196690792Sgshapiro FEATURE(`virtusertable', `LDAP') 196790792Sgshapiro 196890792SgshapiroWhen this keyword is given, that map will use LDAP lookups consisting of 196990792Sgshapirothe objectClass sendmailMTAClassObject, the attribute sendmailMTAMapName 197090792Sgshapirowith the map name, a search attribute of sendmailMTAKey, and the value 197190792Sgshapiroattribute sendmailMTAMapValue. 197290792Sgshapiro 197390792SgshapiroThe values for sendmailMTAMapName are: 197490792Sgshapiro 197590792Sgshapiro FEATURE() sendmailMTAMapName 197690792Sgshapiro --------- ------------------ 197790792Sgshapiro access_db access 197890792Sgshapiro authinfo authinfo 197990792Sgshapiro bitdomain bitdomain 198090792Sgshapiro domaintable domain 198190792Sgshapiro genericstable generics 198290792Sgshapiro mailertable mailer 198390792Sgshapiro uucpdomain uucpdomain 198490792Sgshapiro virtusertable virtuser 198590792Sgshapiro 198690792SgshapiroFor example, FEATURE(`mailertable', `LDAP') would use the map definition: 198790792Sgshapiro 198890792Sgshapiro Kmailertable ldap -k (&(objectClass=sendmailMTAMapObject) 198990792Sgshapiro (sendmailMTAMapName=mailer) 199090792Sgshapiro (|(sendmailMTACluster=${sendmailMTACluster}) 199190792Sgshapiro (sendmailMTAHost=$j)) 199290792Sgshapiro (sendmailMTAKey=%0)) 1993132943Sgshapiro -1 -v sendmailMTAMapValue,sendmailMTAMapSearch:FILTER:sendmailMTAMapObject,sendmailMTAMapURL:URL:sendmailMTAMapObject 199490792Sgshapiro 199590792SgshapiroAn example LDAP LDIF entry using this map might be: 199690792Sgshapiro 199790792Sgshapiro dn: sendmailMTAMapName=mailer, dc=sendmail, dc=org 199890792Sgshapiro objectClass: sendmailMTA 199990792Sgshapiro objectClass: sendmailMTAMap 200090792Sgshapiro sendmailMTACluster: Servers 200190792Sgshapiro sendmailMTAMapName: mailer 200290792Sgshapiro 200390792Sgshapiro dn: sendmailMTAKey=example.com, sendmailMTAMapName=mailer, dc=sendmail, dc=org 200490792Sgshapiro objectClass: sendmailMTA 200590792Sgshapiro objectClass: sendmailMTAMap 200690792Sgshapiro objectClass: sendmailMTAMapObject 200790792Sgshapiro sendmailMTAMapName: mailer 200890792Sgshapiro sendmailMTACluster: Servers 200990792Sgshapiro sendmailMTAKey: example.com 201090792Sgshapiro sendmailMTAMapValue: relay:[smtp.example.com] 201190792Sgshapiro 201290792SgshapiroCAUTION: If your LDAP database contains the record above and *ALSO* a host 201390792Sgshapirospecific record such as: 201490792Sgshapiro 201590792Sgshapiro dn: sendmailMTAKey=example.com@etrn, sendmailMTAMapName=mailer, dc=sendmail, dc=org 201690792Sgshapiro objectClass: sendmailMTA 201790792Sgshapiro objectClass: sendmailMTAMap 201890792Sgshapiro objectClass: sendmailMTAMapObject 201990792Sgshapiro sendmailMTAMapName: mailer 202090792Sgshapiro sendmailMTAHost: etrn.sendmail.org 202190792Sgshapiro sendmailMTAKey: example.com 202290792Sgshapiro sendmailMTAMapValue: relay:[mx.example.com] 202390792Sgshapiro 202490792Sgshapirothen these entries will give unexpected results. When the lookup is done 202590792Sgshapiroon etrn.sendmail.org, the effect is that there is *NO* match at all as maps 202690792Sgshapirorequire a single match. Since the host etrn.sendmail.org is also in the 202790792SgshapiroServers cluster, LDAP would return two answers for the example.com map key 202890792Sgshapiroin which case sendmail would treat this as no match at all. 202990792Sgshapiro 203090792SgshapiroIf you prefer not to use the default LDAP schema for your maps, you can 203190792Sgshapirospecify the map parameters when using the FEATURE(). For example: 203290792Sgshapiro 203390792Sgshapiro FEATURE(`access_db', `ldap:-1 -k (&(objectClass=mapDatabase)(key=%0)) -v value') 203490792Sgshapiro 203590792Sgshapiro------- 203690792SgshapiroClasses 203790792Sgshapiro------- 203890792Sgshapiro 203990792SgshapiroNormally, classes can be filled via files or programs. As of 8.12, they 204090792Sgshapirocan also be filled via map lookups using a new syntax: 204190792Sgshapiro 204290792Sgshapiro F{ClassName}mapkey@mapclass:mapspec 204390792Sgshapiro 204490792Sgshapiromapkey is optional and if not provided the map key will be empty. This can 204590792Sgshapirobe used with LDAP to read classes from LDAP. Note that the lookup is only 204690792Sgshapirodone when sendmail is initially started. Use the special value `@LDAP' to 204790792Sgshapirouse the default LDAP schema. For example: 204890792Sgshapiro 204990792Sgshapiro RELAY_DOMAIN_FILE(`@LDAP') 205090792Sgshapiro 205190792Sgshapirowould put all of the attribute sendmailMTAClassValue values of LDAP records 205290792Sgshapirowith objectClass sendmailMTAClass and an attribute sendmailMTAClassName of 205390792Sgshapiro'R' into class $={R}. In other words, it is equivalent to the LDAP map 205490792Sgshapirospecification: 205590792Sgshapiro 205690792Sgshapiro F{R}@ldap:-k (&(objectClass=sendmailMTAClass) 205790792Sgshapiro (sendmailMTAClassName=R) 205890792Sgshapiro (|(sendmailMTACluster=${sendmailMTACluster}) 205990792Sgshapiro (sendmailMTAHost=$j))) 2060132943Sgshapiro -v sendmailMTAClassValue,sendmailMTAClassSearch:FILTER:sendmailMTAClass,sendmailMTAClassURL:URL:sendmailMTAClass 206190792Sgshapiro 206290792SgshapiroNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually 206390792Sgshapiroused when the binary expands the `@LDAP' token as class declarations are 206490792Sgshapironot actually macro-expanded when read from the sendmail.cf file. 206590792Sgshapiro 206690792SgshapiroThis can be used with class related commands such as RELAY_DOMAIN_FILE(), 206790792SgshapiroMASQUERADE_DOMAIN_FILE(), etc: 206890792Sgshapiro 206990792Sgshapiro Command sendmailMTAClassName 207090792Sgshapiro ------- -------------------- 207190792Sgshapiro CANONIFY_DOMAIN_FILE() Canonify 207290792Sgshapiro EXPOSED_USER_FILE() E 207390792Sgshapiro GENERICS_DOMAIN_FILE() G 207490792Sgshapiro LDAPROUTE_DOMAIN_FILE() LDAPRoute 207590792Sgshapiro LDAPROUTE_EQUIVALENT_FILE() LDAPRouteEquiv 207690792Sgshapiro LOCAL_USER_FILE() L 207790792Sgshapiro MASQUERADE_DOMAIN_FILE() M 207890792Sgshapiro MASQUERADE_EXCEPTION_FILE() N 207990792Sgshapiro RELAY_DOMAIN_FILE() R 208090792Sgshapiro VIRTUSER_DOMAIN_FILE() VirtHost 208190792Sgshapiro 208290792SgshapiroYou can also add your own as any 'F'ile class of the form: 208390792Sgshapiro 208490792Sgshapiro F{ClassName}@LDAP 208590792Sgshapiro ^^^^^^^^^ 208690792Sgshapirowill use "ClassName" for the sendmailMTAClassName. 208790792Sgshapiro 208890792SgshapiroAn example LDAP LDIF entry would look like: 208990792Sgshapiro 209090792Sgshapiro dn: sendmailMTAClassName=R, dc=sendmail, dc=org 209190792Sgshapiro objectClass: sendmailMTA 209290792Sgshapiro objectClass: sendmailMTAClass 209390792Sgshapiro sendmailMTACluster: Servers 209490792Sgshapiro sendmailMTAClassName: R 209590792Sgshapiro sendmailMTAClassValue: sendmail.org 209690792Sgshapiro sendmailMTAClassValue: example.com 209790792Sgshapiro sendmailMTAClassValue: 10.56.23 209890792Sgshapiro 209990792SgshapiroCAUTION: If your LDAP database contains the record above and *ALSO* a host 210090792Sgshapirospecific record such as: 210190792Sgshapiro 210290792Sgshapiro dn: sendmailMTAClassName=R@etrn.sendmail.org, dc=sendmail, dc=org 210390792Sgshapiro objectClass: sendmailMTA 210490792Sgshapiro objectClass: sendmailMTAClass 210590792Sgshapiro sendmailMTAHost: etrn.sendmail.org 210690792Sgshapiro sendmailMTAClassName: R 210790792Sgshapiro sendmailMTAClassValue: example.com 210890792Sgshapiro 210990792Sgshapirothe result will be similar to the aliases caution above. When the lookup 211090792Sgshapirois done on etrn.sendmail.org, $={R} would contain all of the entries (from 211190792Sgshapiroboth the cluster match and the host match). In other words, the effective 211290792Sgshapirois additive. 211390792Sgshapiro 211490792SgshapiroIf you prefer not to use the default LDAP schema for your classes, you can 211590792Sgshapirospecify the map parameters when using the class command. For example: 211690792Sgshapiro 211790792Sgshapiro VIRTUSER_DOMAIN_FILE(`@ldap:-k (&(objectClass=virtHosts)(host=*)) -v host') 211890792Sgshapiro 211990792SgshapiroRemember, macros can not be used in a class declaration as the binary does 212090792Sgshapironot expand them. 212190792Sgshapiro 212290792Sgshapiro 212364562Sgshapiro+--------------+ 212464562Sgshapiro| LDAP ROUTING | 212564562Sgshapiro+--------------+ 212664562Sgshapiro 212764562SgshapiroFEATURE(`ldap_routing') can be used to implement the IETF Internet Draft 212864562SgshapiroLDAP Schema for Intranet Mail Routing 212964562Sgshapiro(draft-lachman-laser-ldap-mail-routing-01). This feature enables 213064562SgshapiroLDAP-based rerouting of a particular address to either a different host 213164562Sgshapiroor a different address. The LDAP lookup is first attempted on the full 213264562Sgshapiroaddress (e.g., user@example.com) and then on the domain portion 213364562Sgshapiro(e.g., @example.com). Be sure to setup your domain for LDAP routing using 213464562SgshapiroLDAPROUTE_DOMAIN(), e.g.: 213564562Sgshapiro 213664562Sgshapiro LDAPROUTE_DOMAIN(`example.com') 213764562Sgshapiro 213890792SgshapiroAdditionally, you can specify equivalent domains for LDAP routing using 213990792SgshapiroLDAPROUTE_EQUIVALENT() and LDAPROUTE_EQUIVALENT_FILE(). 'Equivalent' 214090792Sgshapirohostnames are mapped to $M (the masqueraded hostname for the server) before 214190792Sgshapirothe LDAP query. For example, if the mail is addressed to 214290792Sgshapirouser@host1.example.com, normally the LDAP lookup would only be done for 214390792Sgshapiro'user@host1.example.com' and '@host1.example.com'. However, if 214490792SgshapiroLDAPROUTE_EQUIVALENT(`host1.example.com') is used, the lookups would also be 214590792Sgshapirodone on 'user@example.com' and '@example.com' after attempting the 214690792Sgshapirohost1.example.com lookups. 214790792Sgshapiro 214864562SgshapiroBy default, the feature will use the schemas as specified in the draft 214964562Sgshapiroand will not reject addresses not found by the LDAP lookup. However, 215064562Sgshapirothis behavior can be changed by giving additional arguments to the FEATURE() 215164562Sgshapirocommand: 215264562Sgshapiro 2153132943Sgshapiro FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>, 2154132943Sgshapiro <detail>, <nodomain>, <tempfail>) 215564562Sgshapiro 215664562Sgshapirowhere <mailHost> is a map definition describing how to lookup an alternative 215764562Sgshapiromail host for a particular address; <mailRoutingAddress> is a map definition 215890792Sgshapirodescribing how to lookup an alternative address for a particular address; 215964562Sgshapirothe <bounce> argument, if present and not the word "passthru", dictates 216064562Sgshapirothat mail should be bounced if neither a mailHost nor mailRoutingAddress 2161132943Sgshapirois found, if set to "sendertoo", the sender will be rejected if not 2162132943Sgshapirofound in LDAP; and <detail> indicates what actions to take if the address 216390792Sgshapirocontains +detail information -- `strip' tries the lookup with the +detail 216490792Sgshapiroand if no matches are found, strips the +detail and tries the lookup again; 216590792Sgshapiro`preserve', does the same as `strip' but if a mailRoutingAddress match is 2166132943Sgshapirofound, the +detail information is copied to the new address; the <nodomain> 2167132943Sgshapiroargument, if present, will prevent the @domain lookup if the full 2168132943Sgshapiroaddress is not found in LDAP; the <tempfail> argument, if set to 2169132943Sgshapiro"tempfail", instructs the rules to give an SMTP 4XX temporary 2170132943Sgshapiroerror if the LDAP server gives the MTA a temporary failure, or if set to 2171132943Sgshapiro"queue" (the default), the MTA will locally queue the mail. 217264562Sgshapiro 217364562SgshapiroThe default <mailHost> map definition is: 217464562Sgshapiro 217594334Sgshapiro ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient) 217664562Sgshapiro (mailLocalAddress=%0)) 217764562Sgshapiro 217864562SgshapiroThe default <mailRoutingAddress> map definition is: 217964562Sgshapiro 218094334Sgshapiro ldap -1 -T<TMPF> -v mailRoutingAddress 218194334Sgshapiro -k (&(objectClass=inetLocalMailRecipient) 218294334Sgshapiro (mailLocalAddress=%0)) 218364562Sgshapiro 218464562SgshapiroNote that neither includes the LDAP server hostname (-h server) or base DN 218564562Sgshapiro(-b o=org,c=COUNTRY), both necessary for LDAP queries. It is presumed that 218664562Sgshapiroyour .mc file contains a setting for the confLDAP_DEFAULT_SPEC option with 218764562Sgshapirothese settings. If this is not the case, the map definitions should be 218894334Sgshapirochanged as described above. The "-T<TMPF>" is required in any user 218994334Sgshapirospecified map definition to catch temporary errors. 219064562Sgshapiro 219164562SgshapiroThe following possibilities exist as a result of an LDAP lookup on an 219264562Sgshapiroaddress: 219364562Sgshapiro 219464562Sgshapiro mailHost is mailRoutingAddress is Results in 219564562Sgshapiro ----------- --------------------- ---------- 219664562Sgshapiro set to a set mail delivered to 219764562Sgshapiro "local" host mailRoutingAddress 219864562Sgshapiro 219964562Sgshapiro set to a not set delivered to 220064562Sgshapiro "local" host original address 220164562Sgshapiro 220264562Sgshapiro set to a set mailRoutingAddress 220364562Sgshapiro remote host relayed to mailHost 220464562Sgshapiro 220564562Sgshapiro set to a not set original address 220664562Sgshapiro remote host relayed to mailHost 220764562Sgshapiro 220864562Sgshapiro not set set mail delivered to 220964562Sgshapiro mailRoutingAddress 221064562Sgshapiro 221164562Sgshapiro not set not set delivered to 221264562Sgshapiro original address *OR* 221364562Sgshapiro bounced as unknown user 221464562Sgshapiro 221590792SgshapiroThe term "local" host above means the host specified is in class {w}. If 221690792Sgshapirothe result would mean sending the mail to a different host, that host is 221790792Sgshapirolooked up in the mailertable before delivery. 221890792Sgshapiro 221964562SgshapiroNote that the last case depends on whether the third argument is given 222064562Sgshapiroto the FEATURE() command. The default is to deliver the message to the 222164562Sgshapirooriginal address. 222264562Sgshapiro 222364562SgshapiroThe LDAP entries should be set up with an objectClass of 222464562SgshapiroinetLocalMailRecipient and the address be listed in a mailLocalAddress 222564562Sgshapiroattribute. If present, there must be only one mailHost attribute and it 222664562Sgshapiromust contain a fully qualified host name as its value. Similarly, if 222764562Sgshapiropresent, there must be only one mailRoutingAddress attribute and it must 222890792Sgshapirocontain an RFC 822 compliant address. Some example LDAP records (in LDIF 222964562Sgshapiroformat): 223064562Sgshapiro 223164562Sgshapiro dn: uid=tom, o=example.com, c=US 223264562Sgshapiro objectClass: inetLocalMailRecipient 223364562Sgshapiro mailLocalAddress: tom@example.com 223464562Sgshapiro mailRoutingAddress: thomas@mailhost.example.com 223564562Sgshapiro 223664562SgshapiroThis would deliver mail for tom@example.com to thomas@mailhost.example.com. 223764562Sgshapiro 223864562Sgshapiro dn: uid=dick, o=example.com, c=US 223964562Sgshapiro objectClass: inetLocalMailRecipient 224064562Sgshapiro mailLocalAddress: dick@example.com 224164562Sgshapiro mailHost: eng.example.com 224264562Sgshapiro 224364562SgshapiroThis would relay mail for dick@example.com to the same address but redirect 224490792Sgshapirothe mail to MX records listed for the host eng.example.com (unless the 224590792Sgshapiromailertable overrides). 224664562Sgshapiro 224764562Sgshapiro dn: uid=harry, o=example.com, c=US 224864562Sgshapiro objectClass: inetLocalMailRecipient 224964562Sgshapiro mailLocalAddress: harry@example.com 225064562Sgshapiro mailHost: mktmail.example.com 225164562Sgshapiro mailRoutingAddress: harry@mkt.example.com 225264562Sgshapiro 225364562SgshapiroThis would relay mail for harry@example.com to the MX records listed for 225464562Sgshapirothe host mktmail.example.com using the new address harry@mkt.example.com 225564562Sgshapirowhen talking to that host. 225664562Sgshapiro 225764562Sgshapiro dn: uid=virtual.example.com, o=example.com, c=US 225864562Sgshapiro objectClass: inetLocalMailRecipient 225964562Sgshapiro mailLocalAddress: @virtual.example.com 226064562Sgshapiro mailHost: server.example.com 226164562Sgshapiro mailRoutingAddress: virtual@example.com 226264562Sgshapiro 226364562SgshapiroThis would send all mail destined for any username @virtual.example.com to 226464562Sgshapirothe machine server.example.com's MX servers and deliver to the address 226564562Sgshapirovirtual@example.com on that relay machine. 226664562Sgshapiro 226764562Sgshapiro 226838032Speter+---------------------------------+ 226938032Speter| ANTI-SPAM CONFIGURATION CONTROL | 227038032Speter+---------------------------------+ 227138032Speter 227238032SpeterThe primary anti-spam features available in sendmail are: 227338032Speter 227438032Speter* Relaying is denied by default. 227538032Speter* Better checking on sender information. 227638032Speter* Access database. 227738032Speter* Header checks. 227838032Speter 227964562SgshapiroRelaying (transmission of messages from a site outside your host (class 228064562Sgshapiro{w}) to another site except yours) is denied by default. Note that this 228164562Sgshapirochanged in sendmail 8.9; previous versions allowed relaying by default. 228264562SgshapiroIf you really want to revert to the old behaviour, you will need to use 228364562SgshapiroFEATURE(`promiscuous_relay'). You can allow certain domains to relay 228464562Sgshapirothrough your server by adding their domain name or IP address to class 228564562Sgshapiro{R} using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database 228690792Sgshapiro(described below). Note that IPv6 addresses must be prefaced with "IPv6:". 228790792SgshapiroThe file consists (like any other file based class) of entries listed on 228890792Sgshapiroseparate lines, e.g., 228938032Speter 229064562Sgshapiro sendmail.org 229164562Sgshapiro 128.32 229290792Sgshapiro IPv6:2002:c0a8:02c7 229390792Sgshapiro IPv6:2002:c0a8:51d2::23f4 229464562Sgshapiro host.mydomain.com 229590792Sgshapiro [UNIX:localhost] 229664562Sgshapiro 229790792SgshapiroNotice: the last entry allows relaying for connections via a UNIX 229890792Sgshapirosocket to the MTA/MSP. This might be necessary if your configuration 229990792Sgshapirodoesn't allow relaying by other means in that case, e.g., by having 230090792Sgshapirolocalhost.$m in class {R} (make sure $m is not just a top level 230190792Sgshapirodomain). 230290792Sgshapiro 230338032SpeterIf you use 230438032Speter 230543730Speter FEATURE(`relay_entire_domain') 230638032Speter 230764562Sgshapirothen any host in any of your local domains (that is, class {m}) 230842575Speterwill be relayed (that is, you will accept mail either to or from any 230942575Speterhost in your domain). 231038032Speter 231138032SpeterYou can also allow relaying based on the MX records of the host 231238032Speterportion of an incoming recipient address by using 231338032Speter 231443730Speter FEATURE(`relay_based_on_MX') 231538032Speter 231638032SpeterFor example, if your server receives a recipient of user@domain.com 231738032Speterand domain.com lists your server in its MX records, the mail will be 231890792Sgshapiroaccepted for relay to domain.com. This feature may cause problems 231990792Sgshapiroif MX lookups for the recipient domain are slow or time out. In that 232090792Sgshapirocase, mail will be temporarily rejected. It is usually better to 232190792Sgshapiromaintain a list of hosts/domains for which the server acts as relay. 232290792SgshapiroNote also that this feature will stop spammers from using your host 232390792Sgshapiroto relay spam but it will not stop outsiders from using your server 232490792Sgshapiroas a relay for their site (that is, they set up an MX record pointing 232590792Sgshapiroto your mail server, and you will relay mail addressed to them 232690792Sgshapirowithout any prior arrangement). Along the same lines, 232738032Speter 232843730Speter FEATURE(`relay_local_from') 232938032Speter 233038032Speterwill allow relaying if the sender specifies a return path (i.e. 2331157001SgshapiroMAIL FROM:<user@domain>) domain which is a local domain. This is a 233238032Speterdangerous feature as it will allow spammers to spam using your mail 233338032Speterserver by simply specifying a return address of user@your.domain.com. 233438032SpeterIt should not be used unless absolutely necessary. 233564562SgshapiroA slightly better solution is 233638032Speter 233764562Sgshapiro FEATURE(`relay_mail_from') 233864562Sgshapiro 233964562Sgshapirowhich allows relaying if the mail sender is listed as RELAY in the 2340110560Sgshapiroaccess map. If an optional argument `domain' (this is the literal 2341110560Sgshapiroword `domain', not a placeholder) is given, the domain portion of 2342110560Sgshapirothe mail sender is also checked to allowing relaying. This option 2343110560Sgshapiroonly works together with the tag From: for the LHS of the access 2344132943Sgshapiromap entries. This feature allows spammers to abuse your mail server 2345132943Sgshapiroby specifying a return address that you enabled in your access file. 2346132943SgshapiroThis may be harder to figure out for spammers, but it should not 2347132943Sgshapirobe used unless necessary. Instead use SMTP AUTH or STARTTLS to 2348132943Sgshapiroallow relaying for roaming users. 234964562Sgshapiro 235064562Sgshapiro 235190792SgshapiroIf source routing is used in the recipient address (e.g., 2352157001SgshapiroRCPT TO:<user%site.com@othersite.com>), sendmail will check 235338032Speteruser@site.com for relaying if othersite.com is an allowed relay host 235464562Sgshapiroin either class {R}, class {m} if FEATURE(`relay_entire_domain') is used, 235543730Speteror the access database if FEATURE(`access_db') is used. To prevent 235638032Speterthe address from being stripped down, use: 235738032Speter 235843730Speter FEATURE(`loose_relay_check') 235938032Speter 236038032SpeterIf you think you need to use this feature, you probably do not. This 236138032Spetershould only be used for sites which have no control over the addresses 236238032Speterthat they provide a gateway for. Use this FEATURE with caution as it 236338032Spetercan allow spammers to relay through your server if not setup properly. 236438032Speter 236564562SgshapiroNOTICE: It is possible to relay mail through a system which the anti-relay 236664562Sgshapirorules do not prevent: the case of a system that does use FEATURE(`nouucp', 236764562Sgshapiro`nospecial') (system A) and relays local messages to a mail hub (e.g., via 236864562SgshapiroLOCAL_RELAY or LUSER_RELAY) (system B). If system B doesn't use 236964562SgshapiroFEATURE(`nouucp') at all, addresses of the form 237064562Sgshapiro<example.net!user@local.host> would be relayed to <user@example.net>. 237164562SgshapiroSystem A doesn't recognize `!' as an address separator and therefore 237264562Sgshapiroforwards it to the mail hub which in turns relays it because it came from 237364562Sgshapiroa trusted local host. So if a mailserver allows UUCP (bang-format) 237464562Sgshapiroaddresses, all systems from which it allows relaying should do the same 237564562Sgshapiroor reject those addresses. 237664562Sgshapiro 237738032SpeterAs of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has 237838032Speteran unresolvable domain (i.e., one that DNS, your local name service, 237990792Sgshapiroor special case rules in ruleset 3 cannot locate). This also applies 238090792Sgshapiroto addresses that use domain literals, e.g., <user@[1.2.3.4]>, if the 238190792SgshapiroIP address can't be mapped to a host name. If you want to continue 238290792Sgshapiroto accept such domains, e.g., because you are inside a firewall that 238390792Sgshapirohas only a limited view of the Internet host name space (note that you 238490792Sgshapirowill not be able to return mail to them unless you have some "smart 238590792Sgshapirohost" forwarder), use 238638032Speter 238743730Speter FEATURE(`accept_unresolvable_domains') 238838032Speter 238990792SgshapiroAlternatively, you can allow specific addresses by adding them to 239090792Sgshapirothe access map, e.g., 239190792Sgshapiro 239290792Sgshapiro From:unresolvable.domain OK 239390792Sgshapiro From:[1.2.3.4] OK 239490792Sgshapiro From:[1.2.4] OK 239590792Sgshapiro 239690792SgshapiroNotice: domains which are temporarily unresolvable are (temporarily) 239790792Sgshapirorejected with a 451 reply code. If those domains should be accepted 239890792Sgshapiro(which is discouraged) then you can use 239990792Sgshapiro 240090792Sgshapiro LOCAL_CONFIG 240190792Sgshapiro C{ResOk}TEMP 240290792Sgshapiro 240338032Spetersendmail will also refuse mail if the MAIL FROM: parameter is not 240438032Speterfully qualified (i.e., contains a domain as well as a user). If you 240538032Speterwant to continue to accept such senders, use 240638032Speter 240743730Speter FEATURE(`accept_unqualified_senders') 240838032Speter 240964562SgshapiroSetting the DaemonPortOptions modifier 'u' overrides the default behavior, 241064562Sgshapiroi.e., unqualified addresses are accepted even without this FEATURE. If 241164562Sgshapirothis FEATURE is not used, the DaemonPortOptions modifier 'f' can be used 241290792Sgshapiroto enforce fully qualified domain names. 241364562Sgshapiro 241438032SpeterAn ``access'' database can be created to accept or reject mail from 241538032Speterselected domains. For example, you may choose to reject all mail 241638032Speteroriginating from known spammers. To enable such a database, use 241738032Speter 241843730Speter FEATURE(`access_db') 241938032Speter 242090792SgshapiroNotice: the access database is applied to the envelope addresses 242190792Sgshapiroand the connection information, not to the header. 242290792Sgshapiro 242390792SgshapiroThe FEATURE macro can accept as second parameter the key file 242438032Speterdefinition for the database; for example 242538032Speter 242690792Sgshapiro FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access_map') 242738032Speter 242890792SgshapiroNotice: If a second argument is specified it must contain the option 242990792Sgshapiro`-T<TMPF>' as shown above. The optional third and fourth parameters 243090792Sgshapiromay be `skip' or `lookupdotdomain'. The former enables SKIP as 243190792Sgshapirovalue part (see below), the latter is another way to enable the 243290792Sgshapirofeature of the same name (see above). 243390792Sgshapiro 243442575SpeterRemember, since /etc/mail/access is a database, after creating the text 243542575Speterfile as described below, you must use makemap to create the database 243642575Spetermap. For example: 243742575Speter 243843730Speter makemap hash /etc/mail/access < /etc/mail/access 243942575Speter 244038032SpeterThe table itself uses e-mail addresses, domain names, and network 244190792Sgshapironumbers as keys. Note that IPv6 addresses must be prefaced with "IPv6:". 244290792SgshapiroFor example, 244338032Speter 2444132943Sgshapiro From:spammer@aol.com REJECT 2445132943Sgshapiro From:cyberspammer.com REJECT 2446132943Sgshapiro Connect:cyberspammer.com REJECT 2447132943Sgshapiro Connect:TLD REJECT 2448132943Sgshapiro Connect:192.168.212 REJECT 2449132943Sgshapiro Connect:IPv6:2002:c0a8:02c7 RELAY 2450132943Sgshapiro Connect:IPv6:2002:c0a8:51d2::23f4 REJECT 245138032Speter 245238032Speterwould refuse mail from spammer@aol.com, any user from cyberspammer.com 245394334Sgshapiro(or any host within the cyberspammer.com domain), any host in the entire 245494334Sgshapirotop level domain TLD, 192.168.212.* network, and the IPv6 address 245594334Sgshapiro2002:c0a8:51d2::23f4. It would allow relay for the IPv6 network 245694334Sgshapiro2002:c0a8:02c7::/48. 245738032Speter 2458132943SgshapiroEntries in the access map should be tagged according to their type. 2459132943SgshapiroThree tags are available: 2460132943Sgshapiro 2461132943Sgshapiro Connect: connection information (${client_addr}, ${client_name}) 2462132943Sgshapiro From: envelope sender 2463132943Sgshapiro To: envelope recipient 2464132943Sgshapiro 2465132943SgshapiroNotice: untagged entries are deprecated. 2466132943Sgshapiro 2467132943SgshapiroIf the required item is looked up in a map, it will be tried first 2468132943Sgshapirowith the corresponding tag in front, then (as fallback to enable 2469132943Sgshapirobackward compatibility) without any tag, unless the specific feature 2470132943Sgshapirorequires a tag. For example, 2471132943Sgshapiro 2472132943Sgshapiro From:spammer@some.dom REJECT 2473132943Sgshapiro To:friend.domain RELAY 2474132943Sgshapiro Connect:friend.domain OK 2475132943Sgshapiro Connect:from.domain RELAY 2476132943Sgshapiro From:good@another.dom OK 2477132943Sgshapiro From:another.dom REJECT 2478132943Sgshapiro 2479132943SgshapiroThis would deny mails from spammer@some.dom but you could still 2480132943Sgshapirosend mail to that address even if FEATURE(`blacklist_recipients') 2481132943Sgshapirois enabled. Your system will allow relaying to friend.domain, but 2482132943Sgshapironot from it (unless enabled by other means). Connections from that 2483132943Sgshapirodomain will be allowed even if it ends up in one of the DNS based 2484132943Sgshapirorejection lists. Relaying is enabled from from.domain but not to 2485132943Sgshapiroit (since relaying is based on the connection information for 2486132943Sgshapirooutgoing relaying, the tag Connect: must be used; for incoming 2487132943Sgshapirorelaying, which is based on the recipient address, To: must be 2488132943Sgshapiroused). The last two entries allow mails from good@another.dom but 2489132943Sgshapiroreject mail from all other addresses with another.dom as domain 2490132943Sgshapiropart. 2491132943Sgshapiro 2492132943Sgshapiro 249338032SpeterThe value part of the map can contain: 249438032Speter 249590792Sgshapiro OK Accept mail even if other rules in the running 249690792Sgshapiro ruleset would reject it, for example, if the domain 249790792Sgshapiro name is unresolvable. "Accept" does not mean 249890792Sgshapiro "relay", but at most acceptance for local 249990792Sgshapiro recipients. That is, OK allows less than RELAY. 250042575Speter RELAY Accept mail addressed to the indicated domain or 250142575Speter received from the indicated domain for relaying 250242575Speter through your SMTP server. RELAY also serves as 250342575Speter an implicit OK for the other checks. 250442575Speter REJECT Reject the sender or recipient with a general 250538032Speter purpose message. 250642575Speter DISCARD Discard the message completely using the 250771345Sgshapiro $#discard mailer. If it is used in check_compat, 250871345Sgshapiro it affects only the designated recipient, not 250971345Sgshapiro the whole message as it does in all other cases. 251071345Sgshapiro This should only be used if really necessary. 251190792Sgshapiro SKIP This can only be used for host/domain names 251290792Sgshapiro and IP addresses/nets. It will abort the current 251390792Sgshapiro search for this entry without accepting or rejecting 251490792Sgshapiro it but causing the default action. 251566494Sgshapiro ### any text where ### is an RFC 821 compliant error code and 251666494Sgshapiro "any text" is a message to return for the command. 2517157001Sgshapiro The entire string should be quoted to avoid 2518157001Sgshapiro surprises: 2519157001Sgshapiro 2520157001Sgshapiro "### any text" 2521157001Sgshapiro 2522157001Sgshapiro Otherwise sendmail formats the text as email 2523157001Sgshapiro addresses, e.g., it may remove spaces. 2524132943Sgshapiro This type is deprecated, use one of the two 252590792Sgshapiro ERROR: entries below instead. 252664562Sgshapiro ERROR:### any text 252764562Sgshapiro as above, but useful to mark error messages as such. 2528157001Sgshapiro If quotes need to be used to avoid modifications 2529157001Sgshapiro (see above), they should be placed like this: 2530157001Sgshapiro 2531157001Sgshapiro ERROR:"### any text" 2532157001Sgshapiro 253364562Sgshapiro ERROR:D.S.N:### any text 253464562Sgshapiro where D.S.N is an RFC 1893 compliant error code 2535157001Sgshapiro and the rest as above. If quotes need to be used 2536157001Sgshapiro to avoid modifications, they should be placed 2537157001Sgshapiro like this: 2538157001Sgshapiro 2539157001Sgshapiro ERROR:D.S.N:"### any text" 2540157001Sgshapiro 2541132943Sgshapiro QUARANTINE:any text 2542132943Sgshapiro Quarantine the message using the given text as the 2543132943Sgshapiro quarantining reason. 254438032Speter 254538032SpeterFor example: 254638032Speter 2547132943Sgshapiro From:cyberspammer.com ERROR:"550 We don't accept mail from spammers" 2548132943Sgshapiro From:okay.cyberspammer.com OK 2549132943Sgshapiro Connect:sendmail.org RELAY 2550132943Sgshapiro To:sendmail.org RELAY 2551132943Sgshapiro Connect:128.32 RELAY 2552132943Sgshapiro Connect:128.32.2 SKIP 2553132943Sgshapiro Connect:IPv6:1:2:3:4:5:6:7 RELAY 2554132943Sgshapiro Connect:suspicious.example.com QUARANTINE:Mail from suspicious host 2555132943Sgshapiro Connect:[127.0.0.3] OK 2556132943Sgshapiro Connect:[IPv6:1:2:3:4:5:6:7:8] OK 255738032Speter 2558132943Sgshapirowould accept mail from okay.cyberspammer.com, but would reject mail 2559132943Sgshapirofrom all other hosts at cyberspammer.com with the indicated message. 2560132943SgshapiroIt would allow relaying mail from and to any hosts in the sendmail.org 2561132943Sgshapirodomain, and allow relaying from the IPv6 1:2:3:4:5:6:7:* network 2562132943Sgshapiroand from the 128.32.*.* network except for the 128.32.2.* network, 2563132943Sgshapirowhich shows how SKIP is useful to exempt subnets/subdomains. The 2564132943Sgshapirolast two entries are for checks against ${client_name} if the IP 2565132943Sgshapiroaddress doesn't resolve to a hostname (or is considered as "may be 2566132943Sgshapiroforged"). That is, using square brackets means these are host 2567132943Sgshapironames, not network numbers. 256838032Speter 256964562SgshapiroWarning: if you change the RFC 821 compliant error code from the default 257064562Sgshapirovalue of 550, then you should probably also change the RFC 1893 compliant 257164562Sgshapiroerror code to match it. For example, if you use 257264562Sgshapiro 2573132943Sgshapiro To:user@example.com ERROR:450 mailbox full 257464562Sgshapiro 257590792Sgshapirothe error returned would be "450 5.0.0 mailbox full" which is wrong. 257690792SgshapiroUse "ERROR:4.2.2:450 mailbox full" instead. 257764562Sgshapiro 257864562SgshapiroNote, UUCP users may need to add hostname.UUCP to the access database 257990792Sgshapiroor class {R}. 258064562Sgshapiro 258190792SgshapiroIf you also use: 258290792Sgshapiro 258343730Speter FEATURE(`relay_hosts_only') 258438032Speter 258538032Speterthen the above example will allow relaying for sendmail.org, but not 258638032Speterhosts within the sendmail.org domain. Note that this will also require 258764562Sgshapirohosts listed in class {R} to be fully qualified host names. 258838032Speter 258938032SpeterYou can also use the access database to block sender addresses based on 259038032Speterthe username portion of the address. For example: 259138032Speter 2592132943Sgshapiro From:FREE.STEALTH.MAILER@ ERROR:550 Spam not accepted 259338032Speter 259438032SpeterNote that you must include the @ after the username to signify that 259538032Speterthis database entry is for checking only the username portion of the 259638032Spetersender address. 259738032Speter 259838032SpeterIf you use: 259938032Speter 260043730Speter FEATURE(`blacklist_recipients') 260138032Speter 260238032Speterthen you can add entries to the map for local users, hosts in your 260338032Speterdomains, or addresses in your domain which should not receive mail: 260438032Speter 2605132943Sgshapiro To:badlocaluser@ ERROR:550 Mailbox disabled for badlocaluser 2606132943Sgshapiro To:host.my.TLD ERROR:550 That host does not accept mail 2607132943Sgshapiro To:user@other.my.TLD ERROR:550 Mailbox disabled for this recipient 260838032Speter 2609132943SgshapiroThis would prevent a recipient of badlocaluser in any of the local 2610132943Sgshapirodomains (class {w}), any user at host.my.TLD, and the single address 2611132943Sgshapirouser@other.my.TLD from receiving mail. Please note: a local username 2612132943Sgshapiromust be now tagged with an @ (this is consistent with the check of 2613132943Sgshapirothe sender address, and hence it is possible to distinguish between 2614132943Sgshapirohostnames and usernames). Enabling this feature will keep you from 2615132943Sgshapirosending mails to all addresses that have an error message or REJECT 2616132943Sgshapiroas value part in the access map. Taking the example from above: 261738032Speter 261842575Speter spammer@aol.com REJECT 261942575Speter cyberspammer.com REJECT 262042575Speter 262142575SpeterMail can't be sent to spammer@aol.com or anyone at cyberspammer.com. 2622132943SgshapiroThat's why tagged entries should be used. 262342575Speter 2624159609SgshapiroThere are several DNS based blacklists which can be found by 2625159609Sgshapiroquerying a search engine. These are databases of spammers 262690792Sgshapiromaintained in DNS. To use such a database, specify 262738032Speter 2628159609Sgshapiro FEATURE(`dnsbl', `dnsbl.example.com') 262938032Speter 2630159609SgshapiroThis will cause sendmail to reject mail from any site listed in the 2631159609SgshapiroDNS based blacklist. You must select an DNSB based blacklist domain 2632159609Sgshapiroto check by specifying an argument to the FEATURE. The default 2633159609Sgshapiroerror message is 263438032Speter 263598841Sgshapiro Rejected: IP-ADDRESS listed at SERVER 263680785Sgshapiro 263790792Sgshapirowhere IP-ADDRESS and SERVER are replaced by the appropriate 263890792Sgshapiroinformation. A second argument can be used to specify a different 263990792Sgshapirotext. By default, temporary lookup failures are ignored and hence 264090792Sgshapirocause the connection not to be rejected by the DNS based rejection 264190792Sgshapirolist. This behavior can be changed by specifying a third argument, 264290792Sgshapirowhich must be either `t' or a full error message. For example: 264371345Sgshapiro 264490792Sgshapiro FEATURE(`dnsbl', `dnsbl.example.com', `', 264590792Sgshapiro `"451 Temporary lookup failure for " $&{client_addr} " in dnsbl.example.com"') 264671345Sgshapiro 264790792SgshapiroIf `t' is used, the error message is: 264890792Sgshapiro 264990792Sgshapiro 451 Temporary lookup failure of IP-ADDRESS at SERVER 265090792Sgshapiro 265190792Sgshapirowhere IP-ADDRESS and SERVER are replaced by the appropriate 265290792Sgshapiroinformation. 265390792Sgshapiro 265490792SgshapiroThis FEATURE can be included several times to query different 2655159609SgshapiroDNS based rejection lists. 265690792Sgshapiro 265790792SgshapiroNotice: to avoid checking your own local domains against those 265890792Sgshapiroblacklists, use the access_db feature and add: 265990792Sgshapiro 266090792Sgshapiro Connect:10.1 OK 266190792Sgshapiro Connect:127.0.0.1 RELAY 266290792Sgshapiro 266390792Sgshapiroto the access map, where 10.1 is your local network. You may 266490792Sgshapirowant to use "RELAY" instead of "OK" to allow also relaying 2665147078Sgshapiroinstead of just disabling the DNS lookups in the blacklists. 266690792Sgshapiro 266790792Sgshapiro 266838032SpeterThe features described above make use of the check_relay, check_mail, 2669110560Sgshapiroand check_rcpt rulesets. Note that check_relay checks the SMTP 2670110560Sgshapiroclient hostname and IP address when the connection is made to your 2671110560Sgshapiroserver. It does not check if a mail message is being relayed to 2672110560Sgshapiroanother server. That check is done in check_rcpt. If you wish to 2673110560Sgshapiroinclude your own checks, you can put your checks in the rulesets 2674110560SgshapiroLocal_check_relay, Local_check_mail, and Local_check_rcpt. For 2675110560Sgshapiroexample if you wanted to block senders with all numeric usernames 2676110560Sgshapiro(i.e. 2312343@bigisp.com), you would use Local_check_mail and the 2677110560Sgshapiroregex map: 267838032Speter 267964562Sgshapiro LOCAL_CONFIG 268064562Sgshapiro Kallnumbers regex -a@MATCH ^[0-9]+$ 268164562Sgshapiro 268264562Sgshapiro LOCAL_RULESETS 268364562Sgshapiro SLocal_check_mail 268464562Sgshapiro # check address against various regex checks 268538032Speter R$* $: $>Parse0 $>3 $1 268664562Sgshapiro R$+ < @ bigisp.com. > $* $: $(allnumbers $1 $) 268764562Sgshapiro R@MATCH $#error $: 553 Header Error 268838032Speter 268938032SpeterThese rules are called with the original arguments of the corresponding 269038032Spetercheck_* ruleset. If the local ruleset returns $#OK, no further checking 2691132943Sgshapirois done by the features described above and the mail is accepted. If 2692132943Sgshapirothe local ruleset resolves to a mailer (such as $#error or $#discard), 2693132943Sgshapirothe appropriate action is taken. Other results starting with $# are 2694132943Sgshapirointerpreted by sendmail and may lead to unspecified behavior. Note: do 2695132943SgshapiroNOT create a mailer with the name OK. Return values that do not start 2696132943Sgshapirowith $# are ignored, i.e., normal processing continues. 269738032Speter 269864562SgshapiroDelay all checks 269990792Sgshapiro---------------- 270064562Sgshapiro 270164562SgshapiroBy using FEATURE(`delay_checks') the rulesets check_mail and check_relay 270264562Sgshapirowill not be called when a client connects or issues a MAIL command, 270364562Sgshapirorespectively. Instead, those rulesets will be called by the check_rcpt 270464562Sgshapiroruleset; they will be skipped if a sender has been authenticated using 270564562Sgshapiroa "trusted" mechanism, i.e., one that is defined via TRUST_AUTH_MECH(). 270664562SgshapiroIf check_mail returns an error then the RCPT TO command will be rejected 270764562Sgshapirowith that error. If it returns some other result starting with $# then 270864562Sgshapirocheck_relay will be skipped. If the sender address (or a part of it) is 270964562Sgshapirolisted in the access map and it has a RHS of OK or RELAY, then check_relay 271064562Sgshapirowill be skipped. This has an interesting side effect: if your domain is 271164562Sgshapiromy.domain and you have 271264562Sgshapiro 271364562Sgshapiro my.domain RELAY 271464562Sgshapiro 2715125820Sgshapiroin the access map, then any e-mail with a sender address of 2716125820Sgshapiro<user@my.domain> will not be rejected by check_relay even though 2717125820Sgshapiroit would match the hostname or IP address. This allows spammers 271864562Sgshapiroto get around DNS based blacklist by faking the sender address. To 271964562Sgshapiroavoid this problem you have to use tagged entries: 272064562Sgshapiro 272164562Sgshapiro To:my.domain RELAY 272264562Sgshapiro Connect:my.domain RELAY 272364562Sgshapiro 272464562Sgshapiroif you need those entries at all (class {R} may take care of them). 272573188Sgshapiro 272664562SgshapiroFEATURE(`delay_checks') can take an optional argument: 272764562Sgshapiro 272864562Sgshapiro FEATURE(`delay_checks', `friend') 272964562Sgshapiro enables spamfriend test 273064562Sgshapiro FEATURE(`delay_checks', `hater') 273164562Sgshapiro enables spamhater test 273264562Sgshapiro 273394334SgshapiroIf such an argument is given, the recipient will be looked up in the 273494334Sgshapiroaccess map (using the tag Spam:). If the argument is `friend', then 273594334Sgshapirothe default behavior is to apply the other rulesets and make a SPAM 273694334Sgshapirofriend the exception. The rulesets check_mail and check_relay will be 273794334Sgshapiroskipped only if the recipient address is found and has RHS FRIEND. If 273894334Sgshapirothe argument is `hater', then the default behavior is to skip the rulesets 273994334Sgshapirocheck_mail and check_relay and make a SPAM hater the exception. The 274094334Sgshapiroother two rulesets will be applied only if the recipient address is 274194334Sgshapirofound and has RHS HATER. 274264562Sgshapiro 274364562SgshapiroThis allows for simple exceptions from the tests, e.g., by activating 274490792Sgshapirothe friend option and having 274564562Sgshapiro 274690792Sgshapiro Spam:abuse@ FRIEND 274764562Sgshapiro 2748110560Sgshapiroin the access map, mail to abuse@localdomain will get through (where 2749110560Sgshapiro"localdomain" is any domain in class {w}). It is also possible to 2750110560Sgshapirospecify a full address or an address with +detail: 275164562Sgshapiro 275290792Sgshapiro Spam:abuse@my.domain FRIEND 275390792Sgshapiro Spam:me+abuse@ FRIEND 275490792Sgshapiro Spam:spam.domain FRIEND 275564562Sgshapiro 275690792SgshapiroNote: The required tag has been changed in 8.12 from To: to Spam:. 275790792SgshapiroThis change is incompatible to previous versions. However, you can 275890792Sgshapiro(for now) simply add the new entries to the access map, the old 275990792Sgshapiroones will be ignored. As soon as you removed the old entries from 276090792Sgshapirothe access map, specify a third parameter (`n') to this feature and 276190792Sgshapirothe backward compatibility rules will not be in the generated .cf 276290792Sgshapirofile. 276364562Sgshapiro 276464562SgshapiroHeader Checks 276590792Sgshapiro------------- 276664562Sgshapiro 276738032SpeterYou can also reject mail on the basis of the contents of headers. 276838032SpeterThis is done by adding a ruleset call to the 'H' header definition command 276938032Speterin sendmail.cf. For example, this can be used to check the validity of 277038032Spetera Message-ID: header: 277138032Speter 2772110560Sgshapiro LOCAL_CONFIG 277338032Speter HMessage-Id: $>CheckMessageId 277438032Speter 2775110560Sgshapiro LOCAL_RULESETS 277638032Speter SCheckMessageId 277738032Speter R< $+ @ $+ > $@ OK 277838032Speter R$* $#error $: 553 Header Error 277938032Speter 278064562SgshapiroThe alternative format: 278138032Speter 278264562Sgshapiro HSubject: $>+CheckSubject 278342575Speter 278464562Sgshapirothat is, $>+ instead of $>, gives the full Subject: header including 278564562Sgshapirocomments to the ruleset (comments in parentheses () are stripped 278664562Sgshapiroby default). 278742575Speter 278864562SgshapiroA default ruleset for headers which don't have a specific ruleset 278964562Sgshapirodefined for them can be given by: 279042575Speter 279164562Sgshapiro H*: $>CheckHdr 279243730Speter 279390792SgshapiroNotice: 279490792Sgshapiro1. All rules act on tokens as explained in doc/op/op.{me,ps,txt}. 279573188SgshapiroThat may cause problems with simple header checks due to the 279690792Sgshapirotokenization. It might be simpler to use a regex map and apply it 279773188Sgshapiroto $&{currHeader}. 279890792Sgshapiro2. There are no default rulesets coming with this distribution of 2799157001Sgshapirosendmail. You can write your own, can search the WWW for examples, 2800157001Sgshapiroor take a look at cf/cf/knecht.mc. 2801157001Sgshapiro3. When using a default ruleset for headers, the name of the header 2802132943Sgshapirocurrently being checked can be found in the $&{hdr_name} macro. 280373188Sgshapiro 280464562SgshapiroAfter all of the headers are read, the check_eoh ruleset will be called for 280564562Sgshapiroany final header-related checks. The ruleset is called with the number of 280664562Sgshapiroheaders and the size of all of the headers in bytes separated by $|. One 280764562Sgshapiroexample usage is to reject messages which do not have a Message-Id: 280864562Sgshapiroheader. However, the Message-Id: header is *NOT* a required header and is 280964562Sgshapironot a guaranteed spam indicator. This ruleset is an example and should 281064562Sgshapiroprobably not be used in production. 281164562Sgshapiro 281264562Sgshapiro LOCAL_CONFIG 281364562Sgshapiro Kstorage macro 2814110560Sgshapiro HMessage-Id: $>CheckMessageId 281564562Sgshapiro 281664562Sgshapiro LOCAL_RULESETS 281764562Sgshapiro SCheckMessageId 281864562Sgshapiro # Record the presence of the header 281964562Sgshapiro R$* $: $(storage {MessageIdCheck} $@ OK $) $1 282064562Sgshapiro R< $+ @ $+ > $@ OK 282164562Sgshapiro R$* $#error $: 553 Header Error 282264562Sgshapiro 282364562Sgshapiro Scheck_eoh 282464562Sgshapiro # Check the macro 282564562Sgshapiro R$* $: < $&{MessageIdCheck} > 282664562Sgshapiro # Clear the macro for the next message 282764562Sgshapiro R$* $: $(storage {MessageIdCheck} $) $1 282864562Sgshapiro # Has a Message-Id: header 282964562Sgshapiro R< $+ > $@ OK 283064562Sgshapiro # Allow missing Message-Id: from local mail 283164562Sgshapiro R$* $: < $&{client_name} > 283264562Sgshapiro R< > $@ OK 283364562Sgshapiro R< $=w > $@ OK 283464562Sgshapiro # Otherwise, reject the mail 283564562Sgshapiro R$* $#error $: 553 Header Error 283664562Sgshapiro 2837132943Sgshapiro 2838132943Sgshapiro+--------------------+ 2839132943Sgshapiro| CONNECTION CONTROL | 2840132943Sgshapiro+--------------------+ 2841132943Sgshapiro 2842132943SgshapiroThe features ratecontrol and conncontrol allow to establish connection 2843132943Sgshapirolimits per client IP address or net. These features can limit the 2844132943Sgshapirorate of connections (connections per time unit) or the number of 2845132943Sgshapiroincoming SMTP connections, respectively. If enabled, appropriate 2846132943Sgshapirorulesets are called at the end of check_relay, i.e., after DNS 2847132943Sgshapiroblacklists and generic access_db operations. The features require 2848132943SgshapiroFEATURE(`access_db') to be listed earlier in the mc file. 2849132943Sgshapiro 2850132943SgshapiroNote: FEATURE(`delay_checks') delays those connection control checks 2851132943Sgshapiroafter a recipient address has been received, hence making these 2852132943Sgshapiroconnection control features less useful. To run the checks as early 2853132943Sgshapiroas possible, specify the parameter `nodelay', e.g., 2854132943Sgshapiro 2855132943Sgshapiro FEATURE(`ratecontrol', `nodelay') 2856132943Sgshapiro 2857132943SgshapiroIn that case, FEATURE(`delay_checks') has no effect on connection 2858132943Sgshapirocontrol (and it must be specified earlier in the mc file). 2859132943Sgshapiro 2860132943SgshapiroAn optional second argument `terminate' specifies whether the 2861132943Sgshapirorulesets should return the error code 421 which will cause 2862132943Sgshapirosendmail to terminate the session with that error if it is 2863132943Sgshapiroreturned from check_relay, i.e., not delayed as explained in 2864132943Sgshapirothe previous paragraph. Example: 2865132943Sgshapiro 2866132943Sgshapiro FEATURE(`ratecontrol', `nodelay', `terminate') 2867132943Sgshapiro 2868132943Sgshapiro 286966494Sgshapiro+----------+ 287066494Sgshapiro| STARTTLS | 287166494Sgshapiro+----------+ 287264562Sgshapiro 2873147078SgshapiroIn this text, cert will be used as an abbreviation for X.509 certificate, 287490792SgshapiroDN (CN) is the distinguished (common) name of a cert, and CA is a 287590792Sgshapirocertification authority, which signs (issues) certs. 287664562Sgshapiro 287780785SgshapiroFor STARTTLS to be offered by sendmail you need to set at least 2878147078Sgshapirothese variables (the file names and paths are just examples): 287980785Sgshapiro 288080785Sgshapiro define(`confCACERT_PATH', `/etc/mail/certs/') 288180785Sgshapiro define(`confCACERT', `/etc/mail/certs/CA.cert.pem') 288280785Sgshapiro define(`confSERVER_CERT', `/etc/mail/certs/my.cert.pem') 288380785Sgshapiro define(`confSERVER_KEY', `/etc/mail/certs/my.key.pem') 288480785Sgshapiro 288580785SgshapiroOn systems which do not have the compile flag HASURANDOM set (see 288680785Sgshapirosendmail/README) you also must set confRAND_FILE. 288780785Sgshapiro 288890792SgshapiroSee doc/op/op.{me,ps,txt} for more information about these options, 288990792Sgshapiroespecially the sections ``Certificates for STARTTLS'' and ``PRNG for 289080785SgshapiroSTARTTLS''. 289180785Sgshapiro 289264562SgshapiroMacros related to STARTTLS are: 289364562Sgshapiro 289464562Sgshapiro${cert_issuer} holds the DN of the CA (the cert issuer). 289564562Sgshapiro${cert_subject} holds the DN of the cert (called the cert subject). 289690792Sgshapiro${cn_issuer} holds the CN of the CA (the cert issuer). 289790792Sgshapiro${cn_subject} holds the CN of the cert (called the cert subject). 289864562Sgshapiro${tls_version} the TLS/SSL version used for the connection, e.g., TLSv1, 289990792Sgshapiro TLSv1/SSLv3, SSLv3, SSLv2. 290064562Sgshapiro${cipher} the cipher used for the connection, e.g., EDH-DSS-DES-CBC3-SHA, 290164562Sgshapiro EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA. 290264562Sgshapiro${cipher_bits} the keylength (in bits) of the symmetric encryption algorithm 290364562Sgshapiro used for the connection. 290490792Sgshapiro${verify} holds the result of the verification of the presented cert. 290590792Sgshapiro Possible values are: 290690792Sgshapiro OK verification succeeded. 290790792Sgshapiro NO no cert presented. 290890792Sgshapiro NOT no cert requested. 290990792Sgshapiro FAIL cert presented but could not be verified, 291090792Sgshapiro e.g., the cert of the signing CA is missing. 291190792Sgshapiro NONE STARTTLS has not been performed. 291290792Sgshapiro TEMP temporary error occurred. 291390792Sgshapiro PROTOCOL protocol error occurred (SMTP level). 291464562Sgshapiro SOFTWARE STARTTLS handshake failed. 291590792Sgshapiro${server_name} the name of the server of the current outgoing SMTP 291664562Sgshapiro connection. 291790792Sgshapiro${server_addr} the address of the server of the current outgoing SMTP 291864562Sgshapiro connection. 291964562Sgshapiro 292064562SgshapiroRelaying 292190792Sgshapiro-------- 292264562Sgshapiro 2923110560SgshapiroSMTP STARTTLS can allow relaying for remote SMTP clients which have 2924120256Sgshapirosuccessfully authenticated themselves. If the verification of the cert 2925120256Sgshapirofailed (${verify} != OK), relaying is subject to the usual rules. 2926120256SgshapiroOtherwise the DN of the issuer is looked up in the access map using the 2927120256Sgshapirotag CERTISSUER. If the resulting value is RELAY, relaying is allowed. 2928120256SgshapiroIf it is SUBJECT, the DN of the cert subject is looked up next in the 2929120256Sgshapiroaccess map using the tag CERTSUBJECT. If the value is RELAY, relaying 2930120256Sgshapirois allowed. 2931110560Sgshapiro 2932132943SgshapiroTo make things a bit more flexible (or complicated), the values for 293364562Sgshapiro${cert_issuer} and ${cert_subject} can be optionally modified by regular 293464562Sgshapiroexpressions defined in the m4 variables _CERT_REGEX_ISSUER_ and 293590792Sgshapiro_CERT_REGEX_SUBJECT_, respectively. To avoid problems with those macros in 293664562Sgshapirorulesets and map lookups, they are modified as follows: each non-printable 2937110560Sgshapirocharacter and the characters '<', '>', '(', ')', '"', '+', ' ' are replaced 2938110560Sgshapiroby their HEX value with a leading '+'. For example: 293964562Sgshapiro 294064562Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/Email= 294164562Sgshapirodarth+cert@endmail.org 294264562Sgshapiro 294364562Sgshapirois encoded as: 294464562Sgshapiro 294564562Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN= 294664562SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 294764562Sgshapiro 294864562Sgshapiro(line breaks have been inserted for readability). 294964562Sgshapiro 2950110560SgshapiroThe macros which are subject to this encoding are ${cert_subject}, 2951110560Sgshapiro${cert_issuer}, ${cn_subject}, and ${cn_issuer}. 2952110560Sgshapiro 295390792SgshapiroExamples: 295490792Sgshapiro 295590792SgshapiroTo allow relaying for everyone who can present a cert signed by 295690792Sgshapiro 295790792Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN= 295890792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 295990792Sgshapiro 296090792Sgshapirosimply use: 296190792Sgshapiro 2962110560SgshapiroCertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN= 296390792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org RELAY 296490792Sgshapiro 296590792SgshapiroTo allow relaying only for a subset of machines that have a cert signed by 296690792Sgshapiro 296790792Sgshapiro/C=US/ST=California/O=endmail.org/OU=private/CN= 296890792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 296990792Sgshapiro 297090792Sgshapirouse: 297190792Sgshapiro 2972110560SgshapiroCertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN= 297390792SgshapiroDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org SUBJECT 2974110560SgshapiroCertSubject:/C=US/ST=California/O=endmail.org/OU=private/CN= 297590792SgshapiroDeathStar/Email=deathstar@endmail.org RELAY 297690792Sgshapiro 2977132943SgshapiroNotes: 2978132943Sgshapiro- line breaks have been inserted after "CN=" for readability, 2979132943Sgshapiro each tagged entry must be one (long) line in the access map. 2980132943Sgshapiro- if OpenSSL 0.9.7 or newer is used then the "Email=" part of a DN 2981132943Sgshapiro is replaced by "emailAddress=". 298290792Sgshapiro 298390792SgshapiroOf course it is also possible to write a simple ruleset that allows 298464562Sgshapirorelaying for everyone who can present a cert that can be verified, e.g., 298564562Sgshapiro 298664562SgshapiroLOCAL_RULESETS 298764562SgshapiroSLocal_check_rcpt 298864562SgshapiroR$* $: $&{verify} 298964562SgshapiroROK $# OK 299064562Sgshapiro 299164562SgshapiroAllowing Connections 299290792Sgshapiro-------------------- 299364562Sgshapiro 299490792SgshapiroThe rulesets tls_server, tls_client, and tls_rcpt are used to decide whether 299590792Sgshapiroan SMTP connection is accepted (or should continue). 299664562Sgshapiro 299764562Sgshapirotls_server is called when sendmail acts as client after a STARTTLS command 299890792Sgshapiro(should) have been issued. The parameter is the value of ${verify}. 299964562Sgshapiro 300064562Sgshapirotls_client is called when sendmail acts as server, after a STARTTLS command 300190792Sgshapirohas been issued, and from check_mail. The parameter is the value of 300264562Sgshapiro${verify} and STARTTLS or MAIL, respectively. 300364562Sgshapiro 300490792SgshapiroBoth rulesets behave the same. If no access map is in use, the connection 300564562Sgshapirowill be accepted unless ${verify} is SOFTWARE, in which case the connection 300690792Sgshapirois always aborted. For tls_server/tls_client, ${client_name}/${server_name} 300790792Sgshapirois looked up in the access map using the tag TLS_Srv/TLS_Clt, which is done 300890792Sgshapirowith the ruleset LookUpDomain. If no entry is found, ${client_addr} 300964562Sgshapiro(${server_addr}) is looked up in the access map (same tag, ruleset 301090792SgshapiroLookUpAddr). If this doesn't result in an entry either, just the tag is 301190792Sgshapirolooked up in the access map (included the trailing colon). Notice: 301290792Sgshapirorequiring that e-mail is sent to a server only encrypted, e.g., via 301364562Sgshapiro 301490792SgshapiroTLS_Srv:secure.domain ENCR:112 301590792Sgshapiro 301690792Sgshapirodoesn't necessarily mean that e-mail sent to that domain is encrypted. 301790792SgshapiroIf the domain has multiple MX servers, e.g., 301890792Sgshapiro 301990792Sgshapirosecure.domain. IN MX 10 mail.secure.domain. 302090792Sgshapirosecure.domain. IN MX 50 mail.other.domain. 302190792Sgshapiro 302290792Sgshapirothen mail to user@secure.domain may go unencrypted to mail.other.domain. 302390792Sgshapirotls_rcpt can be used to address this problem. 302490792Sgshapiro 302590792Sgshapirotls_rcpt is called before a RCPT TO: command is sent. The parameter is the 302690792Sgshapirocurrent recipient. This ruleset is only defined if FEATURE(`access_db') 302790792Sgshapirois selected. A recipient address user@domain is looked up in the access 302890792Sgshapiromap in four formats: TLS_Rcpt:user@domain, TLS_Rcpt:user@, TLS_Rcpt:domain, 302990792Sgshapiroand TLS_Rcpt:; the first match is taken. 303090792Sgshapiro 303190792SgshapiroThe result of the lookups is then used to call the ruleset TLS_connection, 303290792Sgshapirowhich checks the requirement specified by the RHS in the access map against 303390792Sgshapirothe actual parameters of the current TLS connection, esp. ${verify} and 303490792Sgshapiro${cipher_bits}. Legal RHSs in the access map are: 303590792Sgshapiro 303664562SgshapiroVERIFY verification must have succeeded 303764562SgshapiroVERIFY:bits verification must have succeeded and ${cipher_bits} must 303864562Sgshapiro be greater than or equal bits. 303964562SgshapiroENCR:bits ${cipher_bits} must be greater than or equal bits. 304064562Sgshapiro 304164562SgshapiroThe RHS can optionally be prefixed by TEMP+ or PERM+ to select a temporary 304290792Sgshapiroor permanent error. The default is a temporary error code (403 4.7.0) 304364562Sgshapirounless the macro TLS_PERM_ERR is set during generation of the .cf file. 304464562Sgshapiro 304564562SgshapiroIf a certain level of encryption is required, then it might also be 304664562Sgshapiropossible that this level is provided by the security layer from a SASL 304764562Sgshapiroalgorithm, e.g., DIGEST-MD5. 304864562Sgshapiro 304990792SgshapiroFurthermore, there can be a list of extensions added. Such a list 305090792Sgshapirostarts with '+' and the items are separated by '++'. Allowed 305190792Sgshapiroextensions are: 305290792Sgshapiro 305390792SgshapiroCN:name name must match ${cn_subject} 305490792SgshapiroCN ${server_name} must match ${cn_subject} 305590792SgshapiroCS:name name must match ${cert_subject} 305690792SgshapiroCI:name name must match ${cert_issuer} 305790792Sgshapiro 305882017SgshapiroExample: e-mail sent to secure.example.com should only use an encrypted 305990792Sgshapiroconnection. E-mail received from hosts within the laptop.example.com domain 306090792Sgshapiroshould only be accepted if they have been authenticated. The host which 306190792Sgshapiroreceives e-mail for darth@endmail.org must present a cert that uses the 306290792SgshapiroCN smtp.endmail.org. 306390792Sgshapiro 306464562SgshapiroTLS_Srv:secure.example.com ENCR:112 306564562SgshapiroTLS_Clt:laptop.example.com PERM+VERIFY:112 306690792SgshapiroTLS_Rcpt:darth@endmail.org ENCR:112+CN:smtp.endmail.org 306764562Sgshapiro 306873188Sgshapiro 306990792SgshapiroDisabling STARTTLS And Setting SMTP Server Features 307090792Sgshapiro--------------------------------------------------- 307173188Sgshapiro 307290792SgshapiroBy default STARTTLS is used whenever possible. However, there are 307390792Sgshapirosome broken MTAs that don't properly implement STARTTLS. To be able 307490792Sgshapiroto send to (or receive from) those MTAs, the ruleset try_tls 307590792Sgshapiro(srv_features) can be used that work together with the access map. 307690792SgshapiroEntries for the access map must be tagged with Try_TLS (Srv_Features) 307790792Sgshapiroand refer to the hostname or IP address of the connecting system. 307890792SgshapiroA default case can be specified by using just the tag. For example, 307990792Sgshapirothe following entries in the access map: 308073188Sgshapiro 308190792Sgshapiro Try_TLS:broken.server NO 308290792Sgshapiro Srv_Features:my.domain v 308390792Sgshapiro Srv_Features: V 308473188Sgshapiro 308590792Sgshapirowill turn off STARTTLS when sending to broken.server (or any host 308690792Sgshapiroin that domain), and request a client certificate during the TLS 308790792Sgshapirohandshake only for hosts in my.domain. The valid entries on the RHS 308890792Sgshapirofor Srv_Features are listed in the Sendmail Installation and 308990792SgshapiroOperations Guide. 309073188Sgshapiro 309173188Sgshapiro 309264562SgshapiroReceived: Header 309390792Sgshapiro---------------- 309464562Sgshapiro 309590792SgshapiroThe Received: header reveals whether STARTTLS has been used. It contains an 309664562Sgshapiroextra line: 309764562Sgshapiro 309890792Sgshapiro(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify}) 309964562Sgshapiro 310090792Sgshapiro 310166494Sgshapiro+---------------------+ 310266494Sgshapiro| SMTP AUTHENTICATION | 310366494Sgshapiro+---------------------+ 310464562Sgshapiro 310564562SgshapiroThe macros ${auth_authen}, ${auth_author}, and ${auth_type} can be 310664562Sgshapiroused in anti-relay rulesets to allow relaying for those users that 310764562Sgshapiroauthenticated themselves. A very simple example is: 310864562Sgshapiro 310964562SgshapiroSLocal_check_rcpt 311064562SgshapiroR$* $: $&{auth_type} 311164562SgshapiroR$+ $# OK 311264562Sgshapiro 311364562Sgshapirowhich checks whether a user has successfully authenticated using 3114132943Sgshapiroany available mechanism. Depending on the setup of the Cyrus SASL 311564562Sgshapirolibrary, more sophisticated rulesets might be required, e.g., 311664562Sgshapiro 311764562SgshapiroSLocal_check_rcpt 311864562SgshapiroR$* $: $&{auth_type} $| $&{auth_authen} 311964562SgshapiroRDIGEST-MD5 $| $+@$=w $# OK 312064562Sgshapiro 312164562Sgshapiroto allow relaying for users that authenticated using DIGEST-MD5 312264562Sgshapiroand have an identity in the local domains. 312364562Sgshapiro 312490792SgshapiroThe ruleset trust_auth is used to determine whether a given AUTH= 312564562Sgshapiroparameter (that is passed to this ruleset) should be trusted. This 312664562Sgshapiroruleset may make use of the other ${auth_*} macros. Only if the 312764562Sgshapiroruleset resolves to the error mailer, the AUTH= parameter is not 312864562Sgshapirotrusted. A user supplied ruleset Local_trust_auth can be written 312964562Sgshapiroto modify the default behavior, which only trust the AUTH= 313064562Sgshapiroparameter if it is identical to the authenticated user. 313164562Sgshapiro 313264562SgshapiroPer default, relaying is allowed for any user who authenticated 313364562Sgshapirovia a "trusted" mechanism, i.e., one that is defined via 313464562SgshapiroTRUST_AUTH_MECH(`list of mechanisms') 313571345SgshapiroFor example: 313671345SgshapiroTRUST_AUTH_MECH(`KERBEROS_V4 DIGEST-MD5') 313764562Sgshapiro 313864562SgshapiroIf the selected mechanism provides a security layer the number of 313964562Sgshapirobits used for the key of the symmetric cipher is stored in the 314064562Sgshapiromacro ${auth_ssf}. 314164562Sgshapiro 3142132943SgshapiroProviding SMTP AUTH Data when sendmail acts as Client 3143132943Sgshapiro----------------------------------------------------- 3144132943Sgshapiro 314590792SgshapiroIf sendmail acts as client, it needs some information how to 314690792Sgshapiroauthenticate against another MTA. This information can be provided 314790792Sgshapiroby the ruleset authinfo or by the option DefaultAuthInfo. The 314890792Sgshapiroauthinfo ruleset looks up {server_name} using the tag AuthInfo: in 314990792Sgshapirothe access map. If no entry is found, {server_addr} is looked up 315090792Sgshapiroin the same way and finally just the tag AuthInfo: to provide 3151111823Sgshapirodefault values. Note: searches for domain parts or IP nets are 3152111823Sgshapiroonly performed if the access map is used; if the authinfo feature 3153111823Sgshapirois used then only up to three lookups are performed (two exact 3154111823Sgshapiromatches, one default). 315590792Sgshapiro 3156132943SgshapiroNote: If your daemon does client authentication when sending, and 3157132943Sgshapiroif it uses either PLAIN or LOGIN authentication, then you *must* 3158132943Sgshapiroprevent ordinary users from seeing verbose output. Do NOT install 3159132943Sgshapirosendmail set-user-ID. Use PrivacyOptions to turn off verbose output 3160132943Sgshapiro("goaway" works for this). 3161132943Sgshapiro 316290792SgshapiroNotice: the default configuration file causes the option DefaultAuthInfo 316390792Sgshapiroto fail since the ruleset authinfo is in the .cf file. If you really 316490792Sgshapirowant to use DefaultAuthInfo (it is deprecated) then you have to 316590792Sgshapiroremove the ruleset. 316690792Sgshapiro 316790792SgshapiroThe RHS for an AuthInfo: entry in the access map should consists of a 316890792Sgshapirolist of tokens, each of which has the form: "TDstring" (including 316990792Sgshapirothe quotes). T is a tag which describes the item, D is a delimiter, 317090792Sgshapiroeither ':' for simple text or '=' for a base64 encoded string. 317190792SgshapiroValid values for the tag are: 317290792Sgshapiro 317390792Sgshapiro U user (authorization) id 317490792Sgshapiro I authentication id 317590792Sgshapiro P password 317690792Sgshapiro R realm 317790792Sgshapiro M list of mechanisms delimited by spaces 317890792Sgshapiro 317990792SgshapiroExample entries are: 318090792Sgshapiro 318190792SgshapiroAuthInfo:other.dom "U:user" "I:user" "P:secret" "R:other.dom" "M:DIGEST-MD5" 3182111823SgshapiroAuthInfo:host.more.dom "U:user" "P=c2VjcmV0" 318390792Sgshapiro 3184111823SgshapiroUser id or authentication id must exist as well as the password. All 318590792Sgshapiroother entries have default values. If one of user or authentication 318690792Sgshapiroid is missing, the existing value is used for the missing item. 318790792SgshapiroIf "R:" is not specified, realm defaults to $j. The list of mechanisms 318890792Sgshapirodefaults to those specified by AuthMechanisms. 318990792Sgshapiro 319090792SgshapiroSince this map contains sensitive information, either the access 319190792Sgshapiromap must be unreadable by everyone but root (or the trusted user) 319290792Sgshapiroor FEATURE(`authinfo') must be used which provides a separate map. 319390792SgshapiroNotice: It is not checked whether the map is actually 319490792Sgshapirogroup/world-unreadable, this is left to the user. 319590792Sgshapiro 319664562Sgshapiro+--------------------------------+ 319738032Speter| ADDING NEW MAILERS OR RULESETS | 319838032Speter+--------------------------------+ 319938032Speter 320038032SpeterSometimes you may need to add entirely new mailers or rulesets. They 320138032Spetershould be introduced with the constructs MAILER_DEFINITIONS and 320238032SpeterLOCAL_RULESETS respectively. For example: 320338032Speter 320438032Speter MAILER_DEFINITIONS 320538032Speter Mmymailer, ... 320638032Speter ... 320738032Speter 320838032Speter LOCAL_RULESETS 320938032Speter Smyruleset 321038032Speter ... 321138032Speter 321290792SgshapiroLocal additions for the rulesets srv_features, try_tls, tls_rcpt, 321390792Sgshapirotls_client, and tls_server can be made using LOCAL_SRV_FEATURES, 321490792SgshapiroLOCAL_TRY_TLS, LOCAL_TLS_RCPT, LOCAL_TLS_CLIENT, and LOCAL_TLS_SERVER, 321590792Sgshapirorespectively. For example, to add a local ruleset that decides 321690792Sgshapirowhether to try STARTTLS in a sendmail client, use: 321738032Speter 321890792Sgshapiro LOCAL_TRY_TLS 321990792Sgshapiro R... 322090792Sgshapiro 322190792SgshapiroNote: you don't need to add a name for the ruleset, it is implicitly 322290792Sgshapirodefined by using the appropriate macro. 322390792Sgshapiro 322490792Sgshapiro 322571345Sgshapiro+-------------------------+ 322671345Sgshapiro| ADDING NEW MAIL FILTERS | 322771345Sgshapiro+-------------------------+ 322864562Sgshapiro 322964562SgshapiroSendmail supports mail filters to filter incoming SMTP messages according 323064562Sgshapiroto the "Sendmail Mail Filter API" documentation. These filters can be 323164562Sgshapiroconfigured in your mc file using the two commands: 323264562Sgshapiro 323364562Sgshapiro MAIL_FILTER(`name', `equates') 323464562Sgshapiro INPUT_MAIL_FILTER(`name', `equates') 323564562Sgshapiro 323664562SgshapiroThe first command, MAIL_FILTER(), simply defines a filter with the given 323764562Sgshapironame and equates. For example: 323864562Sgshapiro 323964562Sgshapiro MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 324064562Sgshapiro 324164562SgshapiroThis creates the equivalent sendmail.cf entry: 324264562Sgshapiro 324364562Sgshapiro Xarchive, S=local:/var/run/archivesock, F=R 324464562Sgshapiro 324564562SgshapiroThe INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER 324664562Sgshapirobut also populates the m4 variable `confINPUT_MAIL_FILTERS' with the name 324764562Sgshapiroof the filter such that the filter will actually be called by sendmail. 324864562Sgshapiro 324964562SgshapiroFor example, the two commands: 325064562Sgshapiro 325164562Sgshapiro INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 325264562Sgshapiro INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T') 325364562Sgshapiro 325464562Sgshapiroare equivalent to the three commands: 325564562Sgshapiro 325664562Sgshapiro MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 325764562Sgshapiro MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T') 325864562Sgshapiro define(`confINPUT_MAIL_FILTERS', `archive, spamcheck') 325964562Sgshapiro 326064562SgshapiroIn general, INPUT_MAIL_FILTER() should be used unless you need to define 326164562Sgshapiromore filters than you want to use for `confINPUT_MAIL_FILTERS'. 326264562Sgshapiro 326364562SgshapiroNote that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER() 326464562Sgshapirocommands will clear the list created by the prior INPUT_MAIL_FILTER() 326564562Sgshapirocommands. 326664562Sgshapiro 326764562Sgshapiro 326890792Sgshapiro+-------------------------+ 326990792Sgshapiro| QUEUE GROUP DEFINITIONS | 327090792Sgshapiro+-------------------------+ 327190792Sgshapiro 327290792SgshapiroIn addition to the queue directory (which is the default queue group 327390792Sgshapirocalled "mqueue"), sendmail can deal with multiple queue groups, which 327490792Sgshapiroare collections of queue directories with the same behaviour. Queue 327590792Sgshapirogroups can be defined using the command: 327690792Sgshapiro 327790792Sgshapiro QUEUE_GROUP(`name', `equates') 327890792Sgshapiro 327990792SgshapiroFor details about queue groups, please see doc/op/op.{me,ps,txt}. 328090792Sgshapiro 328138032Speter+-------------------------------+ 328238032Speter| NON-SMTP BASED CONFIGURATIONS | 328338032Speter+-------------------------------+ 328438032Speter 328564562SgshapiroThese configuration files are designed primarily for use by 328664562SgshapiroSMTP-based sites. They may not be well tuned for UUCP-only or 328738032SpeterUUCP-primarily nodes (the latter is defined as a small local net 328864562Sgshapiroconnected to the rest of the world via UUCP). However, there is 328964562Sgshapiroone hook to handle some special cases. 329038032Speter 329138032SpeterYou can define a ``smart host'' that understands a richer address syntax 329238032Speterusing: 329338032Speter 329443730Speter define(`SMART_HOST', `mailer:hostname') 329538032Speter 329638032SpeterIn this case, the ``mailer:'' defaults to "relay". Any messages that 329738032Spetercan't be handled using the usual UUCP rules are passed to this host. 329838032Speter 329938032SpeterIf you are on a local SMTP-based net that connects to the outside 330038032Speterworld via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules. 330138032SpeterFor example: 330238032Speter 330364562Sgshapiro define(`SMART_HOST', `uucp-new:uunet') 330438032Speter LOCAL_NET_CONFIG 330538032Speter R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 330638032Speter 330794334SgshapiroThis will cause all names that end in your domain name ($m) to be sent 330894334Sgshapirovia SMTP; anything else will be sent via uucp-new (smart UUCP) to uunet. 330943730SpeterIf you have FEATURE(`nocanonify'), you may need to omit the dots after 331038032Speterthe $m. If you are running a local DNS inside your domain which is 331138032Speternot otherwise connected to the outside world, you probably want to 331238032Speteruse: 331338032Speter 331443730Speter define(`SMART_HOST', `smtp:fire.wall.com') 331538032Speter LOCAL_NET_CONFIG 331638032Speter R$* < @ $* . > $* $#smtp $@ $2. $: $1 < @ $2. > $3 331738032Speter 331838032SpeterThat is, send directly only to things you found in your DNS lookup; 331938032Speteranything else goes through SMART_HOST. 332038032Speter 332138032SpeterYou may need to turn off the anti-spam rules in order to accept 332243730SpeterUUCP mail with FEATURE(`promiscuous_relay') and 332343730SpeterFEATURE(`accept_unresolvable_domains'). 332438032Speter 332538032Speter 332638032Speter+-----------+ 332738032Speter| WHO AM I? | 332838032Speter+-----------+ 332938032Speter 333038032SpeterNormally, the $j macro is automatically defined to be your fully 333138032Speterqualified domain name (FQDN). Sendmail does this by getting your 333238032Speterhost name using gethostname and then calling gethostbyname on the 333338032Speterresult. For example, in some environments gethostname returns 333438032Speteronly the root of the host name (such as "foo"); gethostbyname is 333538032Spetersupposed to return the FQDN ("foo.bar.com"). In some (fairly rare) 333638032Spetercases, gethostbyname may fail to return the FQDN. In this case 333738032Speteryou MUST define confDOMAIN_NAME to be your fully qualified domain 333838032Spetername. This is usually done using: 333938032Speter 334038032Speter Dmbar.com 334138032Speter define(`confDOMAIN_NAME', `$w.$m')dnl 334238032Speter 334338032Speter 334464562Sgshapiro+-----------------------------------+ 334564562Sgshapiro| ACCEPTING MAIL FOR MULTIPLE NAMES | 334664562Sgshapiro+-----------------------------------+ 334764562Sgshapiro 334864562SgshapiroIf your host is known by several different names, you need to augment 334964562Sgshapiroclass {w}. This is a list of names by which your host is known, and 335064562Sgshapiroanything sent to an address using a host name in this list will be 335164562Sgshapirotreated as local mail. You can do this in two ways: either create the 335264562Sgshapirofile /etc/mail/local-host-names containing a list of your aliases (one per 335364562Sgshapiroline), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add 335464562Sgshapiro``LOCAL_DOMAIN(`alias.host.name')''. Be sure you use the fully-qualified 335564562Sgshapironame of the host, rather than a short name. 335664562Sgshapiro 335764562SgshapiroIf you want to have different address in different domains, take 335864562Sgshapiroa look at the virtusertable feature, which is also explained at 335964562Sgshapirohttp://www.sendmail.org/virtual-hosting.html 336064562Sgshapiro 336164562Sgshapiro 336238032Speter+--------------------+ 336338032Speter| USING MAILERTABLES | 336438032Speter+--------------------+ 336538032Speter 336643730SpeterTo use FEATURE(`mailertable'), you will have to create an external 336738032Speterdatabase containing the routing information for various domains. 336838032SpeterFor example, a mailertable file in text format might be: 336938032Speter 337038032Speter .my.domain xnet:%1.my.domain 337164562Sgshapiro uuhost1.my.domain uucp-new:uuhost1 337238032Speter .bitnet smtp:relay.bit.net 337338032Speter 337464562SgshapiroThis should normally be stored in /etc/mail/mailertable. The actual 337538032Speterdatabase version of the mailertable is built using: 337638032Speter 337764562Sgshapiro makemap hash /etc/mail/mailertable < /etc/mail/mailertable 337838032Speter 337938032SpeterThe semantics are simple. Any LHS entry that does not begin with 338038032Spetera dot matches the full host name indicated. LHS entries beginning 338166494Sgshapirowith a dot match anything ending with that domain name (including 338266494Sgshapirothe leading dot) -- that is, they can be thought of as having a 338366494Sgshapiroleading ".+" regular expression pattern for a non-empty sequence of 338466494Sgshapirocharacters. Matching is done in order of most-to-least qualified 338566494Sgshapiro-- for example, even though ".my.domain" is listed first in the 338666494Sgshapiroabove example, an entry of "uuhost1.my.domain" will match the second 338766494Sgshapiroentry since it is more explicit. Note: e-mail to "user@my.domain" 338866494Sgshapirodoes not match any entry in the above table. You need to have 338966494Sgshapirosomething like: 339038032Speter 339164562Sgshapiro my.domain esmtp:host.my.domain 339264562Sgshapiro 339338032SpeterThe RHS should always be a "mailer:host" pair. The mailer is the 339490792Sgshapiroconfiguration name of a mailer (that is, an M line in the 339538032Spetersendmail.cf file). The "host" will be the hostname passed to 339638032Speterthat mailer. In domain-based matches (that is, those with leading 339738032Speterdots) the "%1" may be used to interpolate the wildcarded part of 339838032Speterthe host name. For example, the first line above sends everything 339938032Speteraddressed to "anything.my.domain" to that same host name, but using 340038032Speterthe (presumably experimental) xnet mailer. 340138032Speter 340238032SpeterIn some cases you may want to temporarily turn off MX records, 340338032Speterparticularly on gateways. For example, you may want to MX 340438032Spetereverything in a domain to one machine that then forwards it 340538032Speterdirectly. To do this, you might use the DNS configuration: 340638032Speter 340738032Speter *.domain. IN MX 0 relay.machine 340838032Speter 340938032Speterand on relay.machine use the mailertable: 341038032Speter 341138032Speter .domain smtp:[gateway.domain] 341238032Speter 341338032SpeterThe [square brackets] turn off MX records for this host only. 341438032SpeterIf you didn't do this, the mailertable would use the MX record 3415120256Sgshapiroagain, which would give you an MX loop. Note that the use of 3416120256Sgshapirowildcard MX records is almost always a bad idea. Please avoid 3417120256Sgshapirousing them if possible. 341838032Speter 341938032Speter 342038032Speter+--------------------------------+ 342138032Speter| USING USERDB TO MAP FULL NAMES | 342238032Speter+--------------------------------+ 342338032Speter 342438032SpeterThe user database was not originally intended for mapping full names 342538032Speterto login names (e.g., Eric.Allman => eric), but some people are using 342664562Sgshapiroit that way. (it is recommended that you set up aliases for this 342738032Speterpurpose instead -- since you can specify multiple alias files, this 342838032Speteris fairly easy.) The intent was to locate the default maildrop at 342938032Spetera site, but allow you to override this by sending to a specific host. 343038032Speter 343138032SpeterIf you decide to set up the user database in this fashion, it is 343243730Speterimperative that you not use FEATURE(`stickyhost') -- otherwise, 343338032Spetere-mail sent to Full.Name@local.host.name will be rejected. 343438032Speter 343538032SpeterTo build the internal form of the user database, use: 343638032Speter 343764562Sgshapiro makemap btree /etc/mail/userdb < /etc/mail/userdb.txt 343838032Speter 343964562SgshapiroAs a general rule, it is an extremely bad idea to using full names 344064562Sgshapiroas e-mail addresses, since they are not in any sense unique. For 344166494Sgshapiroexample, the UNIX software-development community has at least two 344264562Sgshapirowell-known Peter Deutsches, and at one time Bell Labs had two 344364562SgshapiroStephen R. Bournes with offices along the same hallway. Which one 344464562Sgshapirowill be forced to suffer the indignity of being Stephen_R_Bourne_2? 344564562SgshapiroThe less famous of the two, or the one that was hired later? 344638032Speter 344738032SpeterFinger should handle full names (and be fuzzy). Mail should use 344864562Sgshapirohandles, and not be fuzzy. 344938032Speter 345038032Speter 345138032Speter+--------------------------------+ 345238032Speter| MISCELLANEOUS SPECIAL FEATURES | 345338032Speter+--------------------------------+ 345438032Speter 345538032SpeterPlussed users 345638032Speter Sometimes it is convenient to merge configuration on a 345738032Speter centralized mail machine, for example, to forward all 345838032Speter root mail to a mail server. In this case it might be 345938032Speter useful to be able to treat the root addresses as a class 346038032Speter of addresses with subtle differences. You can do this 346138032Speter using plussed users. For example, a client might include 346238032Speter the alias: 346338032Speter 346438032Speter root: root+client1@server 346538032Speter 346638032Speter On the server, this will match an alias for "root+client1". 346738032Speter If that is not found, the alias "root+*" will be tried, 346838032Speter then "root". 346938032Speter 347038032Speter 347138032Speter+----------------+ 347238032Speter| SECURITY NOTES | 347338032Speter+----------------+ 347438032Speter 347538032SpeterA lot of sendmail security comes down to you. Sendmail 8 is much 347638032Spetermore careful about checking for security problems than previous 347738032Speterversions, but there are some things that you still need to watch 347838032Speterfor. In particular: 347938032Speter 348098121Sgshapiro* Make sure the aliases file is not writable except by trusted 348138032Speter system personnel. This includes both the text and database 348238032Speter version. 348338032Speter 348438032Speter* Make sure that other files that sendmail reads, such as the 348538032Speter mailertable, are only writable by trusted system personnel. 348638032Speter 348738032Speter* The queue directory should not be world writable PARTICULARLY 348838032Speter if your system allows "file giveaways" (that is, if a non-root 348938032Speter user can chown any file they own to any other user). 349038032Speter 349138032Speter* If your system allows file giveaways, DO NOT create a publically 349238032Speter writable directory for forward files. This will allow anyone 349338032Speter to steal anyone else's e-mail. Instead, create a script that 349438032Speter copies the .forward file from users' home directories once a 349538032Speter night (if you want the non-NFS-mounted forward directory). 349638032Speter 349738032Speter* If your system allows file giveaways, you'll find that 349838032Speter sendmail is much less trusting of :include: files -- in 349938032Speter particular, you'll have to have /SENDMAIL/ANY/SHELL/ in 350038032Speter /etc/shells before they will be trusted (that is, before 350138032Speter files and programs listed in them will be honored). 350238032Speter 350338032SpeterIn general, file giveaways are a mistake -- if you can turn them 350464562Sgshapirooff, do so. 350538032Speter 350638032Speter 350738032Speter+--------------------------------+ 350838032Speter| TWEAKING CONFIGURATION OPTIONS | 350938032Speter+--------------------------------+ 351038032Speter 351138032SpeterThere are a large number of configuration options that don't normally 3512132943Sgshapironeed to be changed. However, if you feel you need to tweak them, 3513132943Sgshapiroyou can define the following M4 variables. Note that some of these 3514132943Sgshapirovariables require formats that are defined in RFC 2821 or RFC 2822. 3515132943SgshapiroBefore changing them you need to make sure you do not violate those 3516132943Sgshapiro(and other relevant) RFCs. 351738032Speter 3518132943SgshapiroThis list is shown in four columns: the name you define, the default 3519132943Sgshapirovalue for that definition, the option or macro that is affected 3520132943Sgshapiro(either Ox for an option or Dx for a macro), and a brief description. 3521132943SgshapiroGreater detail of the semantics can be found in the Installation 3522132943Sgshapiroand Operations Guide. 3523132943Sgshapiro 352438032SpeterSome options are likely to be deprecated in future versions -- that is, 352538032Speterthe option is only included to provide back-compatibility. These are 352638032Spetermarked with "*". 352738032Speter 352838032SpeterRemember that these options are M4 variables, and hence may need to 352938032Speterbe quoted. In particular, arguments with commas will usually have to 353038032Speterbe ``double quoted, like this phrase'' to avoid having the comma 353138032Speterconfuse things. This is common for alias file definitions and for 353238032Speterthe read timeout. 353338032Speter 3534132943SgshapiroM4 Variable Name Configuration [Default] & Description 353538032Speter================ ============= ======================= 353638032SpeterconfMAILER_NAME $n macro [MAILER-DAEMON] The sender name used 353738032Speter for internally generated outgoing 353838032Speter messages. 353938032SpeterconfDOMAIN_NAME $j macro If defined, sets $j. This should 354038032Speter only be done if your system cannot 354138032Speter determine your local domain name, 354238032Speter and then it should be set to 354338032Speter $w.Foo.COM, where Foo.COM is your 354438032Speter domain name. 354538032SpeterconfCF_VERSION $Z macro If defined, this is appended to the 354638032Speter configuration version name. 354790792SgshapiroconfLDAP_CLUSTER ${sendmailMTACluster} macro 354890792Sgshapiro If defined, this is the LDAP 354990792Sgshapiro cluster to use for LDAP searches 355090792Sgshapiro as described above in ``USING LDAP 355190792Sgshapiro FOR ALIASES, MAPS, AND CLASSES''. 355264562SgshapiroconfFROM_HEADER From: [$?x$x <$g>$|$g$.] The format of an 355338032Speter internally generated From: address. 355438032SpeterconfRECEIVED_HEADER Received: 355538032Speter [$?sfrom $s $.$?_($?s$|from $.$_) 355664562Sgshapiro $.$?{auth_type}(authenticated) 355738032Speter $.by $j ($v/$Z)$?r with $r$. id $i$?u 355838032Speter for $u; $|; 355938032Speter $.$b] 356038032Speter The format of the Received: header 356138032Speter in messages passed through this host. 356238032Speter It is unwise to try to change this. 3563132943SgshapiroconfMESSAGEID_HEADER Message-Id: [<$t.$i@$j>] The format of an 3564132943Sgshapiro internally generated Message-Id: 3565132943Sgshapiro header. 356664562SgshapiroconfCW_FILE Fw class [/etc/mail/local-host-names] Name 356764562Sgshapiro of file used to get the local 356864562Sgshapiro additions to class {w} (local host 356964562Sgshapiro names). 357064562SgshapiroconfCT_FILE Ft class [/etc/mail/trusted-users] Name of 357164562Sgshapiro file used to get the local additions 357264562Sgshapiro to class {t} (trusted users). 357338032SpeterconfCR_FILE FR class [/etc/mail/relay-domains] Name of 357438032Speter file used to get the local additions 357564562Sgshapiro to class {R} (hosts allowed to relay). 357638032SpeterconfTRUSTED_USERS Ct class [no default] Names of users to add to 357738032Speter the list of trusted users. This list 357838032Speter always includes root, uucp, and daemon. 357943730Speter See also FEATURE(`use_ct_file'). 358064562SgshapiroconfTRUSTED_USER TrustedUser [no default] Trusted user for file 358164562Sgshapiro ownership and starting the daemon. 358264562Sgshapiro Not to be confused with 358364562Sgshapiro confTRUSTED_USERS (see above). 358438032SpeterconfSMTP_MAILER - [esmtp] The mailer name used when 358538032Speter SMTP connectivity is required. 358664562Sgshapiro One of "smtp", "smtp8", 358764562Sgshapiro "esmtp", or "dsmtp". 358838032SpeterconfUUCP_MAILER - [uucp-old] The mailer to be used by 358938032Speter default for bang-format recipient 359038032Speter addresses. See also discussion of 359164562Sgshapiro class {U}, class {Y}, and class {Z} 359264562Sgshapiro in the MAILER(`uucp') section. 359338032SpeterconfLOCAL_MAILER - [local] The mailer name used when 359438032Speter local connectivity is required. 359538032Speter Almost always "local". 359638032SpeterconfRELAY_MAILER - [relay] The default mailer name used 359738032Speter for relaying any mail (e.g., to a 359838032Speter BITNET_RELAY, a SMART_HOST, or 359938032Speter whatever). This can reasonably be 360038032Speter "uucp-new" if you are on a 360138032Speter UUCP-connected site. 360238032SpeterconfSEVEN_BIT_INPUT SevenBitInput [False] Force input to seven bits? 360338032SpeterconfEIGHT_BIT_HANDLING EightBitMode [pass8] 8-bit data handling 360438032SpeterconfALIAS_WAIT AliasWait [10m] Time to wait for alias file 360538032Speter rebuild until you get bored and 360638032Speter decide that the apparently pending 360738032Speter rebuild failed. 360838032SpeterconfMIN_FREE_BLOCKS MinFreeBlocks [100] Minimum number of free blocks on 360938032Speter queue filesystem to accept SMTP mail. 361038032Speter (Prior to 8.7 this was minfree/maxsize, 361138032Speter where minfree was the number of free 361238032Speter blocks and maxsize was the maximum 361338032Speter message size. Use confMAX_MESSAGE_SIZE 361438032Speter for the second value now.) 361538032SpeterconfMAX_MESSAGE_SIZE MaxMessageSize [infinite] The maximum size of messages 361638032Speter that will be accepted (in bytes). 361738032SpeterconfBLANK_SUB BlankSub [.] Blank (space) substitution 361838032Speter character. 361938032SpeterconfCON_EXPENSIVE HoldExpensive [False] Avoid connecting immediately 362064562Sgshapiro to mailers marked expensive. 362138032SpeterconfCHECKPOINT_INTERVAL CheckpointInterval 362238032Speter [10] Checkpoint queue files every N 362338032Speter recipients. 362438032SpeterconfDELIVERY_MODE DeliveryMode [background] Default delivery mode. 362538032SpeterconfERROR_MODE ErrorMode [print] Error message mode. 362638032SpeterconfERROR_MESSAGE ErrorHeader [undefined] Error message header/file. 362742575SpeterconfSAVE_FROM_LINES SaveFromLine Save extra leading From_ lines. 362838032SpeterconfTEMP_FILE_MODE TempFileMode [0600] Temporary file mode. 362938032SpeterconfMATCH_GECOS MatchGECOS [False] Match GECOS field. 363038032SpeterconfMAX_HOP MaxHopCount [25] Maximum hop count. 363164562SgshapiroconfIGNORE_DOTS* IgnoreDots [False; always False in -bs or -bd 363264562Sgshapiro mode] Ignore dot as terminator for 363364562Sgshapiro incoming messages? 363438032SpeterconfBIND_OPTS ResolverOptions [undefined] Default options for DNS 363538032Speter resolver. 363638032SpeterconfMIME_FORMAT_ERRORS* SendMimeErrors [True] Send error messages as MIME- 363738032Speter encapsulated messages per RFC 1344. 363838032SpeterconfFORWARD_PATH ForwardPath [$z/.forward.$w:$z/.forward] 363938032Speter The colon-separated list of places to 364038032Speter search for .forward files. N.B.: see 364138032Speter the Security Notes section. 364238032SpeterconfMCI_CACHE_SIZE ConnectionCacheSize 364338032Speter [2] Size of open connection cache. 364438032SpeterconfMCI_CACHE_TIMEOUT ConnectionCacheTimeout 364538032Speter [5m] Open connection cache timeout. 364638032SpeterconfHOST_STATUS_DIRECTORY HostStatusDirectory 364738032Speter [undefined] If set, host status is kept 364838032Speter on disk between sendmail runs in the 364938032Speter named directory tree. This need not be 365038032Speter a full pathname, in which case it is 365138032Speter interpreted relative to the queue 365238032Speter directory. 365338032SpeterconfSINGLE_THREAD_DELIVERY SingleThreadDelivery 365438032Speter [False] If this option and the 365538032Speter HostStatusDirectory option are both 365638032Speter set, single thread deliveries to other 365738032Speter hosts. That is, don't allow any two 365838032Speter sendmails on this host to connect 365938032Speter simultaneously to any other single 366038032Speter host. This can slow down delivery in 366138032Speter some cases, in particular since a 366238032Speter cached but otherwise idle connection 366338032Speter to a host will prevent other sendmails 366438032Speter from connecting to the other host. 366564562SgshapiroconfUSE_ERRORS_TO* UseErrorsTo [False] Use the Errors-To: header to 366638032Speter deliver error messages. This should 366738032Speter not be necessary because of general 366838032Speter acceptance of the envelope/header 366938032Speter distinction. 367038032SpeterconfLOG_LEVEL LogLevel [9] Log level. 367164562SgshapiroconfME_TOO MeToo [True] Include sender in group 367264562Sgshapiro expansions. This option is 367364562Sgshapiro deprecated and will be removed from 367464562Sgshapiro a future version. 367538032SpeterconfCHECK_ALIASES CheckAliases [False] Check RHS of aliases when 367638032Speter running newaliases. Since this does 367738032Speter DNS lookups on every address, it can 367838032Speter slow down the alias rebuild process 367938032Speter considerably on large alias files. 368038032SpeterconfOLD_STYLE_HEADERS* OldStyleHeaders [True] Assume that headers without 368138032Speter special chars are old style. 368238032SpeterconfPRIVACY_FLAGS PrivacyOptions [authwarnings] Privacy flags. 368338032SpeterconfCOPY_ERRORS_TO PostmasterCopy [undefined] Address for additional 368438032Speter copies of all error messages. 368538032SpeterconfQUEUE_FACTOR QueueFactor [600000] Slope of queue-only function. 368690792SgshapiroconfQUEUE_FILE_MODE QueueFileMode [undefined] Default permissions for 368790792Sgshapiro queue files (octal). If not set, 368890792Sgshapiro sendmail uses 0600 unless its real 368990792Sgshapiro and effective uid are different in 369090792Sgshapiro which case it uses 0644. 369138032SpeterconfDONT_PRUNE_ROUTES DontPruneRoutes [False] Don't prune down route-addr 369238032Speter syntax addresses to the minimum 369338032Speter possible. 369438032SpeterconfSAFE_QUEUE* SuperSafe [True] Commit all messages to disk 369538032Speter before forking. 369638032SpeterconfTO_INITIAL Timeout.initial [5m] The timeout waiting for a response 369738032Speter on the initial connect. 369838032SpeterconfTO_CONNECT Timeout.connect [0] The timeout waiting for an initial 369938032Speter connect() to complete. This can only 370038032Speter shorten connection timeouts; the kernel 370138032Speter silently enforces an absolute maximum 370238032Speter (which varies depending on the system). 370338032SpeterconfTO_ICONNECT Timeout.iconnect 370438032Speter [undefined] Like Timeout.connect, but 370538032Speter applies only to the very first attempt 370638032Speter to connect to a host in a message. 370738032Speter This allows a single very fast pass 370838032Speter followed by more careful delivery 370938032Speter attempts in the future. 371090792SgshapiroconfTO_ACONNECT Timeout.aconnect 371190792Sgshapiro [0] The overall timeout waiting for 371290792Sgshapiro all connection for a single delivery 371390792Sgshapiro attempt to succeed. If 0, no overall 371490792Sgshapiro limit is applied. 371538032SpeterconfTO_HELO Timeout.helo [5m] The timeout waiting for a response 371638032Speter to a HELO or EHLO command. 371738032SpeterconfTO_MAIL Timeout.mail [10m] The timeout waiting for a 371838032Speter response to the MAIL command. 371938032SpeterconfTO_RCPT Timeout.rcpt [1h] The timeout waiting for a response 372038032Speter to the RCPT command. 372138032SpeterconfTO_DATAINIT Timeout.datainit 372238032Speter [5m] The timeout waiting for a 354 372338032Speter response from the DATA command. 372438032SpeterconfTO_DATABLOCK Timeout.datablock 372538032Speter [1h] The timeout waiting for a block 372638032Speter during DATA phase. 372738032SpeterconfTO_DATAFINAL Timeout.datafinal 372838032Speter [1h] The timeout waiting for a response 372938032Speter to the final "." that terminates a 373038032Speter message. 373138032SpeterconfTO_RSET Timeout.rset [5m] The timeout waiting for a response 373238032Speter to the RSET command. 373338032SpeterconfTO_QUIT Timeout.quit [2m] The timeout waiting for a response 373438032Speter to the QUIT command. 373538032SpeterconfTO_MISC Timeout.misc [2m] The timeout waiting for a response 373638032Speter to other SMTP commands. 373764562SgshapiroconfTO_COMMAND Timeout.command [1h] In server SMTP, the timeout 373864562Sgshapiro waiting for a command to be issued. 373964562SgshapiroconfTO_IDENT Timeout.ident [5s] The timeout waiting for a 374064562Sgshapiro response to an IDENT query. 374138032SpeterconfTO_FILEOPEN Timeout.fileopen 374238032Speter [60s] The timeout waiting for a file 374338032Speter (e.g., :include: file) to be opened. 374490792SgshapiroconfTO_LHLO Timeout.lhlo [2m] The timeout waiting for a response 374590792Sgshapiro to an LMTP LHLO command. 374690792SgshapiroconfTO_AUTH Timeout.auth [10m] The timeout waiting for a 374790792Sgshapiro response in an AUTH dialogue. 374890792SgshapiroconfTO_STARTTLS Timeout.starttls 374990792Sgshapiro [1h] The timeout waiting for a 375090792Sgshapiro response to an SMTP STARTTLS command. 375164562SgshapiroconfTO_CONTROL Timeout.control 375264562Sgshapiro [2m] The timeout for a complete 375364562Sgshapiro control socket transaction to complete. 375438032SpeterconfTO_QUEUERETURN Timeout.queuereturn 375538032Speter [5d] The timeout before a message is 375638032Speter returned as undeliverable. 375738032SpeterconfTO_QUEUERETURN_NORMAL 375838032Speter Timeout.queuereturn.normal 375938032Speter [undefined] As above, for normal 376038032Speter priority messages. 376138032SpeterconfTO_QUEUERETURN_URGENT 376238032Speter Timeout.queuereturn.urgent 376338032Speter [undefined] As above, for urgent 376438032Speter priority messages. 376538032SpeterconfTO_QUEUERETURN_NONURGENT 376638032Speter Timeout.queuereturn.non-urgent 376738032Speter [undefined] As above, for non-urgent 376838032Speter (low) priority messages. 3769132943SgshapiroconfTO_QUEUERETURN_DSN 3770132943Sgshapiro Timeout.queuereturn.dsn 3771132943Sgshapiro [undefined] As above, for delivery 3772132943Sgshapiro status notification messages. 377338032SpeterconfTO_QUEUEWARN Timeout.queuewarn 377438032Speter [4h] The timeout before a warning 377538032Speter message is sent to the sender telling 377664562Sgshapiro them that the message has been 377764562Sgshapiro deferred. 377838032SpeterconfTO_QUEUEWARN_NORMAL Timeout.queuewarn.normal 377938032Speter [undefined] As above, for normal 378038032Speter priority messages. 378138032SpeterconfTO_QUEUEWARN_URGENT Timeout.queuewarn.urgent 378238032Speter [undefined] As above, for urgent 378338032Speter priority messages. 378438032SpeterconfTO_QUEUEWARN_NONURGENT 378538032Speter Timeout.queuewarn.non-urgent 378638032Speter [undefined] As above, for non-urgent 378738032Speter (low) priority messages. 3788132943SgshapiroconfTO_QUEUEWARN_DSN 3789132943Sgshapiro Timeout.queuewarn.dsn 3790132943Sgshapiro [undefined] As above, for delivery 3791132943Sgshapiro status notification messages. 379238032SpeterconfTO_HOSTSTATUS Timeout.hoststatus 379338032Speter [30m] How long information about host 379438032Speter statuses will be maintained before it 379538032Speter is considered stale and the host should 379638032Speter be retried. This applies both within 379738032Speter a single queue run and to persistent 379838032Speter information (see below). 379964562SgshapiroconfTO_RESOLVER_RETRANS Timeout.resolver.retrans 380064562Sgshapiro [varies] Sets the resolver's 380198121Sgshapiro retransmission time interval (in 380264562Sgshapiro seconds). Sets both 380364562Sgshapiro Timeout.resolver.retrans.first and 380464562Sgshapiro Timeout.resolver.retrans.normal. 380564562SgshapiroconfTO_RESOLVER_RETRANS_FIRST Timeout.resolver.retrans.first 380664562Sgshapiro [varies] Sets the resolver's 380798121Sgshapiro retransmission time interval (in 380864562Sgshapiro seconds) for the first attempt to 380964562Sgshapiro deliver a message. 381064562SgshapiroconfTO_RESOLVER_RETRANS_NORMAL Timeout.resolver.retrans.normal 381164562Sgshapiro [varies] Sets the resolver's 381298121Sgshapiro retransmission time interval (in 381364562Sgshapiro seconds) for all resolver lookups 381464562Sgshapiro except the first delivery attempt. 381564562SgshapiroconfTO_RESOLVER_RETRY Timeout.resolver.retry 381664562Sgshapiro [varies] Sets the number of times 381764562Sgshapiro to retransmit a resolver query. 381864562Sgshapiro Sets both 381964562Sgshapiro Timeout.resolver.retry.first and 382064562Sgshapiro Timeout.resolver.retry.normal. 382164562SgshapiroconfTO_RESOLVER_RETRY_FIRST Timeout.resolver.retry.first 382264562Sgshapiro [varies] Sets the number of times 382364562Sgshapiro to retransmit a resolver query for 382464562Sgshapiro the first attempt to deliver a 382564562Sgshapiro message. 382664562SgshapiroconfTO_RESOLVER_RETRY_NORMAL Timeout.resolver.retry.normal 382764562Sgshapiro [varies] Sets the number of times 382864562Sgshapiro to retransmit a resolver query for 382964562Sgshapiro all resolver lookups except the 383064562Sgshapiro first delivery attempt. 383138032SpeterconfTIME_ZONE TimeZoneSpec [USE_SYSTEM] Time zone info -- can be 383238032Speter USE_SYSTEM to use the system's idea, 383338032Speter USE_TZ to use the user's TZ envariable, 383438032Speter or something else to force that value. 383538032SpeterconfDEF_USER_ID DefaultUser [1:1] Default user id. 383638032SpeterconfUSERDB_SPEC UserDatabaseSpec 383764562Sgshapiro [undefined] User database 383864562Sgshapiro specification. 383938032SpeterconfFALLBACK_MX FallbackMXhost [undefined] Fallback MX host. 3840132943SgshapiroconfFALLBACK_SMARTHOST FallbackSmartHost 3841132943Sgshapiro [undefined] Fallback smart host. 384264562SgshapiroconfTRY_NULL_MX_LIST TryNullMXList [False] If this host is the best MX 384364562Sgshapiro for a host and other arrangements 384464562Sgshapiro haven't been made, try connecting 384564562Sgshapiro to the host directly; normally this 384664562Sgshapiro would be a config error. 384764562SgshapiroconfQUEUE_LA QueueLA [varies] Load average at which 384864562Sgshapiro queue-only function kicks in. 384964562Sgshapiro Default values is (8 * numproc) 385064562Sgshapiro where numproc is the number of 385164562Sgshapiro processors online (if that can be 385264562Sgshapiro determined). 385364562SgshapiroconfREFUSE_LA RefuseLA [varies] Load average at which 385464562Sgshapiro incoming SMTP connections are 385564562Sgshapiro refused. Default values is (12 * 385664562Sgshapiro numproc) where numproc is the 385764562Sgshapiro number of processors online (if 385864562Sgshapiro that can be determined). 3859132943SgshapiroconfREJECT_LOG_INTERVAL RejectLogInterval [3h] Log interval when 3860132943Sgshapiro refusing connections for this long. 386190792SgshapiroconfDELAY_LA DelayLA [0] Load average at which sendmail 386290792Sgshapiro will sleep for one second on most 386390792Sgshapiro SMTP commands and before accepting 386490792Sgshapiro connections. 0 means no limit. 386564562SgshapiroconfMAX_ALIAS_RECURSION MaxAliasRecursion 386664562Sgshapiro [10] Maximum depth of alias recursion. 386738032SpeterconfMAX_DAEMON_CHILDREN MaxDaemonChildren 386838032Speter [undefined] The maximum number of 386938032Speter children the daemon will permit. After 387038032Speter this number, connections will be 387138032Speter rejected. If not set or <= 0, there is 387238032Speter no limit. 387364562SgshapiroconfMAX_HEADERS_LENGTH MaxHeadersLength 387471345Sgshapiro [32768] Maximum length of the sum 387564562Sgshapiro of all headers. 387664562SgshapiroconfMAX_MIME_HEADER_LENGTH MaxMimeHeaderLength 387764562Sgshapiro [undefined] Maximum length of 387864562Sgshapiro certain MIME header field values. 387938032SpeterconfCONNECTION_RATE_THROTTLE ConnectionRateThrottle 388038032Speter [undefined] The maximum number of 388190792Sgshapiro connections permitted per second per 388290792Sgshapiro daemon. After this many connections 388390792Sgshapiro are accepted, further connections 388490792Sgshapiro will be delayed. If not set or <= 0, 388590792Sgshapiro there is no limit. 3886132943SgshapiroconfCONNECTION_RATE_WINDOW_SIZE ConnectionRateWindowSize 3887132943Sgshapiro [60s] Define the length of the 3888132943Sgshapiro interval for which the number of 3889132943Sgshapiro incoming connections is maintained. 389038032SpeterconfWORK_RECIPIENT_FACTOR 389138032Speter RecipientFactor [30000] Cost of each recipient. 389264562SgshapiroconfSEPARATE_PROC ForkEachJob [False] Run all deliveries in a 389364562Sgshapiro separate process. 389438032SpeterconfWORK_CLASS_FACTOR ClassFactor [1800] Priority multiplier for class. 389538032SpeterconfWORK_TIME_FACTOR RetryFactor [90000] Cost of each delivery attempt. 389638032SpeterconfQUEUE_SORT_ORDER QueueSortOrder [Priority] Queue sort algorithm: 389790792Sgshapiro Priority, Host, Filename, Random, 389890792Sgshapiro Modification, or Time. 389938032SpeterconfMIN_QUEUE_AGE MinQueueAge [0] The minimum amount of time a job 390038032Speter must sit in the queue between queue 390138032Speter runs. This allows you to set the 390238032Speter queue run interval low for better 390338032Speter responsiveness without trying all 390438032Speter jobs in each run. 390538032SpeterconfDEF_CHAR_SET DefaultCharSet [unknown-8bit] When converting 390638032Speter unlabeled 8 bit input to MIME, the 390738032Speter character set to use by default. 390838032SpeterconfSERVICE_SWITCH_FILE ServiceSwitchFile 390964562Sgshapiro [/etc/mail/service.switch] The file 391064562Sgshapiro to use for the service switch on 391164562Sgshapiro systems that do not have a 391264562Sgshapiro system-defined switch. 391338032SpeterconfHOSTS_FILE HostsFile [/etc/hosts] The file to use when doing 391438032Speter "file" type access of hosts names. 391538032SpeterconfDIAL_DELAY DialDelay [0s] If a connection fails, wait this 391638032Speter long and try again. Zero means "don't 391738032Speter retry". This is to allow "dial on 391838032Speter demand" connections to have enough time 391938032Speter to complete a connection. 392038032SpeterconfNO_RCPT_ACTION NoRecipientAction 392138032Speter [none] What to do if there are no legal 392238032Speter recipient fields (To:, Cc: or Bcc:) 392338032Speter in the message. Legal values can 392438032Speter be "none" to just leave the 392538032Speter nonconforming message as is, "add-to" 392638032Speter to add a To: header with all the 392738032Speter known recipients (which may expose 392838032Speter blind recipients), "add-apparently-to" 392938032Speter to do the same but use Apparently-To: 393090792Sgshapiro instead of To: (strongly discouraged 393190792Sgshapiro in accordance with IETF standards), 393290792Sgshapiro "add-bcc" to add an empty Bcc: 393390792Sgshapiro header, or "add-to-undisclosed" to 393490792Sgshapiro add the header 393538032Speter ``To: undisclosed-recipients:;''. 393638032SpeterconfSAFE_FILE_ENV SafeFileEnvironment 393738032Speter [undefined] If set, sendmail will do a 393838032Speter chroot() into this directory before 393938032Speter writing files. 394038032SpeterconfCOLON_OK_IN_ADDR ColonOkInAddr [True unless Configuration Level > 6] 394138032Speter If set, colons are treated as a regular 394238032Speter character in addresses. If not set, 394338032Speter they are treated as the introducer to 394438032Speter the RFC 822 "group" syntax. Colons are 394538032Speter handled properly in route-addrs. This 394638032Speter option defaults on for V5 and lower 394738032Speter configuration files. 394838032SpeterconfMAX_QUEUE_RUN_SIZE MaxQueueRunSize [0] If set, limit the maximum size of 394938032Speter any given queue run to this number of 395038032Speter entries. Essentially, this will stop 395164562Sgshapiro reading each queue directory after this 395238032Speter number of entries are reached; it does 395338032Speter _not_ pick the highest priority jobs, 395438032Speter so this should be as large as your 395538032Speter system can tolerate. If not set, there 395638032Speter is no limit. 395790792SgshapiroconfMAX_QUEUE_CHILDREN MaxQueueChildren 395890792Sgshapiro [undefined] Limits the maximum number 395990792Sgshapiro of concurrent queue runners active. 396090792Sgshapiro This is to keep system resources used 396190792Sgshapiro within a reasonable limit. Relates to 3962132943Sgshapiro Queue Groups and ForkEachJob. 396390792SgshapiroconfMAX_RUNNERS_PER_QUEUE MaxRunnersPerQueue 396490792Sgshapiro [1] Only active when MaxQueueChildren 396590792Sgshapiro defined. Controls the maximum number 396690792Sgshapiro of queue runners (aka queue children) 396790792Sgshapiro active at the same time in a work 396890792Sgshapiro group. See also MaxQueueChildren. 396938032SpeterconfDONT_EXPAND_CNAMES DontExpandCnames 397038032Speter [False] If set, $[ ... $] lookups that 397138032Speter do DNS based lookups do not expand 397238032Speter CNAME records. This currently violates 397338032Speter the published standards, but the IETF 397438032Speter seems to be moving toward legalizing 397538032Speter this. For example, if "FTP.Foo.ORG" 397638032Speter is a CNAME for "Cruft.Foo.ORG", then 397738032Speter with this option set a lookup of 397838032Speter "FTP" will return "FTP.Foo.ORG"; if 397938032Speter clear it returns "Cruft.FOO.ORG". N.B. 398038032Speter you may not see any effect until your 398138032Speter downstream neighbors stop doing CNAME 398238032Speter lookups as well. 398364562SgshapiroconfFROM_LINE UnixFromLine [From $g $d] The From_ line used 398438032Speter when sending to files or programs. 398538032SpeterconfSINGLE_LINE_FROM_HEADER SingleLineFromHeader 398638032Speter [False] From: lines that have 398738032Speter embedded newlines are unwrapped 398838032Speter onto one line. 398938032SpeterconfALLOW_BOGUS_HELO AllowBogusHELO [False] Allow HELO SMTP command that 399038032Speter does not include a host name. 399138032SpeterconfMUST_QUOTE_CHARS MustQuoteChars [.'] Characters to be quoted in a full 399238032Speter name phrase (@,;:\()[] are automatic). 399338032SpeterconfOPERATORS OperatorChars [.:%@!^/[]+] Address operator 399438032Speter characters. 399538032SpeterconfSMTP_LOGIN_MSG SmtpGreetingMessage 399638032Speter [$j Sendmail $v/$Z; $b] 399738032Speter The initial (spontaneous) SMTP 399838032Speter greeting message. The word "ESMTP" 399938032Speter will be inserted between the first and 400038032Speter second words to convince other 400138032Speter sendmails to try to speak ESMTP. 400238032SpeterconfDONT_INIT_GROUPS DontInitGroups [False] If set, the initgroups(3) 400338032Speter routine will never be invoked. You 400438032Speter might want to do this if you are 400538032Speter running NIS and you have a large group 400638032Speter map, since this call does a sequential 400738032Speter scan of the map; in a large site this 400838032Speter can cause your ypserv to run 400938032Speter essentially full time. If you set 401038032Speter this, agents run on behalf of users 401138032Speter will only have their primary 401238032Speter (/etc/passwd) group permissions. 401338032SpeterconfUNSAFE_GROUP_WRITES UnsafeGroupWrites 4014157001Sgshapiro [True] If set, group-writable 401538032Speter :include: and .forward files are 401638032Speter considered "unsafe", that is, programs 401738032Speter and files cannot be directly referenced 401838032Speter from such files. World-writable files 401938032Speter are always considered unsafe. 4020157001Sgshapiro Notice: this option is deprecated and 4021157001Sgshapiro will be removed in future versions; 4022157001Sgshapiro Set GroupWritableForwardFileSafe 4023157001Sgshapiro and GroupWritableIncludeFileSafe in 4024157001Sgshapiro DontBlameSendmail if required. 402564562SgshapiroconfCONNECT_ONLY_TO ConnectOnlyTo [undefined] override connection 402664562Sgshapiro address (for testing). 402764562SgshapiroconfCONTROL_SOCKET_NAME ControlSocketName 402864562Sgshapiro [undefined] Control socket for daemon 402964562Sgshapiro management. 403038032SpeterconfDOUBLE_BOUNCE_ADDRESS DoubleBounceAddress 403138032Speter [postmaster] If an error occurs when 403238032Speter sending an error message, send that 403338032Speter "double bounce" error message to this 403490792Sgshapiro address. If it expands to an empty 403590792Sgshapiro string, double bounces are dropped. 403664562SgshapiroconfDEAD_LETTER_DROP DeadLetterDrop [undefined] Filename to save bounce 403764562Sgshapiro messages which could not be returned 403864562Sgshapiro to the user or sent to postmaster. 403964562Sgshapiro If not set, the queue file will 404064562Sgshapiro be renamed. 404164562SgshapiroconfRRT_IMPLIES_DSN RrtImpliesDsn [False] Return-Receipt-To: header 404264562Sgshapiro implies DSN request. 404338032SpeterconfRUN_AS_USER RunAsUser [undefined] If set, become this user 404438032Speter when reading and delivering mail. 404538032Speter Causes all file reads (e.g., .forward 404638032Speter and :include: files) to be done as 404738032Speter this user. Also, all programs will 404838032Speter be run as this user, and all output 404938032Speter files will be written as this user. 405038032SpeterconfMAX_RCPTS_PER_MESSAGE MaxRecipientsPerMessage 405138032Speter [infinite] If set, allow no more than 405238032Speter the specified number of recipients in 405338032Speter an SMTP envelope. Further recipients 405438032Speter receive a 452 error code (i.e., they 405538032Speter are deferred for the next delivery 405638032Speter attempt). 4057125820SgshapiroconfBAD_RCPT_THROTTLE BadRcptThrottle [infinite] If set and the specified 4058125820Sgshapiro number of recipients in a single SMTP 4059125820Sgshapiro transaction have been rejected, sleep 4060125820Sgshapiro for one second after each subsequent 4061125820Sgshapiro RCPT command in that transaction. 406238032SpeterconfDONT_PROBE_INTERFACES DontProbeInterfaces 406338032Speter [False] If set, sendmail will _not_ 406438032Speter insert the names and addresses of any 406564562Sgshapiro local interfaces into class {w} 406638032Speter (list of known "equivalent" addresses). 406738032Speter If you set this, you must also include 406838032Speter some support for these addresses (e.g., 406938032Speter in a mailertable entry) -- otherwise, 407038032Speter mail to addresses in this list will 407138032Speter bounce with a configuration error. 407290792Sgshapiro If set to "loopback" (without 407390792Sgshapiro quotes), sendmail will skip 407490792Sgshapiro loopback interfaces (e.g., "lo0"). 407564562SgshapiroconfPID_FILE PidFile [system dependent] Location of pid 407664562Sgshapiro file. 407764562SgshapiroconfPROCESS_TITLE_PREFIX ProcessTitlePrefix 407864562Sgshapiro [undefined] Prefix string for the 407964562Sgshapiro process title shown on 'ps' listings. 408038032SpeterconfDONT_BLAME_SENDMAIL DontBlameSendmail 408138032Speter [safe] Override sendmail's file 408238032Speter safety checks. This will definitely 408338032Speter compromise system security and should 408438032Speter not be used unless absolutely 408538032Speter necessary. 408638032SpeterconfREJECT_MSG - [550 Access denied] The message 408738032Speter given if the access database contains 408838032Speter REJECT in the value portion. 408990792SgshapiroconfRELAY_MSG - [550 Relaying denied] The message 409090792Sgshapiro given if an unauthorized relaying 409190792Sgshapiro attempt is rejected. 409264562SgshapiroconfDF_BUFFER_SIZE DataFileBufferSize 409364562Sgshapiro [4096] The maximum size of a 409464562Sgshapiro memory-buffered data (df) file 409564562Sgshapiro before a disk-based file is used. 409664562SgshapiroconfXF_BUFFER_SIZE XScriptFileBufferSize 409764562Sgshapiro [4096] The maximum size of a 409864562Sgshapiro memory-buffered transcript (xf) 409964562Sgshapiro file before a disk-based file is 410064562Sgshapiro used. 410164562SgshapiroconfAUTH_MECHANISMS AuthMechanisms [GSSAPI KERBEROS_V4 DIGEST-MD5 410264562Sgshapiro CRAM-MD5] List of authentication 410364562Sgshapiro mechanisms for AUTH (separated by 410464562Sgshapiro spaces). The advertised list of 410564562Sgshapiro authentication mechanisms will be the 410664562Sgshapiro intersection of this list and the list 410764562Sgshapiro of available mechanisms as determined 4108132943Sgshapiro by the Cyrus SASL library. 4109132943SgshapiroconfAUTH_REALM AuthRealm [undefined] The authentication realm 4110132943Sgshapiro that is passed to the Cyrus SASL 4111132943Sgshapiro library. If no realm is specified, 4112132943Sgshapiro $j is used. 411373188SgshapiroconfDEF_AUTH_INFO DefaultAuthInfo [undefined] Name of file that contains 411464562Sgshapiro authentication information for 411590792Sgshapiro outgoing connections. This file must 411690792Sgshapiro contain the user id, the authorization 411790792Sgshapiro id, the password (plain text), the 411890792Sgshapiro realm to use, and the list of 411990792Sgshapiro mechanisms to try, each on a separate 412090792Sgshapiro line and must be readable by root (or 412190792Sgshapiro the trusted user) only. If no realm 412290792Sgshapiro is specified, $j is used. If no 412390792Sgshapiro mechanisms are given in the file, 412490792Sgshapiro AuthMechanisms is used. Notice: this 412590792Sgshapiro option is deprecated and will be 412690792Sgshapiro removed in future versions; it doesn't 412790792Sgshapiro work for the MSP since it can't read 412890792Sgshapiro the file. Use the authinfo ruleset 412990792Sgshapiro instead. See also the section SMTP 413090792Sgshapiro AUTHENTICATION. 413190792SgshapiroconfAUTH_OPTIONS AuthOptions [undefined] If this option is 'A' 413264562Sgshapiro then the AUTH= parameter for the 413364562Sgshapiro MAIL FROM command is only issued 413464562Sgshapiro when authentication succeeded. 4135147078Sgshapiro See doc/op/op.me for more options 4136147078Sgshapiro and details. 413790792SgshapiroconfAUTH_MAX_BITS AuthMaxBits [INT_MAX] Limit the maximum encryption 413890792Sgshapiro strength for the security layer in 413990792Sgshapiro SMTP AUTH (SASL). Default is 414090792Sgshapiro essentially unlimited. 414190792SgshapiroconfTLS_SRV_OPTIONS TLSSrvOptions If this option is 'V' no client 414290792Sgshapiro verification is performed, i.e., 414390792Sgshapiro the server doesn't ask for a 414490792Sgshapiro certificate. 414564562SgshapiroconfLDAP_DEFAULT_SPEC LDAPDefaultSpec [undefined] Default map 414664562Sgshapiro specification for LDAP maps. The 414764562Sgshapiro value should only contain LDAP 414864562Sgshapiro specific settings such as "-h host 414964562Sgshapiro -p port -d bindDN", etc. The 415064562Sgshapiro settings will be used for all LDAP 415164562Sgshapiro maps unless they are specified in 415264562Sgshapiro the individual map specification 415364562Sgshapiro ('K' command). 4154110560SgshapiroconfCACERT_PATH CACertPath [undefined] Path to directory 415564562Sgshapiro with certs of CAs. 4156110560SgshapiroconfCACERT CACertFile [undefined] File containing one CA 415764562Sgshapiro cert. 415864562SgshapiroconfSERVER_CERT ServerCertFile [undefined] File containing the 415964562Sgshapiro cert of the server, i.e., this cert 416064562Sgshapiro is used when sendmail acts as 416164562Sgshapiro server. 416264562SgshapiroconfSERVER_KEY ServerKeyFile [undefined] File containing the 416364562Sgshapiro private key belonging to the server 416464562Sgshapiro cert. 416564562SgshapiroconfCLIENT_CERT ClientCertFile [undefined] File containing the 416664562Sgshapiro cert of the client, i.e., this cert 416764562Sgshapiro is used when sendmail acts as 416864562Sgshapiro client. 416964562SgshapiroconfCLIENT_KEY ClientKeyFile [undefined] File containing the 417064562Sgshapiro private key belonging to the client 417164562Sgshapiro cert. 4172132943SgshapiroconfCRL CRLFile [undefined] File containing certificate 4173132943Sgshapiro revocation status, useful for X.509v3 4174132943Sgshapiro authentication. Note that CRL requires 4175132943Sgshapiro at least OpenSSL version 0.9.7. 417664562SgshapiroconfDH_PARAMETERS DHParameters [undefined] File containing the 417764562Sgshapiro DH parameters. 417864562SgshapiroconfRAND_FILE RandFile [undefined] File containing random 417966494Sgshapiro data (use prefix file:) or the 418066494Sgshapiro name of the UNIX socket if EGD is 418166494Sgshapiro used (use prefix egd:). STARTTLS 418266494Sgshapiro requires this option if the compile 418366494Sgshapiro flag HASURANDOM is not set (see 418464562Sgshapiro sendmail/README). 418590792SgshapiroconfNICE_QUEUE_RUN NiceQueueRun [undefined] If set, the priority of 418690792Sgshapiro queue runners is set the given value 418790792Sgshapiro (nice(3)). 418890792SgshapiroconfDIRECT_SUBMISSION_MODIFIERS DirectSubmissionModifiers 418990792Sgshapiro [undefined] Defines {daemon_flags} 419090792Sgshapiro for direct submissions. 4191157001SgshapiroconfUSE_MSP UseMSP [undefined] Use as mail submission 419290792Sgshapiro program, see sendmail/SECURITY. 419390792SgshapiroconfDELIVER_BY_MIN DeliverByMin [0] Minimum time for Deliver By 419490792Sgshapiro SMTP Service Extension (RFC 2852). 4195132943SgshapiroconfREQUIRES_DIR_FSYNC RequiresDirfsync [true] RequiresDirfsync can 4196132943Sgshapiro be used to turn off the compile time 4197132943Sgshapiro flag REQUIRES_DIR_FSYNC at runtime. 4198132943Sgshapiro See sendmail/README for details. 419990792SgshapiroconfSHARED_MEMORY_KEY SharedMemoryKey [0] Key for shared memory. 420090792SgshapiroconfFAST_SPLIT FastSplit [1] If set to a value greater than 420190792Sgshapiro zero, the initial MX lookups on 420290792Sgshapiro addresses is suppressed when they 420390792Sgshapiro are sorted which may result in 420490792Sgshapiro faster envelope splitting. If the 420590792Sgshapiro mail is submitted directly from the 420690792Sgshapiro command line, then the value also 420790792Sgshapiro limits the number of processes to 420890792Sgshapiro deliver the envelopes. 420990792SgshapiroconfMAILBOX_DATABASE MailboxDatabase [pw] Type of lookup to find 421090792Sgshapiro information about local mailboxes. 421190792SgshapiroconfDEQUOTE_OPTS - [empty] Additional options for the 421290792Sgshapiro dequote map. 421390792SgshapiroconfINPUT_MAIL_FILTERS InputMailFilters 421490792Sgshapiro A comma separated list of filters 421590792Sgshapiro which determines which filters and 421690792Sgshapiro the invocation sequence are 421790792Sgshapiro contacted for incoming SMTP 421890792Sgshapiro messages. If none are set, no 421990792Sgshapiro filters will be contacted. 422090792SgshapiroconfMILTER_LOG_LEVEL Milter.LogLevel [9] Log level for input mail filter 422190792Sgshapiro actions, defaults to LogLevel. 422290792SgshapiroconfMILTER_MACROS_CONNECT Milter.macros.connect 4223110560Sgshapiro [j, _, {daemon_name}, {if_name}, 4224110560Sgshapiro {if_addr}] Macros to transmit to 4225110560Sgshapiro milters when a session connection 4226110560Sgshapiro starts. 422790792SgshapiroconfMILTER_MACROS_HELO Milter.macros.helo 4228110560Sgshapiro [{tls_version}, {cipher}, 4229110560Sgshapiro {cipher_bits}, {cert_subject}, 4230110560Sgshapiro {cert_issuer}] Macros to transmit to 4231110560Sgshapiro milters after HELO/EHLO command. 423290792SgshapiroconfMILTER_MACROS_ENVFROM Milter.macros.envfrom 4233110560Sgshapiro [i, {auth_type}, {auth_authen}, 4234110560Sgshapiro {auth_ssf}, {auth_author}, 4235110560Sgshapiro {mail_mailer}, {mail_host}, 4236110560Sgshapiro {mail_addr}] Macros to transmit to 4237110560Sgshapiro milters after MAIL FROM command. 423890792SgshapiroconfMILTER_MACROS_ENVRCPT Milter.macros.envrcpt 4239110560Sgshapiro [{rcpt_mailer}, {rcpt_host}, 4240110560Sgshapiro {rcpt_addr}] Macros to transmit to 4241110560Sgshapiro milters after RCPT TO command. 4242132943SgshapiroconfMILTER_MACROS_EOM Milter.macros.eom 4243132943Sgshapiro [{msg_id}] Macros to transmit to 4244132943Sgshapiro milters after DATA command. 424564562Sgshapiro 424690792Sgshapiro 424738032SpeterSee also the description of OSTYPE for some parameters that can be 424838032Spetertweaked (generally pathnames to mailers). 424938032Speter 425090792SgshapiroClientPortOptions and DaemonPortOptions are special cases since multiple 425190792Sgshapiroclients/daemons can be defined. This can be done via 425238032Speter 425390792Sgshapiro CLIENT_OPTIONS(`field1=value1,field2=value2,...') 425464562Sgshapiro DAEMON_OPTIONS(`field1=value1,field2=value2,...') 425564562Sgshapiro 425690792SgshapiroNote that multiple CLIENT_OPTIONS() commands (and therefore multiple 425790792SgshapiroClientPortOptions settings) are allowed in order to give settings for each 425890792Sgshapiroprotocol family (e.g., one for Family=inet and one for Family=inet6). A 425990792Sgshapirorestriction placed on one family only affects outgoing connections on that 426090792Sgshapiroparticular family. 426190792Sgshapiro 426264562SgshapiroIf DAEMON_OPTIONS is not used, then the default is 426364562Sgshapiro 426464562Sgshapiro DAEMON_OPTIONS(`Port=smtp, Name=MTA') 426564562Sgshapiro DAEMON_OPTIONS(`Port=587, Name=MSA, M=E') 426664562Sgshapiro 426764562SgshapiroIf you use one DAEMON_OPTIONS macro, it will alter the parameters 426864562Sgshapiroof the first of these. The second will still be defaulted; it 426964562Sgshapirorepresents a "Message Submission Agent" (MSA) as defined by RFC 427064562Sgshapiro2476 (see below). To turn off the default definition for the MSA, 427164562Sgshapirouse FEATURE(`no_default_msa') (see also FEATURES). If you use 427264562Sgshapiroadditional DAEMON_OPTIONS macros, they will add additional daemons. 427364562Sgshapiro 427464562SgshapiroExample 1: To change the port for the SMTP listener, while 427564562Sgshapirostill using the MSA default, use 427664562Sgshapiro DAEMON_OPTIONS(`Port=925, Name=MTA') 427764562Sgshapiro 427864562SgshapiroExample 2: To change the port for the MSA daemon, while still 427964562Sgshapirousing the default SMTP port, use 428064562Sgshapiro FEATURE(`no_default_msa') 428164562Sgshapiro DAEMON_OPTIONS(`Name=MTA') 428264562Sgshapiro DAEMON_OPTIONS(`Port=987, Name=MSA, M=E') 428364562Sgshapiro 428464562SgshapiroNote that if the first of those DAEMON_OPTIONS lines were omitted, then 428564562Sgshapirothere would be no listener on the standard SMTP port. 428664562Sgshapiro 428764562SgshapiroExample 3: To listen on both IPv4 and IPv6 interfaces, use 428864562Sgshapiro 428964562Sgshapiro DAEMON_OPTIONS(`Name=MTA-v4, Family=inet') 429064562Sgshapiro DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6') 429164562Sgshapiro 429264562SgshapiroA "Message Submission Agent" still uses all of the same rulesets for 429364562Sgshapiroprocessing the message (and therefore still allows message rejection via 429464562Sgshapirothe check_* rulesets). In accordance with the RFC, the MSA will ensure 4295110560Sgshapirothat all domains in envelope addresses are fully qualified if the message 4296110560Sgshapirois relayed to another MTA. It will also enforce the normal address syntax 4297110560Sgshapirorules and log error messages. Additionally, by using the M=a modifier you 4298110560Sgshapirocan require authentication before messages are accepted by the MSA. 4299110560SgshapiroNotice: Do NOT use the 'a' modifier on a public accessible MTA! Finally, 4300110560Sgshapirothe M=E modifier shown above disables ETRN as required by RFC 2476. 430164562Sgshapiro 430290792SgshapiroMail filters can be defined using the INPUT_MAIL_FILTER() and MAIL_FILTER() 430390792Sgshapirocommands: 430464562Sgshapiro 430590792Sgshapiro INPUT_MAIL_FILTER(`sample', `S=local:/var/run/f1.sock') 430690792Sgshapiro MAIL_FILTER(`myfilter', `S=inet:3333@localhost') 430738032Speter 430890792SgshapiroThe INPUT_MAIL_FILTER() command causes the filter(s) to be called in the 430990792Sgshapirosame order they were specified by also setting confINPUT_MAIL_FILTERS. A 431090792Sgshapirofilter can be defined without adding it to the input filter list by using 431190792SgshapiroMAIL_FILTER() instead of INPUT_MAIL_FILTER() in your .mc file. 431290792SgshapiroAlternatively, you can reset the list of filters and their order by setting 431390792SgshapiroconfINPUT_MAIL_FILTERS option after all INPUT_MAIL_FILTER() commands in 431490792Sgshapiroyour .mc file. 431590792Sgshapiro 431690792Sgshapiro 431790792Sgshapiro+----------------------------+ 431890792Sgshapiro| MESSAGE SUBMISSION PROGRAM | 431990792Sgshapiro+----------------------------+ 432090792Sgshapiro 432190792SgshapiroThe purpose of the message submission program (MSP) is explained 432290792Sgshapiroin sendmail/SECURITY. This section contains a list of caveats and 432390792Sgshapiroa few hints how for those who want to tweak the default configuration 432490792Sgshapirofor it (which is installed as submit.cf). 432590792Sgshapiro 432690792SgshapiroNotice: do not add options/features to submit.mc unless you are 432790792Sgshapiroabsolutely sure you need them. Options you may want to change 432890792Sgshapiroinclude: 432990792Sgshapiro 433094334Sgshapiro- confTRUSTED_USERS, FEATURE(`use_ct_file'), and confCT_FILE for 433198121Sgshapiro avoiding X-Authentication warnings. 433294334Sgshapiro- confTIME_ZONE to change it from the default `USE_TZ'. 433390792Sgshapiro- confDELIVERY_MODE is set to interactive in msp.m4 instead 433490792Sgshapiro of the default background mode. 433598121Sgshapiro- FEATURE(stickyhost) and LOCAL_RELAY to send unqualified addresses 433698121Sgshapiro to the LOCAL_RELAY instead of the default relay. 433798121Sgshapiro- confRAND_FILE if you use STARTTLS and sendmail is not compiled with 433898121Sgshapiro the flag HASURANDOM. 433990792Sgshapiro 434098121SgshapiroThe MSP performs hostname canonicalization by default. As also 434198121Sgshapiroexplained in sendmail/SECURITY, mail may end up for various DNS 434298121Sgshapirorelated reasons in the MSP queue. This problem can be minimized by 434398121Sgshapirousing 434498121Sgshapiro 434598121Sgshapiro FEATURE(`nocanonify', `canonify_hosts') 434698121Sgshapiro define(`confDIRECT_SUBMISSION_MODIFIERS', `C') 434798121Sgshapiro 434898121SgshapiroSee the discussion about nocanonify for possible side effects. 434998121Sgshapiro 435090792SgshapiroSome things are not intended to work with the MSP. These include 435190792Sgshapirofeatures that influence the delivery process (e.g., mailertable, 435290792Sgshapiroaliases), or those that are only important for a SMTP server (e.g., 435390792Sgshapirovirtusertable, DaemonPortOptions, multiple queues). Moreover, 435490792Sgshapirorelaxing certain restrictions (RestrictQueueRun, permissions on 435590792Sgshapiroqueue directory) or adding features (e.g., enabling prog/file mailer) 435690792Sgshapirocan cause security problems. 435790792Sgshapiro 435890792SgshapiroOther things don't work well with the MSP and require tweaking or 435990792Sgshapiroworkarounds. For example, to allow for client authentication it 436090792Sgshapirois not just sufficient to provide a client certificate and the 436190792Sgshapirocorresponding key, but it is also necessary to make the key group 436290792Sgshapiro(smmsp) readable and tell sendmail not to complain about that, i.e., 436390792Sgshapiro 436490792Sgshapiro define(`confDONT_BLAME_SENDMAIL', `GroupReadableKeyFile') 436590792Sgshapiro 436690792SgshapiroIf the MSP should actually use AUTH then the necessary data 436790792Sgshapiroshould be placed in a map as explained in SMTP AUTHENTICATION: 436890792Sgshapiro 436990792SgshapiroFEATURE(`authinfo', `DATABASE_MAP_TYPE /etc/mail/msp-authinfo') 437090792Sgshapiro 437190792Sgshapiro/etc/mail/msp-authinfo should contain an entry like: 437290792Sgshapiro 437390792Sgshapiro AuthInfo:127.0.0.1 "U:smmsp" "P:secret" "M:DIGEST-MD5" 437490792Sgshapiro 437590792SgshapiroThe file and the map created by makemap should be owned by smmsp, 437690792Sgshapiroits group should be smmsp, and it should have mode 640. The database 437790792Sgshapiroused by the MTA for AUTH must have a corresponding entry. 437890792SgshapiroAdditionally the MTA must trust this authentication data so the AUTH= 437990792Sgshapiropart will be relayed on to the next hop. This can be achieved by 438090792Sgshapiroadding the following to your sendmail.mc file: 438190792Sgshapiro 438290792Sgshapiro LOCAL_RULESETS 438390792Sgshapiro SLocal_trust_auth 438490792Sgshapiro R$* $: $&{auth_authen} 438590792Sgshapiro Rsmmsp $# OK 438690792Sgshapiro 4387132943SgshapiroNote: the authentication data can leak to local users who invoke 4388132943Sgshapirothe MSP with debug options or even with -v. For that reason either 4389132943Sgshapiroan authentication mechanism that does not show the password in the 4390132943SgshapiroAUTH dialogue (e.g., DIGEST-MD5) or a different authentication 4391132943Sgshapiromethod like STARTTLS should be used. 4392132943Sgshapiro 439390792Sgshapirofeature/msp.m4 defines almost all settings for the MSP. Most of 439490792Sgshapirothose should not be changed at all. Some of the features and options 439590792Sgshapirocan be overridden if really necessary. It is a bit tricky to do 439690792Sgshapirothis, because it depends on the actual way the option is defined 439790792Sgshapiroin feature/msp.m4. If it is directly defined (i.e., define()) then 439890792Sgshapirothe modified value must be defined after 439990792Sgshapiro 440090792Sgshapiro FEATURE(`msp') 440190792Sgshapiro 440290792SgshapiroIf it is conditionally defined (i.e., ifdef()) then the desired 440390792Sgshapirovalue must be defined before the FEATURE line in the .mc file. 440490792SgshapiroTo see how the options are defined read feature/msp.m4. 440590792Sgshapiro 440690792Sgshapiro 440790792Sgshapiro+--------------------------+ 440890792Sgshapiro| FORMAT OF FILES AND MAPS | 440990792Sgshapiro+--------------------------+ 441090792Sgshapiro 441190792SgshapiroFiles that define classes, i.e., F{classname}, consist of lines 441290792Sgshapiroeach of which contains a single element of the class. For example, 441390792Sgshapiro/etc/mail/local-host-names may have the following content: 441490792Sgshapiro 441590792Sgshapiromy.domain 441690792Sgshapiroanother.domain 441790792Sgshapiro 441890792SgshapiroMaps must be created using makemap(8) , e.g., 441990792Sgshapiro 442090792Sgshapiro makemap hash MAP < MAP 442190792Sgshapiro 442290792SgshapiroIn general, a text file from which a map is created contains lines 442390792Sgshapiroof the form 442490792Sgshapiro 442590792Sgshapirokey value 442690792Sgshapiro 442790792Sgshapirowhere 'key' and 'value' are also called LHS and RHS, respectively. 442890792SgshapiroBy default, the delimiter between LHS and RHS is a non-empty sequence 442990792Sgshapiroof white space characters. 443090792Sgshapiro 443190792Sgshapiro 443290792Sgshapiro+------------------+ 443390792Sgshapiro| DIRECTORY LAYOUT | 443490792Sgshapiro+------------------+ 443590792Sgshapiro 443638032SpeterWithin this directory are several subdirectories, to wit: 443738032Speter 443838032Speterm4 General support routines. These are typically 443938032Speter very important and should not be changed without 444038032Speter very careful consideration. 444138032Speter 444238032Spetercf The configuration files themselves. They have 444338032Speter ".mc" suffixes, and must be run through m4 to 444438032Speter become complete. The resulting output should 444538032Speter have a ".cf" suffix. 444638032Speter 444738032Speterostype Definitions describing a particular operating 444838032Speter system type. These should always be referenced 444938032Speter using the OSTYPE macro in the .mc file. Examples 445038032Speter include "bsd4.3", "bsd4.4", "sunos3.5", and 445138032Speter "sunos4.1". 445238032Speter 445338032Speterdomain Definitions describing a particular domain, referenced 445438032Speter using the DOMAIN macro in the .mc file. These are 445538032Speter site dependent; for example, "CS.Berkeley.EDU.m4" 445638032Speter describes hosts in the CS.Berkeley.EDU subdomain. 445738032Speter 445866494Sgshapiromailer Descriptions of mailers. These are referenced using 445938032Speter the MAILER macro in the .mc file. 446038032Speter 446138032Spetersh Shell files used when building the .cf file from the 446238032Speter .mc file in the cf subdirectory. 446338032Speter 446438032Speterfeature These hold special orthogonal features that you might 446538032Speter want to include. They should be referenced using 446638032Speter the FEATURE macro. 446738032Speter 446838032Speterhack Local hacks. These can be referenced using the HACK 446938032Speter macro. They shouldn't be of more than voyeuristic 447038032Speter interest outside the .Berkeley.EDU domain, but who knows? 447138032Speter 447238032Spetersiteconfig Site configuration -- e.g., tables of locally connected 447338032Speter UUCP sites. 447438032Speter 447538032Speter 447638032Speter+------------------------+ 447738032Speter| ADMINISTRATIVE DETAILS | 447838032Speter+------------------------+ 447938032Speter 448038032SpeterThe following sections detail usage of certain internal parts of the 448138032Spetersendmail.cf file. Read them carefully if you are trying to modify 448238032Speterthe current model. If you find the above descriptions adequate, these 448338032Spetershould be {boring, confusing, tedious, ridiculous} (pick one or more). 448438032Speter 448538032SpeterRULESETS (* means built in to sendmail) 448638032Speter 448738032Speter 0 * Parsing 448838032Speter 1 * Sender rewriting 448938032Speter 2 * Recipient rewriting 449038032Speter 3 * Canonicalization 449138032Speter 4 * Post cleanup 449238032Speter 5 * Local address rewrite (after aliasing) 449338032Speter 1x mailer rules (sender qualification) 449438032Speter 2x mailer rules (recipient qualification) 449538032Speter 3x mailer rules (sender header qualification) 449638032Speter 4x mailer rules (recipient header qualification) 449738032Speter 5x mailer subroutines (general) 449838032Speter 6x mailer subroutines (general) 449938032Speter 7x mailer subroutines (general) 450038032Speter 8x reserved 450138032Speter 90 Mailertable host stripping 450238032Speter 96 Bottom half of Ruleset 3 (ruleset 6 in old sendmail) 450338032Speter 97 Hook for recursive ruleset 0 call (ruleset 7 in old sendmail) 450438032Speter 98 Local part of ruleset 0 (ruleset 8 in old sendmail) 450538032Speter 450638032Speter 450738032SpeterMAILERS 450838032Speter 450938032Speter 0 local, prog local and program mailers 451038032Speter 1 [e]smtp, relay SMTP channel 451138032Speter 2 uucp-* UNIX-to-UNIX Copy Program 451238032Speter 3 netnews Network News delivery 451338032Speter 4 fax Sam Leffler's HylaFAX software 451438032Speter 5 mail11 DECnet mailer 451538032Speter 451638032Speter 451738032SpeterMACROS 451838032Speter 451938032Speter A 452038032Speter B Bitnet Relay 452138032Speter C DECnet Relay 452238032Speter D The local domain -- usually not needed 452338032Speter E reserved for X.400 Relay 452438032Speter F FAX Relay 452538032Speter G 452638032Speter H mail Hub (for mail clusters) 452738032Speter I 452838032Speter J 452938032Speter K 453038032Speter L Luser Relay 453164562Sgshapiro M Masquerade (who you claim to be) 453238032Speter N 453338032Speter O 453438032Speter P 453538032Speter Q 453638032Speter R Relay (for unqualified names) 453738032Speter S Smart Host 453838032Speter T 453964562Sgshapiro U my UUCP name (if you have a UUCP connection) 454064562Sgshapiro V UUCP Relay (class {V} hosts) 454164562Sgshapiro W UUCP Relay (class {W} hosts) 454264562Sgshapiro X UUCP Relay (class {X} hosts) 454338032Speter Y UUCP Relay (all other hosts) 454438032Speter Z Version number 454538032Speter 454638032Speter 454738032SpeterCLASSES 454838032Speter 454938032Speter A 455038032Speter B domains that are candidates for bestmx lookup 455138032Speter C 455238032Speter D 455338032Speter E addresses that should not seem to come from $M 455464562Sgshapiro F hosts this system forward for 455538032Speter G domains that should be looked up in genericstable 455638032Speter H 455738032Speter I 455838032Speter J 455938032Speter K 456038032Speter L addresses that should not be forwarded to $R 456138032Speter M domains that should be mapped to $M 456264562Sgshapiro N host/domains that should not be mapped to $M 456338032Speter O operators that indicate network operations (cannot be in local names) 456438032Speter P top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc. 456538032Speter Q 456664562Sgshapiro R domains this system is willing to relay (pass anti-spam filters) 456738032Speter S 456838032Speter T 456938032Speter U locally connected UUCP hosts 457038032Speter V UUCP hosts connected to relay $V 457138032Speter W UUCP hosts connected to relay $W 457238032Speter X UUCP hosts connected to relay $X 457338032Speter Y locally connected smart UUCP hosts 457438032Speter Z locally connected domain-ized UUCP hosts 457538032Speter . the class containing only a dot 457638032Speter [ the class containing only a left bracket 457738032Speter 457838032Speter 457938032SpeterM4 DIVERSIONS 458038032Speter 458138032Speter 1 Local host detection and resolution 458238032Speter 2 Local Ruleset 3 additions 458338032Speter 3 Local Ruleset 0 additions 458438032Speter 4 UUCP Ruleset 0 additions 458538032Speter 5 locally interpreted names (overrides $R) 458638032Speter 6 local configuration (at top of file) 458738032Speter 7 mailer definitions 458864562Sgshapiro 8 DNS based blacklists 458938032Speter 9 special local rulesets (1 and 2) 459064562Sgshapiro 4591159609Sgshapiro$Revision: 8.706 $, Last updated $Date: 2006/04/18 22:31:06 $ 4592