1*7c478bd9Sstevel@tonic-gate 2*7c478bd9Sstevel@tonic-gate SENDMAIL CONFIGURATION FILES 3*7c478bd9Sstevel@tonic-gate 4*7c478bd9Sstevel@tonic-gateThis document describes the sendmail configuration files. It 5*7c478bd9Sstevel@tonic-gateexplains how to create a sendmail.cf file for use with sendmail. 6*7c478bd9Sstevel@tonic-gateIt also describes how to set options for sendmail which are explained 7*7c478bd9Sstevel@tonic-gatein the Sendmail Installation and Operation guide, which can be found 8*7c478bd9Sstevel@tonic-gateon-line at http://www.sendmail.org/%7Eca/email/doc8.12/op.html . 9*7c478bd9Sstevel@tonic-gateRecall this URL throughout this document when references to 10*7c478bd9Sstevel@tonic-gatedoc/op/op.* are made. 11*7c478bd9Sstevel@tonic-gate 12*7c478bd9Sstevel@tonic-gateTable of Content: 13*7c478bd9Sstevel@tonic-gate 14*7c478bd9Sstevel@tonic-gateINTRODUCTION AND EXAMPLE 15*7c478bd9Sstevel@tonic-gateA BRIEF INTRODUCTION TO M4 16*7c478bd9Sstevel@tonic-gateFILE LOCATIONS 17*7c478bd9Sstevel@tonic-gateOSTYPE 18*7c478bd9Sstevel@tonic-gateDOMAINS 19*7c478bd9Sstevel@tonic-gateMAILERS 20*7c478bd9Sstevel@tonic-gateFEATURES 21*7c478bd9Sstevel@tonic-gateHACKS 22*7c478bd9Sstevel@tonic-gateSITE CONFIGURATION 23*7c478bd9Sstevel@tonic-gateUSING UUCP MAILERS 24*7c478bd9Sstevel@tonic-gateTWEAKING RULESETS 25*7c478bd9Sstevel@tonic-gateMASQUERADING AND RELAYING 26*7c478bd9Sstevel@tonic-gateUSING LDAP FOR ALIASES, MAPS, AND CLASSES 27*7c478bd9Sstevel@tonic-gateLDAP ROUTING 28*7c478bd9Sstevel@tonic-gateANTI-SPAM CONFIGURATION CONTROL 29*7c478bd9Sstevel@tonic-gateCONNECTION CONTROL 30*7c478bd9Sstevel@tonic-gateSTARTTLS 31*7c478bd9Sstevel@tonic-gateADDING NEW MAILERS OR RULESETS 32*7c478bd9Sstevel@tonic-gateADDING NEW MAIL FILTERS 33*7c478bd9Sstevel@tonic-gateQUEUE GROUP DEFINITIONS 34*7c478bd9Sstevel@tonic-gateNON-SMTP BASED CONFIGURATIONS 35*7c478bd9Sstevel@tonic-gateWHO AM I? 36*7c478bd9Sstevel@tonic-gateACCEPTING MAIL FOR MULTIPLE NAMES 37*7c478bd9Sstevel@tonic-gateUSING MAILERTABLES 38*7c478bd9Sstevel@tonic-gateUSING USERDB TO MAP FULL NAMES 39*7c478bd9Sstevel@tonic-gateMISCELLANEOUS SPECIAL FEATURES 40*7c478bd9Sstevel@tonic-gateSECURITY NOTES 41*7c478bd9Sstevel@tonic-gateTWEAKING CONFIGURATION OPTIONS 42*7c478bd9Sstevel@tonic-gateMESSAGE SUBMISSION PROGRAM 43*7c478bd9Sstevel@tonic-gateFORMAT OF FILES AND MAPS 44*7c478bd9Sstevel@tonic-gateDIRECTORY LAYOUT 45*7c478bd9Sstevel@tonic-gateADMINISTRATIVE DETAILS 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gate 48*7c478bd9Sstevel@tonic-gate+--------------------------+ 49*7c478bd9Sstevel@tonic-gate| INTRODUCTION AND EXAMPLE | 50*7c478bd9Sstevel@tonic-gate+--------------------------+ 51*7c478bd9Sstevel@tonic-gate 52*7c478bd9Sstevel@tonic-gateConfiguration files are contained in the subdirectory "cf", with a 53*7c478bd9Sstevel@tonic-gatesuffix ".mc". They must be run through "m4" to produce a ".cf" file. 54*7c478bd9Sstevel@tonic-gateYou must pre-load "cf.m4": 55*7c478bd9Sstevel@tonic-gate 56*7c478bd9Sstevel@tonic-gate m4 ${CFDIR}/m4/cf.m4 config.mc > config.cf 57*7c478bd9Sstevel@tonic-gate 58*7c478bd9Sstevel@tonic-gateAlternatively, you can simply: 59*7c478bd9Sstevel@tonic-gate 60*7c478bd9Sstevel@tonic-gate cd ${CFDIR}/cf 61*7c478bd9Sstevel@tonic-gate /usr/ccs/bin/make config.cf 62*7c478bd9Sstevel@tonic-gate 63*7c478bd9Sstevel@tonic-gatewhere ${CFDIR} is the root of the cf directory and config.mc is the 64*7c478bd9Sstevel@tonic-gatename of your configuration file. If you are running a version of M4 65*7c478bd9Sstevel@tonic-gatethat understands the __file__ builtin (versions of GNU m4 >= 0.75 do 66*7c478bd9Sstevel@tonic-gatethis, but the versions distributed with 4.4BSD and derivatives do not) 67*7c478bd9Sstevel@tonic-gateor the -I flag (ditto), then ${CFDIR} can be in an arbitrary directory. 68*7c478bd9Sstevel@tonic-gateFor "traditional" versions, ${CFDIR} ***MUST*** be "..", or you MUST 69*7c478bd9Sstevel@tonic-gateuse -D_CF_DIR_=/path/to/cf/dir/ -- note the trailing slash! For example: 70*7c478bd9Sstevel@tonic-gate 71*7c478bd9Sstevel@tonic-gate m4 -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 config.mc > config.cf 72*7c478bd9Sstevel@tonic-gate 73*7c478bd9Sstevel@tonic-gateLet's examine a typical .mc file: 74*7c478bd9Sstevel@tonic-gate 75*7c478bd9Sstevel@tonic-gate divert(-1) 76*7c478bd9Sstevel@tonic-gate # 77*7c478bd9Sstevel@tonic-gate # Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers. 78*7c478bd9Sstevel@tonic-gate # All rights reserved. 79*7c478bd9Sstevel@tonic-gate # Copyright (c) 1983 Eric P. Allman. All rights reserved. 80*7c478bd9Sstevel@tonic-gate # Copyright (c) 1988, 1993 81*7c478bd9Sstevel@tonic-gate # The Regents of the University of California. All rights reserved. 82*7c478bd9Sstevel@tonic-gate # 83*7c478bd9Sstevel@tonic-gate # By using this file, you agree to the terms and conditions set 84*7c478bd9Sstevel@tonic-gate # forth in the LICENSE file which can be found at the top level of 85*7c478bd9Sstevel@tonic-gate # the sendmail distribution. 86*7c478bd9Sstevel@tonic-gate # 87*7c478bd9Sstevel@tonic-gate 88*7c478bd9Sstevel@tonic-gate # 89*7c478bd9Sstevel@tonic-gate # This is a Berkeley-specific configuration file for HP-UX 9.x. 90*7c478bd9Sstevel@tonic-gate # It applies only to the Computer Science Division at Berkeley, 91*7c478bd9Sstevel@tonic-gate # and should not be used elsewhere. It is provided on the sendmail 92*7c478bd9Sstevel@tonic-gate # distribution as a sample only. To create your own configuration 93*7c478bd9Sstevel@tonic-gate # file, create an appropriate domain file in ../domain, change the 94*7c478bd9Sstevel@tonic-gate # `DOMAIN' macro below to reference that file, and copy the result 95*7c478bd9Sstevel@tonic-gate # to a name of your own choosing. 96*7c478bd9Sstevel@tonic-gate # 97*7c478bd9Sstevel@tonic-gate divert(0) 98*7c478bd9Sstevel@tonic-gate 99*7c478bd9Sstevel@tonic-gateThe divert(-1) will delete the crud in the resulting output file. 100*7c478bd9Sstevel@tonic-gateThe copyright notice can be replaced by whatever your lawyers require; 101*7c478bd9Sstevel@tonic-gateour lawyers require the one that is included in these files. A copyleft 102*7c478bd9Sstevel@tonic-gateis a copyright by another name. The divert(0) restores regular output. 103*7c478bd9Sstevel@tonic-gate 104*7c478bd9Sstevel@tonic-gate VERSIONID(`<SCCS or RCS version id>') 105*7c478bd9Sstevel@tonic-gate 106*7c478bd9Sstevel@tonic-gateVERSIONID is a macro that stuffs the version information into the 107*7c478bd9Sstevel@tonic-gateresulting file. You could use SCCS, RCS, CVS, something else, or 108*7c478bd9Sstevel@tonic-gateomit it completely. This is not the same as the version id included 109*7c478bd9Sstevel@tonic-gatein SMTP greeting messages -- this is defined in m4/version.m4. 110*7c478bd9Sstevel@tonic-gate 111*7c478bd9Sstevel@tonic-gate OSTYPE(`hpux9')dnl 112*7c478bd9Sstevel@tonic-gate 113*7c478bd9Sstevel@tonic-gateYou must specify an OSTYPE to properly configure things such as the 114*7c478bd9Sstevel@tonic-gatepathname of the help and status files, the flags needed for the local 115*7c478bd9Sstevel@tonic-gatemailer, and other important things. If you omit it, you will get an 116*7c478bd9Sstevel@tonic-gateerror when you try to build the configuration. Look at the ostype 117*7c478bd9Sstevel@tonic-gatedirectory for the list of known operating system types. 118*7c478bd9Sstevel@tonic-gate 119*7c478bd9Sstevel@tonic-gate DOMAIN(`CS.Berkeley.EDU')dnl 120*7c478bd9Sstevel@tonic-gate 121*7c478bd9Sstevel@tonic-gateThis example is specific to the Computer Science Division at Berkeley. 122*7c478bd9Sstevel@tonic-gateYou can use "DOMAIN(`generic')" to get a sufficiently bland definition 123*7c478bd9Sstevel@tonic-gatethat may well work for you, or you can create a customized domain 124*7c478bd9Sstevel@tonic-gatedefinition appropriate for your environment. 125*7c478bd9Sstevel@tonic-gate 126*7c478bd9Sstevel@tonic-gate MAILER(`local') 127*7c478bd9Sstevel@tonic-gate MAILER(`smtp') 128*7c478bd9Sstevel@tonic-gate 129*7c478bd9Sstevel@tonic-gateThese describe the mailers used at the default CS site. The local 130*7c478bd9Sstevel@tonic-gatemailer is always included automatically. Beware: MAILER declarations 131*7c478bd9Sstevel@tonic-gateshould only be followed by LOCAL_* sections. The general rules are 132*7c478bd9Sstevel@tonic-gatethat the order should be: 133*7c478bd9Sstevel@tonic-gate 134*7c478bd9Sstevel@tonic-gate VERSIONID 135*7c478bd9Sstevel@tonic-gate OSTYPE 136*7c478bd9Sstevel@tonic-gate DOMAIN 137*7c478bd9Sstevel@tonic-gate FEATURE 138*7c478bd9Sstevel@tonic-gate local macro definitions 139*7c478bd9Sstevel@tonic-gate MAILER 140*7c478bd9Sstevel@tonic-gate LOCAL_CONFIG 141*7c478bd9Sstevel@tonic-gate LOCAL_RULE_* 142*7c478bd9Sstevel@tonic-gate LOCAL_RULESETS 143*7c478bd9Sstevel@tonic-gate 144*7c478bd9Sstevel@tonic-gateThere are a few exceptions to this rule. Local macro definitions which 145*7c478bd9Sstevel@tonic-gateinfluence a FEATURE() should be done before that feature. For example, 146*7c478bd9Sstevel@tonic-gatea define(`PROCMAIL_MAILER_PATH', ...) should be done before 147*7c478bd9Sstevel@tonic-gateFEATURE(`local_procmail'). 148*7c478bd9Sstevel@tonic-gate 149*7c478bd9Sstevel@tonic-gate 150*7c478bd9Sstevel@tonic-gate+----------------------------+ 151*7c478bd9Sstevel@tonic-gate| A BRIEF INTRODUCTION TO M4 | 152*7c478bd9Sstevel@tonic-gate+----------------------------+ 153*7c478bd9Sstevel@tonic-gate 154*7c478bd9Sstevel@tonic-gateSendmail uses the M4 macro processor to ``compile'' the configuration 155*7c478bd9Sstevel@tonic-gatefiles. The most important thing to know is that M4 is stream-based, 156*7c478bd9Sstevel@tonic-gatethat is, it doesn't understand about lines. For this reason, in some 157*7c478bd9Sstevel@tonic-gateplaces you may see the word ``dnl'', which stands for ``delete 158*7c478bd9Sstevel@tonic-gatethrough newline''; essentially, it deletes all characters starting 159*7c478bd9Sstevel@tonic-gateat the ``dnl'' up to and including the next newline character. In 160*7c478bd9Sstevel@tonic-gatemost cases sendmail uses this only to avoid lots of unnecessary 161*7c478bd9Sstevel@tonic-gateblank lines in the output. 162*7c478bd9Sstevel@tonic-gate 163*7c478bd9Sstevel@tonic-gateOther important directives are define(A, B) which defines the macro 164*7c478bd9Sstevel@tonic-gate``A'' to have value ``B''. Macros are expanded as they are read, so 165*7c478bd9Sstevel@tonic-gateone normally quotes both values to prevent expansion. For example, 166*7c478bd9Sstevel@tonic-gate 167*7c478bd9Sstevel@tonic-gate define(`SMART_HOST', `smart.foo.com') 168*7c478bd9Sstevel@tonic-gate 169*7c478bd9Sstevel@tonic-gateOne word of warning: M4 macros are expanded even in lines that appear 170*7c478bd9Sstevel@tonic-gateto be comments. For example, if you have 171*7c478bd9Sstevel@tonic-gate 172*7c478bd9Sstevel@tonic-gate # See FEATURE(`foo') above 173*7c478bd9Sstevel@tonic-gate 174*7c478bd9Sstevel@tonic-gateit will not do what you expect, because the FEATURE(`foo') will be 175*7c478bd9Sstevel@tonic-gateexpanded. This also applies to 176*7c478bd9Sstevel@tonic-gate 177*7c478bd9Sstevel@tonic-gate # And then define the $X macro to be the return address 178*7c478bd9Sstevel@tonic-gate 179*7c478bd9Sstevel@tonic-gatebecause ``define'' is an M4 keyword. If you want to use them, surround 180*7c478bd9Sstevel@tonic-gatethem with directed quotes, `like this'. 181*7c478bd9Sstevel@tonic-gate 182*7c478bd9Sstevel@tonic-gateSince m4 uses single quotes (opening "`" and closing "'") to quote 183*7c478bd9Sstevel@tonic-gatearguments, those quotes can't be used in arguments. For example, 184*7c478bd9Sstevel@tonic-gateit is not possible to define a rejection message containing a single 185*7c478bd9Sstevel@tonic-gatequote. Usually there are simple workarounds by changing those 186*7c478bd9Sstevel@tonic-gatemessages; in the worst case it might be ok to change the value 187*7c478bd9Sstevel@tonic-gatedirectly in the generated .cf file, which however is not advised. 188*7c478bd9Sstevel@tonic-gate 189*7c478bd9Sstevel@tonic-gate+----------------+ 190*7c478bd9Sstevel@tonic-gate| FILE LOCATIONS | 191*7c478bd9Sstevel@tonic-gate+----------------+ 192*7c478bd9Sstevel@tonic-gate 193*7c478bd9Sstevel@tonic-gatesendmail 8.9 has introduced a new configuration directory for sendmail 194*7c478bd9Sstevel@tonic-gaterelated files, /etc/mail. The new files available for sendmail 8.9 -- 195*7c478bd9Sstevel@tonic-gatethe class {R} /etc/mail/relay-domains and the access database 196*7c478bd9Sstevel@tonic-gate/etc/mail/access -- take advantage of this new directory. Beginning with 197*7c478bd9Sstevel@tonic-gate8.10, all files will use this directory by default (some options may be 198*7c478bd9Sstevel@tonic-gateset by OSTYPE() files). This new directory should help to restore 199*7c478bd9Sstevel@tonic-gateuniformity to sendmail's file locations. 200*7c478bd9Sstevel@tonic-gate 201*7c478bd9Sstevel@tonic-gateBelow is a table of some of the common changes: 202*7c478bd9Sstevel@tonic-gate 203*7c478bd9Sstevel@tonic-gateOld filename New filename 204*7c478bd9Sstevel@tonic-gate------------ ------------ 205*7c478bd9Sstevel@tonic-gate/etc/bitdomain /etc/mail/bitdomain 206*7c478bd9Sstevel@tonic-gate/etc/domaintable /etc/mail/domaintable 207*7c478bd9Sstevel@tonic-gate/etc/genericstable /etc/mail/genericstable 208*7c478bd9Sstevel@tonic-gate/etc/uudomain /etc/mail/uudomain 209*7c478bd9Sstevel@tonic-gate/etc/virtusertable /etc/mail/virtusertable 210*7c478bd9Sstevel@tonic-gate/etc/userdb /etc/mail/userdb 211*7c478bd9Sstevel@tonic-gate 212*7c478bd9Sstevel@tonic-gate/etc/aliases /etc/mail/aliases 213*7c478bd9Sstevel@tonic-gate/etc/sendmail/aliases /etc/mail/aliases 214*7c478bd9Sstevel@tonic-gate/etc/ucbmail/aliases /etc/mail/aliases 215*7c478bd9Sstevel@tonic-gate/usr/adm/sendmail/aliases /etc/mail/aliases 216*7c478bd9Sstevel@tonic-gate/usr/lib/aliases /etc/mail/aliases 217*7c478bd9Sstevel@tonic-gate/usr/lib/mail/aliases /etc/mail/aliases 218*7c478bd9Sstevel@tonic-gate/usr/ucblib/aliases /etc/mail/aliases 219*7c478bd9Sstevel@tonic-gate 220*7c478bd9Sstevel@tonic-gate/etc/sendmail.cw /etc/mail/local-host-names 221*7c478bd9Sstevel@tonic-gate/etc/mail/sendmail.cw /etc/mail/local-host-names 222*7c478bd9Sstevel@tonic-gate/etc/sendmail/sendmail.cw /etc/mail/local-host-names 223*7c478bd9Sstevel@tonic-gate 224*7c478bd9Sstevel@tonic-gate/etc/sendmail.ct /etc/mail/trusted-users 225*7c478bd9Sstevel@tonic-gate 226*7c478bd9Sstevel@tonic-gate/etc/sendmail.oE /etc/mail/error-header 227*7c478bd9Sstevel@tonic-gate 228*7c478bd9Sstevel@tonic-gate/etc/sendmail.hf /etc/mail/helpfile 229*7c478bd9Sstevel@tonic-gate/etc/mail/sendmail.hf /etc/mail/helpfile 230*7c478bd9Sstevel@tonic-gate/usr/ucblib/sendmail.hf /etc/mail/helpfile 231*7c478bd9Sstevel@tonic-gate/etc/ucbmail/sendmail.hf /etc/mail/helpfile 232*7c478bd9Sstevel@tonic-gate/usr/lib/sendmail.hf /etc/mail/helpfile 233*7c478bd9Sstevel@tonic-gate/usr/share/lib/sendmail.hf /etc/mail/helpfile 234*7c478bd9Sstevel@tonic-gate/usr/share/misc/sendmail.hf /etc/mail/helpfile 235*7c478bd9Sstevel@tonic-gate/share/misc/sendmail.hf /etc/mail/helpfile 236*7c478bd9Sstevel@tonic-gate 237*7c478bd9Sstevel@tonic-gate/etc/service.switch /etc/mail/service.switch 238*7c478bd9Sstevel@tonic-gate 239*7c478bd9Sstevel@tonic-gate/etc/sendmail.st /etc/mail/statistics 240*7c478bd9Sstevel@tonic-gate/etc/mail/sendmail.st /etc/mail/statistics 241*7c478bd9Sstevel@tonic-gate/etc/mailer/sendmail.st /etc/mail/statistics 242*7c478bd9Sstevel@tonic-gate/etc/sendmail/sendmail.st /etc/mail/statistics 243*7c478bd9Sstevel@tonic-gate/usr/lib/sendmail.st /etc/mail/statistics 244*7c478bd9Sstevel@tonic-gate/usr/ucblib/sendmail.st /etc/mail/statistics 245*7c478bd9Sstevel@tonic-gate 246*7c478bd9Sstevel@tonic-gateNote that all of these paths actually use a new m4 macro MAIL_SETTINGS_DIR 247*7c478bd9Sstevel@tonic-gateto create the pathnames. The default value of this variable is 248*7c478bd9Sstevel@tonic-gate`/etc/mail/'. If you set this macro to a different value, you MUST include 249*7c478bd9Sstevel@tonic-gatea trailing slash. 250*7c478bd9Sstevel@tonic-gate 251*7c478bd9Sstevel@tonic-gateNotice: all filenames used in a .mc (or .cf) file should be absolute 252*7c478bd9Sstevel@tonic-gate(starting at the root, i.e., with '/'). Relative filenames most 253*7c478bd9Sstevel@tonic-gatelikely cause surprises during operations (unless otherwise noted). 254*7c478bd9Sstevel@tonic-gate 255*7c478bd9Sstevel@tonic-gate 256*7c478bd9Sstevel@tonic-gate+--------+ 257*7c478bd9Sstevel@tonic-gate| OSTYPE | 258*7c478bd9Sstevel@tonic-gate+--------+ 259*7c478bd9Sstevel@tonic-gate 260*7c478bd9Sstevel@tonic-gateYou MUST define an operating system environment, or the configuration 261*7c478bd9Sstevel@tonic-gatefile build will puke. There are several environments available; look 262*7c478bd9Sstevel@tonic-gateat the "ostype" directory for the current list. This macro changes 263*7c478bd9Sstevel@tonic-gatethings like the location of the alias file and queue directory. Some 264*7c478bd9Sstevel@tonic-gateof these files are identical to one another. 265*7c478bd9Sstevel@tonic-gate 266*7c478bd9Sstevel@tonic-gateIt is IMPERATIVE that the OSTYPE occur before any MAILER definitions. 267*7c478bd9Sstevel@tonic-gateIn general, the OSTYPE macro should go immediately after any version 268*7c478bd9Sstevel@tonic-gateinformation, and MAILER definitions should always go last. 269*7c478bd9Sstevel@tonic-gate 270*7c478bd9Sstevel@tonic-gateOperating system definitions are usually easy to write. They may define 271*7c478bd9Sstevel@tonic-gatethe following variables (everything defaults, so an ostype file may be 272*7c478bd9Sstevel@tonic-gateempty). Unfortunately, the list of configuration-supported systems is 273*7c478bd9Sstevel@tonic-gatenot as broad as the list of source-supported systems, since many of 274*7c478bd9Sstevel@tonic-gatethe source contributors do not include corresponding ostype files. 275*7c478bd9Sstevel@tonic-gate 276*7c478bd9Sstevel@tonic-gateALIAS_FILE [/etc/mail/aliases] The location of the text version 277*7c478bd9Sstevel@tonic-gate of the alias file(s). It can be a comma-separated 278*7c478bd9Sstevel@tonic-gate list of names (but be sure you quote values with 279*7c478bd9Sstevel@tonic-gate commas in them -- for example, use 280*7c478bd9Sstevel@tonic-gate define(`ALIAS_FILE', `a,b') 281*7c478bd9Sstevel@tonic-gate to get "a" and "b" both listed as alias files; 282*7c478bd9Sstevel@tonic-gate otherwise the define() primitive only sees "a"). 283*7c478bd9Sstevel@tonic-gateHELP_FILE [/etc/mail/helpfile] The name of the file 284*7c478bd9Sstevel@tonic-gate containing information printed in response to 285*7c478bd9Sstevel@tonic-gate the SMTP HELP command. 286*7c478bd9Sstevel@tonic-gateQUEUE_DIR [/var/spool/mqueue] The directory containing 287*7c478bd9Sstevel@tonic-gate queue files. To use multiple queues, supply 288*7c478bd9Sstevel@tonic-gate a value ending with an asterisk. For 289*7c478bd9Sstevel@tonic-gate example, /var/spool/mqueue/qd* will use all of the 290*7c478bd9Sstevel@tonic-gate directories or symbolic links to directories 291*7c478bd9Sstevel@tonic-gate beginning with 'qd' in /var/spool/mqueue as queue 292*7c478bd9Sstevel@tonic-gate directories. The names 'qf', 'df', and 'xf' are 293*7c478bd9Sstevel@tonic-gate reserved as specific subdirectories for the 294*7c478bd9Sstevel@tonic-gate corresponding queue file types as explained in 295*7c478bd9Sstevel@tonic-gate doc/op/op.me. See also QUEUE GROUP DEFINITIONS. 296*7c478bd9Sstevel@tonic-gateMSP_QUEUE_DIR [/var/spool/clientmqueue] The directory containing 297*7c478bd9Sstevel@tonic-gate queue files for the MSP (Mail Submission Program). 298*7c478bd9Sstevel@tonic-gateSTATUS_FILE [/etc/mail/statistics] The file containing status 299*7c478bd9Sstevel@tonic-gate information. 300*7c478bd9Sstevel@tonic-gateLOCAL_MAILER_PATH [/bin/mail] The program used to deliver local mail. 301*7c478bd9Sstevel@tonic-gateLOCAL_MAILER_FLAGS [Prmn9] The flags used by the local mailer. The 302*7c478bd9Sstevel@tonic-gate flags lsDFMAw5:/|@q are always included. 303*7c478bd9Sstevel@tonic-gateLOCAL_MAILER_ARGS [mail -d $u] The arguments passed to deliver local 304*7c478bd9Sstevel@tonic-gate mail. 305*7c478bd9Sstevel@tonic-gateLOCAL_MAILER_MAX [undefined] If defined, the maximum size of local 306*7c478bd9Sstevel@tonic-gate mail that you are willing to accept. 307*7c478bd9Sstevel@tonic-gateLOCAL_MAILER_MAXMSGS [undefined] If defined, the maximum number of 308*7c478bd9Sstevel@tonic-gate messages to deliver in a single connection. Only 309*7c478bd9Sstevel@tonic-gate useful for LMTP local mailers. 310*7c478bd9Sstevel@tonic-gateLOCAL_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 311*7c478bd9Sstevel@tonic-gate that ARRIVE from an address that resolves to the 312*7c478bd9Sstevel@tonic-gate local mailer and which are converted to MIME will be 313*7c478bd9Sstevel@tonic-gate labeled with this character set. 314*7c478bd9Sstevel@tonic-gateLOCAL_MAILER_EOL [undefined] If defined, the string to use as the 315*7c478bd9Sstevel@tonic-gate end of line for the local mailer. 316*7c478bd9Sstevel@tonic-gateLOCAL_MAILER_DSN_DIAGNOSTIC_CODE 317*7c478bd9Sstevel@tonic-gate [X-Unix] The DSN Diagnostic-Code value for the 318*7c478bd9Sstevel@tonic-gate local mailer. This should be changed with care. 319*7c478bd9Sstevel@tonic-gateLOCAL_SHELL_PATH [/bin/sh] The shell used to deliver piped email. 320*7c478bd9Sstevel@tonic-gateLOCAL_SHELL_FLAGS [eu9] The flags used by the shell mailer. The 321*7c478bd9Sstevel@tonic-gate flags lsDFM are always included. 322*7c478bd9Sstevel@tonic-gateLOCAL_SHELL_ARGS [sh -c $u] The arguments passed to deliver "prog" 323*7c478bd9Sstevel@tonic-gate mail. 324*7c478bd9Sstevel@tonic-gateLOCAL_SHELL_DIR [$z:/] The directory search path in which the 325*7c478bd9Sstevel@tonic-gate shell should run. 326*7c478bd9Sstevel@tonic-gateLOCAL_MAILER_QGRP [undefined] The queue group for the local mailer. 327*7c478bd9Sstevel@tonic-gateSMTP_MAILER_FLAGS [undefined] Flags added to SMTP mailer. Default 328*7c478bd9Sstevel@tonic-gate flags are `mDFMuX' for all SMTP-based mailers; the 329*7c478bd9Sstevel@tonic-gate "esmtp" mailer adds `a'; "smtp8" adds `8'; and 330*7c478bd9Sstevel@tonic-gate "dsmtp" adds `%'. 331*7c478bd9Sstevel@tonic-gateRELAY_MAILER_FLAGS [undefined] Flags added to the relay mailer. Default 332*7c478bd9Sstevel@tonic-gate flags are `mDFMuX' for all SMTP-based mailers; the 333*7c478bd9Sstevel@tonic-gate relay mailer adds `a8'. If this is not defined, 334*7c478bd9Sstevel@tonic-gate then SMTP_MAILER_FLAGS is used. 335*7c478bd9Sstevel@tonic-gateSMTP_MAILER_MAX [undefined] The maximum size of messages that will 336*7c478bd9Sstevel@tonic-gate be transported using the smtp, smtp8, esmtp, or dsmtp 337*7c478bd9Sstevel@tonic-gate mailers. 338*7c478bd9Sstevel@tonic-gateSMTP_MAILER_MAXMSGS [undefined] If defined, the maximum number of 339*7c478bd9Sstevel@tonic-gate messages to deliver in a single connection for the 340*7c478bd9Sstevel@tonic-gate smtp, smtp8, esmtp, or dsmtp mailers. 341*7c478bd9Sstevel@tonic-gateSMTP_MAILER_MAXRCPTS [undefined] If defined, the maximum number of 342*7c478bd9Sstevel@tonic-gate recipients to deliver in a single connection for the 343*7c478bd9Sstevel@tonic-gate smtp, smtp8, esmtp, or dsmtp mailers. 344*7c478bd9Sstevel@tonic-gateSMTP_MAILER_ARGS [TCP $h] The arguments passed to the smtp mailer. 345*7c478bd9Sstevel@tonic-gate About the only reason you would want to change this 346*7c478bd9Sstevel@tonic-gate would be to change the default port. 347*7c478bd9Sstevel@tonic-gateESMTP_MAILER_ARGS [TCP $h] The arguments passed to the esmtp mailer. 348*7c478bd9Sstevel@tonic-gateSMTP8_MAILER_ARGS [TCP $h] The arguments passed to the smtp8 mailer. 349*7c478bd9Sstevel@tonic-gateDSMTP_MAILER_ARGS [TCP $h] The arguments passed to the dsmtp mailer. 350*7c478bd9Sstevel@tonic-gateRELAY_MAILER_ARGS [TCP $h] The arguments passed to the relay mailer. 351*7c478bd9Sstevel@tonic-gateSMTP_MAILER_QGRP [undefined] The queue group for the smtp mailer. 352*7c478bd9Sstevel@tonic-gateESMTP_MAILER_QGRP [undefined] The queue group for the esmtp mailer. 353*7c478bd9Sstevel@tonic-gateSMTP8_MAILER_QGRP [undefined] The queue group for the smtp8 mailer. 354*7c478bd9Sstevel@tonic-gateDSMTP_MAILER_QGRP [undefined] The queue group for the dsmtp mailer. 355*7c478bd9Sstevel@tonic-gateRELAY_MAILER_QGRP [undefined] The queue group for the relay mailer. 356*7c478bd9Sstevel@tonic-gateRELAY_MAILER_MAXMSGS [undefined] If defined, the maximum number of 357*7c478bd9Sstevel@tonic-gate messages to deliver in a single connection for the 358*7c478bd9Sstevel@tonic-gate relay mailer. 359*7c478bd9Sstevel@tonic-gateSMTP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 360*7c478bd9Sstevel@tonic-gate that ARRIVE from an address that resolves to one of 361*7c478bd9Sstevel@tonic-gate the SMTP mailers and which are converted to MIME will 362*7c478bd9Sstevel@tonic-gate be labeled with this character set. 363*7c478bd9Sstevel@tonic-gateUUCP_MAILER_PATH [/usr/bin/uux] The program used to send UUCP mail. 364*7c478bd9Sstevel@tonic-gateUUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer. Default 365*7c478bd9Sstevel@tonic-gate flags are `DFMhuU' (and `m' for uucp-new mailer, 366*7c478bd9Sstevel@tonic-gate minus `U' for uucp-dom mailer). 367*7c478bd9Sstevel@tonic-gateUUCP_MAILER_ARGS [uux - -r -z -a$g -gC $h!rmail ($u)] The arguments 368*7c478bd9Sstevel@tonic-gate passed to the UUCP mailer. 369*7c478bd9Sstevel@tonic-gateUUCP_MAILER_MAX [100000] The maximum size message accepted for 370*7c478bd9Sstevel@tonic-gate transmission by the UUCP mailers. 371*7c478bd9Sstevel@tonic-gateUUCP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 372*7c478bd9Sstevel@tonic-gate that ARRIVE from an address that resolves to one of 373*7c478bd9Sstevel@tonic-gate the UUCP mailers and which are converted to MIME will 374*7c478bd9Sstevel@tonic-gate be labeled with this character set. 375*7c478bd9Sstevel@tonic-gateUUCP_MAILER_QGRP [undefined] The queue group for the UUCP mailers. 376*7c478bd9Sstevel@tonic-gatePROCMAIL_MAILER_PATH [/usr/local/bin/procmail] The path to the procmail 377*7c478bd9Sstevel@tonic-gate program. This is also used by 378*7c478bd9Sstevel@tonic-gate FEATURE(`local_procmail'). 379*7c478bd9Sstevel@tonic-gatePROCMAIL_MAILER_FLAGS [SPhnu9] Flags added to Procmail mailer. Flags 380*7c478bd9Sstevel@tonic-gate DFM are always set. This is NOT used by 381*7c478bd9Sstevel@tonic-gate FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS 382*7c478bd9Sstevel@tonic-gate instead. 383*7c478bd9Sstevel@tonic-gatePROCMAIL_MAILER_ARGS [procmail -Y -m $h $f $u] The arguments passed to 384*7c478bd9Sstevel@tonic-gate the Procmail mailer. This is NOT used by 385*7c478bd9Sstevel@tonic-gate FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS 386*7c478bd9Sstevel@tonic-gate instead. 387*7c478bd9Sstevel@tonic-gatePROCMAIL_MAILER_MAX [undefined] If set, the maximum size message that 388*7c478bd9Sstevel@tonic-gate will be accepted by the procmail mailer. 389*7c478bd9Sstevel@tonic-gatePROCMAIL_MAILER_QGRP [undefined] The queue group for the procmail mailer. 390*7c478bd9Sstevel@tonic-gateconfEBINDIR [/usr/libexec] The directory for executables. 391*7c478bd9Sstevel@tonic-gate Currently used for FEATURE(`local_lmtp') and 392*7c478bd9Sstevel@tonic-gate FEATURE(`smrsh'). 393*7c478bd9Sstevel@tonic-gateLOCAL_PROG_QGRP [undefined] The queue group for the prog mailer. 394*7c478bd9Sstevel@tonic-gate 395*7c478bd9Sstevel@tonic-gateNote: to tweak Name_MAILER_FLAGS use the macro MODIFY_MAILER_FLAGS: 396*7c478bd9Sstevel@tonic-gateMODIFY_MAILER_FLAGS(`Name', `change') where Name is the first part of 397*7c478bd9Sstevel@tonic-gatethe macro Name_MAILER_FLAGS and change can be: flags that should 398*7c478bd9Sstevel@tonic-gatebe used directly (thus overriding the default value), or if it 399*7c478bd9Sstevel@tonic-gatestarts with `+' (`-') then those flags are added to (removed from) 400*7c478bd9Sstevel@tonic-gatethe default value. Example: 401*7c478bd9Sstevel@tonic-gate 402*7c478bd9Sstevel@tonic-gate MODIFY_MAILER_FLAGS(`LOCAL', `+e') 403*7c478bd9Sstevel@tonic-gate 404*7c478bd9Sstevel@tonic-gatewill add the flag `e' to LOCAL_MAILER_FLAGS. Notice: there are 405*7c478bd9Sstevel@tonic-gateseveral smtp mailers all of which are manipulated individually. 406*7c478bd9Sstevel@tonic-gateSee the section MAILERS for the available mailer names. 407*7c478bd9Sstevel@tonic-gateWARNING: The FEATUREs local_lmtp and local_procmail set LOCAL_MAILER_FLAGS 408*7c478bd9Sstevel@tonic-gateunconditionally, i.e., without respecting any definitions in an 409*7c478bd9Sstevel@tonic-gateOSTYPE setting. 410*7c478bd9Sstevel@tonic-gate 411*7c478bd9Sstevel@tonic-gate 412*7c478bd9Sstevel@tonic-gate+---------+ 413*7c478bd9Sstevel@tonic-gate| DOMAINS | 414*7c478bd9Sstevel@tonic-gate+---------+ 415*7c478bd9Sstevel@tonic-gate 416*7c478bd9Sstevel@tonic-gateYou will probably want to collect domain-dependent defines into one 417*7c478bd9Sstevel@tonic-gatefile, referenced by the DOMAIN macro. For example, the Berkeley 418*7c478bd9Sstevel@tonic-gatedomain file includes definitions for several internal distinguished 419*7c478bd9Sstevel@tonic-gatehosts: 420*7c478bd9Sstevel@tonic-gate 421*7c478bd9Sstevel@tonic-gateUUCP_RELAY The host that will accept UUCP-addressed email. 422*7c478bd9Sstevel@tonic-gate If not defined, all UUCP sites must be directly 423*7c478bd9Sstevel@tonic-gate connected. 424*7c478bd9Sstevel@tonic-gateBITNET_RELAY The host that will accept BITNET-addressed email. 425*7c478bd9Sstevel@tonic-gate If not defined, the .BITNET pseudo-domain won't work. 426*7c478bd9Sstevel@tonic-gateDECNET_RELAY The host that will accept DECNET-addressed email. 427*7c478bd9Sstevel@tonic-gate If not defined, the .DECNET pseudo-domain and addresses 428*7c478bd9Sstevel@tonic-gate of the form node::user will not work. 429*7c478bd9Sstevel@tonic-gateFAX_RELAY The host that will accept mail to the .FAX pseudo-domain. 430*7c478bd9Sstevel@tonic-gate The "fax" mailer overrides this value. 431*7c478bd9Sstevel@tonic-gateLOCAL_RELAY The site that will handle unqualified names -- that 432*7c478bd9Sstevel@tonic-gate is, names without an @domain extension. 433*7c478bd9Sstevel@tonic-gate Normally MAIL_HUB is preferred for this function. 434*7c478bd9Sstevel@tonic-gate LOCAL_RELAY is mostly useful in conjunction with 435*7c478bd9Sstevel@tonic-gate FEATURE(`stickyhost') -- see the discussion of 436*7c478bd9Sstevel@tonic-gate stickyhost below. If not set, they are assumed to 437*7c478bd9Sstevel@tonic-gate belong on this machine. This allows you to have a 438*7c478bd9Sstevel@tonic-gate central site to store a company- or department-wide 439*7c478bd9Sstevel@tonic-gate alias database. This only works at small sites, 440*7c478bd9Sstevel@tonic-gate and only with some user agents. 441*7c478bd9Sstevel@tonic-gateLUSER_RELAY The site that will handle lusers -- that is, apparently 442*7c478bd9Sstevel@tonic-gate local names that aren't local accounts or aliases. To 443*7c478bd9Sstevel@tonic-gate specify a local user instead of a site, set this to 444*7c478bd9Sstevel@tonic-gate ``local:username''. 445*7c478bd9Sstevel@tonic-gate 446*7c478bd9Sstevel@tonic-gateAny of these can be either ``mailer:hostname'' (in which case the 447*7c478bd9Sstevel@tonic-gatemailer is the internal mailer name, such as ``uucp-new'' and the hostname 448*7c478bd9Sstevel@tonic-gateis the name of the host as appropriate for that mailer) or just a 449*7c478bd9Sstevel@tonic-gate``hostname'', in which case a default mailer type (usually ``relay'', 450*7c478bd9Sstevel@tonic-gatea variant on SMTP) is used. WARNING: if you have a wildcard MX 451*7c478bd9Sstevel@tonic-gaterecord matching your domain, you probably want to define these to 452*7c478bd9Sstevel@tonic-gatehave a trailing dot so that you won't get the mail diverted back 453*7c478bd9Sstevel@tonic-gateto yourself. 454*7c478bd9Sstevel@tonic-gate 455*7c478bd9Sstevel@tonic-gateThe domain file can also be used to define a domain name, if needed 456*7c478bd9Sstevel@tonic-gate(using "DD<domain>") and set certain site-wide features. If all hosts 457*7c478bd9Sstevel@tonic-gateat your site masquerade behind one email name, you could also use 458*7c478bd9Sstevel@tonic-gateMASQUERADE_AS here. 459*7c478bd9Sstevel@tonic-gate 460*7c478bd9Sstevel@tonic-gateYou do not have to define a domain -- in particular, if you are a 461*7c478bd9Sstevel@tonic-gatesingle machine sitting off somewhere, it is probably more work than 462*7c478bd9Sstevel@tonic-gateit's worth. This is just a mechanism for combining "domain dependent 463*7c478bd9Sstevel@tonic-gateknowledge" into one place. 464*7c478bd9Sstevel@tonic-gate 465*7c478bd9Sstevel@tonic-gate 466*7c478bd9Sstevel@tonic-gate+---------+ 467*7c478bd9Sstevel@tonic-gate| MAILERS | 468*7c478bd9Sstevel@tonic-gate+---------+ 469*7c478bd9Sstevel@tonic-gate 470*7c478bd9Sstevel@tonic-gateThere are fewer mailers supported in this version than the previous 471*7c478bd9Sstevel@tonic-gateversion, owing mostly to a simpler world. As a general rule, put the 472*7c478bd9Sstevel@tonic-gateMAILER definitions last in your .mc file. 473*7c478bd9Sstevel@tonic-gate 474*7c478bd9Sstevel@tonic-gatelocal The local and prog mailers. You will almost always 475*7c478bd9Sstevel@tonic-gate need these; the only exception is if you relay ALL 476*7c478bd9Sstevel@tonic-gate your mail to another site. This mailer is included 477*7c478bd9Sstevel@tonic-gate automatically. 478*7c478bd9Sstevel@tonic-gate 479*7c478bd9Sstevel@tonic-gatesmtp The Simple Mail Transport Protocol mailer. This does 480*7c478bd9Sstevel@tonic-gate not hide hosts behind a gateway or another other 481*7c478bd9Sstevel@tonic-gate such hack; it assumes a world where everyone is 482*7c478bd9Sstevel@tonic-gate running the name server. This file actually defines 483*7c478bd9Sstevel@tonic-gate five mailers: "smtp" for regular (old-style) SMTP to 484*7c478bd9Sstevel@tonic-gate other servers, "esmtp" for extended SMTP to other 485*7c478bd9Sstevel@tonic-gate servers, "smtp8" to do SMTP to other servers without 486*7c478bd9Sstevel@tonic-gate converting 8-bit data to MIME (essentially, this is 487*7c478bd9Sstevel@tonic-gate your statement that you know the other end is 8-bit 488*7c478bd9Sstevel@tonic-gate clean even if it doesn't say so), "dsmtp" to do on 489*7c478bd9Sstevel@tonic-gate demand delivery, and "relay" for transmission to the 490*7c478bd9Sstevel@tonic-gate RELAY_HOST, LUSER_RELAY, or MAIL_HUB. 491*7c478bd9Sstevel@tonic-gate 492*7c478bd9Sstevel@tonic-gateuucp The UNIX-to-UNIX Copy Program mailer. Actually, this 493*7c478bd9Sstevel@tonic-gate defines two mailers, "uucp-old" (a.k.a. "uucp") and 494*7c478bd9Sstevel@tonic-gate "uucp-new" (a.k.a. "suucp"). The latter is for when you 495*7c478bd9Sstevel@tonic-gate know that the UUCP mailer at the other end can handle 496*7c478bd9Sstevel@tonic-gate multiple recipients in one transfer. If the smtp mailer 497*7c478bd9Sstevel@tonic-gate is included in your configuration, two other mailers 498*7c478bd9Sstevel@tonic-gate ("uucp-dom" and "uucp-uudom") are also defined [warning: you 499*7c478bd9Sstevel@tonic-gate MUST specify MAILER(`smtp') before MAILER(`uucp')]. When you 500*7c478bd9Sstevel@tonic-gate include the uucp mailer, sendmail looks for all names in 501*7c478bd9Sstevel@tonic-gate class {U} and sends them to the uucp-old mailer; all 502*7c478bd9Sstevel@tonic-gate names in class {Y} are sent to uucp-new; and all 503*7c478bd9Sstevel@tonic-gate names in class {Z} are sent to uucp-uudom. Note that 504*7c478bd9Sstevel@tonic-gate this is a function of what version of rmail runs on 505*7c478bd9Sstevel@tonic-gate the receiving end, and hence may be out of your control. 506*7c478bd9Sstevel@tonic-gate See the section below describing UUCP mailers in more 507*7c478bd9Sstevel@tonic-gate detail. 508*7c478bd9Sstevel@tonic-gate 509*7c478bd9Sstevel@tonic-gateprocmail An interface to procmail (does not come with sendmail). 510*7c478bd9Sstevel@tonic-gate This is designed to be used in mailertables. For example, 511*7c478bd9Sstevel@tonic-gate a common question is "how do I forward all mail for a given 512*7c478bd9Sstevel@tonic-gate domain to a single person?". If you have this mailer 513*7c478bd9Sstevel@tonic-gate defined, you could set up a mailertable reading: 514*7c478bd9Sstevel@tonic-gate 515*7c478bd9Sstevel@tonic-gate host.com procmail:/etc/procmailrcs/host.com 516*7c478bd9Sstevel@tonic-gate 517*7c478bd9Sstevel@tonic-gate with the file /etc/procmailrcs/host.com reading: 518*7c478bd9Sstevel@tonic-gate 519*7c478bd9Sstevel@tonic-gate :0 # forward mail for host.com 520*7c478bd9Sstevel@tonic-gate ! -oi -f $1 person@other.host 521*7c478bd9Sstevel@tonic-gate 522*7c478bd9Sstevel@tonic-gate This would arrange for (anything)@host.com to be sent 523*7c478bd9Sstevel@tonic-gate to person@other.host. In a procmail script, $1 is the 524*7c478bd9Sstevel@tonic-gate name of the sender and $2 is the name of the recipient. 525*7c478bd9Sstevel@tonic-gate If you use this with FEATURE(`local_procmail'), the FEATURE 526*7c478bd9Sstevel@tonic-gate should be listed first. 527*7c478bd9Sstevel@tonic-gate 528*7c478bd9Sstevel@tonic-gate Of course there are other ways to solve this particular 529*7c478bd9Sstevel@tonic-gate problem, e.g., a catch-all entry in a virtusertable. 530*7c478bd9Sstevel@tonic-gate 531*7c478bd9Sstevel@tonic-gateThe local mailer accepts addresses of the form "user+detail", where 532*7c478bd9Sstevel@tonic-gatethe "+detail" is not used for mailbox matching but is available 533*7c478bd9Sstevel@tonic-gateto certain local mail programs (in particular, see 534*7c478bd9Sstevel@tonic-gateFEATURE(`local_procmail')). For example, "eric", "eric+sendmail", and 535*7c478bd9Sstevel@tonic-gate"eric+sww" all indicate the same user, but additional arguments <null>, 536*7c478bd9Sstevel@tonic-gate"sendmail", and "sww" may be provided for use in sorting mail. 537*7c478bd9Sstevel@tonic-gate 538*7c478bd9Sstevel@tonic-gate 539*7c478bd9Sstevel@tonic-gate+----------+ 540*7c478bd9Sstevel@tonic-gate| FEATURES | 541*7c478bd9Sstevel@tonic-gate+----------+ 542*7c478bd9Sstevel@tonic-gate 543*7c478bd9Sstevel@tonic-gateSpecial features can be requested using the "FEATURE" macro. For 544*7c478bd9Sstevel@tonic-gateexample, the .mc line: 545*7c478bd9Sstevel@tonic-gate 546*7c478bd9Sstevel@tonic-gate FEATURE(`use_cw_file') 547*7c478bd9Sstevel@tonic-gate 548*7c478bd9Sstevel@tonic-gatetells sendmail that you want to have it read an /etc/mail/local-host-names 549*7c478bd9Sstevel@tonic-gatefile to get values for class {w}. A FEATURE may contain up to 9 550*7c478bd9Sstevel@tonic-gateoptional parameters -- for example: 551*7c478bd9Sstevel@tonic-gate 552*7c478bd9Sstevel@tonic-gate FEATURE(`mailertable', `dbm /usr/lib/mailertable') 553*7c478bd9Sstevel@tonic-gate 554*7c478bd9Sstevel@tonic-gateThe default database map type for the table features can be set with 555*7c478bd9Sstevel@tonic-gate 556*7c478bd9Sstevel@tonic-gate define(`DATABASE_MAP_TYPE', `dbm') 557*7c478bd9Sstevel@tonic-gate 558*7c478bd9Sstevel@tonic-gatewhich would set it to use ndbm databases. The default is the Berkeley DB 559*7c478bd9Sstevel@tonic-gatehash database format. Note that you must still declare a database map type 560*7c478bd9Sstevel@tonic-gateif you specify an argument to a FEATURE. DATABASE_MAP_TYPE is only used 561*7c478bd9Sstevel@tonic-gateif no argument is given for the FEATURE. It must be specified before any 562*7c478bd9Sstevel@tonic-gatefeature that uses a map. 563*7c478bd9Sstevel@tonic-gate 564*7c478bd9Sstevel@tonic-gateAlso, features which can take a map definition as an argument can also take 565*7c478bd9Sstevel@tonic-gatethe special keyword `LDAP'. If that keyword is used, the map will use the 566*7c478bd9Sstevel@tonic-gateLDAP definition described in the ``USING LDAP FOR ALIASES, MAPS, AND 567*7c478bd9Sstevel@tonic-gateCLASSES'' section below. 568*7c478bd9Sstevel@tonic-gate 569*7c478bd9Sstevel@tonic-gateAvailable features are: 570*7c478bd9Sstevel@tonic-gate 571*7c478bd9Sstevel@tonic-gateuse_cw_file Read the file /etc/mail/local-host-names file to get 572*7c478bd9Sstevel@tonic-gate alternate names for this host. This might be used if you 573*7c478bd9Sstevel@tonic-gate were on a host that MXed for a dynamic set of other hosts. 574*7c478bd9Sstevel@tonic-gate If the set is static, just including the line "Cw<name1> 575*7c478bd9Sstevel@tonic-gate <name2> ..." (where the names are fully qualified domain 576*7c478bd9Sstevel@tonic-gate names) is probably superior. The actual filename can be 577*7c478bd9Sstevel@tonic-gate overridden by redefining confCW_FILE. 578*7c478bd9Sstevel@tonic-gate 579*7c478bd9Sstevel@tonic-gateuse_ct_file Read the file /etc/mail/trusted-users file to get the 580*7c478bd9Sstevel@tonic-gate names of users that will be ``trusted'', that is, able to 581*7c478bd9Sstevel@tonic-gate set their envelope from address using -f without generating 582*7c478bd9Sstevel@tonic-gate a warning message. The actual filename can be overridden 583*7c478bd9Sstevel@tonic-gate by redefining confCT_FILE. 584*7c478bd9Sstevel@tonic-gate 585*7c478bd9Sstevel@tonic-gateredirect Reject all mail addressed to "address.REDIRECT" with 586*7c478bd9Sstevel@tonic-gate a ``551 User has moved; please try <address>'' message. 587*7c478bd9Sstevel@tonic-gate If this is set, you can alias people who have left 588*7c478bd9Sstevel@tonic-gate to their new address with ".REDIRECT" appended. 589*7c478bd9Sstevel@tonic-gate 590*7c478bd9Sstevel@tonic-gatenouucp Don't route UUCP addresses. This feature takes one 591*7c478bd9Sstevel@tonic-gate parameter: 592*7c478bd9Sstevel@tonic-gate `reject': reject addresses which have "!" in the local 593*7c478bd9Sstevel@tonic-gate part unless it originates from a system 594*7c478bd9Sstevel@tonic-gate that is allowed to relay. 595*7c478bd9Sstevel@tonic-gate `nospecial': don't do anything special with "!". 596*7c478bd9Sstevel@tonic-gate Warnings: 1. See the notice in the anti-spam section. 597*7c478bd9Sstevel@tonic-gate 2. don't remove "!" from OperatorChars if `reject' is 598*7c478bd9Sstevel@tonic-gate given as parameter. 599*7c478bd9Sstevel@tonic-gate 600*7c478bd9Sstevel@tonic-gatenocanonify Don't pass addresses to $[ ... $] for canonification 601*7c478bd9Sstevel@tonic-gate by default, i.e., host/domain names are considered canonical, 602*7c478bd9Sstevel@tonic-gate except for unqualified names, which must not be used in this 603*7c478bd9Sstevel@tonic-gate mode (violation of the standard). It can be changed by 604*7c478bd9Sstevel@tonic-gate setting the DaemonPortOptions modifiers (M=). That is, 605*7c478bd9Sstevel@tonic-gate FEATURE(`nocanonify') will be overridden by setting the 606*7c478bd9Sstevel@tonic-gate 'c' flag. Conversely, if FEATURE(`nocanonify') is not used, 607*7c478bd9Sstevel@tonic-gate it can be emulated by setting the 'C' flag 608*7c478bd9Sstevel@tonic-gate (DaemonPortOptions=Modifiers=C). This would generally only 609*7c478bd9Sstevel@tonic-gate be used by sites that only act as mail gateways or which have 610*7c478bd9Sstevel@tonic-gate user agents that do full canonification themselves. You may 611*7c478bd9Sstevel@tonic-gate also want to use 612*7c478bd9Sstevel@tonic-gate "define(`confBIND_OPTS', `-DNSRCH -DEFNAMES')" to turn off 613*7c478bd9Sstevel@tonic-gate the usual resolver options that do a similar thing. 614*7c478bd9Sstevel@tonic-gate 615*7c478bd9Sstevel@tonic-gate An exception list for FEATURE(`nocanonify') can be 616*7c478bd9Sstevel@tonic-gate specified with CANONIFY_DOMAIN or CANONIFY_DOMAIN_FILE, 617*7c478bd9Sstevel@tonic-gate i.e., a list of domains which are nevertheless passed to 618*7c478bd9Sstevel@tonic-gate $[ ... $] for canonification. This is useful to turn on 619*7c478bd9Sstevel@tonic-gate canonification for local domains, e.g., use 620*7c478bd9Sstevel@tonic-gate CANONIFY_DOMAIN(`my.domain my') to canonify addresses 621*7c478bd9Sstevel@tonic-gate which end in "my.domain" or "my". 622*7c478bd9Sstevel@tonic-gate Another way to require canonification in the local 623*7c478bd9Sstevel@tonic-gate domain is CANONIFY_DOMAIN(`$=m'). 624*7c478bd9Sstevel@tonic-gate 625*7c478bd9Sstevel@tonic-gate A trailing dot is added to addresses with more than 626*7c478bd9Sstevel@tonic-gate one component in it such that other features which 627*7c478bd9Sstevel@tonic-gate expect a trailing dot (e.g., virtusertable) will 628*7c478bd9Sstevel@tonic-gate still work. 629*7c478bd9Sstevel@tonic-gate 630*7c478bd9Sstevel@tonic-gate If `canonify_hosts' is specified as parameter, i.e., 631*7c478bd9Sstevel@tonic-gate FEATURE(`nocanonify', `canonify_hosts'), then 632*7c478bd9Sstevel@tonic-gate addresses which have only a hostname, e.g., 633*7c478bd9Sstevel@tonic-gate <user@host>, will be canonified (and hopefully fully 634*7c478bd9Sstevel@tonic-gate qualified), too. 635*7c478bd9Sstevel@tonic-gate 636*7c478bd9Sstevel@tonic-gatestickyhost This feature is sometimes used with LOCAL_RELAY, 637*7c478bd9Sstevel@tonic-gate although it can be used for a different effect with 638*7c478bd9Sstevel@tonic-gate MAIL_HUB. 639*7c478bd9Sstevel@tonic-gate 640*7c478bd9Sstevel@tonic-gate When used without MAIL_HUB, email sent to 641*7c478bd9Sstevel@tonic-gate "user@local.host" are marked as "sticky" -- that 642*7c478bd9Sstevel@tonic-gate is, the local addresses aren't matched against UDB, 643*7c478bd9Sstevel@tonic-gate don't go through ruleset 5, and are not forwarded to 644*7c478bd9Sstevel@tonic-gate the LOCAL_RELAY (if defined). 645*7c478bd9Sstevel@tonic-gate 646*7c478bd9Sstevel@tonic-gate With MAIL_HUB, mail addressed to "user@local.host" 647*7c478bd9Sstevel@tonic-gate is forwarded to the mail hub, with the envelope 648*7c478bd9Sstevel@tonic-gate address still remaining "user@local.host". 649*7c478bd9Sstevel@tonic-gate Without stickyhost, the envelope would be changed 650*7c478bd9Sstevel@tonic-gate to "user@mail_hub", in order to protect against 651*7c478bd9Sstevel@tonic-gate mailing loops. 652*7c478bd9Sstevel@tonic-gate 653*7c478bd9Sstevel@tonic-gatemailertable Include a "mailer table" which can be used to override 654*7c478bd9Sstevel@tonic-gate routing for particular domains (which are not in class {w}, 655*7c478bd9Sstevel@tonic-gate i.e. local host names). The argument of the FEATURE may be 656*7c478bd9Sstevel@tonic-gate the key definition. If none is specified, the definition 657*7c478bd9Sstevel@tonic-gate used is: 658*7c478bd9Sstevel@tonic-gate 659*7c478bd9Sstevel@tonic-gate hash /etc/mail/mailertable 660*7c478bd9Sstevel@tonic-gate 661*7c478bd9Sstevel@tonic-gate Keys in this database are fully qualified domain names 662*7c478bd9Sstevel@tonic-gate or partial domains preceded by a dot -- for example, 663*7c478bd9Sstevel@tonic-gate "vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU". As a 664*7c478bd9Sstevel@tonic-gate special case of the latter, "." matches any domain not 665*7c478bd9Sstevel@tonic-gate covered by other keys. Values must be of the form: 666*7c478bd9Sstevel@tonic-gate mailer:domain 667*7c478bd9Sstevel@tonic-gate where "mailer" is the internal mailer name, and "domain" 668*7c478bd9Sstevel@tonic-gate is where to send the message. These maps are not 669*7c478bd9Sstevel@tonic-gate reflected into the message header. As a special case, 670*7c478bd9Sstevel@tonic-gate the forms: 671*7c478bd9Sstevel@tonic-gate local:user 672*7c478bd9Sstevel@tonic-gate will forward to the indicated user using the local mailer, 673*7c478bd9Sstevel@tonic-gate local: 674*7c478bd9Sstevel@tonic-gate will forward to the original user in the e-mail address 675*7c478bd9Sstevel@tonic-gate using the local mailer, and 676*7c478bd9Sstevel@tonic-gate error:code message 677*7c478bd9Sstevel@tonic-gate error:D.S.N:code message 678*7c478bd9Sstevel@tonic-gate will give an error message with the indicated SMTP reply 679*7c478bd9Sstevel@tonic-gate code and message, where D.S.N is an RFC 1893 compliant 680*7c478bd9Sstevel@tonic-gate error code. 681*7c478bd9Sstevel@tonic-gate 682*7c478bd9Sstevel@tonic-gatedomaintable Include a "domain table" which can be used to provide 683*7c478bd9Sstevel@tonic-gate domain name mapping. Use of this should really be 684*7c478bd9Sstevel@tonic-gate limited to your own domains. It may be useful if you 685*7c478bd9Sstevel@tonic-gate change names (e.g., your company changes names from 686*7c478bd9Sstevel@tonic-gate oldname.com to newname.com). The argument of the 687*7c478bd9Sstevel@tonic-gate FEATURE may be the key definition. If none is specified, 688*7c478bd9Sstevel@tonic-gate the definition used is: 689*7c478bd9Sstevel@tonic-gate 690*7c478bd9Sstevel@tonic-gate hash /etc/mail/domaintable 691*7c478bd9Sstevel@tonic-gate 692*7c478bd9Sstevel@tonic-gate The key in this table is the domain name; the value is 693*7c478bd9Sstevel@tonic-gate the new (fully qualified) domain. Anything in the 694*7c478bd9Sstevel@tonic-gate domaintable is reflected into headers; that is, this 695*7c478bd9Sstevel@tonic-gate is done in ruleset 3. 696*7c478bd9Sstevel@tonic-gate 697*7c478bd9Sstevel@tonic-gatebitdomain Look up bitnet hosts in a table to try to turn them into 698*7c478bd9Sstevel@tonic-gate internet addresses. The table can be built using the 699*7c478bd9Sstevel@tonic-gate bitdomain program contributed by John Gardiner Myers. 700*7c478bd9Sstevel@tonic-gate The argument of the FEATURE may be the key definition; if 701*7c478bd9Sstevel@tonic-gate none is specified, the definition used is: 702*7c478bd9Sstevel@tonic-gate 703*7c478bd9Sstevel@tonic-gate hash /etc/mail/bitdomain 704*7c478bd9Sstevel@tonic-gate 705*7c478bd9Sstevel@tonic-gate Keys are the bitnet hostname; values are the corresponding 706*7c478bd9Sstevel@tonic-gate internet hostname. 707*7c478bd9Sstevel@tonic-gate 708*7c478bd9Sstevel@tonic-gateuucpdomain Similar feature for UUCP hosts. The default map definition 709*7c478bd9Sstevel@tonic-gate is: 710*7c478bd9Sstevel@tonic-gate 711*7c478bd9Sstevel@tonic-gate hash /etc/mail/uudomain 712*7c478bd9Sstevel@tonic-gate 713*7c478bd9Sstevel@tonic-gate At the moment there is no automagic tool to build this 714*7c478bd9Sstevel@tonic-gate database. 715*7c478bd9Sstevel@tonic-gate 716*7c478bd9Sstevel@tonic-gatealways_add_domain 717*7c478bd9Sstevel@tonic-gate Include the local host domain even on locally delivered 718*7c478bd9Sstevel@tonic-gate mail. Normally it is not added on unqualified names. 719*7c478bd9Sstevel@tonic-gate However, if you use a shared message store but do not use 720*7c478bd9Sstevel@tonic-gate the same user name space everywhere, you may need the host 721*7c478bd9Sstevel@tonic-gate name on local names. An optional argument specifies 722*7c478bd9Sstevel@tonic-gate another domain to be added than the local. 723*7c478bd9Sstevel@tonic-gate 724*7c478bd9Sstevel@tonic-gateallmasquerade If masquerading is enabled (using MASQUERADE_AS), this 725*7c478bd9Sstevel@tonic-gate feature will cause recipient addresses to also masquerade 726*7c478bd9Sstevel@tonic-gate as being from the masquerade host. Normally they get 727*7c478bd9Sstevel@tonic-gate the local hostname. Although this may be right for 728*7c478bd9Sstevel@tonic-gate ordinary users, it can break local aliases. For example, 729*7c478bd9Sstevel@tonic-gate if you send to "localalias", the originating sendmail will 730*7c478bd9Sstevel@tonic-gate find that alias and send to all members, but send the 731*7c478bd9Sstevel@tonic-gate message with "To: localalias@masqueradehost". Since that 732*7c478bd9Sstevel@tonic-gate alias likely does not exist, replies will fail. Use this 733*7c478bd9Sstevel@tonic-gate feature ONLY if you can guarantee that the ENTIRE 734*7c478bd9Sstevel@tonic-gate namespace on your masquerade host supersets all the 735*7c478bd9Sstevel@tonic-gate local entries. 736*7c478bd9Sstevel@tonic-gate 737*7c478bd9Sstevel@tonic-gatelimited_masquerade 738*7c478bd9Sstevel@tonic-gate Normally, any hosts listed in class {w} are masqueraded. If 739*7c478bd9Sstevel@tonic-gate this feature is given, only the hosts listed in class {M} (see 740*7c478bd9Sstevel@tonic-gate below: MASQUERADE_DOMAIN) are masqueraded. This is useful 741*7c478bd9Sstevel@tonic-gate if you have several domains with disjoint namespaces hosted 742*7c478bd9Sstevel@tonic-gate on the same machine. 743*7c478bd9Sstevel@tonic-gate 744*7c478bd9Sstevel@tonic-gatemasquerade_entire_domain 745*7c478bd9Sstevel@tonic-gate If masquerading is enabled (using MASQUERADE_AS) and 746*7c478bd9Sstevel@tonic-gate MASQUERADE_DOMAIN (see below) is set, this feature will 747*7c478bd9Sstevel@tonic-gate cause addresses to be rewritten such that the masquerading 748*7c478bd9Sstevel@tonic-gate domains are actually entire domains to be hidden. All 749*7c478bd9Sstevel@tonic-gate hosts within the masquerading domains will be rewritten 750*7c478bd9Sstevel@tonic-gate to the masquerade name (used in MASQUERADE_AS). For example, 751*7c478bd9Sstevel@tonic-gate if you have: 752*7c478bd9Sstevel@tonic-gate 753*7c478bd9Sstevel@tonic-gate MASQUERADE_AS(`masq.com') 754*7c478bd9Sstevel@tonic-gate MASQUERADE_DOMAIN(`foo.org') 755*7c478bd9Sstevel@tonic-gate MASQUERADE_DOMAIN(`bar.com') 756*7c478bd9Sstevel@tonic-gate 757*7c478bd9Sstevel@tonic-gate then *foo.org and *bar.com are converted to masq.com. Without 758*7c478bd9Sstevel@tonic-gate this feature, only foo.org and bar.com are masqueraded. 759*7c478bd9Sstevel@tonic-gate 760*7c478bd9Sstevel@tonic-gate NOTE: only domains within your jurisdiction and 761*7c478bd9Sstevel@tonic-gate current hierarchy should be masqueraded using this. 762*7c478bd9Sstevel@tonic-gate 763*7c478bd9Sstevel@tonic-gatelocal_no_masquerade 764*7c478bd9Sstevel@tonic-gate This feature prevents the local mailer from masquerading even 765*7c478bd9Sstevel@tonic-gate if MASQUERADE_AS is used. MASQUERADE_AS will only have effect 766*7c478bd9Sstevel@tonic-gate on addresses of mail going outside the local domain. 767*7c478bd9Sstevel@tonic-gate 768*7c478bd9Sstevel@tonic-gatemasquerade_envelope 769*7c478bd9Sstevel@tonic-gate If masquerading is enabled (using MASQUERADE_AS) or the 770*7c478bd9Sstevel@tonic-gate genericstable is in use, this feature will cause envelope 771*7c478bd9Sstevel@tonic-gate addresses to also masquerade as being from the masquerade 772*7c478bd9Sstevel@tonic-gate host. Normally only the header addresses are masqueraded. 773*7c478bd9Sstevel@tonic-gate 774*7c478bd9Sstevel@tonic-gategenericstable This feature will cause unqualified addresses (i.e., without 775*7c478bd9Sstevel@tonic-gate a domain) and addresses with a domain listed in class {G} 776*7c478bd9Sstevel@tonic-gate to be looked up in a map and turned into another ("generic") 777*7c478bd9Sstevel@tonic-gate form, which can change both the domain name and the user name. 778*7c478bd9Sstevel@tonic-gate Notice: if you use an MSP (as it is default starting with 779*7c478bd9Sstevel@tonic-gate 8.12), the MTA will only receive qualified addresses from the 780*7c478bd9Sstevel@tonic-gate MSP (as required by the RFCs). Hence you need to add your 781*7c478bd9Sstevel@tonic-gate domain to class {G}. This feature is similar to the userdb 782*7c478bd9Sstevel@tonic-gate functionality. The same types of addresses as for 783*7c478bd9Sstevel@tonic-gate masquerading are looked up, i.e., only header sender 784*7c478bd9Sstevel@tonic-gate addresses unless the allmasquerade and/or masquerade_envelope 785*7c478bd9Sstevel@tonic-gate features are given. Qualified addresses must have the domain 786*7c478bd9Sstevel@tonic-gate part in class {G}; entries can be added to this class by the 787*7c478bd9Sstevel@tonic-gate macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE (analogously 788*7c478bd9Sstevel@tonic-gate to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below). 789*7c478bd9Sstevel@tonic-gate 790*7c478bd9Sstevel@tonic-gate The argument of FEATURE(`genericstable') may be the map 791*7c478bd9Sstevel@tonic-gate definition; the default map definition is: 792*7c478bd9Sstevel@tonic-gate 793*7c478bd9Sstevel@tonic-gate hash /etc/mail/genericstable 794*7c478bd9Sstevel@tonic-gate 795*7c478bd9Sstevel@tonic-gate The key for this table is either the full address, the domain 796*7c478bd9Sstevel@tonic-gate (with a leading @; the localpart is passed as first argument) 797*7c478bd9Sstevel@tonic-gate or the unqualified username (tried in the order mentioned); 798*7c478bd9Sstevel@tonic-gate the value is the new user address. If the new user address 799*7c478bd9Sstevel@tonic-gate does not include a domain, it will be qualified in the standard 800*7c478bd9Sstevel@tonic-gate manner, i.e., using $j or the masquerade name. Note that the 801*7c478bd9Sstevel@tonic-gate address being looked up must be fully qualified. For local 802*7c478bd9Sstevel@tonic-gate mail, it is necessary to use FEATURE(`always_add_domain') 803*7c478bd9Sstevel@tonic-gate for the addresses to be qualified. 804*7c478bd9Sstevel@tonic-gate The "+detail" of an address is passed as %1, so entries like 805*7c478bd9Sstevel@tonic-gate 806*7c478bd9Sstevel@tonic-gate old+*@foo.org new+%1@example.com 807*7c478bd9Sstevel@tonic-gate gen+*@foo.org %1@example.com 808*7c478bd9Sstevel@tonic-gate 809*7c478bd9Sstevel@tonic-gate and other forms are possible. 810*7c478bd9Sstevel@tonic-gate 811*7c478bd9Sstevel@tonic-gategenerics_entire_domain 812*7c478bd9Sstevel@tonic-gate If the genericstable is enabled and GENERICS_DOMAIN or 813*7c478bd9Sstevel@tonic-gate GENERICS_DOMAIN_FILE is used, this feature will cause 814*7c478bd9Sstevel@tonic-gate addresses to be searched in the map if their domain 815*7c478bd9Sstevel@tonic-gate parts are subdomains of elements in class {G}. 816*7c478bd9Sstevel@tonic-gate 817*7c478bd9Sstevel@tonic-gatevirtusertable A domain-specific form of aliasing, allowing multiple 818*7c478bd9Sstevel@tonic-gate virtual domains to be hosted on one machine. For example, 819*7c478bd9Sstevel@tonic-gate if the virtuser table contained: 820*7c478bd9Sstevel@tonic-gate 821*7c478bd9Sstevel@tonic-gate info@foo.com foo-info 822*7c478bd9Sstevel@tonic-gate info@bar.com bar-info 823*7c478bd9Sstevel@tonic-gate joe@bar.com error:nouser 550 No such user here 824*7c478bd9Sstevel@tonic-gate jax@bar.com error:5.7.0:550 Address invalid 825*7c478bd9Sstevel@tonic-gate @baz.org jane@example.net 826*7c478bd9Sstevel@tonic-gate 827*7c478bd9Sstevel@tonic-gate then mail addressed to info@foo.com will be sent to the 828*7c478bd9Sstevel@tonic-gate address foo-info, mail addressed to info@bar.com will be 829*7c478bd9Sstevel@tonic-gate delivered to bar-info, and mail addressed to anyone at baz.org 830*7c478bd9Sstevel@tonic-gate will be sent to jane@example.net, mail to joe@bar.com will 831*7c478bd9Sstevel@tonic-gate be rejected with the specified error message, and mail to 832*7c478bd9Sstevel@tonic-gate jax@bar.com will also have a RFC 1893 compliant error code 833*7c478bd9Sstevel@tonic-gate 5.7.0. 834*7c478bd9Sstevel@tonic-gate 835*7c478bd9Sstevel@tonic-gate The username from the original address is passed 836*7c478bd9Sstevel@tonic-gate as %1 allowing: 837*7c478bd9Sstevel@tonic-gate 838*7c478bd9Sstevel@tonic-gate @foo.org %1@example.com 839*7c478bd9Sstevel@tonic-gate 840*7c478bd9Sstevel@tonic-gate meaning someone@foo.org will be sent to someone@example.com. 841*7c478bd9Sstevel@tonic-gate Additionally, if the local part consists of "user+detail" 842*7c478bd9Sstevel@tonic-gate then "detail" is passed as %2 and "+detail" is passed as %3 843*7c478bd9Sstevel@tonic-gate when a match against user+* is attempted, so entries like 844*7c478bd9Sstevel@tonic-gate 845*7c478bd9Sstevel@tonic-gate old+*@foo.org new+%2@example.com 846*7c478bd9Sstevel@tonic-gate gen+*@foo.org %2@example.com 847*7c478bd9Sstevel@tonic-gate +*@foo.org %1%3@example.com 848*7c478bd9Sstevel@tonic-gate X++@foo.org Z%3@example.com 849*7c478bd9Sstevel@tonic-gate @bar.org %1%3 850*7c478bd9Sstevel@tonic-gate 851*7c478bd9Sstevel@tonic-gate and other forms are possible. Note: to preserve "+detail" 852*7c478bd9Sstevel@tonic-gate for a default case (@domain) %1%3 must be used as RHS. 853*7c478bd9Sstevel@tonic-gate There are two wildcards after "+": "+" matches only a non-empty 854*7c478bd9Sstevel@tonic-gate detail, "*" matches also empty details, e.g., user+@foo.org 855*7c478bd9Sstevel@tonic-gate matches +*@foo.org but not ++@foo.org. This can be used 856*7c478bd9Sstevel@tonic-gate to ensure that the parameters %2 and %3 are not empty. 857*7c478bd9Sstevel@tonic-gate 858*7c478bd9Sstevel@tonic-gate All the host names on the left hand side (foo.com, bar.com, 859*7c478bd9Sstevel@tonic-gate and baz.org) must be in class {w} or class {VirtHost}. The 860*7c478bd9Sstevel@tonic-gate latter can be defined by the macros VIRTUSER_DOMAIN or 861*7c478bd9Sstevel@tonic-gate VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 862*7c478bd9Sstevel@tonic-gate MASQUERADE_DOMAIN_FILE, see below). If VIRTUSER_DOMAIN or 863*7c478bd9Sstevel@tonic-gate VIRTUSER_DOMAIN_FILE is used, then the entries of class 864*7c478bd9Sstevel@tonic-gate {VirtHost} are added to class {R}, i.e., relaying is allowed 865*7c478bd9Sstevel@tonic-gate to (and from) those domains. The default map definition is: 866*7c478bd9Sstevel@tonic-gate 867*7c478bd9Sstevel@tonic-gate hash /etc/mail/virtusertable 868*7c478bd9Sstevel@tonic-gate 869*7c478bd9Sstevel@tonic-gate A new definition can be specified as the second argument of 870*7c478bd9Sstevel@tonic-gate the FEATURE macro, such as 871*7c478bd9Sstevel@tonic-gate 872*7c478bd9Sstevel@tonic-gate FEATURE(`virtusertable', `dbm /etc/mail/virtusers') 873*7c478bd9Sstevel@tonic-gate 874*7c478bd9Sstevel@tonic-gatevirtuser_entire_domain 875*7c478bd9Sstevel@tonic-gate If the virtusertable is enabled and VIRTUSER_DOMAIN or 876*7c478bd9Sstevel@tonic-gate VIRTUSER_DOMAIN_FILE is used, this feature will cause 877*7c478bd9Sstevel@tonic-gate addresses to be searched in the map if their domain 878*7c478bd9Sstevel@tonic-gate parts are subdomains of elements in class {VirtHost}. 879*7c478bd9Sstevel@tonic-gate 880*7c478bd9Sstevel@tonic-gateldap_routing Implement LDAP-based e-mail recipient routing according to 881*7c478bd9Sstevel@tonic-gate the Internet Draft draft-lachman-laser-ldap-mail-routing-01. 882*7c478bd9Sstevel@tonic-gate This provides a method to re-route addresses with a 883*7c478bd9Sstevel@tonic-gate domain portion in class {LDAPRoute} to either a 884*7c478bd9Sstevel@tonic-gate different mail host or a different address. Hosts can 885*7c478bd9Sstevel@tonic-gate be added to this class using LDAPROUTE_DOMAIN and 886*7c478bd9Sstevel@tonic-gate LDAPROUTE_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 887*7c478bd9Sstevel@tonic-gate MASQUERADE_DOMAIN_FILE, see below). 888*7c478bd9Sstevel@tonic-gate 889*7c478bd9Sstevel@tonic-gate See the LDAP ROUTING section below for more information. 890*7c478bd9Sstevel@tonic-gate 891*7c478bd9Sstevel@tonic-gatenodns If you aren't running DNS at your site (for example, 892*7c478bd9Sstevel@tonic-gate you are UUCP-only connected). It's hard to consider 893*7c478bd9Sstevel@tonic-gate this a "feature", but hey, it had to go somewhere. 894*7c478bd9Sstevel@tonic-gate Actually, as of 8.7 this is a no-op -- remove "dns" from 895*7c478bd9Sstevel@tonic-gate the hosts service switch entry instead. 896*7c478bd9Sstevel@tonic-gate 897*7c478bd9Sstevel@tonic-gatenullclient This is a special case -- it creates a configuration file 898*7c478bd9Sstevel@tonic-gate containing nothing but support for forwarding all mail to a 899*7c478bd9Sstevel@tonic-gate central hub via a local SMTP-based network. The argument 900*7c478bd9Sstevel@tonic-gate is the name of that hub. 901*7c478bd9Sstevel@tonic-gate 902*7c478bd9Sstevel@tonic-gate The only other feature that should be used in conjunction 903*7c478bd9Sstevel@tonic-gate with this one is FEATURE(`nocanonify'). No mailers 904*7c478bd9Sstevel@tonic-gate should be defined. No aliasing or forwarding is done. 905*7c478bd9Sstevel@tonic-gate 906*7c478bd9Sstevel@tonic-gatelocal_lmtp Use an LMTP capable local mailer. The argument to this 907*7c478bd9Sstevel@tonic-gate feature is the pathname of an LMTP capable mailer. By 908*7c478bd9Sstevel@tonic-gate default, mail.local is used. This is expected to be the 909*7c478bd9Sstevel@tonic-gate mail.local which came with the 8.9 distribution which is 910*7c478bd9Sstevel@tonic-gate LMTP capable. The path to mail.local is set by the 911*7c478bd9Sstevel@tonic-gate confEBINDIR m4 variable -- making the default 912*7c478bd9Sstevel@tonic-gate LOCAL_MAILER_PATH /usr/libexec/mail.local. 913*7c478bd9Sstevel@tonic-gate If a different LMTP capable mailer is used, its pathname 914*7c478bd9Sstevel@tonic-gate can be specified as second parameter and the arguments 915*7c478bd9Sstevel@tonic-gate passed to it (A=) as third parameter, e.g., 916*7c478bd9Sstevel@tonic-gate 917*7c478bd9Sstevel@tonic-gate FEATURE(`local_lmtp', `/usr/local/bin/lmtp', `lmtp') 918*7c478bd9Sstevel@tonic-gate 919*7c478bd9Sstevel@tonic-gate WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally, 920*7c478bd9Sstevel@tonic-gate i.e., without respecting any definitions in an OSTYPE setting. 921*7c478bd9Sstevel@tonic-gate 922*7c478bd9Sstevel@tonic-gatelocal_procmail Use procmail or another delivery agent as the local mailer. 923*7c478bd9Sstevel@tonic-gate The argument to this feature is the pathname of the 924*7c478bd9Sstevel@tonic-gate delivery agent, which defaults to PROCMAIL_MAILER_PATH. 925*7c478bd9Sstevel@tonic-gate Note that this does NOT use PROCMAIL_MAILER_FLAGS or 926*7c478bd9Sstevel@tonic-gate PROCMAIL_MAILER_ARGS for the local mailer; tweak 927*7c478bd9Sstevel@tonic-gate LOCAL_MAILER_FLAGS and LOCAL_MAILER_ARGS instead, or 928*7c478bd9Sstevel@tonic-gate specify the appropriate parameters. When procmail is used, 929*7c478bd9Sstevel@tonic-gate the local mailer can make use of the 930*7c478bd9Sstevel@tonic-gate "user+indicator@local.host" syntax; normally the +indicator 931*7c478bd9Sstevel@tonic-gate is just tossed, but by default it is passed as the -a 932*7c478bd9Sstevel@tonic-gate argument to procmail. 933*7c478bd9Sstevel@tonic-gate 934*7c478bd9Sstevel@tonic-gate This feature can take up to three arguments: 935*7c478bd9Sstevel@tonic-gate 936*7c478bd9Sstevel@tonic-gate 1. Path to the mailer program 937*7c478bd9Sstevel@tonic-gate [default: /usr/local/bin/procmail] 938*7c478bd9Sstevel@tonic-gate 2. Argument vector including name of the program 939*7c478bd9Sstevel@tonic-gate [default: procmail -Y -a $h -d $u] 940*7c478bd9Sstevel@tonic-gate 3. Flags for the mailer [default: SPfhn9] 941*7c478bd9Sstevel@tonic-gate 942*7c478bd9Sstevel@tonic-gate Empty arguments cause the defaults to be taken. 943*7c478bd9Sstevel@tonic-gate Note that if you are on a system with a broken 944*7c478bd9Sstevel@tonic-gate setreuid() call, you may need to add -f $f to the procmail 945*7c478bd9Sstevel@tonic-gate argument vector to pass the proper sender to procmail. 946*7c478bd9Sstevel@tonic-gate 947*7c478bd9Sstevel@tonic-gate For example, this allows it to use the maildrop 948*7c478bd9Sstevel@tonic-gate (http://www.flounder.net/~mrsam/maildrop/) mailer instead 949*7c478bd9Sstevel@tonic-gate by specifying: 950*7c478bd9Sstevel@tonic-gate 951*7c478bd9Sstevel@tonic-gate FEATURE(`local_procmail', `/usr/local/bin/maildrop', 952*7c478bd9Sstevel@tonic-gate `maildrop -d $u') 953*7c478bd9Sstevel@tonic-gate 954*7c478bd9Sstevel@tonic-gate or scanmails using: 955*7c478bd9Sstevel@tonic-gate 956*7c478bd9Sstevel@tonic-gate FEATURE(`local_procmail', `/usr/local/bin/scanmails') 957*7c478bd9Sstevel@tonic-gate 958*7c478bd9Sstevel@tonic-gate WARNING: This feature sets LOCAL_MAILER_FLAGS unconditionally, 959*7c478bd9Sstevel@tonic-gate i.e., without respecting any definitions in an OSTYPE setting. 960*7c478bd9Sstevel@tonic-gate 961*7c478bd9Sstevel@tonic-gatebestmx_is_local Accept mail as though locally addressed for any host that 962*7c478bd9Sstevel@tonic-gate lists us as the best possible MX record. This generates 963*7c478bd9Sstevel@tonic-gate additional DNS traffic, but should be OK for low to 964*7c478bd9Sstevel@tonic-gate medium traffic hosts. The argument may be a set of 965*7c478bd9Sstevel@tonic-gate domains, which will limit the feature to only apply to 966*7c478bd9Sstevel@tonic-gate these domains -- this will reduce unnecessary DNS 967*7c478bd9Sstevel@tonic-gate traffic. THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH 968*7c478bd9Sstevel@tonic-gate WILDCARD MX RECORDS!!! If you have a wildcard MX record 969*7c478bd9Sstevel@tonic-gate that matches your domain, you cannot use this feature. 970*7c478bd9Sstevel@tonic-gate 971*7c478bd9Sstevel@tonic-gatesmrsh Use the SendMail Restricted SHell (smrsh) provided 972*7c478bd9Sstevel@tonic-gate with the distribution instead of /bin/sh for mailing 973*7c478bd9Sstevel@tonic-gate to programs. This improves the ability of the local 974*7c478bd9Sstevel@tonic-gate system administrator to control what gets run via 975*7c478bd9Sstevel@tonic-gate e-mail. If an argument is provided it is used as the 976*7c478bd9Sstevel@tonic-gate pathname to smrsh; otherwise, the path defined by 977*7c478bd9Sstevel@tonic-gate confEBINDIR is used for the smrsh binary -- by default, 978*7c478bd9Sstevel@tonic-gate /usr/libexec/smrsh is assumed. 979*7c478bd9Sstevel@tonic-gate 980*7c478bd9Sstevel@tonic-gatepromiscuous_relay 981*7c478bd9Sstevel@tonic-gate By default, the sendmail configuration files do not permit 982*7c478bd9Sstevel@tonic-gate mail relaying (that is, accepting mail from outside your 983*7c478bd9Sstevel@tonic-gate local host (class {w}) and sending it to another host than 984*7c478bd9Sstevel@tonic-gate your local host). This option sets your site to allow 985*7c478bd9Sstevel@tonic-gate mail relaying from any site to any site. In almost all 986*7c478bd9Sstevel@tonic-gate cases, it is better to control relaying more carefully 987*7c478bd9Sstevel@tonic-gate with the access map, class {R}, or authentication. Domains 988*7c478bd9Sstevel@tonic-gate can be added to class {R} by the macros RELAY_DOMAIN or 989*7c478bd9Sstevel@tonic-gate RELAY_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and 990*7c478bd9Sstevel@tonic-gate MASQUERADE_DOMAIN_FILE, see below). 991*7c478bd9Sstevel@tonic-gate 992*7c478bd9Sstevel@tonic-gaterelay_entire_domain 993*7c478bd9Sstevel@tonic-gate This option allows any host in your domain as defined by 994*7c478bd9Sstevel@tonic-gate class {m} to use your server for relaying. Notice: make 995*7c478bd9Sstevel@tonic-gate sure that your domain is not just a top level domain, 996*7c478bd9Sstevel@tonic-gate e.g., com. This can happen if you give your host a name 997*7c478bd9Sstevel@tonic-gate like example.com instead of host.example.com. 998*7c478bd9Sstevel@tonic-gate 999*7c478bd9Sstevel@tonic-gaterelay_hosts_only 1000*7c478bd9Sstevel@tonic-gate By default, names that are listed as RELAY in the access 1001*7c478bd9Sstevel@tonic-gate db and class {R} are treated as domain names, not host names. 1002*7c478bd9Sstevel@tonic-gate For example, if you specify ``foo.com'', then mail to or 1003*7c478bd9Sstevel@tonic-gate from foo.com, abc.foo.com, or a.very.deep.domain.foo.com 1004*7c478bd9Sstevel@tonic-gate will all be accepted for relaying. This feature changes 1005*7c478bd9Sstevel@tonic-gate the behaviour to lookup individual host names only. 1006*7c478bd9Sstevel@tonic-gate 1007*7c478bd9Sstevel@tonic-gaterelay_based_on_MX 1008*7c478bd9Sstevel@tonic-gate Turns on the ability to allow relaying based on the MX 1009*7c478bd9Sstevel@tonic-gate records of the host portion of an incoming recipient; that 1010*7c478bd9Sstevel@tonic-gate is, if an MX record for host foo.com points to your site, 1011*7c478bd9Sstevel@tonic-gate you will accept and relay mail addressed to foo.com. See 1012*7c478bd9Sstevel@tonic-gate description below for more information before using this 1013*7c478bd9Sstevel@tonic-gate feature. Also, see the KNOWNBUGS entry regarding bestmx 1014*7c478bd9Sstevel@tonic-gate map lookups. 1015*7c478bd9Sstevel@tonic-gate 1016*7c478bd9Sstevel@tonic-gate FEATURE(`relay_based_on_MX') does not necessarily allow 1017*7c478bd9Sstevel@tonic-gate routing of these messages which you expect to be allowed, 1018*7c478bd9Sstevel@tonic-gate if route address syntax (or %-hack syntax) is used. If 1019*7c478bd9Sstevel@tonic-gate this is a problem, add entries to the access-table or use 1020*7c478bd9Sstevel@tonic-gate FEATURE(`loose_relay_check'). 1021*7c478bd9Sstevel@tonic-gate 1022*7c478bd9Sstevel@tonic-gaterelay_mail_from 1023*7c478bd9Sstevel@tonic-gate Allows relaying if the mail sender is listed as RELAY in 1024*7c478bd9Sstevel@tonic-gate the access map. If an optional argument `domain' (this 1025*7c478bd9Sstevel@tonic-gate is the literal word `domain', not a placeholder) is given, 1026*7c478bd9Sstevel@tonic-gate relaying can be allowed just based on the domain portion 1027*7c478bd9Sstevel@tonic-gate of the sender address. This feature should only be used if 1028*7c478bd9Sstevel@tonic-gate absolutely necessary as the sender address can be easily 1029*7c478bd9Sstevel@tonic-gate forged. Use of this feature requires the "From:" tag to 1030*7c478bd9Sstevel@tonic-gate be used for the key in the access map; see the discussion 1031*7c478bd9Sstevel@tonic-gate of tags and FEATURE(`relay_mail_from') in the section on 1032*7c478bd9Sstevel@tonic-gate anti-spam configuration control. 1033*7c478bd9Sstevel@tonic-gate 1034*7c478bd9Sstevel@tonic-gaterelay_local_from 1035*7c478bd9Sstevel@tonic-gate Allows relaying if the domain portion of the mail sender 1036*7c478bd9Sstevel@tonic-gate is a local host. This should only be used if absolutely 1037*7c478bd9Sstevel@tonic-gate necessary as it opens a window for spammers. Specifically, 1038*7c478bd9Sstevel@tonic-gate they can send mail to your mail server that claims to be 1039*7c478bd9Sstevel@tonic-gate from your domain (either directly or via a routed address), 1040*7c478bd9Sstevel@tonic-gate and you will go ahead and relay it out to arbitrary hosts 1041*7c478bd9Sstevel@tonic-gate on the Internet. 1042*7c478bd9Sstevel@tonic-gate 1043*7c478bd9Sstevel@tonic-gateaccept_unqualified_senders 1044*7c478bd9Sstevel@tonic-gate Normally, MAIL FROM: commands in the SMTP session will be 1045*7c478bd9Sstevel@tonic-gate refused if the connection is a network connection and the 1046*7c478bd9Sstevel@tonic-gate sender address does not include a domain name. If your 1047*7c478bd9Sstevel@tonic-gate setup sends local mail unqualified (i.e., MAIL FROM: <joe>), 1048*7c478bd9Sstevel@tonic-gate you will need to use this feature to accept unqualified 1049*7c478bd9Sstevel@tonic-gate sender addresses. Setting the DaemonPortOptions modifier 1050*7c478bd9Sstevel@tonic-gate 'u' overrides the default behavior, i.e., unqualified 1051*7c478bd9Sstevel@tonic-gate addresses are accepted even without this FEATURE. 1052*7c478bd9Sstevel@tonic-gate If this FEATURE is not used, the DaemonPortOptions modifier 1053*7c478bd9Sstevel@tonic-gate 'f' can be used to enforce fully qualified addresses. 1054*7c478bd9Sstevel@tonic-gate 1055*7c478bd9Sstevel@tonic-gateaccept_unresolvable_domains 1056*7c478bd9Sstevel@tonic-gate Normally, MAIL FROM: commands in the SMTP session will be 1057*7c478bd9Sstevel@tonic-gate refused if the host part of the argument to MAIL FROM: 1058*7c478bd9Sstevel@tonic-gate cannot be located in the host name service (e.g., an A or 1059*7c478bd9Sstevel@tonic-gate MX record in DNS). If you are inside a firewall that has 1060*7c478bd9Sstevel@tonic-gate only a limited view of the Internet host name space, this 1061*7c478bd9Sstevel@tonic-gate could cause problems. In this case you probably want to 1062*7c478bd9Sstevel@tonic-gate use this feature to accept all domains on input, even if 1063*7c478bd9Sstevel@tonic-gate they are unresolvable. 1064*7c478bd9Sstevel@tonic-gate 1065*7c478bd9Sstevel@tonic-gateaccess_db Turns on the access database feature. The access db gives 1066*7c478bd9Sstevel@tonic-gate you the ability to allow or refuse to accept mail from 1067*7c478bd9Sstevel@tonic-gate specified domains for administrative reasons. Moreover, 1068*7c478bd9Sstevel@tonic-gate it can control the behavior of sendmail in various situations. 1069*7c478bd9Sstevel@tonic-gate By default, the access database specification is: 1070*7c478bd9Sstevel@tonic-gate 1071*7c478bd9Sstevel@tonic-gate hash -T<TMPF> /etc/mail/access 1072*7c478bd9Sstevel@tonic-gate 1073*7c478bd9Sstevel@tonic-gate See the anti-spam configuration control section for further 1074*7c478bd9Sstevel@tonic-gate important information about this feature. Notice: 1075*7c478bd9Sstevel@tonic-gate "-T<TMPF>" is meant literal, do not replace it by anything. 1076*7c478bd9Sstevel@tonic-gate 1077*7c478bd9Sstevel@tonic-gateblacklist_recipients 1078*7c478bd9Sstevel@tonic-gate Turns on the ability to block incoming mail for certain 1079*7c478bd9Sstevel@tonic-gate recipient usernames, hostnames, or addresses. For 1080*7c478bd9Sstevel@tonic-gate example, you can block incoming mail to user nobody, 1081*7c478bd9Sstevel@tonic-gate host foo.mydomain.com, or guest@bar.mydomain.com. 1082*7c478bd9Sstevel@tonic-gate These specifications are put in the access db as 1083*7c478bd9Sstevel@tonic-gate described in the anti-spam configuration control section 1084*7c478bd9Sstevel@tonic-gate later in this document. 1085*7c478bd9Sstevel@tonic-gate 1086*7c478bd9Sstevel@tonic-gatedelay_checks The rulesets check_mail and check_relay will not be called 1087*7c478bd9Sstevel@tonic-gate when a client connects or issues a MAIL command, respectively. 1088*7c478bd9Sstevel@tonic-gate Instead, those rulesets will be called by the check_rcpt 1089*7c478bd9Sstevel@tonic-gate ruleset; they will be skipped under certain circumstances. 1090*7c478bd9Sstevel@tonic-gate See "Delay all checks" in the anti-spam configuration control 1091*7c478bd9Sstevel@tonic-gate section. Note: this feature is incompatible to the versions 1092*7c478bd9Sstevel@tonic-gate in 8.10 and 8.11. 1093*7c478bd9Sstevel@tonic-gate 1094*7c478bd9Sstevel@tonic-gateuse_client_ptr If this feature is enabled then check_relay will override 1095*7c478bd9Sstevel@tonic-gate its first argument with $&{client_ptr}. This is useful for 1096*7c478bd9Sstevel@tonic-gate rejections based on the unverified hostname of client, 1097*7c478bd9Sstevel@tonic-gate which turns on the same behavior as in earlier sendmail 1098*7c478bd9Sstevel@tonic-gate versions when delay_checks was not in use. See doc/op/op.* 1099*7c478bd9Sstevel@tonic-gate about check_relay, {client_name}, and {client_ptr}. 1100*7c478bd9Sstevel@tonic-gate 1101*7c478bd9Sstevel@tonic-gatednsbl Turns on rejection of hosts found in an DNS based rejection 1102*7c478bd9Sstevel@tonic-gate list. If an argument is provided it is used as the domain 1103*7c478bd9Sstevel@tonic-gate in which blocked hosts are listed; otherwise it defaults to 1104*7c478bd9Sstevel@tonic-gate blackholes.mail-abuse.org. An explanation for an DNS based 1105*7c478bd9Sstevel@tonic-gate rejection list can be found at http://mail-abuse.org/rbl/. 1106*7c478bd9Sstevel@tonic-gate A second argument can be used to change the default error 1107*7c478bd9Sstevel@tonic-gate message. Without that second argument, the error message 1108*7c478bd9Sstevel@tonic-gate will be 1109*7c478bd9Sstevel@tonic-gate Rejected: IP-ADDRESS listed at SERVER 1110*7c478bd9Sstevel@tonic-gate where IP-ADDRESS and SERVER are replaced by the appropriate 1111*7c478bd9Sstevel@tonic-gate information. By default, temporary lookup failures are 1112*7c478bd9Sstevel@tonic-gate ignored. This behavior can be changed by specifying a 1113*7c478bd9Sstevel@tonic-gate third argument, which must be either `t' or a full error 1114*7c478bd9Sstevel@tonic-gate message. See the anti-spam configuration control section for 1115*7c478bd9Sstevel@tonic-gate an example. The dnsbl feature can be included several times 1116*7c478bd9Sstevel@tonic-gate to query different DNS based rejection lists. See also 1117*7c478bd9Sstevel@tonic-gate enhdnsbl for an enhanced version. 1118*7c478bd9Sstevel@tonic-gate 1119*7c478bd9Sstevel@tonic-gate Set the DNSBL_MAP mc option to change the default map 1120*7c478bd9Sstevel@tonic-gate definition from `host'. Set the DNSBL_MAP_OPT mc option 1121*7c478bd9Sstevel@tonic-gate to add additional options to the map specification used. 1122*7c478bd9Sstevel@tonic-gate 1123*7c478bd9Sstevel@tonic-gate Some DNS based rejection lists cause failures if asked 1124*7c478bd9Sstevel@tonic-gate for AAAA records. If your sendmail version is compiled 1125*7c478bd9Sstevel@tonic-gate with IPv6 support (NETINET6) and you experience this 1126*7c478bd9Sstevel@tonic-gate problem, add 1127*7c478bd9Sstevel@tonic-gate 1128*7c478bd9Sstevel@tonic-gate define(`DNSBL_MAP', `dns -R A') 1129*7c478bd9Sstevel@tonic-gate 1130*7c478bd9Sstevel@tonic-gate before the first use of this feature. Alternatively you 1131*7c478bd9Sstevel@tonic-gate can use enhdnsbl instead (see below). Moreover, this 1132*7c478bd9Sstevel@tonic-gate statement can be used to reduce the number of DNS retries, 1133*7c478bd9Sstevel@tonic-gate e.g., 1134*7c478bd9Sstevel@tonic-gate 1135*7c478bd9Sstevel@tonic-gate define(`DNSBL_MAP', `dns -R A -r2') 1136*7c478bd9Sstevel@tonic-gate 1137*7c478bd9Sstevel@tonic-gate See below (EDNSBL_TO) for an explanation. 1138*7c478bd9Sstevel@tonic-gate 1139*7c478bd9Sstevel@tonic-gate NOTE: The default DNS blacklist, blackholes.mail-abuse.org, 1140*7c478bd9Sstevel@tonic-gate is a service offered by the Mail Abuse Prevention System 1141*7c478bd9Sstevel@tonic-gate (MAPS). As of July 31, 2001, MAPS is a subscription 1142*7c478bd9Sstevel@tonic-gate service, so using that network address won't work if you 1143*7c478bd9Sstevel@tonic-gate haven't subscribed. Contact MAPS to subscribe 1144*7c478bd9Sstevel@tonic-gate (http://mail-abuse.org/). 1145*7c478bd9Sstevel@tonic-gate 1146*7c478bd9Sstevel@tonic-gateenhdnsbl Enhanced version of dnsbl (see above). Further arguments 1147*7c478bd9Sstevel@tonic-gate (up to 5) can be used to specify specific return values 1148*7c478bd9Sstevel@tonic-gate from lookups. Temporary lookup failures are ignored unless 1149*7c478bd9Sstevel@tonic-gate a third argument is given, which must be either `t' or a full 1150*7c478bd9Sstevel@tonic-gate error message. By default, any successful lookup will 1151*7c478bd9Sstevel@tonic-gate generate an error. Otherwise the result of the lookup is 1152*7c478bd9Sstevel@tonic-gate compared with the supplied argument(s), and only if a match 1153*7c478bd9Sstevel@tonic-gate occurs an error is generated. For example, 1154*7c478bd9Sstevel@tonic-gate 1155*7c478bd9Sstevel@tonic-gate FEATURE(`enhdnsbl', `dnsbl.example.com', `', `t', `127.0.0.2.') 1156*7c478bd9Sstevel@tonic-gate 1157*7c478bd9Sstevel@tonic-gate will reject the e-mail if the lookup returns the value 1158*7c478bd9Sstevel@tonic-gate ``127.0.0.2.'', or generate a 451 response if the lookup 1159*7c478bd9Sstevel@tonic-gate temporarily failed. The arguments can contain metasymbols 1160*7c478bd9Sstevel@tonic-gate as they are allowed in the LHS of rules. As the example 1161*7c478bd9Sstevel@tonic-gate shows, the default values are also used if an empty argument, 1162*7c478bd9Sstevel@tonic-gate i.e., `', is specified. This feature requires that sendmail 1163*7c478bd9Sstevel@tonic-gate has been compiled with the flag DNSMAP (see sendmail/README). 1164*7c478bd9Sstevel@tonic-gate 1165*7c478bd9Sstevel@tonic-gate Set the EDNSBL_TO mc option to change the DNS retry count 1166*7c478bd9Sstevel@tonic-gate from the default value of 5, this can be very useful when 1167*7c478bd9Sstevel@tonic-gate a DNS server is not responding, which in turn may cause 1168*7c478bd9Sstevel@tonic-gate clients to time out (an entry stating 1169*7c478bd9Sstevel@tonic-gate 1170*7c478bd9Sstevel@tonic-gate did not issue MAIL/EXPN/VRFY/ETRN 1171*7c478bd9Sstevel@tonic-gate 1172*7c478bd9Sstevel@tonic-gate will be logged). 1173*7c478bd9Sstevel@tonic-gate 1174*7c478bd9Sstevel@tonic-gateratecontrol Enable simple ruleset to do connection rate control 1175*7c478bd9Sstevel@tonic-gate checking. This requires entries in access_db of the form 1176*7c478bd9Sstevel@tonic-gate 1177*7c478bd9Sstevel@tonic-gate ClientRate:IP.ADD.RE.SS LIMIT 1178*7c478bd9Sstevel@tonic-gate 1179*7c478bd9Sstevel@tonic-gate The RHS specifies the maximum number of connections 1180*7c478bd9Sstevel@tonic-gate (an integer number) over the time interval defined 1181*7c478bd9Sstevel@tonic-gate by ConnectionRateWindowSize, where 0 means unlimited. 1182*7c478bd9Sstevel@tonic-gate 1183*7c478bd9Sstevel@tonic-gate Take the following example: 1184*7c478bd9Sstevel@tonic-gate 1185*7c478bd9Sstevel@tonic-gate ClientRate:10.1.2.3 4 1186*7c478bd9Sstevel@tonic-gate ClientRate:127.0.0.1 0 1187*7c478bd9Sstevel@tonic-gate ClientRate: 10 1188*7c478bd9Sstevel@tonic-gate 1189*7c478bd9Sstevel@tonic-gate 10.1.2.3 can only make up to 4 connections, the 1190*7c478bd9Sstevel@tonic-gate general limit it 10, and 127.0.0.1 can make an unlimited 1191*7c478bd9Sstevel@tonic-gate number of connections per ConnectionRateWindowSize. 1192*7c478bd9Sstevel@tonic-gate 1193*7c478bd9Sstevel@tonic-gate See also CONNECTION CONTROL. 1194*7c478bd9Sstevel@tonic-gate 1195*7c478bd9Sstevel@tonic-gateconncontrol Enable a simple check of the number of incoming SMTP 1196*7c478bd9Sstevel@tonic-gate connections. This requires entries in access_db of the 1197*7c478bd9Sstevel@tonic-gate form 1198*7c478bd9Sstevel@tonic-gate 1199*7c478bd9Sstevel@tonic-gate ClientConn:IP.ADD.RE.SS LIMIT 1200*7c478bd9Sstevel@tonic-gate 1201*7c478bd9Sstevel@tonic-gate The RHS specifies the maximum number of open connections 1202*7c478bd9Sstevel@tonic-gate (an integer number). 1203*7c478bd9Sstevel@tonic-gate 1204*7c478bd9Sstevel@tonic-gate Take the following example: 1205*7c478bd9Sstevel@tonic-gate 1206*7c478bd9Sstevel@tonic-gate ClientConn:10.1.2.3 4 1207*7c478bd9Sstevel@tonic-gate ClientConn:127.0.0.1 0 1208*7c478bd9Sstevel@tonic-gate ClientConn: 10 1209*7c478bd9Sstevel@tonic-gate 1210*7c478bd9Sstevel@tonic-gate 10.1.2.3 can only have up to 4 open connections, the 1211*7c478bd9Sstevel@tonic-gate general limit it 10, and 127.0.0.1 does not have any 1212*7c478bd9Sstevel@tonic-gate explicit limit. 1213*7c478bd9Sstevel@tonic-gate 1214*7c478bd9Sstevel@tonic-gate See also CONNECTION CONTROL. 1215*7c478bd9Sstevel@tonic-gate 1216*7c478bd9Sstevel@tonic-gatemtamark Experimental support for "Marking Mail Transfer Agents in 1217*7c478bd9Sstevel@tonic-gate Reverse DNS with TXT RRs" (MTAMark), see 1218*7c478bd9Sstevel@tonic-gate draft-stumpf-dns-mtamark-01. Optional arguments are: 1219*7c478bd9Sstevel@tonic-gate 1220*7c478bd9Sstevel@tonic-gate 1. Error message, default: 1221*7c478bd9Sstevel@tonic-gate 1222*7c478bd9Sstevel@tonic-gate 550 Rejected: $&{client_addr} not listed as MTA 1223*7c478bd9Sstevel@tonic-gate 1224*7c478bd9Sstevel@tonic-gate 2. Temporary lookup failures are ignored unless a second 1225*7c478bd9Sstevel@tonic-gate argument is given, which must be either `t' or a full 1226*7c478bd9Sstevel@tonic-gate error message. 1227*7c478bd9Sstevel@tonic-gate 1228*7c478bd9Sstevel@tonic-gate 3. Lookup prefix, default: _perm._smtp._srv. This should 1229*7c478bd9Sstevel@tonic-gate not be changed unless the draft changes it. 1230*7c478bd9Sstevel@tonic-gate 1231*7c478bd9Sstevel@tonic-gate Example: 1232*7c478bd9Sstevel@tonic-gate 1233*7c478bd9Sstevel@tonic-gate FEATURE(`mtamark', `', `t') 1234*7c478bd9Sstevel@tonic-gate 1235*7c478bd9Sstevel@tonic-gatelookupdotdomain Look up also .domain in the access map. This allows to 1236*7c478bd9Sstevel@tonic-gate match only subdomains. It does not work well with 1237*7c478bd9Sstevel@tonic-gate FEATURE(`relay_hosts_only'), because most lookups for 1238*7c478bd9Sstevel@tonic-gate subdomains are suppressed by the latter feature. 1239*7c478bd9Sstevel@tonic-gate 1240*7c478bd9Sstevel@tonic-gateloose_relay_check 1241*7c478bd9Sstevel@tonic-gate Normally, if % addressing is used for a recipient, e.g. 1242*7c478bd9Sstevel@tonic-gate user%site@othersite, and othersite is in class {R}, the 1243*7c478bd9Sstevel@tonic-gate check_rcpt ruleset will strip @othersite and recheck 1244*7c478bd9Sstevel@tonic-gate user@site for relaying. This feature changes that 1245*7c478bd9Sstevel@tonic-gate behavior. It should not be needed for most installations. 1246*7c478bd9Sstevel@tonic-gate 1247*7c478bd9Sstevel@tonic-gatepreserve_luser_host 1248*7c478bd9Sstevel@tonic-gate Preserve the name of the recipient host if LUSER_RELAY is 1249*7c478bd9Sstevel@tonic-gate used. Without this option, the domain part of the 1250*7c478bd9Sstevel@tonic-gate recipient address will be replaced by the host specified as 1251*7c478bd9Sstevel@tonic-gate LUSER_RELAY. This feature only works if the hostname is 1252*7c478bd9Sstevel@tonic-gate passed to the mailer (see mailer triple in op.me). Note 1253*7c478bd9Sstevel@tonic-gate that in the default configuration the local mailer does not 1254*7c478bd9Sstevel@tonic-gate receive the hostname, i.e., the mailer triple has an empty 1255*7c478bd9Sstevel@tonic-gate hostname. 1256*7c478bd9Sstevel@tonic-gate 1257*7c478bd9Sstevel@tonic-gatepreserve_local_plus_detail 1258*7c478bd9Sstevel@tonic-gate Preserve the +detail portion of the address when passing 1259*7c478bd9Sstevel@tonic-gate address to local delivery agent. Disables alias and 1260*7c478bd9Sstevel@tonic-gate .forward +detail stripping (e.g., given user+detail, only 1261*7c478bd9Sstevel@tonic-gate that address will be looked up in the alias file; user+* and 1262*7c478bd9Sstevel@tonic-gate user will not be looked up). Only use if the local 1263*7c478bd9Sstevel@tonic-gate delivery agent in use supports +detail addressing. 1264*7c478bd9Sstevel@tonic-gate 1265*7c478bd9Sstevel@tonic-gatecompat_check Enable ruleset check_compat to look up pairs of addresses 1266*7c478bd9Sstevel@tonic-gate with the Compat: tag -- Compat:sender<@>recipient -- in the 1267*7c478bd9Sstevel@tonic-gate access map. Valid values for the RHS include 1268*7c478bd9Sstevel@tonic-gate DISCARD silently discard recipient 1269*7c478bd9Sstevel@tonic-gate TEMP: return a temporary error 1270*7c478bd9Sstevel@tonic-gate ERROR: return a permanent error 1271*7c478bd9Sstevel@tonic-gate In the last two cases, a 4xy/5xy SMTP reply code should 1272*7c478bd9Sstevel@tonic-gate follow the colon. 1273*7c478bd9Sstevel@tonic-gate 1274*7c478bd9Sstevel@tonic-gateno_default_msa Don't generate the default MSA daemon, i.e., 1275*7c478bd9Sstevel@tonic-gate DAEMON_OPTIONS(`Port=587,Name=MSA,M=E') 1276*7c478bd9Sstevel@tonic-gate To define a MSA daemon with other parameters, use this 1277*7c478bd9Sstevel@tonic-gate FEATURE and introduce new settings via DAEMON_OPTIONS(). 1278*7c478bd9Sstevel@tonic-gate 1279*7c478bd9Sstevel@tonic-gatemsp Defines config file for Message Submission Program. 1280*7c478bd9Sstevel@tonic-gate See cf/submit.mc for how 1281*7c478bd9Sstevel@tonic-gate to use it. An optional argument can be used to override 1282*7c478bd9Sstevel@tonic-gate the default of `[localhost]' to use as host to send all 1283*7c478bd9Sstevel@tonic-gate e-mails to. Note that MX records will be used if the 1284*7c478bd9Sstevel@tonic-gate specified hostname is not in square brackets (e.g., 1285*7c478bd9Sstevel@tonic-gate [hostname]). If `MSA' is specified as second argument then 1286*7c478bd9Sstevel@tonic-gate port 587 is used to contact the server. Example: 1287*7c478bd9Sstevel@tonic-gate 1288*7c478bd9Sstevel@tonic-gate FEATURE(`msp', `', `MSA') 1289*7c478bd9Sstevel@tonic-gate 1290*7c478bd9Sstevel@tonic-gate Some more hints about possible changes can be found below 1291*7c478bd9Sstevel@tonic-gate in the section MESSAGE SUBMISSION PROGRAM. 1292*7c478bd9Sstevel@tonic-gate 1293*7c478bd9Sstevel@tonic-gate Note: Due to many problems, submit.mc uses 1294*7c478bd9Sstevel@tonic-gate 1295*7c478bd9Sstevel@tonic-gate FEATURE(`msp', `[127.0.0.1]') 1296*7c478bd9Sstevel@tonic-gate 1297*7c478bd9Sstevel@tonic-gate by default. If you have a machine with IPv6 only, 1298*7c478bd9Sstevel@tonic-gate change it to 1299*7c478bd9Sstevel@tonic-gate 1300*7c478bd9Sstevel@tonic-gate FEATURE(`msp', `[IPv6:::1]') 1301*7c478bd9Sstevel@tonic-gate 1302*7c478bd9Sstevel@tonic-gate If you want to continue using '[localhost]', (the behavior 1303*7c478bd9Sstevel@tonic-gate up to 8.12.6), use 1304*7c478bd9Sstevel@tonic-gate 1305*7c478bd9Sstevel@tonic-gate FEATURE(`msp') 1306*7c478bd9Sstevel@tonic-gate 1307*7c478bd9Sstevel@tonic-gatequeuegroup A simple example how to select a queue group based 1308*7c478bd9Sstevel@tonic-gate on the full e-mail address or the domain of the 1309*7c478bd9Sstevel@tonic-gate recipient. Selection is done via entries in the 1310*7c478bd9Sstevel@tonic-gate access map using the tag QGRP:, for example: 1311*7c478bd9Sstevel@tonic-gate 1312*7c478bd9Sstevel@tonic-gate QGRP:example.com main 1313*7c478bd9Sstevel@tonic-gate QGRP:friend@some.org others 1314*7c478bd9Sstevel@tonic-gate QGRP:my.domain local 1315*7c478bd9Sstevel@tonic-gate 1316*7c478bd9Sstevel@tonic-gate where "main", "others", and "local" are names of 1317*7c478bd9Sstevel@tonic-gate queue groups. If an argument is specified, it is used 1318*7c478bd9Sstevel@tonic-gate as default queue group. 1319*7c478bd9Sstevel@tonic-gate 1320*7c478bd9Sstevel@tonic-gate Note: please read the warning in doc/op/op.me about 1321*7c478bd9Sstevel@tonic-gate queue groups and possible queue manipulations. 1322*7c478bd9Sstevel@tonic-gate 1323*7c478bd9Sstevel@tonic-gategreet_pause Adds the greet_pause ruleset which enables open proxy 1324*7c478bd9Sstevel@tonic-gate and SMTP slamming protection. The feature can take an 1325*7c478bd9Sstevel@tonic-gate argument specifying the milliseconds to wait: 1326*7c478bd9Sstevel@tonic-gate 1327*7c478bd9Sstevel@tonic-gate FEATURE(`greet_pause', `5000') dnl 5 seconds 1328*7c478bd9Sstevel@tonic-gate 1329*7c478bd9Sstevel@tonic-gate If FEATURE(`access_db') is enabled, an access database 1330*7c478bd9Sstevel@tonic-gate lookup with the GreetPause tag is done using client 1331*7c478bd9Sstevel@tonic-gate hostname, domain, IP address, or subnet to determine the 1332*7c478bd9Sstevel@tonic-gate pause time: 1333*7c478bd9Sstevel@tonic-gate 1334*7c478bd9Sstevel@tonic-gate GreetPause:my.domain 0 1335*7c478bd9Sstevel@tonic-gate GreetPause:example.com 5000 1336*7c478bd9Sstevel@tonic-gate GreetPause:10.1.2 2000 1337*7c478bd9Sstevel@tonic-gate GreetPause:127.0.0.1 0 1338*7c478bd9Sstevel@tonic-gate 1339*7c478bd9Sstevel@tonic-gate When using FEATURE(`access_db'), the optional 1340*7c478bd9Sstevel@tonic-gate FEATURE(`greet_pause') argument becomes the default if 1341*7c478bd9Sstevel@tonic-gate nothing is found in the access database. A ruleset called 1342*7c478bd9Sstevel@tonic-gate Local_greet_pause can be used for local modifications, e.g., 1343*7c478bd9Sstevel@tonic-gate 1344*7c478bd9Sstevel@tonic-gate LOCAL_RULESETS 1345*7c478bd9Sstevel@tonic-gate SLocal_greet_pause 1346*7c478bd9Sstevel@tonic-gate R$* $: $&{daemon_flags} 1347*7c478bd9Sstevel@tonic-gate R$* a $* $# 0 1348*7c478bd9Sstevel@tonic-gate 1349*7c478bd9Sstevel@tonic-gate+--------------------+ 1350*7c478bd9Sstevel@tonic-gate| USING UUCP MAILERS | 1351*7c478bd9Sstevel@tonic-gate+--------------------+ 1352*7c478bd9Sstevel@tonic-gate 1353*7c478bd9Sstevel@tonic-gateIt's hard to get UUCP mailers right because of the extremely ad hoc 1354*7c478bd9Sstevel@tonic-gatenature of UUCP addressing. These config files are really designed 1355*7c478bd9Sstevel@tonic-gatefor domain-based addressing, even for UUCP sites. 1356*7c478bd9Sstevel@tonic-gate 1357*7c478bd9Sstevel@tonic-gateThere are four UUCP mailers available. The choice of which one to 1358*7c478bd9Sstevel@tonic-gateuse is partly a matter of local preferences and what is running at 1359*7c478bd9Sstevel@tonic-gatethe other end of your UUCP connection. Unlike good protocols that 1360*7c478bd9Sstevel@tonic-gatedefine what will go over the wire, UUCP uses the policy that you 1361*7c478bd9Sstevel@tonic-gateshould do what is right for the other end; if they change, you have 1362*7c478bd9Sstevel@tonic-gateto change. This makes it hard to do the right thing, and discourages 1363*7c478bd9Sstevel@tonic-gatepeople from updating their software. In general, if you can avoid 1364*7c478bd9Sstevel@tonic-gateUUCP, please do. 1365*7c478bd9Sstevel@tonic-gate 1366*7c478bd9Sstevel@tonic-gateThe major choice is whether to go for a domainized scheme or a 1367*7c478bd9Sstevel@tonic-gatenon-domainized scheme. This depends entirely on what the other 1368*7c478bd9Sstevel@tonic-gateend will recognize. If at all possible, you should encourage the 1369*7c478bd9Sstevel@tonic-gateother end to go to a domain-based system -- non-domainized addresses 1370*7c478bd9Sstevel@tonic-gatedon't work entirely properly. 1371*7c478bd9Sstevel@tonic-gate 1372*7c478bd9Sstevel@tonic-gateThe four mailers are: 1373*7c478bd9Sstevel@tonic-gate 1374*7c478bd9Sstevel@tonic-gate uucp-old (obsolete name: "uucp") 1375*7c478bd9Sstevel@tonic-gate This is the oldest, the worst (but the closest to UUCP) way of 1376*7c478bd9Sstevel@tonic-gate sending messages across UUCP connections. It does bangify 1377*7c478bd9Sstevel@tonic-gate everything and prepends $U (your UUCP name) to the sender's 1378*7c478bd9Sstevel@tonic-gate address (which can already be a bang path itself). It can 1379*7c478bd9Sstevel@tonic-gate only send to one address at a time, so it spends a lot of 1380*7c478bd9Sstevel@tonic-gate time copying duplicates of messages. Avoid this if at all 1381*7c478bd9Sstevel@tonic-gate possible. 1382*7c478bd9Sstevel@tonic-gate 1383*7c478bd9Sstevel@tonic-gate uucp-new (obsolete name: "suucp") 1384*7c478bd9Sstevel@tonic-gate The same as above, except that it assumes that in one rmail 1385*7c478bd9Sstevel@tonic-gate command you can specify several recipients. It still has a 1386*7c478bd9Sstevel@tonic-gate lot of other problems. 1387*7c478bd9Sstevel@tonic-gate 1388*7c478bd9Sstevel@tonic-gate uucp-dom 1389*7c478bd9Sstevel@tonic-gate This UUCP mailer keeps everything as domain addresses. 1390*7c478bd9Sstevel@tonic-gate Basically, it uses the SMTP mailer rewriting rules. This mailer 1391*7c478bd9Sstevel@tonic-gate is only included if MAILER(`smtp') is specified before 1392*7c478bd9Sstevel@tonic-gate MAILER(`uucp'). 1393*7c478bd9Sstevel@tonic-gate 1394*7c478bd9Sstevel@tonic-gate Unfortunately, a lot of UUCP mailer transport agents require 1395*7c478bd9Sstevel@tonic-gate bangified addresses in the envelope, although you can use 1396*7c478bd9Sstevel@tonic-gate domain-based addresses in the message header. (The envelope 1397*7c478bd9Sstevel@tonic-gate shows up as the From_ line on UNIX mail.) So.... 1398*7c478bd9Sstevel@tonic-gate 1399*7c478bd9Sstevel@tonic-gate uucp-uudom 1400*7c478bd9Sstevel@tonic-gate This is a cross between uucp-new (for the envelope addresses) 1401*7c478bd9Sstevel@tonic-gate and uucp-dom (for the header addresses). It bangifies the 1402*7c478bd9Sstevel@tonic-gate envelope sender (From_ line in messages) without adding the 1403*7c478bd9Sstevel@tonic-gate local hostname, unless there is no host name on the address 1404*7c478bd9Sstevel@tonic-gate at all (e.g., "wolf") or the host component is a UUCP host name 1405*7c478bd9Sstevel@tonic-gate instead of a domain name ("somehost!wolf" instead of 1406*7c478bd9Sstevel@tonic-gate "some.dom.ain!wolf"). This is also included only if MAILER(`smtp') 1407*7c478bd9Sstevel@tonic-gate is also specified earlier. 1408*7c478bd9Sstevel@tonic-gate 1409*7c478bd9Sstevel@tonic-gateExamples: 1410*7c478bd9Sstevel@tonic-gate 1411*7c478bd9Sstevel@tonic-gateOn host grasp.insa-lyon.fr (UUCP host name "grasp"), the following 1412*7c478bd9Sstevel@tonic-gatesummarizes the sender rewriting for various mailers. 1413*7c478bd9Sstevel@tonic-gate 1414*7c478bd9Sstevel@tonic-gateMailer sender rewriting in the envelope 1415*7c478bd9Sstevel@tonic-gate------ ------ ------------------------- 1416*7c478bd9Sstevel@tonic-gateuucp-{old,new} wolf grasp!wolf 1417*7c478bd9Sstevel@tonic-gateuucp-dom wolf wolf@grasp.insa-lyon.fr 1418*7c478bd9Sstevel@tonic-gateuucp-uudom wolf grasp.insa-lyon.fr!wolf 1419*7c478bd9Sstevel@tonic-gate 1420*7c478bd9Sstevel@tonic-gateuucp-{old,new} wolf@fr.net grasp!fr.net!wolf 1421*7c478bd9Sstevel@tonic-gateuucp-dom wolf@fr.net wolf@fr.net 1422*7c478bd9Sstevel@tonic-gateuucp-uudom wolf@fr.net fr.net!wolf 1423*7c478bd9Sstevel@tonic-gate 1424*7c478bd9Sstevel@tonic-gateuucp-{old,new} somehost!wolf grasp!somehost!wolf 1425*7c478bd9Sstevel@tonic-gateuucp-dom somehost!wolf somehost!wolf@grasp.insa-lyon.fr 1426*7c478bd9Sstevel@tonic-gateuucp-uudom somehost!wolf grasp.insa-lyon.fr!somehost!wolf 1427*7c478bd9Sstevel@tonic-gate 1428*7c478bd9Sstevel@tonic-gateIf you are using one of the domainized UUCP mailers, you really want 1429*7c478bd9Sstevel@tonic-gateto convert all UUCP addresses to domain format -- otherwise, it will 1430*7c478bd9Sstevel@tonic-gatedo it for you (and probably not the way you expected). For example, 1431*7c478bd9Sstevel@tonic-gateif you have the address foo!bar!baz (and you are not sending to foo), 1432*7c478bd9Sstevel@tonic-gatethe heuristics will add the @uucp.relay.name or @local.host.name to 1433*7c478bd9Sstevel@tonic-gatethis address. However, if you map foo to foo.host.name first, it 1434*7c478bd9Sstevel@tonic-gatewill not add the local hostname. You can do this using the uucpdomain 1435*7c478bd9Sstevel@tonic-gatefeature. 1436*7c478bd9Sstevel@tonic-gate 1437*7c478bd9Sstevel@tonic-gate 1438*7c478bd9Sstevel@tonic-gate+-------------------+ 1439*7c478bd9Sstevel@tonic-gate| TWEAKING RULESETS | 1440*7c478bd9Sstevel@tonic-gate+-------------------+ 1441*7c478bd9Sstevel@tonic-gate 1442*7c478bd9Sstevel@tonic-gateFor more complex configurations, you can define special rules. 1443*7c478bd9Sstevel@tonic-gateThe macro LOCAL_RULE_3 introduces rules that are used in canonicalizing 1444*7c478bd9Sstevel@tonic-gatethe names. Any modifications made here are reflected in the header. 1445*7c478bd9Sstevel@tonic-gate 1446*7c478bd9Sstevel@tonic-gateA common use is to convert old UUCP addresses to SMTP addresses using 1447*7c478bd9Sstevel@tonic-gatethe UUCPSMTP macro. For example: 1448*7c478bd9Sstevel@tonic-gate 1449*7c478bd9Sstevel@tonic-gate LOCAL_RULE_3 1450*7c478bd9Sstevel@tonic-gate UUCPSMTP(`decvax', `decvax.dec.com') 1451*7c478bd9Sstevel@tonic-gate UUCPSMTP(`research', `research.att.com') 1452*7c478bd9Sstevel@tonic-gate 1453*7c478bd9Sstevel@tonic-gatewill cause addresses of the form "decvax!user" and "research!user" 1454*7c478bd9Sstevel@tonic-gateto be converted to "user@decvax.dec.com" and "user@research.att.com" 1455*7c478bd9Sstevel@tonic-gaterespectively. 1456*7c478bd9Sstevel@tonic-gate 1457*7c478bd9Sstevel@tonic-gateThis could also be used to look up hosts in a database map: 1458*7c478bd9Sstevel@tonic-gate 1459*7c478bd9Sstevel@tonic-gate LOCAL_RULE_3 1460*7c478bd9Sstevel@tonic-gate R$* < @ $+ > $* $: $1 < @ $(hostmap $2 $) > $3 1461*7c478bd9Sstevel@tonic-gate 1462*7c478bd9Sstevel@tonic-gateThis map would be defined in the LOCAL_CONFIG portion, as shown below. 1463*7c478bd9Sstevel@tonic-gate 1464*7c478bd9Sstevel@tonic-gateSimilarly, LOCAL_RULE_0 can be used to introduce new parsing rules. 1465*7c478bd9Sstevel@tonic-gateFor example, new rules are needed to parse hostnames that you accept 1466*7c478bd9Sstevel@tonic-gatevia MX records. For example, you might have: 1467*7c478bd9Sstevel@tonic-gate 1468*7c478bd9Sstevel@tonic-gate LOCAL_RULE_0 1469*7c478bd9Sstevel@tonic-gate R$+ <@ host.dom.ain.> $#uucp $@ cnmat $: $1 < @ host.dom.ain.> 1470*7c478bd9Sstevel@tonic-gate 1471*7c478bd9Sstevel@tonic-gateYou would use this if you had installed an MX record for cnmat.Berkeley.EDU 1472*7c478bd9Sstevel@tonic-gatepointing at this host; this rule catches the message and forwards it on 1473*7c478bd9Sstevel@tonic-gateusing UUCP. 1474*7c478bd9Sstevel@tonic-gate 1475*7c478bd9Sstevel@tonic-gateYou can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2. 1476*7c478bd9Sstevel@tonic-gateThese rulesets are normally empty. 1477*7c478bd9Sstevel@tonic-gate 1478*7c478bd9Sstevel@tonic-gateA similar macro is LOCAL_CONFIG. This introduces lines added after the 1479*7c478bd9Sstevel@tonic-gateboilerplate option setting but before rulesets. Do not declare rulesets in 1480*7c478bd9Sstevel@tonic-gatethe LOCAL_CONFIG section. It can be used to declare local database maps or 1481*7c478bd9Sstevel@tonic-gatewhatever. For example: 1482*7c478bd9Sstevel@tonic-gate 1483*7c478bd9Sstevel@tonic-gate LOCAL_CONFIG 1484*7c478bd9Sstevel@tonic-gate Khostmap hash /etc/mail/hostmap 1485*7c478bd9Sstevel@tonic-gate Kyplocal nis -m hosts.byname 1486*7c478bd9Sstevel@tonic-gate 1487*7c478bd9Sstevel@tonic-gate 1488*7c478bd9Sstevel@tonic-gate+---------------------------+ 1489*7c478bd9Sstevel@tonic-gate| MASQUERADING AND RELAYING | 1490*7c478bd9Sstevel@tonic-gate+---------------------------+ 1491*7c478bd9Sstevel@tonic-gate 1492*7c478bd9Sstevel@tonic-gateYou can have your host masquerade as another using 1493*7c478bd9Sstevel@tonic-gate 1494*7c478bd9Sstevel@tonic-gate MASQUERADE_AS(`host.domain') 1495*7c478bd9Sstevel@tonic-gate 1496*7c478bd9Sstevel@tonic-gateThis causes mail being sent to be labeled as coming from the 1497*7c478bd9Sstevel@tonic-gateindicated host.domain, rather than $j. One normally masquerades as 1498*7c478bd9Sstevel@tonic-gateone of one's own subdomains (for example, it's unlikely that 1499*7c478bd9Sstevel@tonic-gateBerkeley would choose to masquerade as an MIT site). This 1500*7c478bd9Sstevel@tonic-gatebehaviour is modified by a plethora of FEATUREs; in particular, see 1501*7c478bd9Sstevel@tonic-gatemasquerade_envelope, allmasquerade, limited_masquerade, and 1502*7c478bd9Sstevel@tonic-gatemasquerade_entire_domain. 1503*7c478bd9Sstevel@tonic-gate 1504*7c478bd9Sstevel@tonic-gateThe masquerade name is not normally canonified, so it is important 1505*7c478bd9Sstevel@tonic-gatethat it be your One True Name, that is, fully qualified and not a 1506*7c478bd9Sstevel@tonic-gateCNAME. However, if you use a CNAME, the receiving side may canonify 1507*7c478bd9Sstevel@tonic-gateit for you, so don't think you can cheat CNAME mapping this way. 1508*7c478bd9Sstevel@tonic-gate 1509*7c478bd9Sstevel@tonic-gateNormally the only addresses that are masqueraded are those that come 1510*7c478bd9Sstevel@tonic-gatefrom this host (that is, are either unqualified or in class {w}, the list 1511*7c478bd9Sstevel@tonic-gateof local domain names). You can augment this list, which is realized 1512*7c478bd9Sstevel@tonic-gateby class {M} using 1513*7c478bd9Sstevel@tonic-gate 1514*7c478bd9Sstevel@tonic-gate MASQUERADE_DOMAIN(`otherhost.domain') 1515*7c478bd9Sstevel@tonic-gate 1516*7c478bd9Sstevel@tonic-gateThe effect of this is that although mail to user@otherhost.domain 1517*7c478bd9Sstevel@tonic-gatewill not be delivered locally, any mail including any user@otherhost.domain 1518*7c478bd9Sstevel@tonic-gatewill, when relayed, be rewritten to have the MASQUERADE_AS address. 1519*7c478bd9Sstevel@tonic-gateThis can be a space-separated list of names. 1520*7c478bd9Sstevel@tonic-gate 1521*7c478bd9Sstevel@tonic-gateIf these names are in a file, you can use 1522*7c478bd9Sstevel@tonic-gate 1523*7c478bd9Sstevel@tonic-gate MASQUERADE_DOMAIN_FILE(`filename') 1524*7c478bd9Sstevel@tonic-gate 1525*7c478bd9Sstevel@tonic-gateto read the list of names from the indicated file (i.e., to add 1526*7c478bd9Sstevel@tonic-gateelements to class {M}). 1527*7c478bd9Sstevel@tonic-gate 1528*7c478bd9Sstevel@tonic-gateTo exempt hosts or subdomains from being masqueraded, you can use 1529*7c478bd9Sstevel@tonic-gate 1530*7c478bd9Sstevel@tonic-gate MASQUERADE_EXCEPTION(`host.domain') 1531*7c478bd9Sstevel@tonic-gate 1532*7c478bd9Sstevel@tonic-gateThis can come handy if you want to masquerade a whole domain 1533*7c478bd9Sstevel@tonic-gateexcept for one (or a few) host(s). If these names are in a file, 1534*7c478bd9Sstevel@tonic-gateyou can use 1535*7c478bd9Sstevel@tonic-gate 1536*7c478bd9Sstevel@tonic-gate MASQUERADE_EXCEPTION_FILE(`filename') 1537*7c478bd9Sstevel@tonic-gate 1538*7c478bd9Sstevel@tonic-gateNormally only header addresses are masqueraded. If you want to 1539*7c478bd9Sstevel@tonic-gatemasquerade the envelope as well, use 1540*7c478bd9Sstevel@tonic-gate 1541*7c478bd9Sstevel@tonic-gate FEATURE(`masquerade_envelope') 1542*7c478bd9Sstevel@tonic-gate 1543*7c478bd9Sstevel@tonic-gateThere are always users that need to be "exposed" -- that is, their 1544*7c478bd9Sstevel@tonic-gateinternal site name should be displayed instead of the masquerade name. 1545*7c478bd9Sstevel@tonic-gateRoot is an example (which has been "exposed" by default prior to 8.10). 1546*7c478bd9Sstevel@tonic-gateYou can add users to this list using 1547*7c478bd9Sstevel@tonic-gate 1548*7c478bd9Sstevel@tonic-gate EXPOSED_USER(`usernames') 1549*7c478bd9Sstevel@tonic-gate 1550*7c478bd9Sstevel@tonic-gateThis adds users to class {E}; you could also use 1551*7c478bd9Sstevel@tonic-gate 1552*7c478bd9Sstevel@tonic-gate EXPOSED_USER_FILE(`filename') 1553*7c478bd9Sstevel@tonic-gate 1554*7c478bd9Sstevel@tonic-gateYou can also arrange to relay all unqualified names (that is, names 1555*7c478bd9Sstevel@tonic-gatewithout @host) to a relay host. For example, if you have a central 1556*7c478bd9Sstevel@tonic-gateemail server, you might relay to that host so that users don't have 1557*7c478bd9Sstevel@tonic-gateto have .forward files or aliases. You can do this using 1558*7c478bd9Sstevel@tonic-gate 1559*7c478bd9Sstevel@tonic-gate define(`LOCAL_RELAY', `mailer:hostname') 1560*7c478bd9Sstevel@tonic-gate 1561*7c478bd9Sstevel@tonic-gateThe ``mailer:'' can be omitted, in which case the mailer defaults to 1562*7c478bd9Sstevel@tonic-gate"relay". There are some user names that you don't want relayed, perhaps 1563*7c478bd9Sstevel@tonic-gatebecause of local aliases. A common example is root, which may be 1564*7c478bd9Sstevel@tonic-gatelocally aliased. You can add entries to this list using 1565*7c478bd9Sstevel@tonic-gate 1566*7c478bd9Sstevel@tonic-gate LOCAL_USER(`usernames') 1567*7c478bd9Sstevel@tonic-gate 1568*7c478bd9Sstevel@tonic-gateThis adds users to class {L}; you could also use 1569*7c478bd9Sstevel@tonic-gate 1570*7c478bd9Sstevel@tonic-gate LOCAL_USER_FILE(`filename') 1571*7c478bd9Sstevel@tonic-gate 1572*7c478bd9Sstevel@tonic-gateIf you want all incoming mail sent to a centralized hub, as for a 1573*7c478bd9Sstevel@tonic-gateshared /var/spool/mail scheme, use 1574*7c478bd9Sstevel@tonic-gate 1575*7c478bd9Sstevel@tonic-gate define(`MAIL_HUB', `mailer:hostname') 1576*7c478bd9Sstevel@tonic-gate 1577*7c478bd9Sstevel@tonic-gateAgain, ``mailer:'' defaults to "relay". If you define both LOCAL_RELAY 1578*7c478bd9Sstevel@tonic-gateand MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will 1579*7c478bd9Sstevel@tonic-gatebe sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB. 1580*7c478bd9Sstevel@tonic-gateNote: there is a (long standing) bug which keeps this combination from 1581*7c478bd9Sstevel@tonic-gateworking for addresses of the form user+detail. 1582*7c478bd9Sstevel@tonic-gateNames in class {L} will be delivered locally, so you MUST have aliases or 1583*7c478bd9Sstevel@tonic-gate.forward files for them. 1584*7c478bd9Sstevel@tonic-gate 1585*7c478bd9Sstevel@tonic-gateFor example, if you are on machine mastodon.CS.Berkeley.EDU and you have 1586*7c478bd9Sstevel@tonic-gateFEATURE(`stickyhost'), the following combinations of settings will have the 1587*7c478bd9Sstevel@tonic-gateindicated effects: 1588*7c478bd9Sstevel@tonic-gate 1589*7c478bd9Sstevel@tonic-gateemail sent to.... eric eric@mastodon.CS.Berkeley.EDU 1590*7c478bd9Sstevel@tonic-gate 1591*7c478bd9Sstevel@tonic-gateLOCAL_RELAY set to mail.CS.Berkeley.EDU (delivered locally) 1592*7c478bd9Sstevel@tonic-gatemail.CS.Berkeley.EDU (no local aliasing) (aliasing done) 1593*7c478bd9Sstevel@tonic-gate 1594*7c478bd9Sstevel@tonic-gateMAIL_HUB set to mammoth.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU 1595*7c478bd9Sstevel@tonic-gatemammoth.CS.Berkeley.EDU (aliasing done) (aliasing done) 1596*7c478bd9Sstevel@tonic-gate 1597*7c478bd9Sstevel@tonic-gateBoth LOCAL_RELAY and mail.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU 1598*7c478bd9Sstevel@tonic-gateMAIL_HUB set as above (no local aliasing) (aliasing done) 1599*7c478bd9Sstevel@tonic-gate 1600*7c478bd9Sstevel@tonic-gateIf you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and 1601*7c478bd9Sstevel@tonic-gateMAIL_HUB act identically, with MAIL_HUB taking precedence. 1602*7c478bd9Sstevel@tonic-gate 1603*7c478bd9Sstevel@tonic-gateIf you want all outgoing mail to go to a central relay site, define 1604*7c478bd9Sstevel@tonic-gateSMART_HOST as well. Briefly: 1605*7c478bd9Sstevel@tonic-gate 1606*7c478bd9Sstevel@tonic-gate LOCAL_RELAY applies to unqualified names (e.g., "eric"). 1607*7c478bd9Sstevel@tonic-gate MAIL_HUB applies to names qualified with the name of the 1608*7c478bd9Sstevel@tonic-gate local host (e.g., "eric@mastodon.CS.Berkeley.EDU"). 1609*7c478bd9Sstevel@tonic-gate SMART_HOST applies to names qualified with other hosts or 1610*7c478bd9Sstevel@tonic-gate bracketed addresses (e.g., "eric@mastodon.CS.Berkeley.EDU" 1611*7c478bd9Sstevel@tonic-gate or "eric@[127.0.0.1]"). 1612*7c478bd9Sstevel@tonic-gate 1613*7c478bd9Sstevel@tonic-gateHowever, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY, 1614*7c478bd9Sstevel@tonic-gateDECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you 1615*7c478bd9Sstevel@tonic-gatereally want absolutely everything to go to a single central site you will 1616*7c478bd9Sstevel@tonic-gateneed to unset all the other relays -- or better yet, find or build a 1617*7c478bd9Sstevel@tonic-gateminimal config file that does this. 1618*7c478bd9Sstevel@tonic-gate 1619*7c478bd9Sstevel@tonic-gateFor duplicate suppression to work properly, the host name is best 1620*7c478bd9Sstevel@tonic-gatespecified with a terminal dot: 1621*7c478bd9Sstevel@tonic-gate 1622*7c478bd9Sstevel@tonic-gate define(`MAIL_HUB', `host.domain.') 1623*7c478bd9Sstevel@tonic-gate note the trailing dot ---^ 1624*7c478bd9Sstevel@tonic-gate 1625*7c478bd9Sstevel@tonic-gate 1626*7c478bd9Sstevel@tonic-gate+-------------------------------------------+ 1627*7c478bd9Sstevel@tonic-gate| USING LDAP FOR ALIASES, MAPS, AND CLASSES | 1628*7c478bd9Sstevel@tonic-gate+-------------------------------------------+ 1629*7c478bd9Sstevel@tonic-gate 1630*7c478bd9Sstevel@tonic-gateLDAP can be used for aliases, maps, and classes by either specifying your 1631*7c478bd9Sstevel@tonic-gateown LDAP map specification or using the built-in default LDAP map 1632*7c478bd9Sstevel@tonic-gatespecification. The built-in default specifications all provide lookups 1633*7c478bd9Sstevel@tonic-gatewhich match against either the machine's fully qualified hostname (${j}) or 1634*7c478bd9Sstevel@tonic-gatea "cluster". The cluster allows you to share LDAP entries among a large 1635*7c478bd9Sstevel@tonic-gatenumber of machines without having to enter each of the machine names into 1636*7c478bd9Sstevel@tonic-gateeach LDAP entry. To set the LDAP cluster name to use for a particular 1637*7c478bd9Sstevel@tonic-gatemachine or set of machines, set the confLDAP_CLUSTER m4 variable to a 1638*7c478bd9Sstevel@tonic-gateunique name. For example: 1639*7c478bd9Sstevel@tonic-gate 1640*7c478bd9Sstevel@tonic-gate define(`confLDAP_CLUSTER', `Servers') 1641*7c478bd9Sstevel@tonic-gate 1642*7c478bd9Sstevel@tonic-gateHere, the word `Servers' will be the cluster name. As an example, assume 1643*7c478bd9Sstevel@tonic-gatethat smtp.sendmail.org, etrn.sendmail.org, and mx.sendmail.org all belong 1644*7c478bd9Sstevel@tonic-gateto the Servers cluster. 1645*7c478bd9Sstevel@tonic-gate 1646*7c478bd9Sstevel@tonic-gateSome of the LDAP LDIF examples below show use of the Servers cluster. 1647*7c478bd9Sstevel@tonic-gateEvery entry must have either a sendmailMTAHost or sendmailMTACluster 1648*7c478bd9Sstevel@tonic-gateattribute or it will be ignored. Be careful as mixing clusters and 1649*7c478bd9Sstevel@tonic-gateindividual host records can have surprising results (see the CAUTION 1650*7c478bd9Sstevel@tonic-gatesections below). 1651*7c478bd9Sstevel@tonic-gate 1652*7c478bd9Sstevel@tonic-gateSee the file cf/sendmail.schema for the actual LDAP schemas. Note that 1653*7c478bd9Sstevel@tonic-gatethis schema (and therefore the lookups and examples below) is experimental 1654*7c478bd9Sstevel@tonic-gateat this point as it has had little public review. Therefore, it may change 1655*7c478bd9Sstevel@tonic-gatein future versions. Feedback via sendmail@sendmail.org is encouraged. 1656*7c478bd9Sstevel@tonic-gate 1657*7c478bd9Sstevel@tonic-gate------- 1658*7c478bd9Sstevel@tonic-gateAliases 1659*7c478bd9Sstevel@tonic-gate------- 1660*7c478bd9Sstevel@tonic-gate 1661*7c478bd9Sstevel@tonic-gateThe ALIAS_FILE (O AliasFile) option can be set to use LDAP for alias 1662*7c478bd9Sstevel@tonic-gatelookups. To use the default schema, simply use: 1663*7c478bd9Sstevel@tonic-gate 1664*7c478bd9Sstevel@tonic-gate define(`ALIAS_FILE', `ldap:') 1665*7c478bd9Sstevel@tonic-gate 1666*7c478bd9Sstevel@tonic-gateBy doing so, you will use the default schema which expands to a map 1667*7c478bd9Sstevel@tonic-gatedeclared as follows: 1668*7c478bd9Sstevel@tonic-gate 1669*7c478bd9Sstevel@tonic-gate ldap -k (&(objectClass=sendmailMTAAliasObject) 1670*7c478bd9Sstevel@tonic-gate (sendmailMTAAliasGrouping=aliases) 1671*7c478bd9Sstevel@tonic-gate (|(sendmailMTACluster=${sendmailMTACluster}) 1672*7c478bd9Sstevel@tonic-gate (sendmailMTAHost=$j)) 1673*7c478bd9Sstevel@tonic-gate (sendmailMTAKey=%0)) 1674*7c478bd9Sstevel@tonic-gate -v sendmailMTAAliasValue,sendmailMTAAliasSearch:FILTER:sendmailMTAAliasObject,sendmailMTAAliasURL:URL:sendmailMTAAliasObject 1675*7c478bd9Sstevel@tonic-gate 1676*7c478bd9Sstevel@tonic-gate 1677*7c478bd9Sstevel@tonic-gateNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually 1678*7c478bd9Sstevel@tonic-gateused when the binary expands the `ldap:' token as the AliasFile option is 1679*7c478bd9Sstevel@tonic-gatenot actually macro-expanded when read from the sendmail.cf file. 1680*7c478bd9Sstevel@tonic-gate 1681*7c478bd9Sstevel@tonic-gateExample LDAP LDIF entries might be: 1682*7c478bd9Sstevel@tonic-gate 1683*7c478bd9Sstevel@tonic-gate dn: sendmailMTAKey=sendmail-list, dc=sendmail, dc=org 1684*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTA 1685*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAAlias 1686*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAAliasObject 1687*7c478bd9Sstevel@tonic-gate sendmailMTAAliasGrouping: aliases 1688*7c478bd9Sstevel@tonic-gate sendmailMTAHost: etrn.sendmail.org 1689*7c478bd9Sstevel@tonic-gate sendmailMTAKey: sendmail-list 1690*7c478bd9Sstevel@tonic-gate sendmailMTAAliasValue: ca@example.org 1691*7c478bd9Sstevel@tonic-gate sendmailMTAAliasValue: eric 1692*7c478bd9Sstevel@tonic-gate sendmailMTAAliasValue: gshapiro@example.com 1693*7c478bd9Sstevel@tonic-gate 1694*7c478bd9Sstevel@tonic-gate dn: sendmailMTAKey=owner-sendmail-list, dc=sendmail, dc=org 1695*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTA 1696*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAAlias 1697*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAAliasObject 1698*7c478bd9Sstevel@tonic-gate sendmailMTAAliasGrouping: aliases 1699*7c478bd9Sstevel@tonic-gate sendmailMTAHost: etrn.sendmail.org 1700*7c478bd9Sstevel@tonic-gate sendmailMTAKey: owner-sendmail-list 1701*7c478bd9Sstevel@tonic-gate sendmailMTAAliasValue: eric 1702*7c478bd9Sstevel@tonic-gate 1703*7c478bd9Sstevel@tonic-gate dn: sendmailMTAKey=postmaster, dc=sendmail, dc=org 1704*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTA 1705*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAAlias 1706*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAAliasObject 1707*7c478bd9Sstevel@tonic-gate sendmailMTAAliasGrouping: aliases 1708*7c478bd9Sstevel@tonic-gate sendmailMTACluster: Servers 1709*7c478bd9Sstevel@tonic-gate sendmailMTAKey: postmaster 1710*7c478bd9Sstevel@tonic-gate sendmailMTAAliasValue: eric 1711*7c478bd9Sstevel@tonic-gate 1712*7c478bd9Sstevel@tonic-gateHere, the aliases sendmail-list and owner-sendmail-list will be available 1713*7c478bd9Sstevel@tonic-gateonly on etrn.sendmail.org but the postmaster alias will be available on 1714*7c478bd9Sstevel@tonic-gateevery machine in the Servers cluster (including etrn.sendmail.org). 1715*7c478bd9Sstevel@tonic-gate 1716*7c478bd9Sstevel@tonic-gateCAUTION: aliases are additive so that entries like these: 1717*7c478bd9Sstevel@tonic-gate 1718*7c478bd9Sstevel@tonic-gate dn: sendmailMTAKey=bob, dc=sendmail, dc=org 1719*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTA 1720*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAAlias 1721*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAAliasObject 1722*7c478bd9Sstevel@tonic-gate sendmailMTAAliasGrouping: aliases 1723*7c478bd9Sstevel@tonic-gate sendmailMTACluster: Servers 1724*7c478bd9Sstevel@tonic-gate sendmailMTAKey: bob 1725*7c478bd9Sstevel@tonic-gate sendmailMTAAliasValue: eric 1726*7c478bd9Sstevel@tonic-gate 1727*7c478bd9Sstevel@tonic-gate dn: sendmailMTAKey=bobetrn, dc=sendmail, dc=org 1728*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTA 1729*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAAlias 1730*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAAliasObject 1731*7c478bd9Sstevel@tonic-gate sendmailMTAAliasGrouping: aliases 1732*7c478bd9Sstevel@tonic-gate sendmailMTAHost: etrn.sendmail.org 1733*7c478bd9Sstevel@tonic-gate sendmailMTAKey: bob 1734*7c478bd9Sstevel@tonic-gate sendmailMTAAliasValue: gshapiro 1735*7c478bd9Sstevel@tonic-gate 1736*7c478bd9Sstevel@tonic-gatewould mean that on all of the hosts in the cluster, mail to bob would go to 1737*7c478bd9Sstevel@tonic-gateeric EXCEPT on etrn.sendmail.org in which case it would go to BOTH eric and 1738*7c478bd9Sstevel@tonic-gategshapiro. 1739*7c478bd9Sstevel@tonic-gate 1740*7c478bd9Sstevel@tonic-gateIf you prefer not to use the default LDAP schema for your aliases, you can 1741*7c478bd9Sstevel@tonic-gatespecify the map parameters when setting ALIAS_FILE. For example: 1742*7c478bd9Sstevel@tonic-gate 1743*7c478bd9Sstevel@tonic-gate define(`ALIAS_FILE', `ldap:-k (&(objectClass=mailGroup)(mail=%0)) -v mgrpRFC822MailMember') 1744*7c478bd9Sstevel@tonic-gate 1745*7c478bd9Sstevel@tonic-gate---- 1746*7c478bd9Sstevel@tonic-gateMaps 1747*7c478bd9Sstevel@tonic-gate---- 1748*7c478bd9Sstevel@tonic-gate 1749*7c478bd9Sstevel@tonic-gateFEATURE()'s which take an optional map definition argument (e.g., access, 1750*7c478bd9Sstevel@tonic-gatemailertable, virtusertable, etc.) can instead take the special keyword 1751*7c478bd9Sstevel@tonic-gate`LDAP', e.g.: 1752*7c478bd9Sstevel@tonic-gate 1753*7c478bd9Sstevel@tonic-gate FEATURE(`access_db', `LDAP') 1754*7c478bd9Sstevel@tonic-gate FEATURE(`virtusertable', `LDAP') 1755*7c478bd9Sstevel@tonic-gate 1756*7c478bd9Sstevel@tonic-gateWhen this keyword is given, that map will use LDAP lookups consisting of 1757*7c478bd9Sstevel@tonic-gatethe objectClass sendmailMTAClassObject, the attribute sendmailMTAMapName 1758*7c478bd9Sstevel@tonic-gatewith the map name, a search attribute of sendmailMTAKey, and the value 1759*7c478bd9Sstevel@tonic-gateattribute sendmailMTAMapValue. 1760*7c478bd9Sstevel@tonic-gate 1761*7c478bd9Sstevel@tonic-gateThe values for sendmailMTAMapName are: 1762*7c478bd9Sstevel@tonic-gate 1763*7c478bd9Sstevel@tonic-gate FEATURE() sendmailMTAMapName 1764*7c478bd9Sstevel@tonic-gate --------- ------------------ 1765*7c478bd9Sstevel@tonic-gate access_db access 1766*7c478bd9Sstevel@tonic-gate authinfo authinfo 1767*7c478bd9Sstevel@tonic-gate bitdomain bitdomain 1768*7c478bd9Sstevel@tonic-gate domaintable domain 1769*7c478bd9Sstevel@tonic-gate genericstable generics 1770*7c478bd9Sstevel@tonic-gate mailertable mailer 1771*7c478bd9Sstevel@tonic-gate uucpdomain uucpdomain 1772*7c478bd9Sstevel@tonic-gate virtusertable virtuser 1773*7c478bd9Sstevel@tonic-gate 1774*7c478bd9Sstevel@tonic-gateFor example, FEATURE(`mailertable', `LDAP') would use the map definition: 1775*7c478bd9Sstevel@tonic-gate 1776*7c478bd9Sstevel@tonic-gate Kmailertable ldap -k (&(objectClass=sendmailMTAMapObject) 1777*7c478bd9Sstevel@tonic-gate (sendmailMTAMapName=mailer) 1778*7c478bd9Sstevel@tonic-gate (|(sendmailMTACluster=${sendmailMTACluster}) 1779*7c478bd9Sstevel@tonic-gate (sendmailMTAHost=$j)) 1780*7c478bd9Sstevel@tonic-gate (sendmailMTAKey=%0)) 1781*7c478bd9Sstevel@tonic-gate -1 -v sendmailMTAMapValue,sendmailMTAMapSearch:FILTER:sendmailMTAMapObject,sendmailMTAMapURL:URL:sendmailMTAMapObject 1782*7c478bd9Sstevel@tonic-gate 1783*7c478bd9Sstevel@tonic-gateAn example LDAP LDIF entry using this map might be: 1784*7c478bd9Sstevel@tonic-gate 1785*7c478bd9Sstevel@tonic-gate dn: sendmailMTAMapName=mailer, dc=sendmail, dc=org 1786*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTA 1787*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAMap 1788*7c478bd9Sstevel@tonic-gate sendmailMTACluster: Servers 1789*7c478bd9Sstevel@tonic-gate sendmailMTAMapName: mailer 1790*7c478bd9Sstevel@tonic-gate 1791*7c478bd9Sstevel@tonic-gate dn: sendmailMTAKey=example.com, sendmailMTAMapName=mailer, dc=sendmail, dc=org 1792*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTA 1793*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAMap 1794*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAMapObject 1795*7c478bd9Sstevel@tonic-gate sendmailMTAMapName: mailer 1796*7c478bd9Sstevel@tonic-gate sendmailMTACluster: Servers 1797*7c478bd9Sstevel@tonic-gate sendmailMTAKey: example.com 1798*7c478bd9Sstevel@tonic-gate sendmailMTAMapValue: relay:[smtp.example.com] 1799*7c478bd9Sstevel@tonic-gate 1800*7c478bd9Sstevel@tonic-gateCAUTION: If your LDAP database contains the record above and *ALSO* a host 1801*7c478bd9Sstevel@tonic-gatespecific record such as: 1802*7c478bd9Sstevel@tonic-gate 1803*7c478bd9Sstevel@tonic-gate dn: sendmailMTAKey=example.com@etrn, sendmailMTAMapName=mailer, dc=sendmail, dc=org 1804*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTA 1805*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAMap 1806*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAMapObject 1807*7c478bd9Sstevel@tonic-gate sendmailMTAMapName: mailer 1808*7c478bd9Sstevel@tonic-gate sendmailMTAHost: etrn.sendmail.org 1809*7c478bd9Sstevel@tonic-gate sendmailMTAKey: example.com 1810*7c478bd9Sstevel@tonic-gate sendmailMTAMapValue: relay:[mx.example.com] 1811*7c478bd9Sstevel@tonic-gate 1812*7c478bd9Sstevel@tonic-gatethen these entries will give unexpected results. When the lookup is done 1813*7c478bd9Sstevel@tonic-gateon etrn.sendmail.org, the effect is that there is *NO* match at all as maps 1814*7c478bd9Sstevel@tonic-gaterequire a single match. Since the host etrn.sendmail.org is also in the 1815*7c478bd9Sstevel@tonic-gateServers cluster, LDAP would return two answers for the example.com map key 1816*7c478bd9Sstevel@tonic-gatein which case sendmail would treat this as no match at all. 1817*7c478bd9Sstevel@tonic-gate 1818*7c478bd9Sstevel@tonic-gateIf you prefer not to use the default LDAP schema for your maps, you can 1819*7c478bd9Sstevel@tonic-gatespecify the map parameters when using the FEATURE(). For example: 1820*7c478bd9Sstevel@tonic-gate 1821*7c478bd9Sstevel@tonic-gate FEATURE(`access_db', `ldap:-1 -k (&(objectClass=mapDatabase)(key=%0)) -v value') 1822*7c478bd9Sstevel@tonic-gate 1823*7c478bd9Sstevel@tonic-gate------- 1824*7c478bd9Sstevel@tonic-gateClasses 1825*7c478bd9Sstevel@tonic-gate------- 1826*7c478bd9Sstevel@tonic-gate 1827*7c478bd9Sstevel@tonic-gateNormally, classes can be filled via files or programs. As of 8.12, they 1828*7c478bd9Sstevel@tonic-gatecan also be filled via map lookups using a new syntax: 1829*7c478bd9Sstevel@tonic-gate 1830*7c478bd9Sstevel@tonic-gate F{ClassName}mapkey@mapclass:mapspec 1831*7c478bd9Sstevel@tonic-gate 1832*7c478bd9Sstevel@tonic-gatemapkey is optional and if not provided the map key will be empty. This can 1833*7c478bd9Sstevel@tonic-gatebe used with LDAP to read classes from LDAP. Note that the lookup is only 1834*7c478bd9Sstevel@tonic-gatedone when sendmail is initially started. Use the special value `@LDAP' to 1835*7c478bd9Sstevel@tonic-gateuse the default LDAP schema. For example: 1836*7c478bd9Sstevel@tonic-gate 1837*7c478bd9Sstevel@tonic-gate RELAY_DOMAIN_FILE(`@LDAP') 1838*7c478bd9Sstevel@tonic-gate 1839*7c478bd9Sstevel@tonic-gatewould put all of the attribute sendmailMTAClassValue values of LDAP records 1840*7c478bd9Sstevel@tonic-gatewith objectClass sendmailMTAClass and an attribute sendmailMTAClassName of 1841*7c478bd9Sstevel@tonic-gate'R' into class $={R}. In other words, it is equivalent to the LDAP map 1842*7c478bd9Sstevel@tonic-gatespecification: 1843*7c478bd9Sstevel@tonic-gate 1844*7c478bd9Sstevel@tonic-gate F{R}@ldap:-k (&(objectClass=sendmailMTAClass) 1845*7c478bd9Sstevel@tonic-gate (sendmailMTAClassName=R) 1846*7c478bd9Sstevel@tonic-gate (|(sendmailMTACluster=${sendmailMTACluster}) 1847*7c478bd9Sstevel@tonic-gate (sendmailMTAHost=$j))) 1848*7c478bd9Sstevel@tonic-gate -v sendmailMTAClassValue,sendmailMTAClassSearch:FILTER:sendmailMTAClass,sendmailMTAClassURL:URL:sendmailMTAClass 1849*7c478bd9Sstevel@tonic-gate 1850*7c478bd9Sstevel@tonic-gateNOTE: The macros shown above ${sendmailMTACluster} and $j are not actually 1851*7c478bd9Sstevel@tonic-gateused when the binary expands the `@LDAP' token as class declarations are 1852*7c478bd9Sstevel@tonic-gatenot actually macro-expanded when read from the sendmail.cf file. 1853*7c478bd9Sstevel@tonic-gate 1854*7c478bd9Sstevel@tonic-gateThis can be used with class related commands such as RELAY_DOMAIN_FILE(), 1855*7c478bd9Sstevel@tonic-gateMASQUERADE_DOMAIN_FILE(), etc: 1856*7c478bd9Sstevel@tonic-gate 1857*7c478bd9Sstevel@tonic-gate Command sendmailMTAClassName 1858*7c478bd9Sstevel@tonic-gate ------- -------------------- 1859*7c478bd9Sstevel@tonic-gate CANONIFY_DOMAIN_FILE() Canonify 1860*7c478bd9Sstevel@tonic-gate EXPOSED_USER_FILE() E 1861*7c478bd9Sstevel@tonic-gate GENERICS_DOMAIN_FILE() G 1862*7c478bd9Sstevel@tonic-gate LDAPROUTE_DOMAIN_FILE() LDAPRoute 1863*7c478bd9Sstevel@tonic-gate LDAPROUTE_EQUIVALENT_FILE() LDAPRouteEquiv 1864*7c478bd9Sstevel@tonic-gate LOCAL_USER_FILE() L 1865*7c478bd9Sstevel@tonic-gate MASQUERADE_DOMAIN_FILE() M 1866*7c478bd9Sstevel@tonic-gate MASQUERADE_EXCEPTION_FILE() N 1867*7c478bd9Sstevel@tonic-gate RELAY_DOMAIN_FILE() R 1868*7c478bd9Sstevel@tonic-gate VIRTUSER_DOMAIN_FILE() VirtHost 1869*7c478bd9Sstevel@tonic-gate 1870*7c478bd9Sstevel@tonic-gateYou can also add your own as any 'F'ile class of the form: 1871*7c478bd9Sstevel@tonic-gate 1872*7c478bd9Sstevel@tonic-gate F{ClassName}@LDAP 1873*7c478bd9Sstevel@tonic-gate ^^^^^^^^^ 1874*7c478bd9Sstevel@tonic-gatewill use "ClassName" for the sendmailMTAClassName. 1875*7c478bd9Sstevel@tonic-gate 1876*7c478bd9Sstevel@tonic-gateAn example LDAP LDIF entry would look like: 1877*7c478bd9Sstevel@tonic-gate 1878*7c478bd9Sstevel@tonic-gate dn: sendmailMTAClassName=R, dc=sendmail, dc=org 1879*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTA 1880*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAClass 1881*7c478bd9Sstevel@tonic-gate sendmailMTACluster: Servers 1882*7c478bd9Sstevel@tonic-gate sendmailMTAClassName: R 1883*7c478bd9Sstevel@tonic-gate sendmailMTAClassValue: sendmail.org 1884*7c478bd9Sstevel@tonic-gate sendmailMTAClassValue: example.com 1885*7c478bd9Sstevel@tonic-gate sendmailMTAClassValue: 10.56.23 1886*7c478bd9Sstevel@tonic-gate 1887*7c478bd9Sstevel@tonic-gateCAUTION: If your LDAP database contains the record above and *ALSO* a host 1888*7c478bd9Sstevel@tonic-gatespecific record such as: 1889*7c478bd9Sstevel@tonic-gate 1890*7c478bd9Sstevel@tonic-gate dn: sendmailMTAClassName=R@etrn.sendmail.org, dc=sendmail, dc=org 1891*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTA 1892*7c478bd9Sstevel@tonic-gate objectClass: sendmailMTAClass 1893*7c478bd9Sstevel@tonic-gate sendmailMTAHost: etrn.sendmail.org 1894*7c478bd9Sstevel@tonic-gate sendmailMTAClassName: R 1895*7c478bd9Sstevel@tonic-gate sendmailMTAClassValue: example.com 1896*7c478bd9Sstevel@tonic-gate 1897*7c478bd9Sstevel@tonic-gatethe result will be similar to the aliases caution above. When the lookup 1898*7c478bd9Sstevel@tonic-gateis done on etrn.sendmail.org, $={R} would contain all of the entries (from 1899*7c478bd9Sstevel@tonic-gateboth the cluster match and the host match). In other words, the effective 1900*7c478bd9Sstevel@tonic-gateis additive. 1901*7c478bd9Sstevel@tonic-gate 1902*7c478bd9Sstevel@tonic-gateIf you prefer not to use the default LDAP schema for your classes, you can 1903*7c478bd9Sstevel@tonic-gatespecify the map parameters when using the class command. For example: 1904*7c478bd9Sstevel@tonic-gate 1905*7c478bd9Sstevel@tonic-gate VIRTUSER_DOMAIN_FILE(`@ldap:-k (&(objectClass=virtHosts)(host=*)) -v host') 1906*7c478bd9Sstevel@tonic-gate 1907*7c478bd9Sstevel@tonic-gateRemember, macros can not be used in a class declaration as the binary does 1908*7c478bd9Sstevel@tonic-gatenot expand them. 1909*7c478bd9Sstevel@tonic-gate 1910*7c478bd9Sstevel@tonic-gate 1911*7c478bd9Sstevel@tonic-gate+--------------+ 1912*7c478bd9Sstevel@tonic-gate| LDAP ROUTING | 1913*7c478bd9Sstevel@tonic-gate+--------------+ 1914*7c478bd9Sstevel@tonic-gate 1915*7c478bd9Sstevel@tonic-gateFEATURE(`ldap_routing') can be used to implement the IETF Internet Draft 1916*7c478bd9Sstevel@tonic-gateLDAP Schema for Intranet Mail Routing 1917*7c478bd9Sstevel@tonic-gate(draft-lachman-laser-ldap-mail-routing-01). This feature enables 1918*7c478bd9Sstevel@tonic-gateLDAP-based rerouting of a particular address to either a different host 1919*7c478bd9Sstevel@tonic-gateor a different address. The LDAP lookup is first attempted on the full 1920*7c478bd9Sstevel@tonic-gateaddress (e.g., user@example.com) and then on the domain portion 1921*7c478bd9Sstevel@tonic-gate(e.g., @example.com). Be sure to setup your domain for LDAP routing using 1922*7c478bd9Sstevel@tonic-gateLDAPROUTE_DOMAIN(), e.g.: 1923*7c478bd9Sstevel@tonic-gate 1924*7c478bd9Sstevel@tonic-gate LDAPROUTE_DOMAIN(`example.com') 1925*7c478bd9Sstevel@tonic-gate 1926*7c478bd9Sstevel@tonic-gateAdditionally, you can specify equivalent domains for LDAP routing using 1927*7c478bd9Sstevel@tonic-gateLDAPROUTE_EQUIVALENT() and LDAPROUTE_EQUIVALENT_FILE(). 'Equivalent' 1928*7c478bd9Sstevel@tonic-gatehostnames are mapped to $M (the masqueraded hostname for the server) before 1929*7c478bd9Sstevel@tonic-gatethe LDAP query. For example, if the mail is addressed to 1930*7c478bd9Sstevel@tonic-gateuser@host1.example.com, normally the LDAP lookup would only be done for 1931*7c478bd9Sstevel@tonic-gate'user@host1.example.com' and '@host1.example.com'. However, if 1932*7c478bd9Sstevel@tonic-gateLDAPROUTE_EQUIVALENT(`host1.example.com') is used, the lookups would also be 1933*7c478bd9Sstevel@tonic-gatedone on 'user@example.com' and '@example.com' after attempting the 1934*7c478bd9Sstevel@tonic-gatehost1.example.com lookups. 1935*7c478bd9Sstevel@tonic-gate 1936*7c478bd9Sstevel@tonic-gateBy default, the feature will use the schemas as specified in the draft 1937*7c478bd9Sstevel@tonic-gateand will not reject addresses not found by the LDAP lookup. However, 1938*7c478bd9Sstevel@tonic-gatethis behavior can be changed by giving additional arguments to the FEATURE() 1939*7c478bd9Sstevel@tonic-gatecommand: 1940*7c478bd9Sstevel@tonic-gate 1941*7c478bd9Sstevel@tonic-gate FEATURE(`ldap_routing', <mailHost>, <mailRoutingAddress>, <bounce>, 1942*7c478bd9Sstevel@tonic-gate <detail>, <nodomain>, <tempfail>) 1943*7c478bd9Sstevel@tonic-gate 1944*7c478bd9Sstevel@tonic-gatewhere <mailHost> is a map definition describing how to lookup an alternative 1945*7c478bd9Sstevel@tonic-gatemail host for a particular address; <mailRoutingAddress> is a map definition 1946*7c478bd9Sstevel@tonic-gatedescribing how to lookup an alternative address for a particular address; 1947*7c478bd9Sstevel@tonic-gatethe <bounce> argument, if present and not the word "passthru", dictates 1948*7c478bd9Sstevel@tonic-gatethat mail should be bounced if neither a mailHost nor mailRoutingAddress 1949*7c478bd9Sstevel@tonic-gateis found, if set to "sendertoo", the sender will be rejected if not 1950*7c478bd9Sstevel@tonic-gatefound in LDAP; and <detail> indicates what actions to take if the address 1951*7c478bd9Sstevel@tonic-gatecontains +detail information -- `strip' tries the lookup with the +detail 1952*7c478bd9Sstevel@tonic-gateand if no matches are found, strips the +detail and tries the lookup again; 1953*7c478bd9Sstevel@tonic-gate`preserve', does the same as `strip' but if a mailRoutingAddress match is 1954*7c478bd9Sstevel@tonic-gatefound, the +detail information is copied to the new address; the <nodomain> 1955*7c478bd9Sstevel@tonic-gateargument, if present, will prevent the @domain lookup if the full 1956*7c478bd9Sstevel@tonic-gateaddress is not found in LDAP; the <tempfail> argument, if set to 1957*7c478bd9Sstevel@tonic-gate"tempfail", instructs the rules to give an SMTP 4XX temporary 1958*7c478bd9Sstevel@tonic-gateerror if the LDAP server gives the MTA a temporary failure, or if set to 1959*7c478bd9Sstevel@tonic-gate"queue" (the default), the MTA will locally queue the mail. 1960*7c478bd9Sstevel@tonic-gate 1961*7c478bd9Sstevel@tonic-gateThe default <mailHost> map definition is: 1962*7c478bd9Sstevel@tonic-gate 1963*7c478bd9Sstevel@tonic-gate ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient) 1964*7c478bd9Sstevel@tonic-gate (mailLocalAddress=%0)) 1965*7c478bd9Sstevel@tonic-gate 1966*7c478bd9Sstevel@tonic-gateThe default <mailRoutingAddress> map definition is: 1967*7c478bd9Sstevel@tonic-gate 1968*7c478bd9Sstevel@tonic-gate ldap -1 -T<TMPF> -v mailRoutingAddress 1969*7c478bd9Sstevel@tonic-gate -k (&(objectClass=inetLocalMailRecipient) 1970*7c478bd9Sstevel@tonic-gate (mailLocalAddress=%0)) 1971*7c478bd9Sstevel@tonic-gate 1972*7c478bd9Sstevel@tonic-gateNote that neither includes the LDAP server hostname (-h server) or base DN 1973*7c478bd9Sstevel@tonic-gate(-b o=org,c=COUNTRY), both necessary for LDAP queries. It is presumed that 1974*7c478bd9Sstevel@tonic-gateyour .mc file contains a setting for the confLDAP_DEFAULT_SPEC option with 1975*7c478bd9Sstevel@tonic-gatethese settings. If this is not the case, the map definitions should be 1976*7c478bd9Sstevel@tonic-gatechanged as described above. The "-T<TMPF>" is required in any user 1977*7c478bd9Sstevel@tonic-gatespecified map definition to catch temporary errors. 1978*7c478bd9Sstevel@tonic-gate 1979*7c478bd9Sstevel@tonic-gateThe following possibilities exist as a result of an LDAP lookup on an 1980*7c478bd9Sstevel@tonic-gateaddress: 1981*7c478bd9Sstevel@tonic-gate 1982*7c478bd9Sstevel@tonic-gate mailHost is mailRoutingAddress is Results in 1983*7c478bd9Sstevel@tonic-gate ----------- --------------------- ---------- 1984*7c478bd9Sstevel@tonic-gate set to a set mail delivered to 1985*7c478bd9Sstevel@tonic-gate "local" host mailRoutingAddress 1986*7c478bd9Sstevel@tonic-gate 1987*7c478bd9Sstevel@tonic-gate set to a not set delivered to 1988*7c478bd9Sstevel@tonic-gate "local" host original address 1989*7c478bd9Sstevel@tonic-gate 1990*7c478bd9Sstevel@tonic-gate set to a set mailRoutingAddress 1991*7c478bd9Sstevel@tonic-gate remote host relayed to mailHost 1992*7c478bd9Sstevel@tonic-gate 1993*7c478bd9Sstevel@tonic-gate set to a not set original address 1994*7c478bd9Sstevel@tonic-gate remote host relayed to mailHost 1995*7c478bd9Sstevel@tonic-gate 1996*7c478bd9Sstevel@tonic-gate not set set mail delivered to 1997*7c478bd9Sstevel@tonic-gate mailRoutingAddress 1998*7c478bd9Sstevel@tonic-gate 1999*7c478bd9Sstevel@tonic-gate not set not set delivered to 2000*7c478bd9Sstevel@tonic-gate original address *OR* 2001*7c478bd9Sstevel@tonic-gate bounced as unknown user 2002*7c478bd9Sstevel@tonic-gate 2003*7c478bd9Sstevel@tonic-gateThe term "local" host above means the host specified is in class {w}. If 2004*7c478bd9Sstevel@tonic-gatethe result would mean sending the mail to a different host, that host is 2005*7c478bd9Sstevel@tonic-gatelooked up in the mailertable before delivery. 2006*7c478bd9Sstevel@tonic-gate 2007*7c478bd9Sstevel@tonic-gateNote that the last case depends on whether the third argument is given 2008*7c478bd9Sstevel@tonic-gateto the FEATURE() command. The default is to deliver the message to the 2009*7c478bd9Sstevel@tonic-gateoriginal address. 2010*7c478bd9Sstevel@tonic-gate 2011*7c478bd9Sstevel@tonic-gateThe LDAP entries should be set up with an objectClass of 2012*7c478bd9Sstevel@tonic-gateinetLocalMailRecipient and the address be listed in a mailLocalAddress 2013*7c478bd9Sstevel@tonic-gateattribute. If present, there must be only one mailHost attribute and it 2014*7c478bd9Sstevel@tonic-gatemust contain a fully qualified host name as its value. Similarly, if 2015*7c478bd9Sstevel@tonic-gatepresent, there must be only one mailRoutingAddress attribute and it must 2016*7c478bd9Sstevel@tonic-gatecontain an RFC 822 compliant address. Some example LDAP records (in LDIF 2017*7c478bd9Sstevel@tonic-gateformat): 2018*7c478bd9Sstevel@tonic-gate 2019*7c478bd9Sstevel@tonic-gate dn: uid=tom, o=example.com, c=US 2020*7c478bd9Sstevel@tonic-gate objectClass: inetLocalMailRecipient 2021*7c478bd9Sstevel@tonic-gate mailLocalAddress: tom@example.com 2022*7c478bd9Sstevel@tonic-gate mailRoutingAddress: thomas@mailhost.example.com 2023*7c478bd9Sstevel@tonic-gate 2024*7c478bd9Sstevel@tonic-gateThis would deliver mail for tom@example.com to thomas@mailhost.example.com. 2025*7c478bd9Sstevel@tonic-gate 2026*7c478bd9Sstevel@tonic-gate dn: uid=dick, o=example.com, c=US 2027*7c478bd9Sstevel@tonic-gate objectClass: inetLocalMailRecipient 2028*7c478bd9Sstevel@tonic-gate mailLocalAddress: dick@example.com 2029*7c478bd9Sstevel@tonic-gate mailHost: eng.example.com 2030*7c478bd9Sstevel@tonic-gate 2031*7c478bd9Sstevel@tonic-gateThis would relay mail for dick@example.com to the same address but redirect 2032*7c478bd9Sstevel@tonic-gatethe mail to MX records listed for the host eng.example.com (unless the 2033*7c478bd9Sstevel@tonic-gatemailertable overrides). 2034*7c478bd9Sstevel@tonic-gate 2035*7c478bd9Sstevel@tonic-gate dn: uid=harry, o=example.com, c=US 2036*7c478bd9Sstevel@tonic-gate objectClass: inetLocalMailRecipient 2037*7c478bd9Sstevel@tonic-gate mailLocalAddress: harry@example.com 2038*7c478bd9Sstevel@tonic-gate mailHost: mktmail.example.com 2039*7c478bd9Sstevel@tonic-gate mailRoutingAddress: harry@mkt.example.com 2040*7c478bd9Sstevel@tonic-gate 2041*7c478bd9Sstevel@tonic-gateThis would relay mail for harry@example.com to the MX records listed for 2042*7c478bd9Sstevel@tonic-gatethe host mktmail.example.com using the new address harry@mkt.example.com 2043*7c478bd9Sstevel@tonic-gatewhen talking to that host. 2044*7c478bd9Sstevel@tonic-gate 2045*7c478bd9Sstevel@tonic-gate dn: uid=virtual.example.com, o=example.com, c=US 2046*7c478bd9Sstevel@tonic-gate objectClass: inetLocalMailRecipient 2047*7c478bd9Sstevel@tonic-gate mailLocalAddress: @virtual.example.com 2048*7c478bd9Sstevel@tonic-gate mailHost: server.example.com 2049*7c478bd9Sstevel@tonic-gate mailRoutingAddress: virtual@example.com 2050*7c478bd9Sstevel@tonic-gate 2051*7c478bd9Sstevel@tonic-gateThis would send all mail destined for any username @virtual.example.com to 2052*7c478bd9Sstevel@tonic-gatethe machine server.example.com's MX servers and deliver to the address 2053*7c478bd9Sstevel@tonic-gatevirtual@example.com on that relay machine. 2054*7c478bd9Sstevel@tonic-gate 2055*7c478bd9Sstevel@tonic-gate 2056*7c478bd9Sstevel@tonic-gate+---------------------------------+ 2057*7c478bd9Sstevel@tonic-gate| ANTI-SPAM CONFIGURATION CONTROL | 2058*7c478bd9Sstevel@tonic-gate+---------------------------------+ 2059*7c478bd9Sstevel@tonic-gate 2060*7c478bd9Sstevel@tonic-gateThe primary anti-spam features available in sendmail are: 2061*7c478bd9Sstevel@tonic-gate 2062*7c478bd9Sstevel@tonic-gate* Relaying is denied by default. 2063*7c478bd9Sstevel@tonic-gate* Better checking on sender information. 2064*7c478bd9Sstevel@tonic-gate* Access database. 2065*7c478bd9Sstevel@tonic-gate* Header checks. 2066*7c478bd9Sstevel@tonic-gate 2067*7c478bd9Sstevel@tonic-gateRelaying (transmission of messages from a site outside your host (class 2068*7c478bd9Sstevel@tonic-gate{w}) to another site except yours) is denied by default. Note that this 2069*7c478bd9Sstevel@tonic-gatechanged in sendmail 8.9; previous versions allowed relaying by default. 2070*7c478bd9Sstevel@tonic-gateIf you really want to revert to the old behaviour, you will need to use 2071*7c478bd9Sstevel@tonic-gateFEATURE(`promiscuous_relay'). You can allow certain domains to relay 2072*7c478bd9Sstevel@tonic-gatethrough your server by adding their domain name or IP address to class 2073*7c478bd9Sstevel@tonic-gate{R} using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the access database 2074*7c478bd9Sstevel@tonic-gate(described below). Note that IPv6 addresses must be prefaced with "IPv6:". 2075*7c478bd9Sstevel@tonic-gateThe file consists (like any other file based class) of entries listed on 2076*7c478bd9Sstevel@tonic-gateseparate lines, e.g., 2077*7c478bd9Sstevel@tonic-gate 2078*7c478bd9Sstevel@tonic-gate sendmail.org 2079*7c478bd9Sstevel@tonic-gate 128.32 2080*7c478bd9Sstevel@tonic-gate IPv6:2002:c0a8:02c7 2081*7c478bd9Sstevel@tonic-gate IPv6:2002:c0a8:51d2::23f4 2082*7c478bd9Sstevel@tonic-gate host.mydomain.com 2083*7c478bd9Sstevel@tonic-gate [UNIX:localhost] 2084*7c478bd9Sstevel@tonic-gate 2085*7c478bd9Sstevel@tonic-gateNotice: the last entry allows relaying for connections via a UNIX 2086*7c478bd9Sstevel@tonic-gatesocket to the MTA/MSP. This might be necessary if your configuration 2087*7c478bd9Sstevel@tonic-gatedoesn't allow relaying by other means in that case, e.g., by having 2088*7c478bd9Sstevel@tonic-gatelocalhost.$m in class {R} (make sure $m is not just a top level 2089*7c478bd9Sstevel@tonic-gatedomain). 2090*7c478bd9Sstevel@tonic-gate 2091*7c478bd9Sstevel@tonic-gateIf you use 2092*7c478bd9Sstevel@tonic-gate 2093*7c478bd9Sstevel@tonic-gate FEATURE(`relay_entire_domain') 2094*7c478bd9Sstevel@tonic-gate 2095*7c478bd9Sstevel@tonic-gatethen any host in any of your local domains (that is, class {m}) 2096*7c478bd9Sstevel@tonic-gatewill be relayed (that is, you will accept mail either to or from any 2097*7c478bd9Sstevel@tonic-gatehost in your domain). 2098*7c478bd9Sstevel@tonic-gate 2099*7c478bd9Sstevel@tonic-gateYou can also allow relaying based on the MX records of the host 2100*7c478bd9Sstevel@tonic-gateportion of an incoming recipient address by using 2101*7c478bd9Sstevel@tonic-gate 2102*7c478bd9Sstevel@tonic-gate FEATURE(`relay_based_on_MX') 2103*7c478bd9Sstevel@tonic-gate 2104*7c478bd9Sstevel@tonic-gateFor example, if your server receives a recipient of user@domain.com 2105*7c478bd9Sstevel@tonic-gateand domain.com lists your server in its MX records, the mail will be 2106*7c478bd9Sstevel@tonic-gateaccepted for relay to domain.com. This feature may cause problems 2107*7c478bd9Sstevel@tonic-gateif MX lookups for the recipient domain are slow or time out. In that 2108*7c478bd9Sstevel@tonic-gatecase, mail will be temporarily rejected. It is usually better to 2109*7c478bd9Sstevel@tonic-gatemaintain a list of hosts/domains for which the server acts as relay. 2110*7c478bd9Sstevel@tonic-gateNote also that this feature will stop spammers from using your host 2111*7c478bd9Sstevel@tonic-gateto relay spam but it will not stop outsiders from using your server 2112*7c478bd9Sstevel@tonic-gateas a relay for their site (that is, they set up an MX record pointing 2113*7c478bd9Sstevel@tonic-gateto your mail server, and you will relay mail addressed to them 2114*7c478bd9Sstevel@tonic-gatewithout any prior arrangement). Along the same lines, 2115*7c478bd9Sstevel@tonic-gate 2116*7c478bd9Sstevel@tonic-gate FEATURE(`relay_local_from') 2117*7c478bd9Sstevel@tonic-gate 2118*7c478bd9Sstevel@tonic-gatewill allow relaying if the sender specifies a return path (i.e. 2119*7c478bd9Sstevel@tonic-gateMAIL FROM: <user@domain>) domain which is a local domain. This is a 2120*7c478bd9Sstevel@tonic-gatedangerous feature as it will allow spammers to spam using your mail 2121*7c478bd9Sstevel@tonic-gateserver by simply specifying a return address of user@your.domain.com. 2122*7c478bd9Sstevel@tonic-gateIt should not be used unless absolutely necessary. 2123*7c478bd9Sstevel@tonic-gateA slightly better solution is 2124*7c478bd9Sstevel@tonic-gate 2125*7c478bd9Sstevel@tonic-gate FEATURE(`relay_mail_from') 2126*7c478bd9Sstevel@tonic-gate 2127*7c478bd9Sstevel@tonic-gatewhich allows relaying if the mail sender is listed as RELAY in the 2128*7c478bd9Sstevel@tonic-gateaccess map. If an optional argument `domain' (this is the literal 2129*7c478bd9Sstevel@tonic-gateword `domain', not a placeholder) is given, the domain portion of 2130*7c478bd9Sstevel@tonic-gatethe mail sender is also checked to allowing relaying. This option 2131*7c478bd9Sstevel@tonic-gateonly works together with the tag From: for the LHS of the access 2132*7c478bd9Sstevel@tonic-gatemap entries. This feature allows spammers to abuse your mail server 2133*7c478bd9Sstevel@tonic-gateby specifying a return address that you enabled in your access file. 2134*7c478bd9Sstevel@tonic-gateThis may be harder to figure out for spammers, but it should not 2135*7c478bd9Sstevel@tonic-gatebe used unless necessary. Instead use STARTTLS to 2136*7c478bd9Sstevel@tonic-gateallow relaying for roaming users. 2137*7c478bd9Sstevel@tonic-gate 2138*7c478bd9Sstevel@tonic-gate 2139*7c478bd9Sstevel@tonic-gateIf source routing is used in the recipient address (e.g., 2140*7c478bd9Sstevel@tonic-gateRCPT TO: <user%site.com@othersite.com>), sendmail will check 2141*7c478bd9Sstevel@tonic-gateuser@site.com for relaying if othersite.com is an allowed relay host 2142*7c478bd9Sstevel@tonic-gatein either class {R}, class {m} if FEATURE(`relay_entire_domain') is used, 2143*7c478bd9Sstevel@tonic-gateor the access database if FEATURE(`access_db') is used. To prevent 2144*7c478bd9Sstevel@tonic-gatethe address from being stripped down, use: 2145*7c478bd9Sstevel@tonic-gate 2146*7c478bd9Sstevel@tonic-gate FEATURE(`loose_relay_check') 2147*7c478bd9Sstevel@tonic-gate 2148*7c478bd9Sstevel@tonic-gateIf you think you need to use this feature, you probably do not. This 2149*7c478bd9Sstevel@tonic-gateshould only be used for sites which have no control over the addresses 2150*7c478bd9Sstevel@tonic-gatethat they provide a gateway for. Use this FEATURE with caution as it 2151*7c478bd9Sstevel@tonic-gatecan allow spammers to relay through your server if not setup properly. 2152*7c478bd9Sstevel@tonic-gate 2153*7c478bd9Sstevel@tonic-gateNOTICE: It is possible to relay mail through a system which the anti-relay 2154*7c478bd9Sstevel@tonic-gaterules do not prevent: the case of a system that does use FEATURE(`nouucp', 2155*7c478bd9Sstevel@tonic-gate`nospecial') (system A) and relays local messages to a mail hub (e.g., via 2156*7c478bd9Sstevel@tonic-gateLOCAL_RELAY or LUSER_RELAY) (system B). If system B doesn't use 2157*7c478bd9Sstevel@tonic-gateFEATURE(`nouucp') at all, addresses of the form 2158*7c478bd9Sstevel@tonic-gate<example.net!user@local.host> would be relayed to <user@example.net>. 2159*7c478bd9Sstevel@tonic-gateSystem A doesn't recognize `!' as an address separator and therefore 2160*7c478bd9Sstevel@tonic-gateforwards it to the mail hub which in turns relays it because it came from 2161*7c478bd9Sstevel@tonic-gatea trusted local host. So if a mailserver allows UUCP (bang-format) 2162*7c478bd9Sstevel@tonic-gateaddresses, all systems from which it allows relaying should do the same 2163*7c478bd9Sstevel@tonic-gateor reject those addresses. 2164*7c478bd9Sstevel@tonic-gate 2165*7c478bd9Sstevel@tonic-gateAs of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has 2166*7c478bd9Sstevel@tonic-gatean unresolvable domain (i.e., one that DNS, your local name service, 2167*7c478bd9Sstevel@tonic-gateor special case rules in ruleset 3 cannot locate). This also applies 2168*7c478bd9Sstevel@tonic-gateto addresses that use domain literals, e.g., <user@[1.2.3.4]>, if the 2169*7c478bd9Sstevel@tonic-gateIP address can't be mapped to a host name. If you want to continue 2170*7c478bd9Sstevel@tonic-gateto accept such domains, e.g., because you are inside a firewall that 2171*7c478bd9Sstevel@tonic-gatehas only a limited view of the Internet host name space (note that you 2172*7c478bd9Sstevel@tonic-gatewill not be able to return mail to them unless you have some "smart 2173*7c478bd9Sstevel@tonic-gatehost" forwarder), use 2174*7c478bd9Sstevel@tonic-gate 2175*7c478bd9Sstevel@tonic-gate FEATURE(`accept_unresolvable_domains') 2176*7c478bd9Sstevel@tonic-gate 2177*7c478bd9Sstevel@tonic-gateAlternatively, you can allow specific addresses by adding them to 2178*7c478bd9Sstevel@tonic-gatethe access map, e.g., 2179*7c478bd9Sstevel@tonic-gate 2180*7c478bd9Sstevel@tonic-gate From:unresolvable.domain OK 2181*7c478bd9Sstevel@tonic-gate From:[1.2.3.4] OK 2182*7c478bd9Sstevel@tonic-gate From:[1.2.4] OK 2183*7c478bd9Sstevel@tonic-gate 2184*7c478bd9Sstevel@tonic-gateNotice: domains which are temporarily unresolvable are (temporarily) 2185*7c478bd9Sstevel@tonic-gaterejected with a 451 reply code. If those domains should be accepted 2186*7c478bd9Sstevel@tonic-gate(which is discouraged) then you can use 2187*7c478bd9Sstevel@tonic-gate 2188*7c478bd9Sstevel@tonic-gate LOCAL_CONFIG 2189*7c478bd9Sstevel@tonic-gate C{ResOk}TEMP 2190*7c478bd9Sstevel@tonic-gate 2191*7c478bd9Sstevel@tonic-gatesendmail will also refuse mail if the MAIL FROM: parameter is not 2192*7c478bd9Sstevel@tonic-gatefully qualified (i.e., contains a domain as well as a user). If you 2193*7c478bd9Sstevel@tonic-gatewant to continue to accept such senders, use 2194*7c478bd9Sstevel@tonic-gate 2195*7c478bd9Sstevel@tonic-gate FEATURE(`accept_unqualified_senders') 2196*7c478bd9Sstevel@tonic-gate 2197*7c478bd9Sstevel@tonic-gateSetting the DaemonPortOptions modifier 'u' overrides the default behavior, 2198*7c478bd9Sstevel@tonic-gatei.e., unqualified addresses are accepted even without this FEATURE. If 2199*7c478bd9Sstevel@tonic-gatethis FEATURE is not used, the DaemonPortOptions modifier 'f' can be used 2200*7c478bd9Sstevel@tonic-gateto enforce fully qualified domain names. 2201*7c478bd9Sstevel@tonic-gate 2202*7c478bd9Sstevel@tonic-gateAn ``access'' database can be created to accept or reject mail from 2203*7c478bd9Sstevel@tonic-gateselected domains. For example, you may choose to reject all mail 2204*7c478bd9Sstevel@tonic-gateoriginating from known spammers. To enable such a database, use 2205*7c478bd9Sstevel@tonic-gate 2206*7c478bd9Sstevel@tonic-gate FEATURE(`access_db') 2207*7c478bd9Sstevel@tonic-gate 2208*7c478bd9Sstevel@tonic-gateNotice: the access database is applied to the envelope addresses 2209*7c478bd9Sstevel@tonic-gateand the connection information, not to the header. 2210*7c478bd9Sstevel@tonic-gate 2211*7c478bd9Sstevel@tonic-gateThe FEATURE macro can accept as second parameter the key file 2212*7c478bd9Sstevel@tonic-gatedefinition for the database; for example 2213*7c478bd9Sstevel@tonic-gate 2214*7c478bd9Sstevel@tonic-gate FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access_map') 2215*7c478bd9Sstevel@tonic-gate 2216*7c478bd9Sstevel@tonic-gateNotice: If a second argument is specified it must contain the option 2217*7c478bd9Sstevel@tonic-gate`-T<TMPF>' as shown above. The optional third and fourth parameters 2218*7c478bd9Sstevel@tonic-gatemay be `skip' or `lookupdotdomain'. The former enables SKIP as 2219*7c478bd9Sstevel@tonic-gatevalue part (see below), the latter is another way to enable the 2220*7c478bd9Sstevel@tonic-gatefeature of the same name (see above). 2221*7c478bd9Sstevel@tonic-gate 2222*7c478bd9Sstevel@tonic-gateRemember, since /etc/mail/access is a database, after creating the text 2223*7c478bd9Sstevel@tonic-gatefile as described below, you must use makemap to create the database 2224*7c478bd9Sstevel@tonic-gatemap. For example: 2225*7c478bd9Sstevel@tonic-gate 2226*7c478bd9Sstevel@tonic-gate makemap hash /etc/mail/access < /etc/mail/access 2227*7c478bd9Sstevel@tonic-gate 2228*7c478bd9Sstevel@tonic-gateThe table itself uses e-mail addresses, domain names, and network 2229*7c478bd9Sstevel@tonic-gatenumbers as keys. Note that IPv6 addresses must be prefaced with "IPv6:". 2230*7c478bd9Sstevel@tonic-gateFor example, 2231*7c478bd9Sstevel@tonic-gate 2232*7c478bd9Sstevel@tonic-gate From:spammer@aol.com REJECT 2233*7c478bd9Sstevel@tonic-gate From:cyberspammer.com REJECT 2234*7c478bd9Sstevel@tonic-gate Connect:cyberspammer.com REJECT 2235*7c478bd9Sstevel@tonic-gate Connect:TLD REJECT 2236*7c478bd9Sstevel@tonic-gate Connect:192.168.212 REJECT 2237*7c478bd9Sstevel@tonic-gate Connect:IPv6:2002:c0a8:02c7 RELAY 2238*7c478bd9Sstevel@tonic-gate Connect:IPv6:2002:c0a8:51d2::23f4 REJECT 2239*7c478bd9Sstevel@tonic-gate 2240*7c478bd9Sstevel@tonic-gatewould refuse mail from spammer@aol.com, any user from cyberspammer.com 2241*7c478bd9Sstevel@tonic-gate(or any host within the cyberspammer.com domain), any host in the entire 2242*7c478bd9Sstevel@tonic-gatetop level domain TLD, 192.168.212.* network, and the IPv6 address 2243*7c478bd9Sstevel@tonic-gate2002:c0a8:51d2::23f4. It would allow relay for the IPv6 network 2244*7c478bd9Sstevel@tonic-gate2002:c0a8:02c7::/48. 2245*7c478bd9Sstevel@tonic-gate 2246*7c478bd9Sstevel@tonic-gateEntries in the access map should be tagged according to their type. 2247*7c478bd9Sstevel@tonic-gateThree tags are available: 2248*7c478bd9Sstevel@tonic-gate 2249*7c478bd9Sstevel@tonic-gate Connect: connection information (${client_addr}, ${client_name}) 2250*7c478bd9Sstevel@tonic-gate From: envelope sender 2251*7c478bd9Sstevel@tonic-gate To: envelope recipient 2252*7c478bd9Sstevel@tonic-gate 2253*7c478bd9Sstevel@tonic-gateNotice: untagged entries are deprecated. 2254*7c478bd9Sstevel@tonic-gate 2255*7c478bd9Sstevel@tonic-gateIf the required item is looked up in a map, it will be tried first 2256*7c478bd9Sstevel@tonic-gatewith the corresponding tag in front, then (as fallback to enable 2257*7c478bd9Sstevel@tonic-gatebackward compatibility) without any tag, unless the specific feature 2258*7c478bd9Sstevel@tonic-gaterequires a tag. For example, 2259*7c478bd9Sstevel@tonic-gate 2260*7c478bd9Sstevel@tonic-gate From:spammer@some.dom REJECT 2261*7c478bd9Sstevel@tonic-gate To:friend.domain RELAY 2262*7c478bd9Sstevel@tonic-gate Connect:friend.domain OK 2263*7c478bd9Sstevel@tonic-gate Connect:from.domain RELAY 2264*7c478bd9Sstevel@tonic-gate From:good@another.dom OK 2265*7c478bd9Sstevel@tonic-gate From:another.dom REJECT 2266*7c478bd9Sstevel@tonic-gate 2267*7c478bd9Sstevel@tonic-gateThis would deny mails from spammer@some.dom but you could still 2268*7c478bd9Sstevel@tonic-gatesend mail to that address even if FEATURE(`blacklist_recipients') 2269*7c478bd9Sstevel@tonic-gateis enabled. Your system will allow relaying to friend.domain, but 2270*7c478bd9Sstevel@tonic-gatenot from it (unless enabled by other means). Connections from that 2271*7c478bd9Sstevel@tonic-gatedomain will be allowed even if it ends up in one of the DNS based 2272*7c478bd9Sstevel@tonic-gaterejection lists. Relaying is enabled from from.domain but not to 2273*7c478bd9Sstevel@tonic-gateit (since relaying is based on the connection information for 2274*7c478bd9Sstevel@tonic-gateoutgoing relaying, the tag Connect: must be used; for incoming 2275*7c478bd9Sstevel@tonic-gaterelaying, which is based on the recipient address, To: must be 2276*7c478bd9Sstevel@tonic-gateused). The last two entries allow mails from good@another.dom but 2277*7c478bd9Sstevel@tonic-gatereject mail from all other addresses with another.dom as domain 2278*7c478bd9Sstevel@tonic-gatepart. 2279*7c478bd9Sstevel@tonic-gate 2280*7c478bd9Sstevel@tonic-gate 2281*7c478bd9Sstevel@tonic-gateThe value part of the map can contain: 2282*7c478bd9Sstevel@tonic-gate 2283*7c478bd9Sstevel@tonic-gate OK Accept mail even if other rules in the running 2284*7c478bd9Sstevel@tonic-gate ruleset would reject it, for example, if the domain 2285*7c478bd9Sstevel@tonic-gate name is unresolvable. "Accept" does not mean 2286*7c478bd9Sstevel@tonic-gate "relay", but at most acceptance for local 2287*7c478bd9Sstevel@tonic-gate recipients. That is, OK allows less than RELAY. 2288*7c478bd9Sstevel@tonic-gate RELAY Accept mail addressed to the indicated domain or 2289*7c478bd9Sstevel@tonic-gate received from the indicated domain for relaying 2290*7c478bd9Sstevel@tonic-gate through your SMTP server. RELAY also serves as 2291*7c478bd9Sstevel@tonic-gate an implicit OK for the other checks. 2292*7c478bd9Sstevel@tonic-gate REJECT Reject the sender or recipient with a general 2293*7c478bd9Sstevel@tonic-gate purpose message. 2294*7c478bd9Sstevel@tonic-gate DISCARD Discard the message completely using the 2295*7c478bd9Sstevel@tonic-gate $#discard mailer. If it is used in check_compat, 2296*7c478bd9Sstevel@tonic-gate it affects only the designated recipient, not 2297*7c478bd9Sstevel@tonic-gate the whole message as it does in all other cases. 2298*7c478bd9Sstevel@tonic-gate This should only be used if really necessary. 2299*7c478bd9Sstevel@tonic-gate SKIP This can only be used for host/domain names 2300*7c478bd9Sstevel@tonic-gate and IP addresses/nets. It will abort the current 2301*7c478bd9Sstevel@tonic-gate search for this entry without accepting or rejecting 2302*7c478bd9Sstevel@tonic-gate it but causing the default action. 2303*7c478bd9Sstevel@tonic-gate ### any text where ### is an RFC 821 compliant error code and 2304*7c478bd9Sstevel@tonic-gate "any text" is a message to return for the command. 2305*7c478bd9Sstevel@tonic-gate The string should be quoted to avoid surprises, 2306*7c478bd9Sstevel@tonic-gate e.g., sendmail may remove spaces otherwise. 2307*7c478bd9Sstevel@tonic-gate This type is deprecated, use one of the two 2308*7c478bd9Sstevel@tonic-gate ERROR: entries below instead. 2309*7c478bd9Sstevel@tonic-gate ERROR:### any text 2310*7c478bd9Sstevel@tonic-gate as above, but useful to mark error messages as such. 2311*7c478bd9Sstevel@tonic-gate ERROR:D.S.N:### any text 2312*7c478bd9Sstevel@tonic-gate where D.S.N is an RFC 1893 compliant error code 2313*7c478bd9Sstevel@tonic-gate and the rest as above. 2314*7c478bd9Sstevel@tonic-gate QUARANTINE:any text 2315*7c478bd9Sstevel@tonic-gate Quarantine the message using the given text as the 2316*7c478bd9Sstevel@tonic-gate quarantining reason. 2317*7c478bd9Sstevel@tonic-gate 2318*7c478bd9Sstevel@tonic-gateFor example: 2319*7c478bd9Sstevel@tonic-gate 2320*7c478bd9Sstevel@tonic-gate From:cyberspammer.com ERROR:"550 We don't accept mail from spammers" 2321*7c478bd9Sstevel@tonic-gate From:okay.cyberspammer.com OK 2322*7c478bd9Sstevel@tonic-gate Connect:sendmail.org RELAY 2323*7c478bd9Sstevel@tonic-gate To:sendmail.org RELAY 2324*7c478bd9Sstevel@tonic-gate Connect:128.32 RELAY 2325*7c478bd9Sstevel@tonic-gate Connect:128.32.2 SKIP 2326*7c478bd9Sstevel@tonic-gate Connect:IPv6:1:2:3:4:5:6:7 RELAY 2327*7c478bd9Sstevel@tonic-gate Connect:suspicious.example.com QUARANTINE:Mail from suspicious host 2328*7c478bd9Sstevel@tonic-gate Connect:[127.0.0.3] OK 2329*7c478bd9Sstevel@tonic-gate Connect:[IPv6:1:2:3:4:5:6:7:8] OK 2330*7c478bd9Sstevel@tonic-gate 2331*7c478bd9Sstevel@tonic-gatewould accept mail from okay.cyberspammer.com, but would reject mail 2332*7c478bd9Sstevel@tonic-gatefrom all other hosts at cyberspammer.com with the indicated message. 2333*7c478bd9Sstevel@tonic-gateIt would allow relaying mail from and to any hosts in the sendmail.org 2334*7c478bd9Sstevel@tonic-gatedomain, and allow relaying from the IPv6 1:2:3:4:5:6:7:* network 2335*7c478bd9Sstevel@tonic-gateand from the 128.32.*.* network except for the 128.32.2.* network, 2336*7c478bd9Sstevel@tonic-gatewhich shows how SKIP is useful to exempt subnets/subdomains. The 2337*7c478bd9Sstevel@tonic-gatelast two entries are for checks against ${client_name} if the IP 2338*7c478bd9Sstevel@tonic-gateaddress doesn't resolve to a hostname (or is considered as "may be 2339*7c478bd9Sstevel@tonic-gateforged"). That is, using square brackets means these are host 2340*7c478bd9Sstevel@tonic-gatenames, not network numbers. 2341*7c478bd9Sstevel@tonic-gate 2342*7c478bd9Sstevel@tonic-gateWarning: if you change the RFC 821 compliant error code from the default 2343*7c478bd9Sstevel@tonic-gatevalue of 550, then you should probably also change the RFC 1893 compliant 2344*7c478bd9Sstevel@tonic-gateerror code to match it. For example, if you use 2345*7c478bd9Sstevel@tonic-gate 2346*7c478bd9Sstevel@tonic-gate To:user@example.com ERROR:450 mailbox full 2347*7c478bd9Sstevel@tonic-gate 2348*7c478bd9Sstevel@tonic-gatethe error returned would be "450 5.0.0 mailbox full" which is wrong. 2349*7c478bd9Sstevel@tonic-gateUse "ERROR:4.2.2:450 mailbox full" instead. 2350*7c478bd9Sstevel@tonic-gate 2351*7c478bd9Sstevel@tonic-gateNote, UUCP users may need to add hostname.UUCP to the access database 2352*7c478bd9Sstevel@tonic-gateor class {R}. 2353*7c478bd9Sstevel@tonic-gate 2354*7c478bd9Sstevel@tonic-gateIf you also use: 2355*7c478bd9Sstevel@tonic-gate 2356*7c478bd9Sstevel@tonic-gate FEATURE(`relay_hosts_only') 2357*7c478bd9Sstevel@tonic-gate 2358*7c478bd9Sstevel@tonic-gatethen the above example will allow relaying for sendmail.org, but not 2359*7c478bd9Sstevel@tonic-gatehosts within the sendmail.org domain. Note that this will also require 2360*7c478bd9Sstevel@tonic-gatehosts listed in class {R} to be fully qualified host names. 2361*7c478bd9Sstevel@tonic-gate 2362*7c478bd9Sstevel@tonic-gateYou can also use the access database to block sender addresses based on 2363*7c478bd9Sstevel@tonic-gatethe username portion of the address. For example: 2364*7c478bd9Sstevel@tonic-gate 2365*7c478bd9Sstevel@tonic-gate From:FREE.STEALTH.MAILER@ ERROR:550 Spam not accepted 2366*7c478bd9Sstevel@tonic-gate 2367*7c478bd9Sstevel@tonic-gateNote that you must include the @ after the username to signify that 2368*7c478bd9Sstevel@tonic-gatethis database entry is for checking only the username portion of the 2369*7c478bd9Sstevel@tonic-gatesender address. 2370*7c478bd9Sstevel@tonic-gate 2371*7c478bd9Sstevel@tonic-gateIf you use: 2372*7c478bd9Sstevel@tonic-gate 2373*7c478bd9Sstevel@tonic-gate FEATURE(`blacklist_recipients') 2374*7c478bd9Sstevel@tonic-gate 2375*7c478bd9Sstevel@tonic-gatethen you can add entries to the map for local users, hosts in your 2376*7c478bd9Sstevel@tonic-gatedomains, or addresses in your domain which should not receive mail: 2377*7c478bd9Sstevel@tonic-gate 2378*7c478bd9Sstevel@tonic-gate To:badlocaluser@ ERROR:550 Mailbox disabled for badlocaluser 2379*7c478bd9Sstevel@tonic-gate To:host.my.TLD ERROR:550 That host does not accept mail 2380*7c478bd9Sstevel@tonic-gate To:user@other.my.TLD ERROR:550 Mailbox disabled for this recipient 2381*7c478bd9Sstevel@tonic-gate 2382*7c478bd9Sstevel@tonic-gateThis would prevent a recipient of badlocaluser in any of the local 2383*7c478bd9Sstevel@tonic-gatedomains (class {w}), any user at host.my.TLD, and the single address 2384*7c478bd9Sstevel@tonic-gateuser@other.my.TLD from receiving mail. Please note: a local username 2385*7c478bd9Sstevel@tonic-gatemust be now tagged with an @ (this is consistent with the check of 2386*7c478bd9Sstevel@tonic-gatethe sender address, and hence it is possible to distinguish between 2387*7c478bd9Sstevel@tonic-gatehostnames and usernames). Enabling this feature will keep you from 2388*7c478bd9Sstevel@tonic-gatesending mails to all addresses that have an error message or REJECT 2389*7c478bd9Sstevel@tonic-gateas value part in the access map. Taking the example from above: 2390*7c478bd9Sstevel@tonic-gate 2391*7c478bd9Sstevel@tonic-gate spammer@aol.com REJECT 2392*7c478bd9Sstevel@tonic-gate cyberspammer.com REJECT 2393*7c478bd9Sstevel@tonic-gate 2394*7c478bd9Sstevel@tonic-gateMail can't be sent to spammer@aol.com or anyone at cyberspammer.com. 2395*7c478bd9Sstevel@tonic-gateThat's why tagged entries should be used. 2396*7c478bd9Sstevel@tonic-gate 2397*7c478bd9Sstevel@tonic-gateThere are several DNS based blacklists, the first of which was 2398*7c478bd9Sstevel@tonic-gatethe RBL (``Realtime Blackhole List'') run by the MAPS project, 2399*7c478bd9Sstevel@tonic-gatesee http://mail-abuse.org/. These are databases of spammers 2400*7c478bd9Sstevel@tonic-gatemaintained in DNS. To use such a database, specify 2401*7c478bd9Sstevel@tonic-gate 2402*7c478bd9Sstevel@tonic-gate FEATURE(`dnsbl') 2403*7c478bd9Sstevel@tonic-gate 2404*7c478bd9Sstevel@tonic-gateThis will cause sendmail to reject mail from any site in the original 2405*7c478bd9Sstevel@tonic-gateRealtime Blackhole List database. This default DNS blacklist, 2406*7c478bd9Sstevel@tonic-gateblackholes.mail-abuse.org, is a service offered by the Mail Abuse 2407*7c478bd9Sstevel@tonic-gatePrevention System (MAPS). As of July 31, 2001, MAPS is a subscription 2408*7c478bd9Sstevel@tonic-gateservice, so using that network address won't work if you haven't 2409*7c478bd9Sstevel@tonic-gatesubscribed. Contact MAPS to subscribe (http://mail-abuse.org/). 2410*7c478bd9Sstevel@tonic-gate 2411*7c478bd9Sstevel@tonic-gateYou can specify an alternative RBL server to check by specifying an 2412*7c478bd9Sstevel@tonic-gateargument to the FEATURE. The default error message is 2413*7c478bd9Sstevel@tonic-gate 2414*7c478bd9Sstevel@tonic-gate Rejected: IP-ADDRESS listed at SERVER 2415*7c478bd9Sstevel@tonic-gate 2416*7c478bd9Sstevel@tonic-gatewhere IP-ADDRESS and SERVER are replaced by the appropriate 2417*7c478bd9Sstevel@tonic-gateinformation. A second argument can be used to specify a different 2418*7c478bd9Sstevel@tonic-gatetext. By default, temporary lookup failures are ignored and hence 2419*7c478bd9Sstevel@tonic-gatecause the connection not to be rejected by the DNS based rejection 2420*7c478bd9Sstevel@tonic-gatelist. This behavior can be changed by specifying a third argument, 2421*7c478bd9Sstevel@tonic-gatewhich must be either `t' or a full error message. For example: 2422*7c478bd9Sstevel@tonic-gate 2423*7c478bd9Sstevel@tonic-gate FEATURE(`dnsbl', `dnsbl.example.com', `', 2424*7c478bd9Sstevel@tonic-gate `"451 Temporary lookup failure for " $&{client_addr} " in dnsbl.example.com"') 2425*7c478bd9Sstevel@tonic-gate 2426*7c478bd9Sstevel@tonic-gateIf `t' is used, the error message is: 2427*7c478bd9Sstevel@tonic-gate 2428*7c478bd9Sstevel@tonic-gate 451 Temporary lookup failure of IP-ADDRESS at SERVER 2429*7c478bd9Sstevel@tonic-gate 2430*7c478bd9Sstevel@tonic-gatewhere IP-ADDRESS and SERVER are replaced by the appropriate 2431*7c478bd9Sstevel@tonic-gateinformation. 2432*7c478bd9Sstevel@tonic-gate 2433*7c478bd9Sstevel@tonic-gateThis FEATURE can be included several times to query different 2434*7c478bd9Sstevel@tonic-gateDNS based rejection lists, e.g., the dial-up user list (see 2435*7c478bd9Sstevel@tonic-gatehttp://mail-abuse.org/dul/). 2436*7c478bd9Sstevel@tonic-gate 2437*7c478bd9Sstevel@tonic-gateNotice: to avoid checking your own local domains against those 2438*7c478bd9Sstevel@tonic-gateblacklists, use the access_db feature and add: 2439*7c478bd9Sstevel@tonic-gate 2440*7c478bd9Sstevel@tonic-gate Connect:10.1 OK 2441*7c478bd9Sstevel@tonic-gate Connect:127.0.0.1 RELAY 2442*7c478bd9Sstevel@tonic-gate 2443*7c478bd9Sstevel@tonic-gateto the access map, where 10.1 is your local network. You may 2444*7c478bd9Sstevel@tonic-gatewant to use "RELAY" instead of "OK" to allow also relaying 2445*7c478bd9Sstevel@tonic-gateinstead of just disabling the DNS lookups in the blacklists. 2446*7c478bd9Sstevel@tonic-gate 2447*7c478bd9Sstevel@tonic-gate 2448*7c478bd9Sstevel@tonic-gateThe features described above make use of the check_relay, check_mail, 2449*7c478bd9Sstevel@tonic-gateand check_rcpt rulesets. Note that check_relay checks the SMTP 2450*7c478bd9Sstevel@tonic-gateclient hostname and IP address when the connection is made to your 2451*7c478bd9Sstevel@tonic-gateserver. It does not check if a mail message is being relayed to 2452*7c478bd9Sstevel@tonic-gateanother server. That check is done in check_rcpt. If you wish to 2453*7c478bd9Sstevel@tonic-gateinclude your own checks, you can put your checks in the rulesets 2454*7c478bd9Sstevel@tonic-gateLocal_check_relay, Local_check_mail, and Local_check_rcpt. For 2455*7c478bd9Sstevel@tonic-gateexample if you wanted to block senders with all numeric usernames 2456*7c478bd9Sstevel@tonic-gate(i.e. 2312343@bigisp.com), you would use Local_check_mail and the 2457*7c478bd9Sstevel@tonic-gateregex map: 2458*7c478bd9Sstevel@tonic-gate 2459*7c478bd9Sstevel@tonic-gate LOCAL_CONFIG 2460*7c478bd9Sstevel@tonic-gate Kallnumbers regex -a@MATCH ^[0-9]+$ 2461*7c478bd9Sstevel@tonic-gate 2462*7c478bd9Sstevel@tonic-gate LOCAL_RULESETS 2463*7c478bd9Sstevel@tonic-gate SLocal_check_mail 2464*7c478bd9Sstevel@tonic-gate # check address against various regex checks 2465*7c478bd9Sstevel@tonic-gate R$* $: $>Parse0 $>3 $1 2466*7c478bd9Sstevel@tonic-gate R$+ < @ bigisp.com. > $* $: $(allnumbers $1 $) 2467*7c478bd9Sstevel@tonic-gate R@MATCH $#error $: 553 Header Error 2468*7c478bd9Sstevel@tonic-gate 2469*7c478bd9Sstevel@tonic-gateThese rules are called with the original arguments of the corresponding 2470*7c478bd9Sstevel@tonic-gatecheck_* ruleset. If the local ruleset returns $#OK, no further checking 2471*7c478bd9Sstevel@tonic-gateis done by the features described above and the mail is accepted. If 2472*7c478bd9Sstevel@tonic-gatethe local ruleset resolves to a mailer (such as $#error or $#discard), 2473*7c478bd9Sstevel@tonic-gatethe appropriate action is taken. Other results starting with $# are 2474*7c478bd9Sstevel@tonic-gateinterpreted by sendmail and may lead to unspecified behavior. Note: do 2475*7c478bd9Sstevel@tonic-gateNOT create a mailer with the name OK. Return values that do not start 2476*7c478bd9Sstevel@tonic-gatewith $# are ignored, i.e., normal processing continues. 2477*7c478bd9Sstevel@tonic-gate 2478*7c478bd9Sstevel@tonic-gateDelay all checks 2479*7c478bd9Sstevel@tonic-gate---------------- 2480*7c478bd9Sstevel@tonic-gate 2481*7c478bd9Sstevel@tonic-gateBy using FEATURE(`delay_checks') the rulesets check_mail and check_relay 2482*7c478bd9Sstevel@tonic-gatewill not be called when a client connects or issues a MAIL command, 2483*7c478bd9Sstevel@tonic-gaterespectively. Instead, those rulesets will be called by the check_rcpt 2484*7c478bd9Sstevel@tonic-gateruleset; they will be skipped if a sender has been authenticated using 2485*7c478bd9Sstevel@tonic-gatea "trusted" mechanism, i.e., one that is defined via TRUST_AUTH_MECH(). 2486*7c478bd9Sstevel@tonic-gateIf check_mail returns an error then the RCPT TO command will be rejected 2487*7c478bd9Sstevel@tonic-gatewith that error. If it returns some other result starting with $# then 2488*7c478bd9Sstevel@tonic-gatecheck_relay will be skipped. If the sender address (or a part of it) is 2489*7c478bd9Sstevel@tonic-gatelisted in the access map and it has a RHS of OK or RELAY, then check_relay 2490*7c478bd9Sstevel@tonic-gatewill be skipped. This has an interesting side effect: if your domain is 2491*7c478bd9Sstevel@tonic-gatemy.domain and you have 2492*7c478bd9Sstevel@tonic-gate 2493*7c478bd9Sstevel@tonic-gate my.domain RELAY 2494*7c478bd9Sstevel@tonic-gate 2495*7c478bd9Sstevel@tonic-gatein the access map, then any e-mail with a sender address of 2496*7c478bd9Sstevel@tonic-gate<user@my.domain> will not be rejected by check_relay even though 2497*7c478bd9Sstevel@tonic-gateit would match the hostname or IP address. This allows spammers 2498*7c478bd9Sstevel@tonic-gateto get around DNS based blacklist by faking the sender address. To 2499*7c478bd9Sstevel@tonic-gateavoid this problem you have to use tagged entries: 2500*7c478bd9Sstevel@tonic-gate 2501*7c478bd9Sstevel@tonic-gate To:my.domain RELAY 2502*7c478bd9Sstevel@tonic-gate Connect:my.domain RELAY 2503*7c478bd9Sstevel@tonic-gate 2504*7c478bd9Sstevel@tonic-gateif you need those entries at all (class {R} may take care of them). 2505*7c478bd9Sstevel@tonic-gate 2506*7c478bd9Sstevel@tonic-gateFEATURE(`delay_checks') can take an optional argument: 2507*7c478bd9Sstevel@tonic-gate 2508*7c478bd9Sstevel@tonic-gate FEATURE(`delay_checks', `friend') 2509*7c478bd9Sstevel@tonic-gate enables spamfriend test 2510*7c478bd9Sstevel@tonic-gate FEATURE(`delay_checks', `hater') 2511*7c478bd9Sstevel@tonic-gate enables spamhater test 2512*7c478bd9Sstevel@tonic-gate 2513*7c478bd9Sstevel@tonic-gateIf such an argument is given, the recipient will be looked up in the 2514*7c478bd9Sstevel@tonic-gateaccess map (using the tag Spam:). If the argument is `friend', then 2515*7c478bd9Sstevel@tonic-gatethe default behavior is to apply the other rulesets and make a SPAM 2516*7c478bd9Sstevel@tonic-gatefriend the exception. The rulesets check_mail and check_relay will be 2517*7c478bd9Sstevel@tonic-gateskipped only if the recipient address is found and has RHS FRIEND. If 2518*7c478bd9Sstevel@tonic-gatethe argument is `hater', then the default behavior is to skip the rulesets 2519*7c478bd9Sstevel@tonic-gatecheck_mail and check_relay and make a SPAM hater the exception. The 2520*7c478bd9Sstevel@tonic-gateother two rulesets will be applied only if the recipient address is 2521*7c478bd9Sstevel@tonic-gatefound and has RHS HATER. 2522*7c478bd9Sstevel@tonic-gate 2523*7c478bd9Sstevel@tonic-gateThis allows for simple exceptions from the tests, e.g., by activating 2524*7c478bd9Sstevel@tonic-gatethe friend option and having 2525*7c478bd9Sstevel@tonic-gate 2526*7c478bd9Sstevel@tonic-gate Spam:abuse@ FRIEND 2527*7c478bd9Sstevel@tonic-gate 2528*7c478bd9Sstevel@tonic-gatein the access map, mail to abuse@localdomain will get through (where 2529*7c478bd9Sstevel@tonic-gate"localdomain" is any domain in class {w}). It is also possible to 2530*7c478bd9Sstevel@tonic-gatespecify a full address or an address with +detail: 2531*7c478bd9Sstevel@tonic-gate 2532*7c478bd9Sstevel@tonic-gate Spam:abuse@my.domain FRIEND 2533*7c478bd9Sstevel@tonic-gate Spam:me+abuse@ FRIEND 2534*7c478bd9Sstevel@tonic-gate Spam:spam.domain FRIEND 2535*7c478bd9Sstevel@tonic-gate 2536*7c478bd9Sstevel@tonic-gateNote: The required tag has been changed in 8.12 from To: to Spam:. 2537*7c478bd9Sstevel@tonic-gateThis change is incompatible to previous versions. However, you can 2538*7c478bd9Sstevel@tonic-gate(for now) simply add the new entries to the access map, the old 2539*7c478bd9Sstevel@tonic-gateones will be ignored. As soon as you removed the old entries from 2540*7c478bd9Sstevel@tonic-gatethe access map, specify a third parameter (`n') to this feature and 2541*7c478bd9Sstevel@tonic-gatethe backward compatibility rules will not be in the generated .cf 2542*7c478bd9Sstevel@tonic-gatefile. 2543*7c478bd9Sstevel@tonic-gate 2544*7c478bd9Sstevel@tonic-gateHeader Checks 2545*7c478bd9Sstevel@tonic-gate------------- 2546*7c478bd9Sstevel@tonic-gate 2547*7c478bd9Sstevel@tonic-gateYou can also reject mail on the basis of the contents of headers. 2548*7c478bd9Sstevel@tonic-gateThis is done by adding a ruleset call to the 'H' header definition command 2549*7c478bd9Sstevel@tonic-gatein sendmail.cf. For example, this can be used to check the validity of 2550*7c478bd9Sstevel@tonic-gatea Message-ID: header: 2551*7c478bd9Sstevel@tonic-gate 2552*7c478bd9Sstevel@tonic-gate LOCAL_CONFIG 2553*7c478bd9Sstevel@tonic-gate HMessage-Id: $>CheckMessageId 2554*7c478bd9Sstevel@tonic-gate 2555*7c478bd9Sstevel@tonic-gate LOCAL_RULESETS 2556*7c478bd9Sstevel@tonic-gate SCheckMessageId 2557*7c478bd9Sstevel@tonic-gate R< $+ @ $+ > $@ OK 2558*7c478bd9Sstevel@tonic-gate R$* $#error $: 553 Header Error 2559*7c478bd9Sstevel@tonic-gate 2560*7c478bd9Sstevel@tonic-gateThe alternative format: 2561*7c478bd9Sstevel@tonic-gate 2562*7c478bd9Sstevel@tonic-gate HSubject: $>+CheckSubject 2563*7c478bd9Sstevel@tonic-gate 2564*7c478bd9Sstevel@tonic-gatethat is, $>+ instead of $>, gives the full Subject: header including 2565*7c478bd9Sstevel@tonic-gatecomments to the ruleset (comments in parentheses () are stripped 2566*7c478bd9Sstevel@tonic-gateby default). 2567*7c478bd9Sstevel@tonic-gate 2568*7c478bd9Sstevel@tonic-gateA default ruleset for headers which don't have a specific ruleset 2569*7c478bd9Sstevel@tonic-gatedefined for them can be given by: 2570*7c478bd9Sstevel@tonic-gate 2571*7c478bd9Sstevel@tonic-gate H*: $>CheckHdr 2572*7c478bd9Sstevel@tonic-gate 2573*7c478bd9Sstevel@tonic-gateNotice: 2574*7c478bd9Sstevel@tonic-gate1. All rules act on tokens as explained in doc/op/op.{me,ps,txt}. 2575*7c478bd9Sstevel@tonic-gateThat may cause problems with simple header checks due to the 2576*7c478bd9Sstevel@tonic-gatetokenization. It might be simpler to use a regex map and apply it 2577*7c478bd9Sstevel@tonic-gateto $&{currHeader}. 2578*7c478bd9Sstevel@tonic-gate2. There are no default rulesets coming with this distribution of 2579*7c478bd9Sstevel@tonic-gatesendmail. You can either write your own or you can search the 2580*7c478bd9Sstevel@tonic-gateWWW for examples, e.g., http://www.digitalanswers.org/check_local/ 2581*7c478bd9Sstevel@tonic-gate3. When using a default ruleset for headers, the name of the header 2582*7c478bd9Sstevel@tonic-gatecurrently being checked can be found in the $&{hdr_name} macro. 2583*7c478bd9Sstevel@tonic-gate 2584*7c478bd9Sstevel@tonic-gateAfter all of the headers are read, the check_eoh ruleset will be called for 2585*7c478bd9Sstevel@tonic-gateany final header-related checks. The ruleset is called with the number of 2586*7c478bd9Sstevel@tonic-gateheaders and the size of all of the headers in bytes separated by $|. One 2587*7c478bd9Sstevel@tonic-gateexample usage is to reject messages which do not have a Message-Id: 2588*7c478bd9Sstevel@tonic-gateheader. However, the Message-Id: header is *NOT* a required header and is 2589*7c478bd9Sstevel@tonic-gatenot a guaranteed spam indicator. This ruleset is an example and should 2590*7c478bd9Sstevel@tonic-gateprobably not be used in production. 2591*7c478bd9Sstevel@tonic-gate 2592*7c478bd9Sstevel@tonic-gate LOCAL_CONFIG 2593*7c478bd9Sstevel@tonic-gate Kstorage macro 2594*7c478bd9Sstevel@tonic-gate HMessage-Id: $>CheckMessageId 2595*7c478bd9Sstevel@tonic-gate 2596*7c478bd9Sstevel@tonic-gate LOCAL_RULESETS 2597*7c478bd9Sstevel@tonic-gate SCheckMessageId 2598*7c478bd9Sstevel@tonic-gate # Record the presence of the header 2599*7c478bd9Sstevel@tonic-gate R$* $: $(storage {MessageIdCheck} $@ OK $) $1 2600*7c478bd9Sstevel@tonic-gate R< $+ @ $+ > $@ OK 2601*7c478bd9Sstevel@tonic-gate R$* $#error $: 553 Header Error 2602*7c478bd9Sstevel@tonic-gate 2603*7c478bd9Sstevel@tonic-gate Scheck_eoh 2604*7c478bd9Sstevel@tonic-gate # Check the macro 2605*7c478bd9Sstevel@tonic-gate R$* $: < $&{MessageIdCheck} > 2606*7c478bd9Sstevel@tonic-gate # Clear the macro for the next message 2607*7c478bd9Sstevel@tonic-gate R$* $: $(storage {MessageIdCheck} $) $1 2608*7c478bd9Sstevel@tonic-gate # Has a Message-Id: header 2609*7c478bd9Sstevel@tonic-gate R< $+ > $@ OK 2610*7c478bd9Sstevel@tonic-gate # Allow missing Message-Id: from local mail 2611*7c478bd9Sstevel@tonic-gate R$* $: < $&{client_name} > 2612*7c478bd9Sstevel@tonic-gate R< > $@ OK 2613*7c478bd9Sstevel@tonic-gate R< $=w > $@ OK 2614*7c478bd9Sstevel@tonic-gate # Otherwise, reject the mail 2615*7c478bd9Sstevel@tonic-gate R$* $#error $: 553 Header Error 2616*7c478bd9Sstevel@tonic-gate 2617*7c478bd9Sstevel@tonic-gate 2618*7c478bd9Sstevel@tonic-gate+--------------------+ 2619*7c478bd9Sstevel@tonic-gate| CONNECTION CONTROL | 2620*7c478bd9Sstevel@tonic-gate+--------------------+ 2621*7c478bd9Sstevel@tonic-gate 2622*7c478bd9Sstevel@tonic-gateThe features ratecontrol and conncontrol allow to establish connection 2623*7c478bd9Sstevel@tonic-gatelimits per client IP address or net. These features can limit the 2624*7c478bd9Sstevel@tonic-gaterate of connections (connections per time unit) or the number of 2625*7c478bd9Sstevel@tonic-gateincoming SMTP connections, respectively. If enabled, appropriate 2626*7c478bd9Sstevel@tonic-gaterulesets are called at the end of check_relay, i.e., after DNS 2627*7c478bd9Sstevel@tonic-gateblacklists and generic access_db operations. The features require 2628*7c478bd9Sstevel@tonic-gateFEATURE(`access_db') to be listed earlier in the mc file. 2629*7c478bd9Sstevel@tonic-gate 2630*7c478bd9Sstevel@tonic-gateNote: FEATURE(`delay_checks') delays those connection control checks 2631*7c478bd9Sstevel@tonic-gateafter a recipient address has been received, hence making these 2632*7c478bd9Sstevel@tonic-gateconnection control features less useful. To run the checks as early 2633*7c478bd9Sstevel@tonic-gateas possible, specify the parameter `nodelay', e.g., 2634*7c478bd9Sstevel@tonic-gate 2635*7c478bd9Sstevel@tonic-gate FEATURE(`ratecontrol', `nodelay') 2636*7c478bd9Sstevel@tonic-gate 2637*7c478bd9Sstevel@tonic-gateIn that case, FEATURE(`delay_checks') has no effect on connection 2638*7c478bd9Sstevel@tonic-gatecontrol (and it must be specified earlier in the mc file). 2639*7c478bd9Sstevel@tonic-gate 2640*7c478bd9Sstevel@tonic-gateAn optional second argument `terminate' specifies whether the 2641*7c478bd9Sstevel@tonic-gaterulesets should return the error code 421 which will cause 2642*7c478bd9Sstevel@tonic-gatesendmail to terminate the session with that error if it is 2643*7c478bd9Sstevel@tonic-gatereturned from check_relay, i.e., not delayed as explained in 2644*7c478bd9Sstevel@tonic-gatethe previous paragraph. Example: 2645*7c478bd9Sstevel@tonic-gate 2646*7c478bd9Sstevel@tonic-gate FEATURE(`ratecontrol', `nodelay', `terminate') 2647*7c478bd9Sstevel@tonic-gate 2648*7c478bd9Sstevel@tonic-gate 2649*7c478bd9Sstevel@tonic-gate+----------+ 2650*7c478bd9Sstevel@tonic-gate| STARTTLS | 2651*7c478bd9Sstevel@tonic-gate+----------+ 2652*7c478bd9Sstevel@tonic-gate 2653*7c478bd9Sstevel@tonic-gateIn this text, cert will be used as an abbreviation for X.509 certificate, 2654*7c478bd9Sstevel@tonic-gateDN (CN) is the distinguished (common) name of a cert, and CA is a 2655*7c478bd9Sstevel@tonic-gatecertification authority, which signs (issues) certs. 2656*7c478bd9Sstevel@tonic-gate 2657*7c478bd9Sstevel@tonic-gateFor STARTTLS to be offered by sendmail you need to set at least 2658*7c478bd9Sstevel@tonic-gatethese variables (the file names and paths are just examples): 2659*7c478bd9Sstevel@tonic-gate 2660*7c478bd9Sstevel@tonic-gate define(`confCACERT_PATH', `/etc/mail/certs/') 2661*7c478bd9Sstevel@tonic-gate define(`confCACERT', `/etc/mail/certs/CA.cert.pem') 2662*7c478bd9Sstevel@tonic-gate define(`confSERVER_CERT', `/etc/mail/certs/my.cert.pem') 2663*7c478bd9Sstevel@tonic-gate define(`confSERVER_KEY', `/etc/mail/certs/my.key.pem') 2664*7c478bd9Sstevel@tonic-gate 2665*7c478bd9Sstevel@tonic-gateOn systems which do not have the compile flag HASURANDOM set (see 2666*7c478bd9Sstevel@tonic-gatesendmail/README) you also must set confRAND_FILE. 2667*7c478bd9Sstevel@tonic-gate 2668*7c478bd9Sstevel@tonic-gateSee doc/op/op.{me,ps,txt} for more information about these options, 2669*7c478bd9Sstevel@tonic-gateespecially the sections ``Certificates for STARTTLS'' and ``PRNG for 2670*7c478bd9Sstevel@tonic-gateSTARTTLS''. 2671*7c478bd9Sstevel@tonic-gate 2672*7c478bd9Sstevel@tonic-gateMacros related to STARTTLS are: 2673*7c478bd9Sstevel@tonic-gate 2674*7c478bd9Sstevel@tonic-gate${cert_issuer} holds the DN of the CA (the cert issuer). 2675*7c478bd9Sstevel@tonic-gate${cert_subject} holds the DN of the cert (called the cert subject). 2676*7c478bd9Sstevel@tonic-gate${cn_issuer} holds the CN of the CA (the cert issuer). 2677*7c478bd9Sstevel@tonic-gate${cn_subject} holds the CN of the cert (called the cert subject). 2678*7c478bd9Sstevel@tonic-gate${tls_version} the TLS/SSL version used for the connection, e.g., TLSv1, 2679*7c478bd9Sstevel@tonic-gate TLSv1/SSLv3, SSLv3, SSLv2. 2680*7c478bd9Sstevel@tonic-gate${cipher} the cipher used for the connection, e.g., EDH-DSS-DES-CBC3-SHA, 2681*7c478bd9Sstevel@tonic-gate EDH-RSA-DES-CBC-SHA, DES-CBC-MD5, DES-CBC3-SHA. 2682*7c478bd9Sstevel@tonic-gate${cipher_bits} the keylength (in bits) of the symmetric encryption algorithm 2683*7c478bd9Sstevel@tonic-gate used for the connection. 2684*7c478bd9Sstevel@tonic-gate${verify} holds the result of the verification of the presented cert. 2685*7c478bd9Sstevel@tonic-gate Possible values are: 2686*7c478bd9Sstevel@tonic-gate OK verification succeeded. 2687*7c478bd9Sstevel@tonic-gate NO no cert presented. 2688*7c478bd9Sstevel@tonic-gate NOT no cert requested. 2689*7c478bd9Sstevel@tonic-gate FAIL cert presented but could not be verified, 2690*7c478bd9Sstevel@tonic-gate e.g., the cert of the signing CA is missing. 2691*7c478bd9Sstevel@tonic-gate NONE STARTTLS has not been performed. 2692*7c478bd9Sstevel@tonic-gate TEMP temporary error occurred. 2693*7c478bd9Sstevel@tonic-gate PROTOCOL protocol error occurred (SMTP level). 2694*7c478bd9Sstevel@tonic-gate SOFTWARE STARTTLS handshake failed. 2695*7c478bd9Sstevel@tonic-gate${server_name} the name of the server of the current outgoing SMTP 2696*7c478bd9Sstevel@tonic-gate connection. 2697*7c478bd9Sstevel@tonic-gate${server_addr} the address of the server of the current outgoing SMTP 2698*7c478bd9Sstevel@tonic-gate connection. 2699*7c478bd9Sstevel@tonic-gate 2700*7c478bd9Sstevel@tonic-gateRelaying 2701*7c478bd9Sstevel@tonic-gate-------- 2702*7c478bd9Sstevel@tonic-gate 2703*7c478bd9Sstevel@tonic-gateSMTP STARTTLS can allow relaying for remote SMTP clients which have 2704*7c478bd9Sstevel@tonic-gatesuccessfully authenticated themselves. If the verification of the cert 2705*7c478bd9Sstevel@tonic-gatefailed (${verify} != OK), relaying is subject to the usual rules. 2706*7c478bd9Sstevel@tonic-gateOtherwise the DN of the issuer is looked up in the access map using the 2707*7c478bd9Sstevel@tonic-gatetag CERTISSUER. If the resulting value is RELAY, relaying is allowed. 2708*7c478bd9Sstevel@tonic-gateIf it is SUBJECT, the DN of the cert subject is looked up next in the 2709*7c478bd9Sstevel@tonic-gateaccess map using the tag CERTSUBJECT. If the value is RELAY, relaying 2710*7c478bd9Sstevel@tonic-gateis allowed. 2711*7c478bd9Sstevel@tonic-gate 2712*7c478bd9Sstevel@tonic-gateTo make things a bit more flexible (or complicated), the values for 2713*7c478bd9Sstevel@tonic-gate${cert_issuer} and ${cert_subject} can be optionally modified by regular 2714*7c478bd9Sstevel@tonic-gateexpressions defined in the m4 variables _CERT_REGEX_ISSUER_ and 2715*7c478bd9Sstevel@tonic-gate_CERT_REGEX_SUBJECT_, respectively. To avoid problems with those macros in 2716*7c478bd9Sstevel@tonic-gaterulesets and map lookups, they are modified as follows: each non-printable 2717*7c478bd9Sstevel@tonic-gatecharacter and the characters '<', '>', '(', ')', '"', '+', ' ' are replaced 2718*7c478bd9Sstevel@tonic-gateby their HEX value with a leading '+'. For example: 2719*7c478bd9Sstevel@tonic-gate 2720*7c478bd9Sstevel@tonic-gate/C=US/ST=California/O=endmail.org/OU=private/CN=Darth Mail (Cert)/Email= 2721*7c478bd9Sstevel@tonic-gatedarth+cert@endmail.org 2722*7c478bd9Sstevel@tonic-gate 2723*7c478bd9Sstevel@tonic-gateis encoded as: 2724*7c478bd9Sstevel@tonic-gate 2725*7c478bd9Sstevel@tonic-gate/C=US/ST=California/O=endmail.org/OU=private/CN= 2726*7c478bd9Sstevel@tonic-gateDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 2727*7c478bd9Sstevel@tonic-gate 2728*7c478bd9Sstevel@tonic-gate(line breaks have been inserted for readability). 2729*7c478bd9Sstevel@tonic-gate 2730*7c478bd9Sstevel@tonic-gateThe macros which are subject to this encoding are ${cert_subject}, 2731*7c478bd9Sstevel@tonic-gate${cert_issuer}, ${cn_subject}, and ${cn_issuer}. 2732*7c478bd9Sstevel@tonic-gate 2733*7c478bd9Sstevel@tonic-gateExamples: 2734*7c478bd9Sstevel@tonic-gate 2735*7c478bd9Sstevel@tonic-gateTo allow relaying for everyone who can present a cert signed by 2736*7c478bd9Sstevel@tonic-gate 2737*7c478bd9Sstevel@tonic-gate/C=US/ST=California/O=endmail.org/OU=private/CN= 2738*7c478bd9Sstevel@tonic-gateDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 2739*7c478bd9Sstevel@tonic-gate 2740*7c478bd9Sstevel@tonic-gatesimply use: 2741*7c478bd9Sstevel@tonic-gate 2742*7c478bd9Sstevel@tonic-gateCertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN= 2743*7c478bd9Sstevel@tonic-gateDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org RELAY 2744*7c478bd9Sstevel@tonic-gate 2745*7c478bd9Sstevel@tonic-gateTo allow relaying only for a subset of machines that have a cert signed by 2746*7c478bd9Sstevel@tonic-gate 2747*7c478bd9Sstevel@tonic-gate/C=US/ST=California/O=endmail.org/OU=private/CN= 2748*7c478bd9Sstevel@tonic-gateDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org 2749*7c478bd9Sstevel@tonic-gate 2750*7c478bd9Sstevel@tonic-gateuse: 2751*7c478bd9Sstevel@tonic-gate 2752*7c478bd9Sstevel@tonic-gateCertIssuer:/C=US/ST=California/O=endmail.org/OU=private/CN= 2753*7c478bd9Sstevel@tonic-gateDarth+20Mail+20+28Cert+29/Email=darth+2Bcert@endmail.org SUBJECT 2754*7c478bd9Sstevel@tonic-gateCertSubject:/C=US/ST=California/O=endmail.org/OU=private/CN= 2755*7c478bd9Sstevel@tonic-gateDeathStar/Email=deathstar@endmail.org RELAY 2756*7c478bd9Sstevel@tonic-gate 2757*7c478bd9Sstevel@tonic-gateNotes: 2758*7c478bd9Sstevel@tonic-gate- line breaks have been inserted after "CN=" for readability, 2759*7c478bd9Sstevel@tonic-gate each tagged entry must be one (long) line in the access map. 2760*7c478bd9Sstevel@tonic-gate- if OpenSSL 0.9.7 or newer is used then the "Email=" part of a DN 2761*7c478bd9Sstevel@tonic-gate is replaced by "emailAddress=". 2762*7c478bd9Sstevel@tonic-gate 2763*7c478bd9Sstevel@tonic-gateOf course it is also possible to write a simple ruleset that allows 2764*7c478bd9Sstevel@tonic-gaterelaying for everyone who can present a cert that can be verified, e.g., 2765*7c478bd9Sstevel@tonic-gate 2766*7c478bd9Sstevel@tonic-gateLOCAL_RULESETS 2767*7c478bd9Sstevel@tonic-gateSLocal_check_rcpt 2768*7c478bd9Sstevel@tonic-gateR$* $: $&{verify} 2769*7c478bd9Sstevel@tonic-gateROK $# OK 2770*7c478bd9Sstevel@tonic-gate 2771*7c478bd9Sstevel@tonic-gateAllowing Connections 2772*7c478bd9Sstevel@tonic-gate-------------------- 2773*7c478bd9Sstevel@tonic-gate 2774*7c478bd9Sstevel@tonic-gateThe rulesets tls_server, tls_client, and tls_rcpt are used to decide whether 2775*7c478bd9Sstevel@tonic-gatean SMTP connection is accepted (or should continue). 2776*7c478bd9Sstevel@tonic-gate 2777*7c478bd9Sstevel@tonic-gatetls_server is called when sendmail acts as client after a STARTTLS command 2778*7c478bd9Sstevel@tonic-gate(should) have been issued. The parameter is the value of ${verify}. 2779*7c478bd9Sstevel@tonic-gate 2780*7c478bd9Sstevel@tonic-gatetls_client is called when sendmail acts as server, after a STARTTLS command 2781*7c478bd9Sstevel@tonic-gatehas been issued, and from check_mail. The parameter is the value of 2782*7c478bd9Sstevel@tonic-gate${verify} and STARTTLS or MAIL, respectively. 2783*7c478bd9Sstevel@tonic-gate 2784*7c478bd9Sstevel@tonic-gateBoth rulesets behave the same. If no access map is in use, the connection 2785*7c478bd9Sstevel@tonic-gatewill be accepted unless ${verify} is SOFTWARE, in which case the connection 2786*7c478bd9Sstevel@tonic-gateis always aborted. For tls_server/tls_client, ${client_name}/${server_name} 2787*7c478bd9Sstevel@tonic-gateis looked up in the access map using the tag TLS_Srv/TLS_Clt, which is done 2788*7c478bd9Sstevel@tonic-gatewith the ruleset LookUpDomain. If no entry is found, ${client_addr} 2789*7c478bd9Sstevel@tonic-gate(${server_addr}) is looked up in the access map (same tag, ruleset 2790*7c478bd9Sstevel@tonic-gateLookUpAddr). If this doesn't result in an entry either, just the tag is 2791*7c478bd9Sstevel@tonic-gatelooked up in the access map (included the trailing colon). Notice: 2792*7c478bd9Sstevel@tonic-gaterequiring that e-mail is sent to a server only encrypted, e.g., via 2793*7c478bd9Sstevel@tonic-gate 2794*7c478bd9Sstevel@tonic-gateTLS_Srv:secure.domain ENCR:112 2795*7c478bd9Sstevel@tonic-gate 2796*7c478bd9Sstevel@tonic-gatedoesn't necessarily mean that e-mail sent to that domain is encrypted. 2797*7c478bd9Sstevel@tonic-gateIf the domain has multiple MX servers, e.g., 2798*7c478bd9Sstevel@tonic-gate 2799*7c478bd9Sstevel@tonic-gatesecure.domain. IN MX 10 mail.secure.domain. 2800*7c478bd9Sstevel@tonic-gatesecure.domain. IN MX 50 mail.other.domain. 2801*7c478bd9Sstevel@tonic-gate 2802*7c478bd9Sstevel@tonic-gatethen mail to user@secure.domain may go unencrypted to mail.other.domain. 2803*7c478bd9Sstevel@tonic-gatetls_rcpt can be used to address this problem. 2804*7c478bd9Sstevel@tonic-gate 2805*7c478bd9Sstevel@tonic-gatetls_rcpt is called before a RCPT TO: command is sent. The parameter is the 2806*7c478bd9Sstevel@tonic-gatecurrent recipient. This ruleset is only defined if FEATURE(`access_db') 2807*7c478bd9Sstevel@tonic-gateis selected. A recipient address user@domain is looked up in the access 2808*7c478bd9Sstevel@tonic-gatemap in four formats: TLS_Rcpt:user@domain, TLS_Rcpt:user@, TLS_Rcpt:domain, 2809*7c478bd9Sstevel@tonic-gateand TLS_Rcpt:; the first match is taken. 2810*7c478bd9Sstevel@tonic-gate 2811*7c478bd9Sstevel@tonic-gateThe result of the lookups is then used to call the ruleset TLS_connection, 2812*7c478bd9Sstevel@tonic-gatewhich checks the requirement specified by the RHS in the access map against 2813*7c478bd9Sstevel@tonic-gatethe actual parameters of the current TLS connection, esp. ${verify} and 2814*7c478bd9Sstevel@tonic-gate${cipher_bits}. Legal RHSs in the access map are: 2815*7c478bd9Sstevel@tonic-gate 2816*7c478bd9Sstevel@tonic-gateVERIFY verification must have succeeded 2817*7c478bd9Sstevel@tonic-gateVERIFY:bits verification must have succeeded and ${cipher_bits} must 2818*7c478bd9Sstevel@tonic-gate be greater than or equal bits. 2819*7c478bd9Sstevel@tonic-gateENCR:bits ${cipher_bits} must be greater than or equal bits. 2820*7c478bd9Sstevel@tonic-gate 2821*7c478bd9Sstevel@tonic-gateThe RHS can optionally be prefixed by TEMP+ or PERM+ to select a temporary 2822*7c478bd9Sstevel@tonic-gateor permanent error. The default is a temporary error code (403 4.7.0) 2823*7c478bd9Sstevel@tonic-gateunless the macro TLS_PERM_ERR is set during generation of the .cf file. 2824*7c478bd9Sstevel@tonic-gate 2825*7c478bd9Sstevel@tonic-gateIf a certain level of encryption is required, then it might also be 2826*7c478bd9Sstevel@tonic-gatepossible that this level is provided by the security layer from a SASL 2827*7c478bd9Sstevel@tonic-gatealgorithm, e.g., DIGEST-MD5. 2828*7c478bd9Sstevel@tonic-gate 2829*7c478bd9Sstevel@tonic-gateFurthermore, there can be a list of extensions added. Such a list 2830*7c478bd9Sstevel@tonic-gatestarts with '+' and the items are separated by '++'. Allowed 2831*7c478bd9Sstevel@tonic-gateextensions are: 2832*7c478bd9Sstevel@tonic-gate 2833*7c478bd9Sstevel@tonic-gateCN:name name must match ${cn_subject} 2834*7c478bd9Sstevel@tonic-gateCN ${server_name} must match ${cn_subject} 2835*7c478bd9Sstevel@tonic-gateCS:name name must match ${cert_subject} 2836*7c478bd9Sstevel@tonic-gateCI:name name must match ${cert_issuer} 2837*7c478bd9Sstevel@tonic-gate 2838*7c478bd9Sstevel@tonic-gateExample: e-mail sent to secure.example.com should only use an encrypted 2839*7c478bd9Sstevel@tonic-gateconnection. E-mail received from hosts within the laptop.example.com domain 2840*7c478bd9Sstevel@tonic-gateshould only be accepted if they have been authenticated. The host which 2841*7c478bd9Sstevel@tonic-gatereceives e-mail for darth@endmail.org must present a cert that uses the 2842*7c478bd9Sstevel@tonic-gateCN smtp.endmail.org. 2843*7c478bd9Sstevel@tonic-gate 2844*7c478bd9Sstevel@tonic-gateTLS_Srv:secure.example.com ENCR:112 2845*7c478bd9Sstevel@tonic-gateTLS_Clt:laptop.example.com PERM+VERIFY:112 2846*7c478bd9Sstevel@tonic-gateTLS_Rcpt:darth@endmail.org ENCR:112+CN:smtp.endmail.org 2847*7c478bd9Sstevel@tonic-gate 2848*7c478bd9Sstevel@tonic-gate 2849*7c478bd9Sstevel@tonic-gateDisabling STARTTLS And Setting SMTP Server Features 2850*7c478bd9Sstevel@tonic-gate--------------------------------------------------- 2851*7c478bd9Sstevel@tonic-gate 2852*7c478bd9Sstevel@tonic-gateBy default STARTTLS is used whenever possible. However, there are 2853*7c478bd9Sstevel@tonic-gatesome broken MTAs that don't properly implement STARTTLS. To be able 2854*7c478bd9Sstevel@tonic-gateto send to (or receive from) those MTAs, the ruleset try_tls 2855*7c478bd9Sstevel@tonic-gate(srv_features) can be used that work together with the access map. 2856*7c478bd9Sstevel@tonic-gateEntries for the access map must be tagged with Try_TLS (Srv_Features) 2857*7c478bd9Sstevel@tonic-gateand refer to the hostname or IP address of the connecting system. 2858*7c478bd9Sstevel@tonic-gateA default case can be specified by using just the tag. For example, 2859*7c478bd9Sstevel@tonic-gatethe following entries in the access map: 2860*7c478bd9Sstevel@tonic-gate 2861*7c478bd9Sstevel@tonic-gate Try_TLS:broken.server NO 2862*7c478bd9Sstevel@tonic-gate Srv_Features:my.domain v 2863*7c478bd9Sstevel@tonic-gate Srv_Features: V 2864*7c478bd9Sstevel@tonic-gate 2865*7c478bd9Sstevel@tonic-gatewill turn off STARTTLS when sending to broken.server (or any host 2866*7c478bd9Sstevel@tonic-gatein that domain), and request a client certificate during the TLS 2867*7c478bd9Sstevel@tonic-gatehandshake only for hosts in my.domain. The valid entries on the RHS 2868*7c478bd9Sstevel@tonic-gatefor Srv_Features are listed in the Sendmail Installation and 2869*7c478bd9Sstevel@tonic-gateOperations Guide. 2870*7c478bd9Sstevel@tonic-gate 2871*7c478bd9Sstevel@tonic-gate 2872*7c478bd9Sstevel@tonic-gateReceived: Header 2873*7c478bd9Sstevel@tonic-gate---------------- 2874*7c478bd9Sstevel@tonic-gate 2875*7c478bd9Sstevel@tonic-gateThe Received: header reveals whether STARTTLS has been used. It contains an 2876*7c478bd9Sstevel@tonic-gateextra line: 2877*7c478bd9Sstevel@tonic-gate 2878*7c478bd9Sstevel@tonic-gate(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify}) 2879*7c478bd9Sstevel@tonic-gate 2880*7c478bd9Sstevel@tonic-gate 2881*7c478bd9Sstevel@tonic-gate+--------------------------------+ 2882*7c478bd9Sstevel@tonic-gate| ADDING NEW MAILERS OR RULESETS | 2883*7c478bd9Sstevel@tonic-gate+--------------------------------+ 2884*7c478bd9Sstevel@tonic-gate 2885*7c478bd9Sstevel@tonic-gateSometimes you may need to add entirely new mailers or rulesets. They 2886*7c478bd9Sstevel@tonic-gateshould be introduced with the constructs MAILER_DEFINITIONS and 2887*7c478bd9Sstevel@tonic-gateLOCAL_RULESETS respectively. For example: 2888*7c478bd9Sstevel@tonic-gate 2889*7c478bd9Sstevel@tonic-gate MAILER_DEFINITIONS 2890*7c478bd9Sstevel@tonic-gate Mmymailer, ... 2891*7c478bd9Sstevel@tonic-gate ... 2892*7c478bd9Sstevel@tonic-gate 2893*7c478bd9Sstevel@tonic-gate LOCAL_RULESETS 2894*7c478bd9Sstevel@tonic-gate Smyruleset 2895*7c478bd9Sstevel@tonic-gate ... 2896*7c478bd9Sstevel@tonic-gate 2897*7c478bd9Sstevel@tonic-gateNote: you don't need to add a name for the ruleset, it is implicitly 2898*7c478bd9Sstevel@tonic-gatedefined by using the appropriate macro. 2899*7c478bd9Sstevel@tonic-gate 2900*7c478bd9Sstevel@tonic-gate 2901*7c478bd9Sstevel@tonic-gate+-------------------------+ 2902*7c478bd9Sstevel@tonic-gate| ADDING NEW MAIL FILTERS | 2903*7c478bd9Sstevel@tonic-gate+-------------------------+ 2904*7c478bd9Sstevel@tonic-gate 2905*7c478bd9Sstevel@tonic-gateSendmail supports mail filters to filter incoming SMTP messages according 2906*7c478bd9Sstevel@tonic-gateto the "Sendmail Mail Filter API" documentation. These filters can be 2907*7c478bd9Sstevel@tonic-gateconfigured in your mc file using the two commands: 2908*7c478bd9Sstevel@tonic-gate 2909*7c478bd9Sstevel@tonic-gate MAIL_FILTER(`name', `equates') 2910*7c478bd9Sstevel@tonic-gate INPUT_MAIL_FILTER(`name', `equates') 2911*7c478bd9Sstevel@tonic-gate 2912*7c478bd9Sstevel@tonic-gateThe first command, MAIL_FILTER(), simply defines a filter with the given 2913*7c478bd9Sstevel@tonic-gatename and equates. For example: 2914*7c478bd9Sstevel@tonic-gate 2915*7c478bd9Sstevel@tonic-gate MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 2916*7c478bd9Sstevel@tonic-gate 2917*7c478bd9Sstevel@tonic-gateThis creates the equivalent sendmail.cf entry: 2918*7c478bd9Sstevel@tonic-gate 2919*7c478bd9Sstevel@tonic-gate Xarchive, S=local:/var/run/archivesock, F=R 2920*7c478bd9Sstevel@tonic-gate 2921*7c478bd9Sstevel@tonic-gateThe INPUT_MAIL_FILTER() command performs the same actions as MAIL_FILTER 2922*7c478bd9Sstevel@tonic-gatebut also populates the m4 variable `confINPUT_MAIL_FILTERS' with the name 2923*7c478bd9Sstevel@tonic-gateof the filter such that the filter will actually be called by sendmail. 2924*7c478bd9Sstevel@tonic-gate 2925*7c478bd9Sstevel@tonic-gateFor example, the two commands: 2926*7c478bd9Sstevel@tonic-gate 2927*7c478bd9Sstevel@tonic-gate INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 2928*7c478bd9Sstevel@tonic-gate INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T') 2929*7c478bd9Sstevel@tonic-gate 2930*7c478bd9Sstevel@tonic-gateare equivalent to the three commands: 2931*7c478bd9Sstevel@tonic-gate 2932*7c478bd9Sstevel@tonic-gate MAIL_FILTER(`archive', `S=local:/var/run/archivesock, F=R') 2933*7c478bd9Sstevel@tonic-gate MAIL_FILTER(`spamcheck', `S=inet:2525@localhost, F=T') 2934*7c478bd9Sstevel@tonic-gate define(`confINPUT_MAIL_FILTERS', `archive, spamcheck') 2935*7c478bd9Sstevel@tonic-gate 2936*7c478bd9Sstevel@tonic-gateIn general, INPUT_MAIL_FILTER() should be used unless you need to define 2937*7c478bd9Sstevel@tonic-gatemore filters than you want to use for `confINPUT_MAIL_FILTERS'. 2938*7c478bd9Sstevel@tonic-gate 2939*7c478bd9Sstevel@tonic-gateNote that setting `confINPUT_MAIL_FILTERS' after any INPUT_MAIL_FILTER() 2940*7c478bd9Sstevel@tonic-gatecommands will clear the list created by the prior INPUT_MAIL_FILTER() 2941*7c478bd9Sstevel@tonic-gatecommands. 2942*7c478bd9Sstevel@tonic-gate 2943*7c478bd9Sstevel@tonic-gate 2944*7c478bd9Sstevel@tonic-gate+-------------------------+ 2945*7c478bd9Sstevel@tonic-gate| QUEUE GROUP DEFINITIONS | 2946*7c478bd9Sstevel@tonic-gate+-------------------------+ 2947*7c478bd9Sstevel@tonic-gate 2948*7c478bd9Sstevel@tonic-gateIn addition to the queue directory (which is the default queue group 2949*7c478bd9Sstevel@tonic-gatecalled "mqueue"), sendmail can deal with multiple queue groups, which 2950*7c478bd9Sstevel@tonic-gateare collections of queue directories with the same behaviour. Queue 2951*7c478bd9Sstevel@tonic-gategroups can be defined using the command: 2952*7c478bd9Sstevel@tonic-gate 2953*7c478bd9Sstevel@tonic-gate QUEUE_GROUP(`name', `equates') 2954*7c478bd9Sstevel@tonic-gate 2955*7c478bd9Sstevel@tonic-gateFor details about queue groups, please see doc/op/op.{me,ps,txt}. 2956*7c478bd9Sstevel@tonic-gate 2957*7c478bd9Sstevel@tonic-gate+-------------------------------+ 2958*7c478bd9Sstevel@tonic-gate| NON-SMTP BASED CONFIGURATIONS | 2959*7c478bd9Sstevel@tonic-gate+-------------------------------+ 2960*7c478bd9Sstevel@tonic-gate 2961*7c478bd9Sstevel@tonic-gateThese configuration files are designed primarily for use by 2962*7c478bd9Sstevel@tonic-gateSMTP-based sites. They may not be well tuned for UUCP-only or 2963*7c478bd9Sstevel@tonic-gateUUCP-primarily nodes (the latter is defined as a small local net 2964*7c478bd9Sstevel@tonic-gateconnected to the rest of the world via UUCP). However, there is 2965*7c478bd9Sstevel@tonic-gateone hook to handle some special cases. 2966*7c478bd9Sstevel@tonic-gate 2967*7c478bd9Sstevel@tonic-gateYou can define a ``smart host'' that understands a richer address syntax 2968*7c478bd9Sstevel@tonic-gateusing: 2969*7c478bd9Sstevel@tonic-gate 2970*7c478bd9Sstevel@tonic-gate define(`SMART_HOST', `mailer:hostname') 2971*7c478bd9Sstevel@tonic-gate 2972*7c478bd9Sstevel@tonic-gateIn this case, the ``mailer:'' defaults to "relay". Any messages that 2973*7c478bd9Sstevel@tonic-gatecan't be handled using the usual UUCP rules are passed to this host. 2974*7c478bd9Sstevel@tonic-gate 2975*7c478bd9Sstevel@tonic-gateIf you are on a local SMTP-based net that connects to the outside 2976*7c478bd9Sstevel@tonic-gateworld via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules. 2977*7c478bd9Sstevel@tonic-gateFor example: 2978*7c478bd9Sstevel@tonic-gate 2979*7c478bd9Sstevel@tonic-gate define(`SMART_HOST', `uucp-new:uunet') 2980*7c478bd9Sstevel@tonic-gate LOCAL_NET_CONFIG 2981*7c478bd9Sstevel@tonic-gate R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 2982*7c478bd9Sstevel@tonic-gate 2983*7c478bd9Sstevel@tonic-gateThis will cause all names that end in your domain name ($m) to be sent 2984*7c478bd9Sstevel@tonic-gatevia SMTP; anything else will be sent via uucp-new (smart UUCP) to uunet. 2985*7c478bd9Sstevel@tonic-gateIf you have FEATURE(`nocanonify'), you may need to omit the dots after 2986*7c478bd9Sstevel@tonic-gatethe $m. If you are running a local DNS inside your domain which is 2987*7c478bd9Sstevel@tonic-gatenot otherwise connected to the outside world, you probably want to 2988*7c478bd9Sstevel@tonic-gateuse: 2989*7c478bd9Sstevel@tonic-gate 2990*7c478bd9Sstevel@tonic-gate define(`SMART_HOST', `smtp:fire.wall.com') 2991*7c478bd9Sstevel@tonic-gate LOCAL_NET_CONFIG 2992*7c478bd9Sstevel@tonic-gate R$* < @ $* . > $* $#smtp $@ $2. $: $1 < @ $2. > $3 2993*7c478bd9Sstevel@tonic-gate 2994*7c478bd9Sstevel@tonic-gateThat is, send directly only to things you found in your DNS lookup; 2995*7c478bd9Sstevel@tonic-gateanything else goes through SMART_HOST. 2996*7c478bd9Sstevel@tonic-gate 2997*7c478bd9Sstevel@tonic-gateYou may need to turn off the anti-spam rules in order to accept 2998*7c478bd9Sstevel@tonic-gateUUCP mail with FEATURE(`promiscuous_relay') and 2999*7c478bd9Sstevel@tonic-gateFEATURE(`accept_unresolvable_domains'). 3000*7c478bd9Sstevel@tonic-gate 3001*7c478bd9Sstevel@tonic-gate 3002*7c478bd9Sstevel@tonic-gate+-----------+ 3003*7c478bd9Sstevel@tonic-gate| WHO AM I? | 3004*7c478bd9Sstevel@tonic-gate+-----------+ 3005*7c478bd9Sstevel@tonic-gate 3006*7c478bd9Sstevel@tonic-gateNormally, the $j macro is automatically defined to be your fully 3007*7c478bd9Sstevel@tonic-gatequalified domain name (FQDN). Sendmail does this by getting your 3008*7c478bd9Sstevel@tonic-gatehost name using gethostname and then calling gethostbyname on the 3009*7c478bd9Sstevel@tonic-gateresult. For example, in some environments gethostname returns 3010*7c478bd9Sstevel@tonic-gateonly the root of the host name (such as "foo"); gethostbyname is 3011*7c478bd9Sstevel@tonic-gatesupposed to return the FQDN ("foo.bar.com"). In some (fairly rare) 3012*7c478bd9Sstevel@tonic-gatecases, gethostbyname may fail to return the FQDN. In this case 3013*7c478bd9Sstevel@tonic-gateyou MUST define confDOMAIN_NAME to be your fully qualified domain 3014*7c478bd9Sstevel@tonic-gatename. This is usually done using: 3015*7c478bd9Sstevel@tonic-gate 3016*7c478bd9Sstevel@tonic-gate Dmbar.com 3017*7c478bd9Sstevel@tonic-gate define(`confDOMAIN_NAME', `$w.$m')dnl 3018*7c478bd9Sstevel@tonic-gate 3019*7c478bd9Sstevel@tonic-gate 3020*7c478bd9Sstevel@tonic-gate+-----------------------------------+ 3021*7c478bd9Sstevel@tonic-gate| ACCEPTING MAIL FOR MULTIPLE NAMES | 3022*7c478bd9Sstevel@tonic-gate+-----------------------------------+ 3023*7c478bd9Sstevel@tonic-gate 3024*7c478bd9Sstevel@tonic-gateIf your host is known by several different names, you need to augment 3025*7c478bd9Sstevel@tonic-gateclass {w}. This is a list of names by which your host is known, and 3026*7c478bd9Sstevel@tonic-gateanything sent to an address using a host name in this list will be 3027*7c478bd9Sstevel@tonic-gatetreated as local mail. You can do this in two ways: either create the 3028*7c478bd9Sstevel@tonic-gatefile /etc/mail/local-host-names containing a list of your aliases (one per 3029*7c478bd9Sstevel@tonic-gateline), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add 3030*7c478bd9Sstevel@tonic-gate``LOCAL_DOMAIN(`alias.host.name')''. Be sure you use the fully-qualified 3031*7c478bd9Sstevel@tonic-gatename of the host, rather than a short name. 3032*7c478bd9Sstevel@tonic-gate 3033*7c478bd9Sstevel@tonic-gateIf you want to have different address in different domains, take 3034*7c478bd9Sstevel@tonic-gatea look at the virtusertable feature, which is also explained at 3035*7c478bd9Sstevel@tonic-gatehttp://www.sendmail.org/virtual-hosting.html 3036*7c478bd9Sstevel@tonic-gate 3037*7c478bd9Sstevel@tonic-gate 3038*7c478bd9Sstevel@tonic-gate+--------------------+ 3039*7c478bd9Sstevel@tonic-gate| USING MAILERTABLES | 3040*7c478bd9Sstevel@tonic-gate+--------------------+ 3041*7c478bd9Sstevel@tonic-gate 3042*7c478bd9Sstevel@tonic-gateTo use FEATURE(`mailertable'), you will have to create an external 3043*7c478bd9Sstevel@tonic-gatedatabase containing the routing information for various domains. 3044*7c478bd9Sstevel@tonic-gateFor example, a mailertable file in text format might be: 3045*7c478bd9Sstevel@tonic-gate 3046*7c478bd9Sstevel@tonic-gate .my.domain xnet:%1.my.domain 3047*7c478bd9Sstevel@tonic-gate uuhost1.my.domain uucp-new:uuhost1 3048*7c478bd9Sstevel@tonic-gate .bitnet smtp:relay.bit.net 3049*7c478bd9Sstevel@tonic-gate 3050*7c478bd9Sstevel@tonic-gateThis should normally be stored in /etc/mail/mailertable. The actual 3051*7c478bd9Sstevel@tonic-gatedatabase version of the mailertable is built using: 3052*7c478bd9Sstevel@tonic-gate 3053*7c478bd9Sstevel@tonic-gate makemap hash /etc/mail/mailertable < /etc/mail/mailertable 3054*7c478bd9Sstevel@tonic-gate 3055*7c478bd9Sstevel@tonic-gateThe semantics are simple. Any LHS entry that does not begin with 3056*7c478bd9Sstevel@tonic-gatea dot matches the full host name indicated. LHS entries beginning 3057*7c478bd9Sstevel@tonic-gatewith a dot match anything ending with that domain name (including 3058*7c478bd9Sstevel@tonic-gatethe leading dot) -- that is, they can be thought of as having a 3059*7c478bd9Sstevel@tonic-gateleading ".+" regular expression pattern for a non-empty sequence of 3060*7c478bd9Sstevel@tonic-gatecharacters. Matching is done in order of most-to-least qualified 3061*7c478bd9Sstevel@tonic-gate-- for example, even though ".my.domain" is listed first in the 3062*7c478bd9Sstevel@tonic-gateabove example, an entry of "uuhost1.my.domain" will match the second 3063*7c478bd9Sstevel@tonic-gateentry since it is more explicit. Note: e-mail to "user@my.domain" 3064*7c478bd9Sstevel@tonic-gatedoes not match any entry in the above table. You need to have 3065*7c478bd9Sstevel@tonic-gatesomething like: 3066*7c478bd9Sstevel@tonic-gate 3067*7c478bd9Sstevel@tonic-gate my.domain esmtp:host.my.domain 3068*7c478bd9Sstevel@tonic-gate 3069*7c478bd9Sstevel@tonic-gateThe RHS should always be a "mailer:host" pair. The mailer is the 3070*7c478bd9Sstevel@tonic-gateconfiguration name of a mailer (that is, an M line in the 3071*7c478bd9Sstevel@tonic-gatesendmail.cf file). The "host" will be the hostname passed to 3072*7c478bd9Sstevel@tonic-gatethat mailer. In domain-based matches (that is, those with leading 3073*7c478bd9Sstevel@tonic-gatedots) the "%1" may be used to interpolate the wildcarded part of 3074*7c478bd9Sstevel@tonic-gatethe host name. For example, the first line above sends everything 3075*7c478bd9Sstevel@tonic-gateaddressed to "anything.my.domain" to that same host name, but using 3076*7c478bd9Sstevel@tonic-gatethe (presumably experimental) xnet mailer. 3077*7c478bd9Sstevel@tonic-gate 3078*7c478bd9Sstevel@tonic-gateIn some cases you may want to temporarily turn off MX records, 3079*7c478bd9Sstevel@tonic-gateparticularly on gateways. For example, you may want to MX 3080*7c478bd9Sstevel@tonic-gateeverything in a domain to one machine that then forwards it 3081*7c478bd9Sstevel@tonic-gatedirectly. To do this, you might use the DNS configuration: 3082*7c478bd9Sstevel@tonic-gate 3083*7c478bd9Sstevel@tonic-gate *.domain. IN MX 0 relay.machine 3084*7c478bd9Sstevel@tonic-gate 3085*7c478bd9Sstevel@tonic-gateand on relay.machine use the mailertable: 3086*7c478bd9Sstevel@tonic-gate 3087*7c478bd9Sstevel@tonic-gate .domain smtp:[gateway.domain] 3088*7c478bd9Sstevel@tonic-gate 3089*7c478bd9Sstevel@tonic-gateThe [square brackets] turn off MX records for this host only. 3090*7c478bd9Sstevel@tonic-gateIf you didn't do this, the mailertable would use the MX record 3091*7c478bd9Sstevel@tonic-gateagain, which would give you an MX loop. Note that the use of 3092*7c478bd9Sstevel@tonic-gatewildcard MX records is almost always a bad idea. Please avoid 3093*7c478bd9Sstevel@tonic-gateusing them if possible. 3094*7c478bd9Sstevel@tonic-gate 3095*7c478bd9Sstevel@tonic-gate 3096*7c478bd9Sstevel@tonic-gate+--------------------------------+ 3097*7c478bd9Sstevel@tonic-gate| USING USERDB TO MAP FULL NAMES | 3098*7c478bd9Sstevel@tonic-gate+--------------------------------+ 3099*7c478bd9Sstevel@tonic-gate 3100*7c478bd9Sstevel@tonic-gateThe user database was not originally intended for mapping full names 3101*7c478bd9Sstevel@tonic-gateto login names (e.g., Eric.Allman => eric), but some people are using 3102*7c478bd9Sstevel@tonic-gateit that way. (it is recommended that you set up aliases for this 3103*7c478bd9Sstevel@tonic-gatepurpose instead -- since you can specify multiple alias files, this 3104*7c478bd9Sstevel@tonic-gateis fairly easy.) The intent was to locate the default maildrop at 3105*7c478bd9Sstevel@tonic-gatea site, but allow you to override this by sending to a specific host. 3106*7c478bd9Sstevel@tonic-gate 3107*7c478bd9Sstevel@tonic-gateIf you decide to set up the user database in this fashion, it is 3108*7c478bd9Sstevel@tonic-gateimperative that you not use FEATURE(`stickyhost') -- otherwise, 3109*7c478bd9Sstevel@tonic-gatee-mail sent to Full.Name@local.host.name will be rejected. 3110*7c478bd9Sstevel@tonic-gate 3111*7c478bd9Sstevel@tonic-gateTo build the internal form of the user database, use: 3112*7c478bd9Sstevel@tonic-gate 3113*7c478bd9Sstevel@tonic-gate makemap btree /etc/mail/userdb < /etc/mail/userdb.txt 3114*7c478bd9Sstevel@tonic-gate 3115*7c478bd9Sstevel@tonic-gateAs a general rule, it is an extremely bad idea to using full names 3116*7c478bd9Sstevel@tonic-gateas e-mail addresses, since they are not in any sense unique. For 3117*7c478bd9Sstevel@tonic-gateexample, the UNIX software-development community has at least two 3118*7c478bd9Sstevel@tonic-gatewell-known Peter Deutsches, and at one time Bell Labs had two 3119*7c478bd9Sstevel@tonic-gateStephen R. Bournes with offices along the same hallway. Which one 3120*7c478bd9Sstevel@tonic-gatewill be forced to suffer the indignity of being Stephen_R_Bourne_2? 3121*7c478bd9Sstevel@tonic-gateThe less famous of the two, or the one that was hired later? 3122*7c478bd9Sstevel@tonic-gate 3123*7c478bd9Sstevel@tonic-gateFinger should handle full names (and be fuzzy). Mail should use 3124*7c478bd9Sstevel@tonic-gatehandles, and not be fuzzy. 3125*7c478bd9Sstevel@tonic-gate 3126*7c478bd9Sstevel@tonic-gate 3127*7c478bd9Sstevel@tonic-gate+--------------------------------+ 3128*7c478bd9Sstevel@tonic-gate| MISCELLANEOUS SPECIAL FEATURES | 3129*7c478bd9Sstevel@tonic-gate+--------------------------------+ 3130*7c478bd9Sstevel@tonic-gate 3131*7c478bd9Sstevel@tonic-gatePlussed users 3132*7c478bd9Sstevel@tonic-gate Sometimes it is convenient to merge configuration on a 3133*7c478bd9Sstevel@tonic-gate centralized mail machine, for example, to forward all 3134*7c478bd9Sstevel@tonic-gate root mail to a mail server. In this case it might be 3135*7c478bd9Sstevel@tonic-gate useful to be able to treat the root addresses as a class 3136*7c478bd9Sstevel@tonic-gate of addresses with subtle differences. You can do this 3137*7c478bd9Sstevel@tonic-gate using plussed users. For example, a client might include 3138*7c478bd9Sstevel@tonic-gate the alias: 3139*7c478bd9Sstevel@tonic-gate 3140*7c478bd9Sstevel@tonic-gate root: root+client1@server 3141*7c478bd9Sstevel@tonic-gate 3142*7c478bd9Sstevel@tonic-gate On the server, this will match an alias for "root+client1". 3143*7c478bd9Sstevel@tonic-gate If that is not found, the alias "root+*" will be tried, 3144*7c478bd9Sstevel@tonic-gate then "root". 3145*7c478bd9Sstevel@tonic-gate 3146*7c478bd9Sstevel@tonic-gate 3147*7c478bd9Sstevel@tonic-gate+----------------+ 3148*7c478bd9Sstevel@tonic-gate| SECURITY NOTES | 3149*7c478bd9Sstevel@tonic-gate+----------------+ 3150*7c478bd9Sstevel@tonic-gate 3151*7c478bd9Sstevel@tonic-gateA lot of sendmail security comes down to you. Sendmail 8 is much 3152*7c478bd9Sstevel@tonic-gatemore careful about checking for security problems than previous 3153*7c478bd9Sstevel@tonic-gateversions, but there are some things that you still need to watch 3154*7c478bd9Sstevel@tonic-gatefor. In particular: 3155*7c478bd9Sstevel@tonic-gate 3156*7c478bd9Sstevel@tonic-gate* Make sure the aliases file is not writable except by trusted 3157*7c478bd9Sstevel@tonic-gate system personnel. This includes both the text and database 3158*7c478bd9Sstevel@tonic-gate version. 3159*7c478bd9Sstevel@tonic-gate 3160*7c478bd9Sstevel@tonic-gate* Make sure that other files that sendmail reads, such as the 3161*7c478bd9Sstevel@tonic-gate mailertable, are only writable by trusted system personnel. 3162*7c478bd9Sstevel@tonic-gate 3163*7c478bd9Sstevel@tonic-gate* The queue directory should not be world writable PARTICULARLY 3164*7c478bd9Sstevel@tonic-gate if your system allows "file giveaways" (that is, if a non-root 3165*7c478bd9Sstevel@tonic-gate user can chown any file they own to any other user). 3166*7c478bd9Sstevel@tonic-gate 3167*7c478bd9Sstevel@tonic-gate* If your system allows file giveaways, DO NOT create a publically 3168*7c478bd9Sstevel@tonic-gate writable directory for forward files. This will allow anyone 3169*7c478bd9Sstevel@tonic-gate to steal anyone else's e-mail. Instead, create a script that 3170*7c478bd9Sstevel@tonic-gate copies the .forward file from users' home directories once a 3171*7c478bd9Sstevel@tonic-gate night (if you want the non-NFS-mounted forward directory). 3172*7c478bd9Sstevel@tonic-gate 3173*7c478bd9Sstevel@tonic-gate* If your system allows file giveaways, you'll find that 3174*7c478bd9Sstevel@tonic-gate sendmail is much less trusting of :include: files -- in 3175*7c478bd9Sstevel@tonic-gate particular, you'll have to have /SENDMAIL/ANY/SHELL/ in 3176*7c478bd9Sstevel@tonic-gate /etc/shells before they will be trusted (that is, before 3177*7c478bd9Sstevel@tonic-gate files and programs listed in them will be honored). 3178*7c478bd9Sstevel@tonic-gate 3179*7c478bd9Sstevel@tonic-gateIn general, file giveaways are a mistake -- if you can turn them 3180*7c478bd9Sstevel@tonic-gateoff, do so. 3181*7c478bd9Sstevel@tonic-gate 3182*7c478bd9Sstevel@tonic-gate 3183*7c478bd9Sstevel@tonic-gate+--------------------------------+ 3184*7c478bd9Sstevel@tonic-gate| TWEAKING CONFIGURATION OPTIONS | 3185*7c478bd9Sstevel@tonic-gate+--------------------------------+ 3186*7c478bd9Sstevel@tonic-gate 3187*7c478bd9Sstevel@tonic-gateThere are a large number of configuration options that don't normally 3188*7c478bd9Sstevel@tonic-gateneed to be changed. However, if you feel you need to tweak them, 3189*7c478bd9Sstevel@tonic-gateyou can define the following M4 variables. Note that some of these 3190*7c478bd9Sstevel@tonic-gatevariables require formats that are defined in RFC 2821 or RFC 2822. 3191*7c478bd9Sstevel@tonic-gateBefore changing them you need to make sure you do not violate those 3192*7c478bd9Sstevel@tonic-gate(and other relevant) RFCs. 3193*7c478bd9Sstevel@tonic-gate 3194*7c478bd9Sstevel@tonic-gateThis list is shown in four columns: the name you define, the default 3195*7c478bd9Sstevel@tonic-gatevalue for that definition, the option or macro that is affected 3196*7c478bd9Sstevel@tonic-gate(either Ox for an option or Dx for a macro), and a brief description. 3197*7c478bd9Sstevel@tonic-gate 3198*7c478bd9Sstevel@tonic-gateSome options are likely to be deprecated in future versions -- that is, 3199*7c478bd9Sstevel@tonic-gatethe option is only included to provide back-compatibility. These are 3200*7c478bd9Sstevel@tonic-gatemarked with "*". 3201*7c478bd9Sstevel@tonic-gate 3202*7c478bd9Sstevel@tonic-gateRemember that these options are M4 variables, and hence may need to 3203*7c478bd9Sstevel@tonic-gatebe quoted. In particular, arguments with commas will usually have to 3204*7c478bd9Sstevel@tonic-gatebe ``double quoted, like this phrase'' to avoid having the comma 3205*7c478bd9Sstevel@tonic-gateconfuse things. This is common for alias file definitions and for 3206*7c478bd9Sstevel@tonic-gatethe read timeout. 3207*7c478bd9Sstevel@tonic-gate 3208*7c478bd9Sstevel@tonic-gateM4 Variable Name Configuration [Default] & Description 3209*7c478bd9Sstevel@tonic-gate================ ============= ======================= 3210*7c478bd9Sstevel@tonic-gateconfMAILER_NAME $n macro [MAILER-DAEMON] The sender name used 3211*7c478bd9Sstevel@tonic-gate for internally generated outgoing 3212*7c478bd9Sstevel@tonic-gate messages. 3213*7c478bd9Sstevel@tonic-gateconfDOMAIN_NAME $j macro If defined, sets $j. This should 3214*7c478bd9Sstevel@tonic-gate only be done if your system cannot 3215*7c478bd9Sstevel@tonic-gate determine your local domain name, 3216*7c478bd9Sstevel@tonic-gate and then it should be set to 3217*7c478bd9Sstevel@tonic-gate $w.Foo.COM, where Foo.COM is your 3218*7c478bd9Sstevel@tonic-gate domain name. 3219*7c478bd9Sstevel@tonic-gateconfCF_VERSION $Z macro If defined, this is appended to the 3220*7c478bd9Sstevel@tonic-gate configuration version name. 3221*7c478bd9Sstevel@tonic-gateconfLDAP_CLUSTER ${sendmailMTACluster} macro 3222*7c478bd9Sstevel@tonic-gate If defined, this is the LDAP 3223*7c478bd9Sstevel@tonic-gate cluster to use for LDAP searches 3224*7c478bd9Sstevel@tonic-gate as described above in ``USING LDAP 3225*7c478bd9Sstevel@tonic-gate FOR ALIASES, MAPS, AND CLASSES''. 3226*7c478bd9Sstevel@tonic-gateconfFROM_HEADER From: [$?x$x <$g>$|$g$.] The format of an 3227*7c478bd9Sstevel@tonic-gate internally generated From: address. 3228*7c478bd9Sstevel@tonic-gateconfRECEIVED_HEADER Received: 3229*7c478bd9Sstevel@tonic-gate [$?sfrom $s $.$?_($?s$|from $.$_) 3230*7c478bd9Sstevel@tonic-gate $.$?{auth_type}(authenticated) 3231*7c478bd9Sstevel@tonic-gate $.by $j ($v/$Z)$?r with $r$. id $i$?u 3232*7c478bd9Sstevel@tonic-gate for $u; $|; 3233*7c478bd9Sstevel@tonic-gate $.$b] 3234*7c478bd9Sstevel@tonic-gate The format of the Received: header 3235*7c478bd9Sstevel@tonic-gate in messages passed through this host. 3236*7c478bd9Sstevel@tonic-gate It is unwise to try to change this. 3237*7c478bd9Sstevel@tonic-gateconfMESSAGEID_HEADER Message-Id: [<$t.$i@$j>] The format of an 3238*7c478bd9Sstevel@tonic-gate internally generated Message-Id: 3239*7c478bd9Sstevel@tonic-gate header. 3240*7c478bd9Sstevel@tonic-gateconfCW_FILE Fw class [/etc/mail/local-host-names] Name 3241*7c478bd9Sstevel@tonic-gate of file used to get the local 3242*7c478bd9Sstevel@tonic-gate additions to class {w} (local host 3243*7c478bd9Sstevel@tonic-gate names). 3244*7c478bd9Sstevel@tonic-gateconfCT_FILE Ft class [/etc/mail/trusted-users] Name of 3245*7c478bd9Sstevel@tonic-gate file used to get the local additions 3246*7c478bd9Sstevel@tonic-gate to class {t} (trusted users). 3247*7c478bd9Sstevel@tonic-gateconfCR_FILE FR class [/etc/mail/relay-domains] Name of 3248*7c478bd9Sstevel@tonic-gate file used to get the local additions 3249*7c478bd9Sstevel@tonic-gate to class {R} (hosts allowed to relay). 3250*7c478bd9Sstevel@tonic-gateconfTRUSTED_USERS Ct class [no default] Names of users to add to 3251*7c478bd9Sstevel@tonic-gate the list of trusted users. This list 3252*7c478bd9Sstevel@tonic-gate always includes root, uucp, and daemon. 3253*7c478bd9Sstevel@tonic-gate See also FEATURE(`use_ct_file'). 3254*7c478bd9Sstevel@tonic-gateconfTRUSTED_USER TrustedUser [no default] Trusted user for file 3255*7c478bd9Sstevel@tonic-gate ownership and starting the daemon. 3256*7c478bd9Sstevel@tonic-gate Not to be confused with 3257*7c478bd9Sstevel@tonic-gate confTRUSTED_USERS (see above). 3258*7c478bd9Sstevel@tonic-gateconfSMTP_MAILER - [esmtp] The mailer name used when 3259*7c478bd9Sstevel@tonic-gate SMTP connectivity is required. 3260*7c478bd9Sstevel@tonic-gate One of "smtp", "smtp8", 3261*7c478bd9Sstevel@tonic-gate "esmtp", or "dsmtp". 3262*7c478bd9Sstevel@tonic-gateconfUUCP_MAILER - [uucp-old] The mailer to be used by 3263*7c478bd9Sstevel@tonic-gate default for bang-format recipient 3264*7c478bd9Sstevel@tonic-gate addresses. See also discussion of 3265*7c478bd9Sstevel@tonic-gate class {U}, class {Y}, and class {Z} 3266*7c478bd9Sstevel@tonic-gate in the MAILER(`uucp') section. 3267*7c478bd9Sstevel@tonic-gateconfLOCAL_MAILER - [local] The mailer name used when 3268*7c478bd9Sstevel@tonic-gate local connectivity is required. 3269*7c478bd9Sstevel@tonic-gate Almost always "local". 3270*7c478bd9Sstevel@tonic-gateconfRELAY_MAILER - [relay] The default mailer name used 3271*7c478bd9Sstevel@tonic-gate for relaying any mail (e.g., to a 3272*7c478bd9Sstevel@tonic-gate BITNET_RELAY, a SMART_HOST, or 3273*7c478bd9Sstevel@tonic-gate whatever). This can reasonably be 3274*7c478bd9Sstevel@tonic-gate "uucp-new" if you are on a 3275*7c478bd9Sstevel@tonic-gate UUCP-connected site. 3276*7c478bd9Sstevel@tonic-gateconfSEVEN_BIT_INPUT SevenBitInput [False] Force input to seven bits? 3277*7c478bd9Sstevel@tonic-gateconfEIGHT_BIT_HANDLING EightBitMode [pass8] 8-bit data handling 3278*7c478bd9Sstevel@tonic-gateconfALIAS_WAIT AliasWait [10m] Time to wait for alias file 3279*7c478bd9Sstevel@tonic-gate rebuild until you get bored and 3280*7c478bd9Sstevel@tonic-gate decide that the apparently pending 3281*7c478bd9Sstevel@tonic-gate rebuild failed. 3282*7c478bd9Sstevel@tonic-gateconfMIN_FREE_BLOCKS MinFreeBlocks [100] Minimum number of free blocks on 3283*7c478bd9Sstevel@tonic-gate queue filesystem to accept SMTP mail. 3284*7c478bd9Sstevel@tonic-gate (Prior to 8.7 this was minfree/maxsize, 3285*7c478bd9Sstevel@tonic-gate where minfree was the number of free 3286*7c478bd9Sstevel@tonic-gate blocks and maxsize was the maximum 3287*7c478bd9Sstevel@tonic-gate message size. Use confMAX_MESSAGE_SIZE 3288*7c478bd9Sstevel@tonic-gate for the second value now.) 3289*7c478bd9Sstevel@tonic-gateconfMAX_MESSAGE_SIZE MaxMessageSize [infinite] The maximum size of messages 3290*7c478bd9Sstevel@tonic-gate that will be accepted (in bytes). 3291*7c478bd9Sstevel@tonic-gateconfBLANK_SUB BlankSub [.] Blank (space) substitution 3292*7c478bd9Sstevel@tonic-gate character. 3293*7c478bd9Sstevel@tonic-gateconfCON_EXPENSIVE HoldExpensive [False] Avoid connecting immediately 3294*7c478bd9Sstevel@tonic-gate to mailers marked expensive. 3295*7c478bd9Sstevel@tonic-gateconfCHECKPOINT_INTERVAL CheckpointInterval 3296*7c478bd9Sstevel@tonic-gate [10] Checkpoint queue files every N 3297*7c478bd9Sstevel@tonic-gate recipients. 3298*7c478bd9Sstevel@tonic-gateconfDELIVERY_MODE DeliveryMode [background] Default delivery mode. 3299*7c478bd9Sstevel@tonic-gateconfERROR_MODE ErrorMode [print] Error message mode. 3300*7c478bd9Sstevel@tonic-gateconfERROR_MESSAGE ErrorHeader [undefined] Error message header/file. 3301*7c478bd9Sstevel@tonic-gateconfSAVE_FROM_LINES SaveFromLine Save extra leading From_ lines. 3302*7c478bd9Sstevel@tonic-gateconfTEMP_FILE_MODE TempFileMode [0600] Temporary file mode. 3303*7c478bd9Sstevel@tonic-gateconfMATCH_GECOS MatchGECOS [False] Match GECOS field. 3304*7c478bd9Sstevel@tonic-gateconfMAX_HOP MaxHopCount [25] Maximum hop count. 3305*7c478bd9Sstevel@tonic-gateconfIGNORE_DOTS* IgnoreDots [False; always False in -bs or -bd 3306*7c478bd9Sstevel@tonic-gate mode] Ignore dot as terminator for 3307*7c478bd9Sstevel@tonic-gate incoming messages? 3308*7c478bd9Sstevel@tonic-gateconfBIND_OPTS ResolverOptions [undefined] Default options for DNS 3309*7c478bd9Sstevel@tonic-gate resolver. 3310*7c478bd9Sstevel@tonic-gateconfMIME_FORMAT_ERRORS* SendMimeErrors [True] Send error messages as MIME- 3311*7c478bd9Sstevel@tonic-gate encapsulated messages per RFC 1344. 3312*7c478bd9Sstevel@tonic-gateconfFORWARD_PATH ForwardPath [$z/.forward.$w:$z/.forward] 3313*7c478bd9Sstevel@tonic-gate The colon-separated list of places to 3314*7c478bd9Sstevel@tonic-gate search for .forward files. N.B.: see 3315*7c478bd9Sstevel@tonic-gate the Security Notes section. 3316*7c478bd9Sstevel@tonic-gateconfMCI_CACHE_SIZE ConnectionCacheSize 3317*7c478bd9Sstevel@tonic-gate [2] Size of open connection cache. 3318*7c478bd9Sstevel@tonic-gateconfMCI_CACHE_TIMEOUT ConnectionCacheTimeout 3319*7c478bd9Sstevel@tonic-gate [5m] Open connection cache timeout. 3320*7c478bd9Sstevel@tonic-gateconfHOST_STATUS_DIRECTORY HostStatusDirectory 3321*7c478bd9Sstevel@tonic-gate [undefined] If set, host status is kept 3322*7c478bd9Sstevel@tonic-gate on disk between sendmail runs in the 3323*7c478bd9Sstevel@tonic-gate named directory tree. This need not be 3324*7c478bd9Sstevel@tonic-gate a full pathname, in which case it is 3325*7c478bd9Sstevel@tonic-gate interpreted relative to the queue 3326*7c478bd9Sstevel@tonic-gate directory. 3327*7c478bd9Sstevel@tonic-gateconfSINGLE_THREAD_DELIVERY SingleThreadDelivery 3328*7c478bd9Sstevel@tonic-gate [False] If this option and the 3329*7c478bd9Sstevel@tonic-gate HostStatusDirectory option are both 3330*7c478bd9Sstevel@tonic-gate set, single thread deliveries to other 3331*7c478bd9Sstevel@tonic-gate hosts. That is, don't allow any two 3332*7c478bd9Sstevel@tonic-gate sendmails on this host to connect 3333*7c478bd9Sstevel@tonic-gate simultaneously to any other single 3334*7c478bd9Sstevel@tonic-gate host. This can slow down delivery in 3335*7c478bd9Sstevel@tonic-gate some cases, in particular since a 3336*7c478bd9Sstevel@tonic-gate cached but otherwise idle connection 3337*7c478bd9Sstevel@tonic-gate to a host will prevent other sendmails 3338*7c478bd9Sstevel@tonic-gate from connecting to the other host. 3339*7c478bd9Sstevel@tonic-gateconfUSE_ERRORS_TO* UseErrorsTo [False] Use the Errors-To: header to 3340*7c478bd9Sstevel@tonic-gate deliver error messages. This should 3341*7c478bd9Sstevel@tonic-gate not be necessary because of general 3342*7c478bd9Sstevel@tonic-gate acceptance of the envelope/header 3343*7c478bd9Sstevel@tonic-gate distinction. 3344*7c478bd9Sstevel@tonic-gateconfLOG_LEVEL LogLevel [9] Log level. 3345*7c478bd9Sstevel@tonic-gateconfME_TOO MeToo [True] Include sender in group 3346*7c478bd9Sstevel@tonic-gate expansions. This option is 3347*7c478bd9Sstevel@tonic-gate deprecated and will be removed from 3348*7c478bd9Sstevel@tonic-gate a future version. 3349*7c478bd9Sstevel@tonic-gateconfCHECK_ALIASES CheckAliases [False] Check RHS of aliases when 3350*7c478bd9Sstevel@tonic-gate running newaliases. Since this does 3351*7c478bd9Sstevel@tonic-gate DNS lookups on every address, it can 3352*7c478bd9Sstevel@tonic-gate slow down the alias rebuild process 3353*7c478bd9Sstevel@tonic-gate considerably on large alias files. 3354*7c478bd9Sstevel@tonic-gateconfOLD_STYLE_HEADERS* OldStyleHeaders [True] Assume that headers without 3355*7c478bd9Sstevel@tonic-gate special chars are old style. 3356*7c478bd9Sstevel@tonic-gateconfPRIVACY_FLAGS PrivacyOptions [authwarnings] Privacy flags. 3357*7c478bd9Sstevel@tonic-gateconfCOPY_ERRORS_TO PostmasterCopy [undefined] Address for additional 3358*7c478bd9Sstevel@tonic-gate copies of all error messages. 3359*7c478bd9Sstevel@tonic-gateconfQUEUE_FACTOR QueueFactor [600000] Slope of queue-only function. 3360*7c478bd9Sstevel@tonic-gateconfQUEUE_FILE_MODE QueueFileMode [undefined] Default permissions for 3361*7c478bd9Sstevel@tonic-gate queue files (octal). If not set, 3362*7c478bd9Sstevel@tonic-gate sendmail uses 0600 unless its real 3363*7c478bd9Sstevel@tonic-gate and effective uid are different in 3364*7c478bd9Sstevel@tonic-gate which case it uses 0644. 3365*7c478bd9Sstevel@tonic-gateconfDONT_PRUNE_ROUTES DontPruneRoutes [False] Don't prune down route-addr 3366*7c478bd9Sstevel@tonic-gate syntax addresses to the minimum 3367*7c478bd9Sstevel@tonic-gate possible. 3368*7c478bd9Sstevel@tonic-gateconfSAFE_QUEUE* SuperSafe [True] Commit all messages to disk 3369*7c478bd9Sstevel@tonic-gate before forking. 3370*7c478bd9Sstevel@tonic-gateconfTO_INITIAL Timeout.initial [5m] The timeout waiting for a response 3371*7c478bd9Sstevel@tonic-gate on the initial connect. 3372*7c478bd9Sstevel@tonic-gateconfTO_CONNECT Timeout.connect [0] The timeout waiting for an initial 3373*7c478bd9Sstevel@tonic-gate connect() to complete. This can only 3374*7c478bd9Sstevel@tonic-gate shorten connection timeouts; the kernel 3375*7c478bd9Sstevel@tonic-gate silently enforces an absolute maximum 3376*7c478bd9Sstevel@tonic-gate (which varies depending on the system). 3377*7c478bd9Sstevel@tonic-gateconfTO_ICONNECT Timeout.iconnect 3378*7c478bd9Sstevel@tonic-gate [undefined] Like Timeout.connect, but 3379*7c478bd9Sstevel@tonic-gate applies only to the very first attempt 3380*7c478bd9Sstevel@tonic-gate to connect to a host in a message. 3381*7c478bd9Sstevel@tonic-gate This allows a single very fast pass 3382*7c478bd9Sstevel@tonic-gate followed by more careful delivery 3383*7c478bd9Sstevel@tonic-gate attempts in the future. 3384*7c478bd9Sstevel@tonic-gateconfTO_ACONNECT Timeout.aconnect 3385*7c478bd9Sstevel@tonic-gate [0] The overall timeout waiting for 3386*7c478bd9Sstevel@tonic-gate all connection for a single delivery 3387*7c478bd9Sstevel@tonic-gate attempt to succeed. If 0, no overall 3388*7c478bd9Sstevel@tonic-gate limit is applied. 3389*7c478bd9Sstevel@tonic-gateconfTO_HELO Timeout.helo [5m] The timeout waiting for a response 3390*7c478bd9Sstevel@tonic-gate to a HELO or EHLO command. 3391*7c478bd9Sstevel@tonic-gateconfTO_MAIL Timeout.mail [10m] The timeout waiting for a 3392*7c478bd9Sstevel@tonic-gate response to the MAIL command. 3393*7c478bd9Sstevel@tonic-gateconfTO_RCPT Timeout.rcpt [1h] The timeout waiting for a response 3394*7c478bd9Sstevel@tonic-gate to the RCPT command. 3395*7c478bd9Sstevel@tonic-gateconfTO_DATAINIT Timeout.datainit 3396*7c478bd9Sstevel@tonic-gate [5m] The timeout waiting for a 354 3397*7c478bd9Sstevel@tonic-gate response from the DATA command. 3398*7c478bd9Sstevel@tonic-gateconfTO_DATABLOCK Timeout.datablock 3399*7c478bd9Sstevel@tonic-gate [1h] The timeout waiting for a block 3400*7c478bd9Sstevel@tonic-gate during DATA phase. 3401*7c478bd9Sstevel@tonic-gateconfTO_DATAFINAL Timeout.datafinal 3402*7c478bd9Sstevel@tonic-gate [1h] The timeout waiting for a response 3403*7c478bd9Sstevel@tonic-gate to the final "." that terminates a 3404*7c478bd9Sstevel@tonic-gate message. 3405*7c478bd9Sstevel@tonic-gateconfTO_RSET Timeout.rset [5m] The timeout waiting for a response 3406*7c478bd9Sstevel@tonic-gate to the RSET command. 3407*7c478bd9Sstevel@tonic-gateconfTO_QUIT Timeout.quit [2m] The timeout waiting for a response 3408*7c478bd9Sstevel@tonic-gate to the QUIT command. 3409*7c478bd9Sstevel@tonic-gateconfTO_MISC Timeout.misc [2m] The timeout waiting for a response 3410*7c478bd9Sstevel@tonic-gate to other SMTP commands. 3411*7c478bd9Sstevel@tonic-gateconfTO_COMMAND Timeout.command [1h] In server SMTP, the timeout 3412*7c478bd9Sstevel@tonic-gate waiting for a command to be issued. 3413*7c478bd9Sstevel@tonic-gateconfTO_IDENT Timeout.ident [5s] The timeout waiting for a 3414*7c478bd9Sstevel@tonic-gate response to an IDENT query. 3415*7c478bd9Sstevel@tonic-gateconfTO_FILEOPEN Timeout.fileopen 3416*7c478bd9Sstevel@tonic-gate [60s] The timeout waiting for a file 3417*7c478bd9Sstevel@tonic-gate (e.g., :include: file) to be opened. 3418*7c478bd9Sstevel@tonic-gateconfTO_LHLO Timeout.lhlo [2m] The timeout waiting for a response 3419*7c478bd9Sstevel@tonic-gate to an LMTP LHLO command. 3420*7c478bd9Sstevel@tonic-gateconfTO_STARTTLS Timeout.starttls 3421*7c478bd9Sstevel@tonic-gate [1h] The timeout waiting for a 3422*7c478bd9Sstevel@tonic-gate response to an SMTP STARTTLS command. 3423*7c478bd9Sstevel@tonic-gateconfTO_CONTROL Timeout.control 3424*7c478bd9Sstevel@tonic-gate [2m] The timeout for a complete 3425*7c478bd9Sstevel@tonic-gate control socket transaction to complete. 3426*7c478bd9Sstevel@tonic-gateconfTO_QUEUERETURN Timeout.queuereturn 3427*7c478bd9Sstevel@tonic-gate [5d] The timeout before a message is 3428*7c478bd9Sstevel@tonic-gate returned as undeliverable. 3429*7c478bd9Sstevel@tonic-gateconfTO_QUEUERETURN_NORMAL 3430*7c478bd9Sstevel@tonic-gate Timeout.queuereturn.normal 3431*7c478bd9Sstevel@tonic-gate [undefined] As above, for normal 3432*7c478bd9Sstevel@tonic-gate priority messages. 3433*7c478bd9Sstevel@tonic-gateconfTO_QUEUERETURN_URGENT 3434*7c478bd9Sstevel@tonic-gate Timeout.queuereturn.urgent 3435*7c478bd9Sstevel@tonic-gate [undefined] As above, for urgent 3436*7c478bd9Sstevel@tonic-gate priority messages. 3437*7c478bd9Sstevel@tonic-gateconfTO_QUEUERETURN_NONURGENT 3438*7c478bd9Sstevel@tonic-gate Timeout.queuereturn.non-urgent 3439*7c478bd9Sstevel@tonic-gate [undefined] As above, for non-urgent 3440*7c478bd9Sstevel@tonic-gate (low) priority messages. 3441*7c478bd9Sstevel@tonic-gateconfTO_QUEUERETURN_DSN 3442*7c478bd9Sstevel@tonic-gate Timeout.queuereturn.dsn 3443*7c478bd9Sstevel@tonic-gate [undefined] As above, for delivery 3444*7c478bd9Sstevel@tonic-gate status notification messages. 3445*7c478bd9Sstevel@tonic-gateconfTO_QUEUEWARN Timeout.queuewarn 3446*7c478bd9Sstevel@tonic-gate [4h] The timeout before a warning 3447*7c478bd9Sstevel@tonic-gate message is sent to the sender telling 3448*7c478bd9Sstevel@tonic-gate them that the message has been 3449*7c478bd9Sstevel@tonic-gate deferred. 3450*7c478bd9Sstevel@tonic-gateconfTO_QUEUEWARN_NORMAL Timeout.queuewarn.normal 3451*7c478bd9Sstevel@tonic-gate [undefined] As above, for normal 3452*7c478bd9Sstevel@tonic-gate priority messages. 3453*7c478bd9Sstevel@tonic-gateconfTO_QUEUEWARN_URGENT Timeout.queuewarn.urgent 3454*7c478bd9Sstevel@tonic-gate [undefined] As above, for urgent 3455*7c478bd9Sstevel@tonic-gate priority messages. 3456*7c478bd9Sstevel@tonic-gateconfTO_QUEUEWARN_NONURGENT 3457*7c478bd9Sstevel@tonic-gate Timeout.queuewarn.non-urgent 3458*7c478bd9Sstevel@tonic-gate [undefined] As above, for non-urgent 3459*7c478bd9Sstevel@tonic-gate (low) priority messages. 3460*7c478bd9Sstevel@tonic-gateconfTO_QUEUEWARN_DSN 3461*7c478bd9Sstevel@tonic-gate Timeout.queuewarn.dsn 3462*7c478bd9Sstevel@tonic-gate [undefined] As above, for delivery 3463*7c478bd9Sstevel@tonic-gate status notification messages. 3464*7c478bd9Sstevel@tonic-gateconfTO_HOSTSTATUS Timeout.hoststatus 3465*7c478bd9Sstevel@tonic-gate [30m] How long information about host 3466*7c478bd9Sstevel@tonic-gate statuses will be maintained before it 3467*7c478bd9Sstevel@tonic-gate is considered stale and the host should 3468*7c478bd9Sstevel@tonic-gate be retried. This applies both within 3469*7c478bd9Sstevel@tonic-gate a single queue run and to persistent 3470*7c478bd9Sstevel@tonic-gate information (see below). 3471*7c478bd9Sstevel@tonic-gateconfTO_RESOLVER_RETRANS Timeout.resolver.retrans 3472*7c478bd9Sstevel@tonic-gate [varies] Sets the resolver's 3473*7c478bd9Sstevel@tonic-gate retransmission time interval (in 3474*7c478bd9Sstevel@tonic-gate seconds). Sets both 3475*7c478bd9Sstevel@tonic-gate Timeout.resolver.retrans.first and 3476*7c478bd9Sstevel@tonic-gate Timeout.resolver.retrans.normal. 3477*7c478bd9Sstevel@tonic-gateconfTO_RESOLVER_RETRANS_FIRST Timeout.resolver.retrans.first 3478*7c478bd9Sstevel@tonic-gate [varies] Sets the resolver's 3479*7c478bd9Sstevel@tonic-gate retransmission time interval (in 3480*7c478bd9Sstevel@tonic-gate seconds) for the first attempt to 3481*7c478bd9Sstevel@tonic-gate deliver a message. 3482*7c478bd9Sstevel@tonic-gateconfTO_RESOLVER_RETRANS_NORMAL Timeout.resolver.retrans.normal 3483*7c478bd9Sstevel@tonic-gate [varies] Sets the resolver's 3484*7c478bd9Sstevel@tonic-gate retransmission time interval (in 3485*7c478bd9Sstevel@tonic-gate seconds) for all resolver lookups 3486*7c478bd9Sstevel@tonic-gate except the first delivery attempt. 3487*7c478bd9Sstevel@tonic-gateconfTO_RESOLVER_RETRY Timeout.resolver.retry 3488*7c478bd9Sstevel@tonic-gate [varies] Sets the number of times 3489*7c478bd9Sstevel@tonic-gate to retransmit a resolver query. 3490*7c478bd9Sstevel@tonic-gate Sets both 3491*7c478bd9Sstevel@tonic-gate Timeout.resolver.retry.first and 3492*7c478bd9Sstevel@tonic-gate Timeout.resolver.retry.normal. 3493*7c478bd9Sstevel@tonic-gateconfTO_RESOLVER_RETRY_FIRST Timeout.resolver.retry.first 3494*7c478bd9Sstevel@tonic-gate [varies] Sets the number of times 3495*7c478bd9Sstevel@tonic-gate to retransmit a resolver query for 3496*7c478bd9Sstevel@tonic-gate the first attempt to deliver a 3497*7c478bd9Sstevel@tonic-gate message. 3498*7c478bd9Sstevel@tonic-gateconfTO_RESOLVER_RETRY_NORMAL Timeout.resolver.retry.normal 3499*7c478bd9Sstevel@tonic-gate [varies] Sets the number of times 3500*7c478bd9Sstevel@tonic-gate to retransmit a resolver query for 3501*7c478bd9Sstevel@tonic-gate all resolver lookups except the 3502*7c478bd9Sstevel@tonic-gate first delivery attempt. 3503*7c478bd9Sstevel@tonic-gateconfTIME_ZONE TimeZoneSpec [USE_SYSTEM] Time zone info -- can be 3504*7c478bd9Sstevel@tonic-gate USE_SYSTEM to use the system's idea, 3505*7c478bd9Sstevel@tonic-gate USE_TZ to use the user's TZ envariable, 3506*7c478bd9Sstevel@tonic-gate or something else to force that value. 3507*7c478bd9Sstevel@tonic-gateconfDEF_USER_ID DefaultUser [1:1] Default user id. 3508*7c478bd9Sstevel@tonic-gateconfUSERDB_SPEC UserDatabaseSpec 3509*7c478bd9Sstevel@tonic-gate [undefined] User database 3510*7c478bd9Sstevel@tonic-gate specification. 3511*7c478bd9Sstevel@tonic-gateconfFALLBACK_MX FallbackMXhost [undefined] Fallback MX host. 3512*7c478bd9Sstevel@tonic-gateconfFALLBACK_SMARTHOST FallbackSmartHost 3513*7c478bd9Sstevel@tonic-gate [undefined] Fallback smart host. 3514*7c478bd9Sstevel@tonic-gateconfTRY_NULL_MX_LIST TryNullMXList [False] If this host is the best MX 3515*7c478bd9Sstevel@tonic-gate for a host and other arrangements 3516*7c478bd9Sstevel@tonic-gate haven't been made, try connecting 3517*7c478bd9Sstevel@tonic-gate to the host directly; normally this 3518*7c478bd9Sstevel@tonic-gate would be a config error. 3519*7c478bd9Sstevel@tonic-gateconfQUEUE_LA QueueLA [varies] Load average at which 3520*7c478bd9Sstevel@tonic-gate queue-only function kicks in. 3521*7c478bd9Sstevel@tonic-gate Default values is (8 * numproc) 3522*7c478bd9Sstevel@tonic-gate where numproc is the number of 3523*7c478bd9Sstevel@tonic-gate processors online (if that can be 3524*7c478bd9Sstevel@tonic-gate determined). 3525*7c478bd9Sstevel@tonic-gateconfREFUSE_LA RefuseLA [varies] Load average at which 3526*7c478bd9Sstevel@tonic-gate incoming SMTP connections are 3527*7c478bd9Sstevel@tonic-gate refused. Default values is (12 * 3528*7c478bd9Sstevel@tonic-gate numproc) where numproc is the 3529*7c478bd9Sstevel@tonic-gate number of processors online (if 3530*7c478bd9Sstevel@tonic-gate that can be determined). 3531*7c478bd9Sstevel@tonic-gateconfREJECT_LOG_INTERVAL RejectLogInterval [3h] Log interval when 3532*7c478bd9Sstevel@tonic-gate refusing connections for this long. 3533*7c478bd9Sstevel@tonic-gateconfDELAY_LA DelayLA [0] Load average at which sendmail 3534*7c478bd9Sstevel@tonic-gate will sleep for one second on most 3535*7c478bd9Sstevel@tonic-gate SMTP commands and before accepting 3536*7c478bd9Sstevel@tonic-gate connections. 0 means no limit. 3537*7c478bd9Sstevel@tonic-gateconfMAX_ALIAS_RECURSION MaxAliasRecursion 3538*7c478bd9Sstevel@tonic-gate [10] Maximum depth of alias recursion. 3539*7c478bd9Sstevel@tonic-gateconfMAX_DAEMON_CHILDREN MaxDaemonChildren 3540*7c478bd9Sstevel@tonic-gate [undefined] The maximum number of 3541*7c478bd9Sstevel@tonic-gate children the daemon will permit. After 3542*7c478bd9Sstevel@tonic-gate this number, connections will be 3543*7c478bd9Sstevel@tonic-gate rejected. If not set or <= 0, there is 3544*7c478bd9Sstevel@tonic-gate no limit. 3545*7c478bd9Sstevel@tonic-gateconfMAX_HEADERS_LENGTH MaxHeadersLength 3546*7c478bd9Sstevel@tonic-gate [32768] Maximum length of the sum 3547*7c478bd9Sstevel@tonic-gate of all headers. 3548*7c478bd9Sstevel@tonic-gateconfMAX_MIME_HEADER_LENGTH MaxMimeHeaderLength 3549*7c478bd9Sstevel@tonic-gate [undefined] Maximum length of 3550*7c478bd9Sstevel@tonic-gate certain MIME header field values. 3551*7c478bd9Sstevel@tonic-gateconfCONNECTION_RATE_THROTTLE ConnectionRateThrottle 3552*7c478bd9Sstevel@tonic-gate [undefined] The maximum number of 3553*7c478bd9Sstevel@tonic-gate connections permitted per second per 3554*7c478bd9Sstevel@tonic-gate daemon. After this many connections 3555*7c478bd9Sstevel@tonic-gate are accepted, further connections 3556*7c478bd9Sstevel@tonic-gate will be delayed. If not set or <= 0, 3557*7c478bd9Sstevel@tonic-gate there is no limit. 3558*7c478bd9Sstevel@tonic-gateconfCONNECTION_RATE_WINDOW_SIZE ConnectionRateWindowSize 3559*7c478bd9Sstevel@tonic-gate [60s] Define the length of the 3560*7c478bd9Sstevel@tonic-gate interval for which the number of 3561*7c478bd9Sstevel@tonic-gate incoming connections is maintained. 3562*7c478bd9Sstevel@tonic-gateconfWORK_RECIPIENT_FACTOR 3563*7c478bd9Sstevel@tonic-gate RecipientFactor [30000] Cost of each recipient. 3564*7c478bd9Sstevel@tonic-gateconfSEPARATE_PROC ForkEachJob [False] Run all deliveries in a 3565*7c478bd9Sstevel@tonic-gate separate process. 3566*7c478bd9Sstevel@tonic-gateconfWORK_CLASS_FACTOR ClassFactor [1800] Priority multiplier for class. 3567*7c478bd9Sstevel@tonic-gateconfWORK_TIME_FACTOR RetryFactor [90000] Cost of each delivery attempt. 3568*7c478bd9Sstevel@tonic-gateconfQUEUE_SORT_ORDER QueueSortOrder [Priority] Queue sort algorithm: 3569*7c478bd9Sstevel@tonic-gate Priority, Host, Filename, Random, 3570*7c478bd9Sstevel@tonic-gate Modification, or Time. 3571*7c478bd9Sstevel@tonic-gateconfMIN_QUEUE_AGE MinQueueAge [0] The minimum amount of time a job 3572*7c478bd9Sstevel@tonic-gate must sit in the queue between queue 3573*7c478bd9Sstevel@tonic-gate runs. This allows you to set the 3574*7c478bd9Sstevel@tonic-gate queue run interval low for better 3575*7c478bd9Sstevel@tonic-gate responsiveness without trying all 3576*7c478bd9Sstevel@tonic-gate jobs in each run. 3577*7c478bd9Sstevel@tonic-gateconfDEF_CHAR_SET DefaultCharSet [unknown-8bit] When converting 3578*7c478bd9Sstevel@tonic-gate unlabeled 8 bit input to MIME, the 3579*7c478bd9Sstevel@tonic-gate character set to use by default. 3580*7c478bd9Sstevel@tonic-gateconfSERVICE_SWITCH_FILE ServiceSwitchFile 3581*7c478bd9Sstevel@tonic-gate [/etc/mail/service.switch] The file 3582*7c478bd9Sstevel@tonic-gate to use for the service switch on 3583*7c478bd9Sstevel@tonic-gate systems that do not have a 3584*7c478bd9Sstevel@tonic-gate system-defined switch. 3585*7c478bd9Sstevel@tonic-gateconfHOSTS_FILE HostsFile [/etc/hosts] The file to use when doing 3586*7c478bd9Sstevel@tonic-gate "file" type access of hosts names. 3587*7c478bd9Sstevel@tonic-gateconfDIAL_DELAY DialDelay [0s] If a connection fails, wait this 3588*7c478bd9Sstevel@tonic-gate long and try again. Zero means "don't 3589*7c478bd9Sstevel@tonic-gate retry". This is to allow "dial on 3590*7c478bd9Sstevel@tonic-gate demand" connections to have enough time 3591*7c478bd9Sstevel@tonic-gate to complete a connection. 3592*7c478bd9Sstevel@tonic-gateconfNO_RCPT_ACTION NoRecipientAction 3593*7c478bd9Sstevel@tonic-gate [none] What to do if there are no legal 3594*7c478bd9Sstevel@tonic-gate recipient fields (To:, Cc: or Bcc:) 3595*7c478bd9Sstevel@tonic-gate in the message. Legal values can 3596*7c478bd9Sstevel@tonic-gate be "none" to just leave the 3597*7c478bd9Sstevel@tonic-gate nonconforming message as is, "add-to" 3598*7c478bd9Sstevel@tonic-gate to add a To: header with all the 3599*7c478bd9Sstevel@tonic-gate known recipients (which may expose 3600*7c478bd9Sstevel@tonic-gate blind recipients), "add-apparently-to" 3601*7c478bd9Sstevel@tonic-gate to do the same but use Apparently-To: 3602*7c478bd9Sstevel@tonic-gate instead of To: (strongly discouraged 3603*7c478bd9Sstevel@tonic-gate in accordance with IETF standards), 3604*7c478bd9Sstevel@tonic-gate "add-bcc" to add an empty Bcc: 3605*7c478bd9Sstevel@tonic-gate header, or "add-to-undisclosed" to 3606*7c478bd9Sstevel@tonic-gate add the header 3607*7c478bd9Sstevel@tonic-gate ``To: undisclosed-recipients:;''. 3608*7c478bd9Sstevel@tonic-gateconfSAFE_FILE_ENV SafeFileEnvironment 3609*7c478bd9Sstevel@tonic-gate [undefined] If set, sendmail will do a 3610*7c478bd9Sstevel@tonic-gate chroot() into this directory before 3611*7c478bd9Sstevel@tonic-gate writing files. 3612*7c478bd9Sstevel@tonic-gateconfCOLON_OK_IN_ADDR ColonOkInAddr [True unless Configuration Level > 6] 3613*7c478bd9Sstevel@tonic-gate If set, colons are treated as a regular 3614*7c478bd9Sstevel@tonic-gate character in addresses. If not set, 3615*7c478bd9Sstevel@tonic-gate they are treated as the introducer to 3616*7c478bd9Sstevel@tonic-gate the RFC 822 "group" syntax. Colons are 3617*7c478bd9Sstevel@tonic-gate handled properly in route-addrs. This 3618*7c478bd9Sstevel@tonic-gate option defaults on for V5 and lower 3619*7c478bd9Sstevel@tonic-gate configuration files. 3620*7c478bd9Sstevel@tonic-gateconfMAX_QUEUE_RUN_SIZE MaxQueueRunSize [0] If set, limit the maximum size of 3621*7c478bd9Sstevel@tonic-gate any given queue run to this number of 3622*7c478bd9Sstevel@tonic-gate entries. Essentially, this will stop 3623*7c478bd9Sstevel@tonic-gate reading each queue directory after this 3624*7c478bd9Sstevel@tonic-gate number of entries are reached; it does 3625*7c478bd9Sstevel@tonic-gate _not_ pick the highest priority jobs, 3626*7c478bd9Sstevel@tonic-gate so this should be as large as your 3627*7c478bd9Sstevel@tonic-gate system can tolerate. If not set, there 3628*7c478bd9Sstevel@tonic-gate is no limit. 3629*7c478bd9Sstevel@tonic-gateconfMAX_QUEUE_CHILDREN MaxQueueChildren 3630*7c478bd9Sstevel@tonic-gate [undefined] Limits the maximum number 3631*7c478bd9Sstevel@tonic-gate of concurrent queue runners active. 3632*7c478bd9Sstevel@tonic-gate This is to keep system resources used 3633*7c478bd9Sstevel@tonic-gate within a reasonable limit. Relates to 3634*7c478bd9Sstevel@tonic-gate Queue Groups and ForkEachJob. 3635*7c478bd9Sstevel@tonic-gateconfMAX_RUNNERS_PER_QUEUE MaxRunnersPerQueue 3636*7c478bd9Sstevel@tonic-gate [1] Only active when MaxQueueChildren 3637*7c478bd9Sstevel@tonic-gate defined. Controls the maximum number 3638*7c478bd9Sstevel@tonic-gate of queue runners (aka queue children) 3639*7c478bd9Sstevel@tonic-gate active at the same time in a work 3640*7c478bd9Sstevel@tonic-gate group. See also MaxQueueChildren. 3641*7c478bd9Sstevel@tonic-gateconfDONT_EXPAND_CNAMES DontExpandCnames 3642*7c478bd9Sstevel@tonic-gate [False] If set, $[ ... $] lookups that 3643*7c478bd9Sstevel@tonic-gate do DNS based lookups do not expand 3644*7c478bd9Sstevel@tonic-gate CNAME records. This currently violates 3645*7c478bd9Sstevel@tonic-gate the published standards, but the IETF 3646*7c478bd9Sstevel@tonic-gate seems to be moving toward legalizing 3647*7c478bd9Sstevel@tonic-gate this. For example, if "FTP.Foo.ORG" 3648*7c478bd9Sstevel@tonic-gate is a CNAME for "Cruft.Foo.ORG", then 3649*7c478bd9Sstevel@tonic-gate with this option set a lookup of 3650*7c478bd9Sstevel@tonic-gate "FTP" will return "FTP.Foo.ORG"; if 3651*7c478bd9Sstevel@tonic-gate clear it returns "Cruft.FOO.ORG". N.B. 3652*7c478bd9Sstevel@tonic-gate you may not see any effect until your 3653*7c478bd9Sstevel@tonic-gate downstream neighbors stop doing CNAME 3654*7c478bd9Sstevel@tonic-gate lookups as well. 3655*7c478bd9Sstevel@tonic-gateconfFROM_LINE UnixFromLine [From $g $d] The From_ line used 3656*7c478bd9Sstevel@tonic-gate when sending to files or programs. 3657*7c478bd9Sstevel@tonic-gateconfSINGLE_LINE_FROM_HEADER SingleLineFromHeader 3658*7c478bd9Sstevel@tonic-gate [False] From: lines that have 3659*7c478bd9Sstevel@tonic-gate embedded newlines are unwrapped 3660*7c478bd9Sstevel@tonic-gate onto one line. 3661*7c478bd9Sstevel@tonic-gateconfALLOW_BOGUS_HELO AllowBogusHELO [False] Allow HELO SMTP command that 3662*7c478bd9Sstevel@tonic-gate does not include a host name. 3663*7c478bd9Sstevel@tonic-gateconfMUST_QUOTE_CHARS MustQuoteChars [.'] Characters to be quoted in a full 3664*7c478bd9Sstevel@tonic-gate name phrase (@,;:\()[] are automatic). 3665*7c478bd9Sstevel@tonic-gateconfOPERATORS OperatorChars [.:%@!^/[]+] Address operator 3666*7c478bd9Sstevel@tonic-gate characters. 3667*7c478bd9Sstevel@tonic-gateconfSMTP_LOGIN_MSG SmtpGreetingMessage 3668*7c478bd9Sstevel@tonic-gate [$j Sendmail $v/$Z; $b] 3669*7c478bd9Sstevel@tonic-gate The initial (spontaneous) SMTP 3670*7c478bd9Sstevel@tonic-gate greeting message. The word "ESMTP" 3671*7c478bd9Sstevel@tonic-gate will be inserted between the first and 3672*7c478bd9Sstevel@tonic-gate second words to convince other 3673*7c478bd9Sstevel@tonic-gate sendmails to try to speak ESMTP. 3674*7c478bd9Sstevel@tonic-gateconfDONT_INIT_GROUPS DontInitGroups [False] If set, the initgroups(3) 3675*7c478bd9Sstevel@tonic-gate routine will never be invoked. You 3676*7c478bd9Sstevel@tonic-gate might want to do this if you are 3677*7c478bd9Sstevel@tonic-gate running NIS and you have a large group 3678*7c478bd9Sstevel@tonic-gate map, since this call does a sequential 3679*7c478bd9Sstevel@tonic-gate scan of the map; in a large site this 3680*7c478bd9Sstevel@tonic-gate can cause your ypserv to run 3681*7c478bd9Sstevel@tonic-gate essentially full time. If you set 3682*7c478bd9Sstevel@tonic-gate this, agents run on behalf of users 3683*7c478bd9Sstevel@tonic-gate will only have their primary 3684*7c478bd9Sstevel@tonic-gate (/etc/passwd) group permissions. 3685*7c478bd9Sstevel@tonic-gateconfUNSAFE_GROUP_WRITES UnsafeGroupWrites 3686*7c478bd9Sstevel@tonic-gate [False] If set, group-writable 3687*7c478bd9Sstevel@tonic-gate :include: and .forward files are 3688*7c478bd9Sstevel@tonic-gate considered "unsafe", that is, programs 3689*7c478bd9Sstevel@tonic-gate and files cannot be directly referenced 3690*7c478bd9Sstevel@tonic-gate from such files. World-writable files 3691*7c478bd9Sstevel@tonic-gate are always considered unsafe. 3692*7c478bd9Sstevel@tonic-gateconfCONNECT_ONLY_TO ConnectOnlyTo [undefined] override connection 3693*7c478bd9Sstevel@tonic-gate address (for testing). 3694*7c478bd9Sstevel@tonic-gateconfCONTROL_SOCKET_NAME ControlSocketName 3695*7c478bd9Sstevel@tonic-gate [undefined] Control socket for daemon 3696*7c478bd9Sstevel@tonic-gate management. 3697*7c478bd9Sstevel@tonic-gateconfDOUBLE_BOUNCE_ADDRESS DoubleBounceAddress 3698*7c478bd9Sstevel@tonic-gate [postmaster] If an error occurs when 3699*7c478bd9Sstevel@tonic-gate sending an error message, send that 3700*7c478bd9Sstevel@tonic-gate "double bounce" error message to this 3701*7c478bd9Sstevel@tonic-gate address. If it expands to an empty 3702*7c478bd9Sstevel@tonic-gate string, double bounces are dropped. 3703*7c478bd9Sstevel@tonic-gateconfDEAD_LETTER_DROP DeadLetterDrop [undefined] Filename to save bounce 3704*7c478bd9Sstevel@tonic-gate messages which could not be returned 3705*7c478bd9Sstevel@tonic-gate to the user or sent to postmaster. 3706*7c478bd9Sstevel@tonic-gate If not set, the queue file will 3707*7c478bd9Sstevel@tonic-gate be renamed. 3708*7c478bd9Sstevel@tonic-gateconfRRT_IMPLIES_DSN RrtImpliesDsn [False] Return-Receipt-To: header 3709*7c478bd9Sstevel@tonic-gate implies DSN request. 3710*7c478bd9Sstevel@tonic-gateconfRUN_AS_USER RunAsUser [undefined] If set, become this user 3711*7c478bd9Sstevel@tonic-gate when reading and delivering mail. 3712*7c478bd9Sstevel@tonic-gate Causes all file reads (e.g., .forward 3713*7c478bd9Sstevel@tonic-gate and :include: files) to be done as 3714*7c478bd9Sstevel@tonic-gate this user. Also, all programs will 3715*7c478bd9Sstevel@tonic-gate be run as this user, and all output 3716*7c478bd9Sstevel@tonic-gate files will be written as this user. 3717*7c478bd9Sstevel@tonic-gateconfMAX_RCPTS_PER_MESSAGE MaxRecipientsPerMessage 3718*7c478bd9Sstevel@tonic-gate [infinite] If set, allow no more than 3719*7c478bd9Sstevel@tonic-gate the specified number of recipients in 3720*7c478bd9Sstevel@tonic-gate an SMTP envelope. Further recipients 3721*7c478bd9Sstevel@tonic-gate receive a 452 error code (i.e., they 3722*7c478bd9Sstevel@tonic-gate are deferred for the next delivery 3723*7c478bd9Sstevel@tonic-gate attempt). 3724*7c478bd9Sstevel@tonic-gateconfBAD_RCPT_THROTTLE BadRcptThrottle [infinite] If set and the specified 3725*7c478bd9Sstevel@tonic-gate number of recipients in a single SMTP 3726*7c478bd9Sstevel@tonic-gate transaction have been rejected, sleep 3727*7c478bd9Sstevel@tonic-gate for one second after each subsequent 3728*7c478bd9Sstevel@tonic-gate RCPT command in that transaction. 3729*7c478bd9Sstevel@tonic-gateconfDONT_PROBE_INTERFACES DontProbeInterfaces 3730*7c478bd9Sstevel@tonic-gate [False] If set, sendmail will _not_ 3731*7c478bd9Sstevel@tonic-gate insert the names and addresses of any 3732*7c478bd9Sstevel@tonic-gate local interfaces into class {w} 3733*7c478bd9Sstevel@tonic-gate (list of known "equivalent" addresses). 3734*7c478bd9Sstevel@tonic-gate If you set this, you must also include 3735*7c478bd9Sstevel@tonic-gate some support for these addresses (e.g., 3736*7c478bd9Sstevel@tonic-gate in a mailertable entry) -- otherwise, 3737*7c478bd9Sstevel@tonic-gate mail to addresses in this list will 3738*7c478bd9Sstevel@tonic-gate bounce with a configuration error. 3739*7c478bd9Sstevel@tonic-gate If set to "loopback" (without 3740*7c478bd9Sstevel@tonic-gate quotes), sendmail will skip 3741*7c478bd9Sstevel@tonic-gate loopback interfaces (e.g., "lo0"). 3742*7c478bd9Sstevel@tonic-gateconfPID_FILE PidFile [system dependent] Location of pid 3743*7c478bd9Sstevel@tonic-gate file. 3744*7c478bd9Sstevel@tonic-gateconfPROCESS_TITLE_PREFIX ProcessTitlePrefix 3745*7c478bd9Sstevel@tonic-gate [undefined] Prefix string for the 3746*7c478bd9Sstevel@tonic-gate process title shown on 'ps' listings. 3747*7c478bd9Sstevel@tonic-gateconfDONT_BLAME_SENDMAIL DontBlameSendmail 3748*7c478bd9Sstevel@tonic-gate [safe] Override sendmail's file 3749*7c478bd9Sstevel@tonic-gate safety checks. This will definitely 3750*7c478bd9Sstevel@tonic-gate compromise system security and should 3751*7c478bd9Sstevel@tonic-gate not be used unless absolutely 3752*7c478bd9Sstevel@tonic-gate necessary. 3753*7c478bd9Sstevel@tonic-gateconfREJECT_MSG - [550 Access denied] The message 3754*7c478bd9Sstevel@tonic-gate given if the access database contains 3755*7c478bd9Sstevel@tonic-gate REJECT in the value portion. 3756*7c478bd9Sstevel@tonic-gateconfRELAY_MSG - [550 Relaying denied] The message 3757*7c478bd9Sstevel@tonic-gate given if an unauthorized relaying 3758*7c478bd9Sstevel@tonic-gate attempt is rejected. 3759*7c478bd9Sstevel@tonic-gateconfDF_BUFFER_SIZE DataFileBufferSize 3760*7c478bd9Sstevel@tonic-gate [4096] The maximum size of a 3761*7c478bd9Sstevel@tonic-gate memory-buffered data (df) file 3762*7c478bd9Sstevel@tonic-gate before a disk-based file is used. 3763*7c478bd9Sstevel@tonic-gateconfXF_BUFFER_SIZE XScriptFileBufferSize 3764*7c478bd9Sstevel@tonic-gate [4096] The maximum size of a 3765*7c478bd9Sstevel@tonic-gate memory-buffered transcript (xf) 3766*7c478bd9Sstevel@tonic-gate file before a disk-based file is 3767*7c478bd9Sstevel@tonic-gate used. 3768*7c478bd9Sstevel@tonic-gateconfTLS_SRV_OPTIONS TLSSrvOptions If this option is 'V' no client 3769*7c478bd9Sstevel@tonic-gate verification is performed, i.e., 3770*7c478bd9Sstevel@tonic-gate the server doesn't ask for a 3771*7c478bd9Sstevel@tonic-gate certificate. 3772*7c478bd9Sstevel@tonic-gateconfLDAP_DEFAULT_SPEC LDAPDefaultSpec [undefined] Default map 3773*7c478bd9Sstevel@tonic-gate specification for LDAP maps. The 3774*7c478bd9Sstevel@tonic-gate value should only contain LDAP 3775*7c478bd9Sstevel@tonic-gate specific settings such as "-h host 3776*7c478bd9Sstevel@tonic-gate -p port -d bindDN", etc. The 3777*7c478bd9Sstevel@tonic-gate settings will be used for all LDAP 3778*7c478bd9Sstevel@tonic-gate maps unless they are specified in 3779*7c478bd9Sstevel@tonic-gate the individual map specification 3780*7c478bd9Sstevel@tonic-gate ('K' command). 3781*7c478bd9Sstevel@tonic-gateconfCACERT_PATH CACertPath [undefined] Path to directory 3782*7c478bd9Sstevel@tonic-gate with certs of CAs. 3783*7c478bd9Sstevel@tonic-gateconfCACERT CACertFile [undefined] File containing one CA 3784*7c478bd9Sstevel@tonic-gate cert. 3785*7c478bd9Sstevel@tonic-gateconfSERVER_CERT ServerCertFile [undefined] File containing the 3786*7c478bd9Sstevel@tonic-gate cert of the server, i.e., this cert 3787*7c478bd9Sstevel@tonic-gate is used when sendmail acts as 3788*7c478bd9Sstevel@tonic-gate server. 3789*7c478bd9Sstevel@tonic-gateconfSERVER_KEY ServerKeyFile [undefined] File containing the 3790*7c478bd9Sstevel@tonic-gate private key belonging to the server 3791*7c478bd9Sstevel@tonic-gate cert. 3792*7c478bd9Sstevel@tonic-gateconfCLIENT_CERT ClientCertFile [undefined] File containing the 3793*7c478bd9Sstevel@tonic-gate cert of the client, i.e., this cert 3794*7c478bd9Sstevel@tonic-gate is used when sendmail acts as 3795*7c478bd9Sstevel@tonic-gate client. 3796*7c478bd9Sstevel@tonic-gateconfCLIENT_KEY ClientKeyFile [undefined] File containing the 3797*7c478bd9Sstevel@tonic-gate private key belonging to the client 3798*7c478bd9Sstevel@tonic-gate cert. 3799*7c478bd9Sstevel@tonic-gateconfCRL CRLFile [undefined] File containing certificate 3800*7c478bd9Sstevel@tonic-gate revocation status, useful for X.509v3 3801*7c478bd9Sstevel@tonic-gate authentication. Note that CRL requires 3802*7c478bd9Sstevel@tonic-gate at least OpenSSL version 0.9.7. 3803*7c478bd9Sstevel@tonic-gateconfDH_PARAMETERS DHParameters [undefined] File containing the 3804*7c478bd9Sstevel@tonic-gate DH parameters. 3805*7c478bd9Sstevel@tonic-gateconfRAND_FILE RandFile [undefined] File containing random 3806*7c478bd9Sstevel@tonic-gate data (use prefix file:) or the 3807*7c478bd9Sstevel@tonic-gate name of the UNIX socket if EGD is 3808*7c478bd9Sstevel@tonic-gate used (use prefix egd:). STARTTLS 3809*7c478bd9Sstevel@tonic-gate requires this option if the compile 3810*7c478bd9Sstevel@tonic-gate flag HASURANDOM is not set (see 3811*7c478bd9Sstevel@tonic-gate sendmail/README). 3812*7c478bd9Sstevel@tonic-gateconfNICE_QUEUE_RUN NiceQueueRun [undefined] If set, the priority of 3813*7c478bd9Sstevel@tonic-gate queue runners is set the given value 3814*7c478bd9Sstevel@tonic-gate (nice(3)). 3815*7c478bd9Sstevel@tonic-gateconfDIRECT_SUBMISSION_MODIFIERS DirectSubmissionModifiers 3816*7c478bd9Sstevel@tonic-gate [undefined] Defines {daemon_flags} 3817*7c478bd9Sstevel@tonic-gate for direct submissions. 3818*7c478bd9Sstevel@tonic-gateconfUSE_MSP UseMSP [false] Use as mail submission 3819*7c478bd9Sstevel@tonic-gate program. 3820*7c478bd9Sstevel@tonic-gateconfDELIVER_BY_MIN DeliverByMin [0] Minimum time for Deliver By 3821*7c478bd9Sstevel@tonic-gate SMTP Service Extension (RFC 2852). 3822*7c478bd9Sstevel@tonic-gateconfREQUIRES_DIR_FSYNC RequiresDirfsync [true] RequiresDirfsync can 3823*7c478bd9Sstevel@tonic-gate be used to turn off the compile time 3824*7c478bd9Sstevel@tonic-gate flag REQUIRES_DIR_FSYNC at runtime. 3825*7c478bd9Sstevel@tonic-gate See sendmail/README for details. 3826*7c478bd9Sstevel@tonic-gateconfSHARED_MEMORY_KEY SharedMemoryKey [0] Key for shared memory. 3827*7c478bd9Sstevel@tonic-gateconfFAST_SPLIT FastSplit [1] If set to a value greater than 3828*7c478bd9Sstevel@tonic-gate zero, the initial MX lookups on 3829*7c478bd9Sstevel@tonic-gate addresses is suppressed when they 3830*7c478bd9Sstevel@tonic-gate are sorted which may result in 3831*7c478bd9Sstevel@tonic-gate faster envelope splitting. If the 3832*7c478bd9Sstevel@tonic-gate mail is submitted directly from the 3833*7c478bd9Sstevel@tonic-gate command line, then the value also 3834*7c478bd9Sstevel@tonic-gate limits the number of processes to 3835*7c478bd9Sstevel@tonic-gate deliver the envelopes. 3836*7c478bd9Sstevel@tonic-gateconfMAILBOX_DATABASE MailboxDatabase [pw] Type of lookup to find 3837*7c478bd9Sstevel@tonic-gate information about local mailboxes. 3838*7c478bd9Sstevel@tonic-gateconfDEQUOTE_OPTS - [empty] Additional options for the 3839*7c478bd9Sstevel@tonic-gate dequote map. 3840*7c478bd9Sstevel@tonic-gateconfINPUT_MAIL_FILTERS InputMailFilters 3841*7c478bd9Sstevel@tonic-gate A comma separated list of filters 3842*7c478bd9Sstevel@tonic-gate which determines which filters and 3843*7c478bd9Sstevel@tonic-gate the invocation sequence are 3844*7c478bd9Sstevel@tonic-gate contacted for incoming SMTP 3845*7c478bd9Sstevel@tonic-gate messages. If none are set, no 3846*7c478bd9Sstevel@tonic-gate filters will be contacted. 3847*7c478bd9Sstevel@tonic-gateconfMILTER_LOG_LEVEL Milter.LogLevel [9] Log level for input mail filter 3848*7c478bd9Sstevel@tonic-gate actions, defaults to LogLevel. 3849*7c478bd9Sstevel@tonic-gateconfMILTER_MACROS_CONNECT Milter.macros.connect 3850*7c478bd9Sstevel@tonic-gate [j, _, {daemon_name}, {if_name}, 3851*7c478bd9Sstevel@tonic-gate {if_addr}] Macros to transmit to 3852*7c478bd9Sstevel@tonic-gate milters when a session connection 3853*7c478bd9Sstevel@tonic-gate starts. 3854*7c478bd9Sstevel@tonic-gateconfMILTER_MACROS_HELO Milter.macros.helo 3855*7c478bd9Sstevel@tonic-gate [{tls_version}, {cipher}, 3856*7c478bd9Sstevel@tonic-gate {cipher_bits}, {cert_subject}, 3857*7c478bd9Sstevel@tonic-gate {cert_issuer}] Macros to transmit to 3858*7c478bd9Sstevel@tonic-gate milters after HELO/EHLO command. 3859*7c478bd9Sstevel@tonic-gateconfMILTER_MACROS_ENVFROM Milter.macros.envfrom 3860*7c478bd9Sstevel@tonic-gate [i, {auth_type}, {auth_authen}, 3861*7c478bd9Sstevel@tonic-gate {auth_ssf}, {auth_author}, 3862*7c478bd9Sstevel@tonic-gate {mail_mailer}, {mail_host}, 3863*7c478bd9Sstevel@tonic-gate {mail_addr}] Macros to transmit to 3864*7c478bd9Sstevel@tonic-gate milters after MAIL FROM command. 3865*7c478bd9Sstevel@tonic-gateconfMILTER_MACROS_ENVRCPT Milter.macros.envrcpt 3866*7c478bd9Sstevel@tonic-gate [{rcpt_mailer}, {rcpt_host}, 3867*7c478bd9Sstevel@tonic-gate {rcpt_addr}] Macros to transmit to 3868*7c478bd9Sstevel@tonic-gate milters after RCPT TO command. 3869*7c478bd9Sstevel@tonic-gateconfMILTER_MACROS_EOM Milter.macros.eom 3870*7c478bd9Sstevel@tonic-gate [{msg_id}] Macros to transmit to 3871*7c478bd9Sstevel@tonic-gate milters after DATA command. 3872*7c478bd9Sstevel@tonic-gate 3873*7c478bd9Sstevel@tonic-gate 3874*7c478bd9Sstevel@tonic-gateSee also the description of OSTYPE for some parameters that can be 3875*7c478bd9Sstevel@tonic-gatetweaked (generally pathnames to mailers). 3876*7c478bd9Sstevel@tonic-gate 3877*7c478bd9Sstevel@tonic-gateClientPortOptions and DaemonPortOptions are special cases since multiple 3878*7c478bd9Sstevel@tonic-gateclients/daemons can be defined. This can be done via 3879*7c478bd9Sstevel@tonic-gate 3880*7c478bd9Sstevel@tonic-gate CLIENT_OPTIONS(`field1=value1,field2=value2,...') 3881*7c478bd9Sstevel@tonic-gate DAEMON_OPTIONS(`field1=value1,field2=value2,...') 3882*7c478bd9Sstevel@tonic-gate 3883*7c478bd9Sstevel@tonic-gateNote that multiple CLIENT_OPTIONS() commands (and therefore multiple 3884*7c478bd9Sstevel@tonic-gateClientPortOptions settings) are allowed in order to give settings for each 3885*7c478bd9Sstevel@tonic-gateprotocol family (e.g., one for Family=inet and one for Family=inet6). A 3886*7c478bd9Sstevel@tonic-gaterestriction placed on one family only affects outgoing connections on that 3887*7c478bd9Sstevel@tonic-gateparticular family. 3888*7c478bd9Sstevel@tonic-gate 3889*7c478bd9Sstevel@tonic-gateIf DAEMON_OPTIONS is not used, then the default is 3890*7c478bd9Sstevel@tonic-gate 3891*7c478bd9Sstevel@tonic-gate DAEMON_OPTIONS(`Port=smtp, Name=MTA') 3892*7c478bd9Sstevel@tonic-gate DAEMON_OPTIONS(`Port=587, Name=MSA, M=E') 3893*7c478bd9Sstevel@tonic-gate 3894*7c478bd9Sstevel@tonic-gateIf you use one DAEMON_OPTIONS macro, it will alter the parameters 3895*7c478bd9Sstevel@tonic-gateof the first of these. The second will still be defaulted; it 3896*7c478bd9Sstevel@tonic-gaterepresents a "Message Submission Agent" (MSA) as defined by RFC 3897*7c478bd9Sstevel@tonic-gate2476 (see below). To turn off the default definition for the MSA, 3898*7c478bd9Sstevel@tonic-gateuse FEATURE(`no_default_msa') (see also FEATURES). If you use 3899*7c478bd9Sstevel@tonic-gateadditional DAEMON_OPTIONS macros, they will add additional daemons. 3900*7c478bd9Sstevel@tonic-gate 3901*7c478bd9Sstevel@tonic-gateExample 1: To change the port for the SMTP listener, while 3902*7c478bd9Sstevel@tonic-gatestill using the MSA default, use 3903*7c478bd9Sstevel@tonic-gate DAEMON_OPTIONS(`Port=925, Name=MTA') 3904*7c478bd9Sstevel@tonic-gate 3905*7c478bd9Sstevel@tonic-gateExample 2: To change the port for the MSA daemon, while still 3906*7c478bd9Sstevel@tonic-gateusing the default SMTP port, use 3907*7c478bd9Sstevel@tonic-gate FEATURE(`no_default_msa') 3908*7c478bd9Sstevel@tonic-gate DAEMON_OPTIONS(`Name=MTA') 3909*7c478bd9Sstevel@tonic-gate DAEMON_OPTIONS(`Port=987, Name=MSA, M=E') 3910*7c478bd9Sstevel@tonic-gate 3911*7c478bd9Sstevel@tonic-gateNote that if the first of those DAEMON_OPTIONS lines were omitted, then 3912*7c478bd9Sstevel@tonic-gatethere would be no listener on the standard SMTP port. 3913*7c478bd9Sstevel@tonic-gate 3914*7c478bd9Sstevel@tonic-gateExample 3: To listen on both IPv4 and IPv6 interfaces, use 3915*7c478bd9Sstevel@tonic-gate 3916*7c478bd9Sstevel@tonic-gate DAEMON_OPTIONS(`Name=MTA-v4, Family=inet') 3917*7c478bd9Sstevel@tonic-gate DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6') 3918*7c478bd9Sstevel@tonic-gate 3919*7c478bd9Sstevel@tonic-gateA "Message Submission Agent" still uses all of the same rulesets for 3920*7c478bd9Sstevel@tonic-gateprocessing the message (and therefore still allows message rejection via 3921*7c478bd9Sstevel@tonic-gatethe check_* rulesets). In accordance with the RFC, the MSA will ensure 3922*7c478bd9Sstevel@tonic-gatethat all domains in envelope addresses are fully qualified if the message 3923*7c478bd9Sstevel@tonic-gateis relayed to another MTA. It will also enforce the normal address syntax 3924*7c478bd9Sstevel@tonic-gaterules and log error messages. Additionally, by using the M=a modifier you 3925*7c478bd9Sstevel@tonic-gatecan require authentication before messages are accepted by the MSA. 3926*7c478bd9Sstevel@tonic-gateNotice: Do NOT use the 'a' modifier on a public accessible MTA! Finally, 3927*7c478bd9Sstevel@tonic-gatethe M=E modifier shown above disables ETRN as required by RFC 2476. 3928*7c478bd9Sstevel@tonic-gate 3929*7c478bd9Sstevel@tonic-gateMail filters can be defined using the INPUT_MAIL_FILTER() and MAIL_FILTER() 3930*7c478bd9Sstevel@tonic-gatecommands: 3931*7c478bd9Sstevel@tonic-gate 3932*7c478bd9Sstevel@tonic-gate INPUT_MAIL_FILTER(`sample', `S=local:/var/run/f1.sock') 3933*7c478bd9Sstevel@tonic-gate MAIL_FILTER(`myfilter', `S=inet:3333@localhost') 3934*7c478bd9Sstevel@tonic-gate 3935*7c478bd9Sstevel@tonic-gateThe INPUT_MAIL_FILTER() command causes the filter(s) to be called in the 3936*7c478bd9Sstevel@tonic-gatesame order they were specified by also setting confINPUT_MAIL_FILTERS. A 3937*7c478bd9Sstevel@tonic-gatefilter can be defined without adding it to the input filter list by using 3938*7c478bd9Sstevel@tonic-gateMAIL_FILTER() instead of INPUT_MAIL_FILTER() in your .mc file. 3939*7c478bd9Sstevel@tonic-gateAlternatively, you can reset the list of filters and their order by setting 3940*7c478bd9Sstevel@tonic-gateconfINPUT_MAIL_FILTERS option after all INPUT_MAIL_FILTER() commands in 3941*7c478bd9Sstevel@tonic-gateyour .mc file. 3942*7c478bd9Sstevel@tonic-gate 3943*7c478bd9Sstevel@tonic-gate 3944*7c478bd9Sstevel@tonic-gate+----------------------------+ 3945*7c478bd9Sstevel@tonic-gate| MESSAGE SUBMISSION PROGRAM | 3946*7c478bd9Sstevel@tonic-gate+----------------------------+ 3947*7c478bd9Sstevel@tonic-gate 3948*7c478bd9Sstevel@tonic-gateThis section contains a list of caveats and 3949*7c478bd9Sstevel@tonic-gatea few hints how for those who want to tweak the default configuration 3950*7c478bd9Sstevel@tonic-gatefor it (which is installed as submit.cf). 3951*7c478bd9Sstevel@tonic-gate 3952*7c478bd9Sstevel@tonic-gateNotice: do not add options/features to submit.mc unless you are 3953*7c478bd9Sstevel@tonic-gateabsolutely sure you need them. Options you may want to change 3954*7c478bd9Sstevel@tonic-gateinclude: 3955*7c478bd9Sstevel@tonic-gate 3956*7c478bd9Sstevel@tonic-gate- confTRUSTED_USERS, FEATURE(`use_ct_file'), and confCT_FILE for 3957*7c478bd9Sstevel@tonic-gate avoiding X-Authentication warnings. 3958*7c478bd9Sstevel@tonic-gate- confTIME_ZONE to change it from the default `USE_TZ'. 3959*7c478bd9Sstevel@tonic-gate- confDELIVERY_MODE is set to interactive in msp.m4 instead 3960*7c478bd9Sstevel@tonic-gate of the default background mode. 3961*7c478bd9Sstevel@tonic-gate- FEATURE(stickyhost) and LOCAL_RELAY to send unqualified addresses 3962*7c478bd9Sstevel@tonic-gate to the LOCAL_RELAY instead of the default relay. 3963*7c478bd9Sstevel@tonic-gate 3964*7c478bd9Sstevel@tonic-gateThe MSP performs hostname canonicalization by default. Mail may end 3965*7c478bd9Sstevel@tonic-gateup for various DNS related reasons in the MSP queue. This problem 3966*7c478bd9Sstevel@tonic-gatecan be minimized by using 3967*7c478bd9Sstevel@tonic-gate 3968*7c478bd9Sstevel@tonic-gate FEATURE(`nocanonify', `canonify_hosts') 3969*7c478bd9Sstevel@tonic-gate define(`confDIRECT_SUBMISSION_MODIFIERS', `C') 3970*7c478bd9Sstevel@tonic-gate 3971*7c478bd9Sstevel@tonic-gateSee the discussion about nocanonify for possible side effects. 3972*7c478bd9Sstevel@tonic-gate 3973*7c478bd9Sstevel@tonic-gateSome things are not intended to work with the MSP. These include 3974*7c478bd9Sstevel@tonic-gatefeatures that influence the delivery process (e.g., mailertable, 3975*7c478bd9Sstevel@tonic-gatealiases), or those that are only important for a SMTP server (e.g., 3976*7c478bd9Sstevel@tonic-gatevirtusertable, DaemonPortOptions, multiple queues). Moreover, 3977*7c478bd9Sstevel@tonic-gaterelaxing certain restrictions (RestrictQueueRun, permissions on 3978*7c478bd9Sstevel@tonic-gatequeue directory) or adding features (e.g., enabling prog/file mailer) 3979*7c478bd9Sstevel@tonic-gatecan cause security problems. 3980*7c478bd9Sstevel@tonic-gate 3981*7c478bd9Sstevel@tonic-gateOther things don't work well with the MSP and require tweaking or 3982*7c478bd9Sstevel@tonic-gateworkarounds. 3983*7c478bd9Sstevel@tonic-gate 3984*7c478bd9Sstevel@tonic-gateThe file and the map created by makemap should be owned by smmsp, 3985*7c478bd9Sstevel@tonic-gateits group should be smmsp, and it should have mode 640. 3986*7c478bd9Sstevel@tonic-gate 3987*7c478bd9Sstevel@tonic-gatefeature/msp.m4 defines almost all settings for the MSP. Most of 3988*7c478bd9Sstevel@tonic-gatethose should not be changed at all. Some of the features and options 3989*7c478bd9Sstevel@tonic-gatecan be overridden if really necessary. It is a bit tricky to do 3990*7c478bd9Sstevel@tonic-gatethis, because it depends on the actual way the option is defined 3991*7c478bd9Sstevel@tonic-gatein feature/msp.m4. If it is directly defined (i.e., define()) then 3992*7c478bd9Sstevel@tonic-gatethe modified value must be defined after 3993*7c478bd9Sstevel@tonic-gate 3994*7c478bd9Sstevel@tonic-gate FEATURE(`msp') 3995*7c478bd9Sstevel@tonic-gate 3996*7c478bd9Sstevel@tonic-gateIf it is conditionally defined (i.e., ifdef()) then the desired 3997*7c478bd9Sstevel@tonic-gatevalue must be defined before the FEATURE line in the .mc file. 3998*7c478bd9Sstevel@tonic-gateTo see how the options are defined read feature/msp.m4. 3999*7c478bd9Sstevel@tonic-gate 4000*7c478bd9Sstevel@tonic-gate 4001*7c478bd9Sstevel@tonic-gate+--------------------------+ 4002*7c478bd9Sstevel@tonic-gate| FORMAT OF FILES AND MAPS | 4003*7c478bd9Sstevel@tonic-gate+--------------------------+ 4004*7c478bd9Sstevel@tonic-gate 4005*7c478bd9Sstevel@tonic-gateFiles that define classes, i.e., F{classname}, consist of lines 4006*7c478bd9Sstevel@tonic-gateeach of which contains a single element of the class. For example, 4007*7c478bd9Sstevel@tonic-gate/etc/mail/local-host-names may have the following content: 4008*7c478bd9Sstevel@tonic-gate 4009*7c478bd9Sstevel@tonic-gatemy.domain 4010*7c478bd9Sstevel@tonic-gateanother.domain 4011*7c478bd9Sstevel@tonic-gate 4012*7c478bd9Sstevel@tonic-gateMaps must be created using makemap(8) , e.g., 4013*7c478bd9Sstevel@tonic-gate 4014*7c478bd9Sstevel@tonic-gate makemap hash MAP < MAP 4015*7c478bd9Sstevel@tonic-gate 4016*7c478bd9Sstevel@tonic-gateIn general, a text file from which a map is created contains lines 4017*7c478bd9Sstevel@tonic-gateof the form 4018*7c478bd9Sstevel@tonic-gate 4019*7c478bd9Sstevel@tonic-gatekey value 4020*7c478bd9Sstevel@tonic-gate 4021*7c478bd9Sstevel@tonic-gatewhere 'key' and 'value' are also called LHS and RHS, respectively. 4022*7c478bd9Sstevel@tonic-gateBy default, the delimiter between LHS and RHS is a non-empty sequence 4023*7c478bd9Sstevel@tonic-gateof white space characters. 4024*7c478bd9Sstevel@tonic-gate 4025*7c478bd9Sstevel@tonic-gate 4026*7c478bd9Sstevel@tonic-gate+------------------+ 4027*7c478bd9Sstevel@tonic-gate| DIRECTORY LAYOUT | 4028*7c478bd9Sstevel@tonic-gate+------------------+ 4029*7c478bd9Sstevel@tonic-gate 4030*7c478bd9Sstevel@tonic-gateWithin this directory are several subdirectories, to wit: 4031*7c478bd9Sstevel@tonic-gate 4032*7c478bd9Sstevel@tonic-gatem4 General support routines. These are typically 4033*7c478bd9Sstevel@tonic-gate very important and should not be changed without 4034*7c478bd9Sstevel@tonic-gate very careful consideration. 4035*7c478bd9Sstevel@tonic-gate 4036*7c478bd9Sstevel@tonic-gatecf The configuration files themselves. They have 4037*7c478bd9Sstevel@tonic-gate ".mc" suffixes, and must be run through m4 to 4038*7c478bd9Sstevel@tonic-gate become complete. The resulting output should 4039*7c478bd9Sstevel@tonic-gate have a ".cf" suffix. 4040*7c478bd9Sstevel@tonic-gate 4041*7c478bd9Sstevel@tonic-gateostype Definitions describing a particular operating 4042*7c478bd9Sstevel@tonic-gate system type. These should always be referenced 4043*7c478bd9Sstevel@tonic-gate using the OSTYPE macro in the .mc file. Examples 4044*7c478bd9Sstevel@tonic-gate include "bsd4.3", "bsd4.4", "sunos3.5", and 4045*7c478bd9Sstevel@tonic-gate "sunos4.1". 4046*7c478bd9Sstevel@tonic-gate 4047*7c478bd9Sstevel@tonic-gatedomain Definitions describing a particular domain, referenced 4048*7c478bd9Sstevel@tonic-gate using the DOMAIN macro in the .mc file. These are 4049*7c478bd9Sstevel@tonic-gate site dependent; for example, "CS.Berkeley.EDU.m4" 4050*7c478bd9Sstevel@tonic-gate describes hosts in the CS.Berkeley.EDU subdomain. 4051*7c478bd9Sstevel@tonic-gate 4052*7c478bd9Sstevel@tonic-gatemailer Descriptions of mailers. These are referenced using 4053*7c478bd9Sstevel@tonic-gate the MAILER macro in the .mc file. 4054*7c478bd9Sstevel@tonic-gate 4055*7c478bd9Sstevel@tonic-gatesh Shell files used when building the .cf file from the 4056*7c478bd9Sstevel@tonic-gate .mc file in the cf subdirectory. 4057*7c478bd9Sstevel@tonic-gate 4058*7c478bd9Sstevel@tonic-gatefeature These hold special orthogonal features that you might 4059*7c478bd9Sstevel@tonic-gate want to include. They should be referenced using 4060*7c478bd9Sstevel@tonic-gate the FEATURE macro. 4061*7c478bd9Sstevel@tonic-gate 4062*7c478bd9Sstevel@tonic-gatehack Local hacks. These can be referenced using the HACK 4063*7c478bd9Sstevel@tonic-gate macro. They shouldn't be of more than voyeuristic 4064*7c478bd9Sstevel@tonic-gate interest outside the .Berkeley.EDU domain, but who knows? 4065*7c478bd9Sstevel@tonic-gate 4066*7c478bd9Sstevel@tonic-gatesiteconfig Site configuration -- e.g., tables of locally connected 4067*7c478bd9Sstevel@tonic-gate UUCP sites. 4068*7c478bd9Sstevel@tonic-gate 4069*7c478bd9Sstevel@tonic-gate 4070*7c478bd9Sstevel@tonic-gate+------------------------+ 4071*7c478bd9Sstevel@tonic-gate| ADMINISTRATIVE DETAILS | 4072*7c478bd9Sstevel@tonic-gate+------------------------+ 4073*7c478bd9Sstevel@tonic-gate 4074*7c478bd9Sstevel@tonic-gateThe following sections detail usage of certain internal parts of the 4075*7c478bd9Sstevel@tonic-gatesendmail.cf file. Read them carefully if you are trying to modify 4076*7c478bd9Sstevel@tonic-gatethe current model. If you find the above descriptions adequate, these 4077*7c478bd9Sstevel@tonic-gateshould be {boring, confusing, tedious, ridiculous} (pick one or more). 4078*7c478bd9Sstevel@tonic-gate 4079*7c478bd9Sstevel@tonic-gateRULESETS (* means built in to sendmail) 4080*7c478bd9Sstevel@tonic-gate 4081*7c478bd9Sstevel@tonic-gate 0 * Parsing 4082*7c478bd9Sstevel@tonic-gate 1 * Sender rewriting 4083*7c478bd9Sstevel@tonic-gate 2 * Recipient rewriting 4084*7c478bd9Sstevel@tonic-gate 3 * Canonicalization 4085*7c478bd9Sstevel@tonic-gate 4 * Post cleanup 4086*7c478bd9Sstevel@tonic-gate 5 * Local address rewrite (after aliasing) 4087*7c478bd9Sstevel@tonic-gate 1x mailer rules (sender qualification) 4088*7c478bd9Sstevel@tonic-gate 2x mailer rules (recipient qualification) 4089*7c478bd9Sstevel@tonic-gate 3x mailer rules (sender header qualification) 4090*7c478bd9Sstevel@tonic-gate 4x mailer rules (recipient header qualification) 4091*7c478bd9Sstevel@tonic-gate 5x mailer subroutines (general) 4092*7c478bd9Sstevel@tonic-gate 6x mailer subroutines (general) 4093*7c478bd9Sstevel@tonic-gate 7x mailer subroutines (general) 4094*7c478bd9Sstevel@tonic-gate 8x reserved 4095*7c478bd9Sstevel@tonic-gate 90 Mailertable host stripping 4096*7c478bd9Sstevel@tonic-gate 96 Bottom half of Ruleset 3 (ruleset 6 in old sendmail) 4097*7c478bd9Sstevel@tonic-gate 97 Hook for recursive ruleset 0 call (ruleset 7 in old sendmail) 4098*7c478bd9Sstevel@tonic-gate 98 Local part of ruleset 0 (ruleset 8 in old sendmail) 4099*7c478bd9Sstevel@tonic-gate 4100*7c478bd9Sstevel@tonic-gate 4101*7c478bd9Sstevel@tonic-gateMAILERS 4102*7c478bd9Sstevel@tonic-gate 4103*7c478bd9Sstevel@tonic-gate 0 local, prog local and program mailers 4104*7c478bd9Sstevel@tonic-gate 1 [e]smtp, relay SMTP channel 4105*7c478bd9Sstevel@tonic-gate 2 uucp-* UNIX-to-UNIX Copy Program 4106*7c478bd9Sstevel@tonic-gate 3 netnews Network News delivery 4107*7c478bd9Sstevel@tonic-gate 4 fax Sam Leffler's HylaFAX software 4108*7c478bd9Sstevel@tonic-gate 5 mail11 DECnet mailer 4109*7c478bd9Sstevel@tonic-gate 4110*7c478bd9Sstevel@tonic-gate 4111*7c478bd9Sstevel@tonic-gateMACROS 4112*7c478bd9Sstevel@tonic-gate 4113*7c478bd9Sstevel@tonic-gate A 4114*7c478bd9Sstevel@tonic-gate B Bitnet Relay 4115*7c478bd9Sstevel@tonic-gate C DECnet Relay 4116*7c478bd9Sstevel@tonic-gate D The local domain -- usually not needed 4117*7c478bd9Sstevel@tonic-gate E reserved for X.400 Relay 4118*7c478bd9Sstevel@tonic-gate F FAX Relay 4119*7c478bd9Sstevel@tonic-gate G 4120*7c478bd9Sstevel@tonic-gate H mail Hub (for mail clusters) 4121*7c478bd9Sstevel@tonic-gate I 4122*7c478bd9Sstevel@tonic-gate J 4123*7c478bd9Sstevel@tonic-gate K 4124*7c478bd9Sstevel@tonic-gate L Luser Relay 4125*7c478bd9Sstevel@tonic-gate M Masquerade (who you claim to be) 4126*7c478bd9Sstevel@tonic-gate N 4127*7c478bd9Sstevel@tonic-gate O 4128*7c478bd9Sstevel@tonic-gate P 4129*7c478bd9Sstevel@tonic-gate Q 4130*7c478bd9Sstevel@tonic-gate R Relay (for unqualified names) 4131*7c478bd9Sstevel@tonic-gate S Smart Host 4132*7c478bd9Sstevel@tonic-gate T 4133*7c478bd9Sstevel@tonic-gate U my UUCP name (if you have a UUCP connection) 4134*7c478bd9Sstevel@tonic-gate V UUCP Relay (class {V} hosts) 4135*7c478bd9Sstevel@tonic-gate W UUCP Relay (class {W} hosts) 4136*7c478bd9Sstevel@tonic-gate X UUCP Relay (class {X} hosts) 4137*7c478bd9Sstevel@tonic-gate Y UUCP Relay (all other hosts) 4138*7c478bd9Sstevel@tonic-gate Z Version number 4139*7c478bd9Sstevel@tonic-gate 4140*7c478bd9Sstevel@tonic-gate 4141*7c478bd9Sstevel@tonic-gateCLASSES 4142*7c478bd9Sstevel@tonic-gate 4143*7c478bd9Sstevel@tonic-gate A 4144*7c478bd9Sstevel@tonic-gate B domains that are candidates for bestmx lookup 4145*7c478bd9Sstevel@tonic-gate C 4146*7c478bd9Sstevel@tonic-gate D 4147*7c478bd9Sstevel@tonic-gate E addresses that should not seem to come from $M 4148*7c478bd9Sstevel@tonic-gate F hosts this system forward for 4149*7c478bd9Sstevel@tonic-gate G domains that should be looked up in genericstable 4150*7c478bd9Sstevel@tonic-gate H 4151*7c478bd9Sstevel@tonic-gate I 4152*7c478bd9Sstevel@tonic-gate J 4153*7c478bd9Sstevel@tonic-gate K 4154*7c478bd9Sstevel@tonic-gate L addresses that should not be forwarded to $R 4155*7c478bd9Sstevel@tonic-gate M domains that should be mapped to $M 4156*7c478bd9Sstevel@tonic-gate N host/domains that should not be mapped to $M 4157*7c478bd9Sstevel@tonic-gate O operators that indicate network operations (cannot be in local names) 4158*7c478bd9Sstevel@tonic-gate P top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc. 4159*7c478bd9Sstevel@tonic-gate Q 4160*7c478bd9Sstevel@tonic-gate R domains this system is willing to relay (pass anti-spam filters) 4161*7c478bd9Sstevel@tonic-gate S 4162*7c478bd9Sstevel@tonic-gate T 4163*7c478bd9Sstevel@tonic-gate U locally connected UUCP hosts 4164*7c478bd9Sstevel@tonic-gate V UUCP hosts connected to relay $V 4165*7c478bd9Sstevel@tonic-gate W UUCP hosts connected to relay $W 4166*7c478bd9Sstevel@tonic-gate X UUCP hosts connected to relay $X 4167*7c478bd9Sstevel@tonic-gate Y locally connected smart UUCP hosts 4168*7c478bd9Sstevel@tonic-gate Z locally connected domain-ized UUCP hosts 4169*7c478bd9Sstevel@tonic-gate . the class containing only a dot 4170*7c478bd9Sstevel@tonic-gate [ the class containing only a left bracket 4171*7c478bd9Sstevel@tonic-gate 4172*7c478bd9Sstevel@tonic-gate 4173*7c478bd9Sstevel@tonic-gateM4 DIVERSIONS 4174*7c478bd9Sstevel@tonic-gate 4175*7c478bd9Sstevel@tonic-gate 1 Local host detection and resolution 4176*7c478bd9Sstevel@tonic-gate 2 Local Ruleset 3 additions 4177*7c478bd9Sstevel@tonic-gate 3 Local Ruleset 0 additions 4178*7c478bd9Sstevel@tonic-gate 4 UUCP Ruleset 0 additions 4179*7c478bd9Sstevel@tonic-gate 5 locally interpreted names (overrides $R) 4180*7c478bd9Sstevel@tonic-gate 6 local configuration (at top of file) 4181*7c478bd9Sstevel@tonic-gate 7 mailer definitions 4182*7c478bd9Sstevel@tonic-gate 8 DNS based blacklists 4183*7c478bd9Sstevel@tonic-gate 9 special local rulesets (1 and 2) 4184*7c478bd9Sstevel@tonic-gate 4185*7c478bd9Sstevel@tonic-gate$Revision: 8.694 $, Last updated $Date: 2005/03/23 21:41:09 $ 4186*7c478bd9Sstevel@tonic-gateident "%Z%%M% %I% %E% SMI" 4187