1 2 3 NEW SENDMAIL CONFIGURATION FILES 4 5 Eric Allman <eric@Sendmail.ORG> 6 7 @(#)README 8.186 (Berkeley) 2/3/1999 8 9 10This document describes the sendmail configuration files being used 11at Berkeley. These use features in the new (R8) sendmail; they will 12not work on other versions. 13 14These configuration files are probably not as general as previous 15versions, and don't handle as many of the weird cases automagically. 16I was able to simplify them for two reasons. First, the network 17has become more consistent -- for example, at this point, everyone 18on the internet is supposed to be running a name server, so hacks to 19handle NIC-registered hosts can go away. Second, I assumed that a 20subdomain would be running SMTP internally -- UUCP is presumed to be 21a long-haul protocol. I realize that this is not universal, but it 22does describe the vast majority of sites with which I am familiar, 23including those outside the US. 24 25Of course, the downside of this is that if you do live in a weird 26world, things are going to get weirder for you. I'm sorry about that, 27but at the time we at Berkeley had a problem, and it seemed like the 28right thing to do. 29 30This package requires a post-V7 version of m4; if you are running the 314.2bsd, SysV.2, or 7th Edition version, I suggest finding a friend with 32a newer version. You can m4-expand on their system, then run locally. 33SunOS's /usr/5bin/m4 or BSD-Net/2's m4 both work. GNU m4 version 1.1 34or later also works. Unfortunately, I'm told that the M4 on BSDI 1.0 35doesn't work -- you'll have to use a Net/2 or GNU version. GNU m4 is 36available from ftp://ftp.gnu.org/pub/gnu/m4-1.4.tar.gz (check for 37the latest version). EXCEPTIONS: DEC's m4 on Digital UNIX 4.x is broken 38(3.x is fine). Use GNU m4 on this platform. 39 40IF YOU DON'T HAVE A BERKELEY MAKE, don't despair! Just run 41"m4 ../m4/cf.m4 foo.mc > foo.cf" -- that should be all you need. 42There is also a fairly crude (but functional) Makefile.dist that works 43on the old version of make. 44 45To get started, you may want to look at tcpproto.mc (for TCP-only 46sites), uucpproto.mc (for UUCP-only sites), and clientproto.mc (for 47clusters of clients using a single mail host). Others are versions 48that we use at Berkeley, although not all are in current use. For 49example, ucbvax has gone away, but I've left ucbvax.mc in because 50it demonstrates some interesting techniques. 51 52I'm not pretending that this README describes everything that these 53configuration files can do; clever people can probably tweak them 54to great effect. But it should get you started. 55 56******************************************************************* 57*** BE SURE YOU CUSTOMIZE THESE FILES! They have some *** 58*** Berkeley-specific assumptions built in, such as the name *** 59*** of our UUCP-relay. You'll want to create your own domain *** 60*** description, and use that in place of *** 61*** domain/Berkeley.EDU.m4. *** 62******************************************************************* 63 64 65+--------------------------+ 66| INTRODUCTION AND EXAMPLE | 67+--------------------------+ 68 69Configuration files are contained in the subdirectory "cf", with a 70suffix ".mc". They must be run through "m4" to produce a ".cf" file. 71You must pre-load "cf.m4": 72 73 m4 ${CFDIR}/m4/cf.m4 config.mc > config.cf 74 75where ${CFDIR} is the root of the cf directory and config.mc is the 76name of your configuration file. If you are running a version of M4 77that understands the __file__ builtin (versions of GNU m4 >= 0.75 do 78this, but the versions distributed with 4.4BSD and derivatives do not) 79or the -I flag (ditto), then ${CFDIR} can be in an arbitrary directory. 80For "traditional" versions, ${CFDIR} ***MUST*** be "..", or you MUST 81use -D_CF_DIR_=/path/to/cf/dir/ -- note the trailing slash! For example: 82 83 m4 -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 config.mc > config.cf 84 85Let's examine a typical .mc file: 86 87 divert(-1) 88 # 89 # Copyright (c) 1998 Sendmail, Inc. All rights reserved. 90 # Copyright (c) 1983 Eric P. Allman. All rights reserved. 91 # Copyright (c) 1988, 1993 92 # The Regents of the University of California. All rights reserved. 93 # 94 # By using this file, you agree to the terms and conditions set 95 # forth in the LICENSE file which can be found at the top level of 96 # the sendmail distribution. 97 # 98 99 # 100 # This is a Berkeley-specific configuration file for HP-UX 9.x. 101 # It applies only to the Computer Science Division at Berkeley, 102 # and should not be used elsewhere. It is provided on the sendmail 103 # distribution as a sample only. To create your own configuration 104 # file, create an appropriate domain file in ../domain, change the 105 # `DOMAIN' macro below to reference that file, and copy the result 106 # to a name of your own choosing. 107 # 108 divert(0) 109 110The divert(-1) will delete the crud in the resulting output file. 111The copyright notice can be replaced by whatever your lawyers require; 112our lawyers require the one that I've included in my files. A copyleft 113is a copyright by another name. The divert(0) restores regular output. 114 115 VERSIONID(`<SCCS or RCS version id>') 116 117VERSIONID is a macro that stuffs the version information into the 118resulting file. We use SCCS; you could use RCS, something else, or 119omit it completely. This is not the same as the version id included 120in SMTP greeting messages -- this is defined in m4/version.m4. 121 122 OSTYPE(hpux9)dnl 123 124You must specify an OSTYPE to properly configure things such as the 125pathname of the help and status files, the flags needed for the local 126mailer, and other important things. If you omit it, you will get an 127error when you try to build the configuration. Look at the ostype 128directory for the list of known operating system types. 129 130 DOMAIN(CS.Berkeley.EDU)dnl 131 132This example is specific to the Computer Science Division at Berkeley. 133You can use "DOMAIN(generic)" to get a sufficiently bland definition 134that may well work for you, or you can create a customized domain 135definition appropriate for your environment. 136 137 MAILER(local) 138 MAILER(smtp) 139 140These describe the mailers used at the default CS site site. The 141local mailer is always included automatically. Beware: MAILER 142declarations should always be at the end of the configuration file, 143and MAILER(smtp) should always precede MAILER(uucp). The general 144rules are that the order should be: 145 146 VERSIONID 147 OSTYPE 148 DOMAIN 149 FEATURE 150 local macro definitions 151 MAILER 152 LOCAL_RULESET_* 153 154 155+----------------------------+ 156| A BRIEF INTRODUCTION TO M4 | 157+----------------------------+ 158 159Sendmail uses the M4 macro processor to ``compile'' the configuration 160files. The most important thing to know is that M4 is stream-based, 161that is, it doesn't understand about lines. For this reason, in some 162places you may see the word ``dnl'', which stands for ``delete 163through newline''; essentially, it deletes all characters starting 164at the ``dnl'' up to and including the next newline character. In 165most cases sendmail uses this only to avoid lots of unnecessary 166blank lines in the output. 167 168Other important directives are define(A, B) which defines the macro 169``A'' to have value ``B''. Macros are expanded as they are read, so 170one normally quotes both values to prevent expansion. For example, 171 172 define(`SMART_HOST', `smart.foo.com') 173 174One word of warning: M4 macros are expanded even in lines that appear 175to be comments. For example, if you have 176 177 # See FEATURE(foo) above 178 179it will not do what you expect, because the FEATURE(foo) will be 180expanded. This also applies to 181 182 # And then define the $X macro to be the return address 183 184because ``define'' is an M4 keyword. If you want to use them, surround 185them with directed quotes, `like this'. 186 187+----------------+ 188| FILE LOCATIONS | 189+----------------+ 190 191sendmail 8.9 has introduced a new configuration directory for sendmail 192related files, /etc/mail. The new files available for sendmail 8.9 -- 193the class 'R' /etc/mail/relay-domains and the access database 194/etc/mail/access -- take advantage of this new directory. 8.9 will 195serve as a transition release. Beginning with 8.10, all of the files 196will use this directory by default. 197 198+--------+ 199| OSTYPE | 200+--------+ 201 202You MUST define an operating system environment, or the configuration 203file build will puke. There are several environments available; look 204at the "ostype" directory for the current list. This macro changes 205things like the location of the alias file and queue directory. Some 206of these files are identical to one another. 207 208It is IMPERATIVE that the OSTYPE occur before any MAILER definitions. 209In general, the OSTYPE macro should go immediately after any version 210information, and MAILER definitions should always go last. 211 212Operating system definitions are usually easy to write. They may define 213the following variables (everything defaults, so an ostype file may be 214empty). Unfortunately, the list of configuration-supported systems is 215not as broad as the list of source-supported systems, since many of 216the source contributors do not include corresponding ostype files. 217 218ALIAS_FILE [/etc/aliases] The location of the text version 219 of the alias file(s). It can be a comma-separated 220 list of names (but be sure you quote values with 221 commas in them -- for example, use 222 define(`ALIAS_FILE', `a,b') 223 to get "a" and "b" both listed as alias files; 224 otherwise the define() primitive only sees "a"). 225HELP_FILE [/usr/lib/sendmail.hf] The name of the file 226 containing information printed in response to 227 the SMTP HELP command. 228QUEUE_DIR [/var/spool/mqueue] The directory containing 229 queue files. 230STATUS_FILE [/etc/sendmail.st] The file containing status 231 information. 232LOCAL_MAILER_PATH [/bin/mail] The program used to deliver local mail. 233LOCAL_MAILER_FLAGS [rmn9] The flags used by the local mailer. The 234 flags lsDFM are always included. 235LOCAL_MAILER_ARGS [mail -d $u] The arguments passed to deliver local 236 mail. 237LOCAL_MAILER_MAX [undefined] If defined, the maximum size of local 238 mail that you are willing to accept. 239LOCAL_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 240 that ARRIVE from an address that resolves to the 241 local mailer and which are converted to MIME will be 242 labeled with this character set. 243LOCAL_SHELL_PATH [/bin/sh] The shell used to deliver piped email. 244LOCAL_SHELL_FLAGS [eu9] The flags used by the shell mailer. The 245 flags lsDFM are always included. 246LOCAL_SHELL_ARGS [sh -c $u] The arguments passed to deliver "prog" 247 mail. 248LOCAL_SHELL_DIR [$z:/] The directory search path in which the 249 shell should run. 250USENET_MAILER_PATH [/usr/lib/news/inews] The name of the program 251 used to submit news. 252USENET_MAILER_FLAGS [rlsDFMmn] The mailer flags for the usenet mailer. 253USENET_MAILER_ARGS [-m -h -n] The command line arguments for the 254 usenet mailer. 255USENET_MAILER_MAX [100000] The maximum size of messages that will 256 be accepted by the usenet mailer. 257SMTP_MAILER_FLAGS [undefined] Flags added to SMTP mailer. Default 258 flags are `mDFMUX' for all SMTP-based mailers; the 259 "esmtp" mailer adds `a' and "smtp8" adds `8'. 260SMTP_MAILER_MAX [undefined] The maximum size of messages that will 261 be transported using the smtp, smtp8, or esmtp 262 mailers. 263SMTP_MAILER_ARGS [IPC $h] The arguments passed to the smtp mailer. 264 About the only reason you would want to change this 265 would be to change the default port. 266ESMTP_MAILER_ARGS [IPC $h] The arguments passed to the esmtp mailer. 267SMTP8_MAILER_ARGS [IPC $h] The arguments passed to the smtp8 mailer. 268RELAY_MAILER_ARGS [IPC $h] The arguments passed to the relay mailer. 269SMTP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 270 that ARRIVE from an address that resolves to one of 271 the SMTP mailers and which are converted to MIME will 272 be labeled with this character set. 273UUCP_MAILER_PATH [/usr/bin/uux] The program used to send UUCP mail. 274UUCP_MAILER_FLAGS [undefined] Flags added to UUCP mailer. Default 275 flags are `DFMhuU' (and `m' for uucp-new mailer, 276 minus `U' for uucp-dom mailer). 277UUCP_MAILER_ARGS [uux - -r -z -a$g -gC $h!rmail ($u)] The arguments 278 passed to the UUCP mailer. 279UUCP_MAILER_MAX [100000] The maximum size message accepted for 280 transmission by the UUCP mailers. 281UUCP_MAILER_CHARSET [undefined] If defined, messages containing 8-bit data 282 that ARRIVE from an address that resolves to one of 283 the UUCP mailers and which are converted to MIME will 284 be labeled with this character set. 285FAX_MAILER_PATH [/usr/local/lib/fax/mailfax] The program used to 286 submit FAX messages. 287FAX_MAILER_ARGS [mailfax $u $h $f] The arguments passed to the FAX 288 mailer. 289FAX_MAILER_MAX [100000] The maximum size message accepted for 290 transmission by FAX. 291POP_MAILER_PATH [/usr/lib/mh/spop] The pathname of the POP mailer. 292POP_MAILER_FLAGS [Penu] Flags added to POP mailer. Flags "lsDFM" 293 are always added. 294POP_MAILER_ARGS [pop $u] The arguments passed to the POP mailer. 295PROCMAIL_MAILER_PATH [/usr/local/bin/procmail] The path to the procmail 296 program. This is also used by 297 FEATURE(`local_procmail'). 298PROCMAIL_MAILER_FLAGS [SPhnu9] Flags added to Procmail mailer. Flags 299 ``DFM'' are always set. This is NOT used by 300 FEATURE(`local_procmail'); tweak LOCAL_MAILER_FLAGS 301 instead. 302PROCMAIL_MAILER_ARGS [procmail -Y -m $h $f $u] The arguments passed to 303 the Procmail mailer. This is NOT used by 304 FEATURE(`local_procmail'); tweak LOCAL_MAILER_ARGS 305 instead. 306PROCMAIL_MAILER_MAX [undefined] If set, the maximum size message that 307 will be accepted by the procmail mailer. 308MAIL11_MAILER_PATH [/usr/etc/mail11] The path to the mail11 mailer. 309MAIL11_MAILER_FLAGS [nsFx] Flags for the mail11 mailer. 310MAIL11_MAILER_ARGS [mail11 $g $x $h $u] Arguments passed to the mail11 311 mailer. 312PH_MAILER_PATH [/usr/local/etc/phquery] The path to the phquery 313 program. 314PH_MAILER_FLAGS [ehmu] Flags for the phquery mailer. 315PH_MAILER_ARGS [phquery -- $u] -- arguments to the phquery mailer. 316CYRUS_MAILER_FLAGS [A5@/:|] The flags used by the cyrus mailer. The 317 flags lsDFMnPq are always included. 318CYRUS_MAILER_PATH [/usr/cyrus/bin/deliver] The program used to deliver 319 cyrus mail. 320CYRUS_MAILER_ARGS [deliver -e -m $h -- $u] The arguments passed 321 to deliver cyrus mail. 322CYRUS_MAILER_MAX [undefined] If set, the maximum size message that 323 will be accepted by the cyrus mailer. 324CYRUS_MAILER_USER [cyrus:mail] The user and group to become when 325 running the cyrus mailer. 326CYRUS_BB_MAILER_FLAGS [undefined] The flags used by the cyrusbb 327 mailer. The flags lsDFMnP are always included. 328CYRUS_BB_MAILER_ARGS [deliver -e -m $u] The arguments passed 329 to deliver cyrusbb mail. 330confEBINDIR [/usr/libexec] The directory for executables. 331 Currently used for FEATURE(`local_lmtp') and 332 FEATURE(`smrsh'). 333 334 335 336+---------+ 337| DOMAINS | 338+---------+ 339 340You will probably want to collect domain-dependent defines into one 341file, referenced by the DOMAIN macro. For example, our Berkeley 342domain file includes definitions for several internal distinguished 343hosts: 344 345UUCP_RELAY The host that will accept UUCP-addressed email. 346 If not defined, all UUCP sites must be directly 347 connected. 348BITNET_RELAY The host that will accept BITNET-addressed email. 349 If not defined, the .BITNET pseudo-domain won't work. 350DECNET_RELAY The host that will accept DECNET-addressed email. 351 If not defined, the .DECNET pseudo-domain and addresses 352 of the form node::user will not work. 353FAX_RELAY The host that will accept mail to the .FAX pseudo-domain. 354 The "fax" mailer overrides this value. 355LOCAL_RELAY DEPRECATED. The site that will handle unqualified 356 names -- that is, names with out an @domain extension. 357 If not set, they are assumed to belong on this machine. 358 This allows you to have a central site to store a 359 company- or department-wide alias database. This 360 only works at small sites, and only with some user 361 agents. 362LUSER_RELAY The site that will handle lusers -- that is, apparently 363 local names that aren't local accounts or aliases. 364 365Any of these can be either ``mailer:hostname'' (in which case the 366mailer is the internal mailer name, such as ``uucp-new'' and the hostname 367is the name of the host as appropriate for that mailer) or just a 368``hostname'', in which case a default mailer type (usually ``relay'', 369a variant on SMTP) is used. WARNING: if you have a wildcard MX 370record matching your domain, you probably want to define these to 371have a trailing dot so that you won't get the mail diverted back 372to yourself. 373 374The domain file can also be used to define a domain name, if needed 375(using "DD<domain>") and set certain site-wide features. If all hosts 376at your site masquerade behind one email name, you could also use 377MASQUERADE_AS here. 378 379You do not have to define a domain -- in particular, if you are a 380single machine sitting off somewhere, it is probably more work than 381it's worth. This is just a mechanism for combining "domain dependent 382knowledge" into one place. 383 384+---------+ 385| MAILERS | 386+---------+ 387 388There are fewer mailers supported in this version than the previous 389version, owing mostly to a simpler world. As a general rule, put the 390MAILER definitions last in your .mc file, and always put MAILER(smtp) 391before MAILER(uucp) -- several features and definitions will modify 392the definition of mailers, and the smtp mailer modifies the UUCP 393mailer. 394 395local The local and prog mailers. You will almost always 396 need these; the only exception is if you relay ALL 397 your mail to another site. This mailer is included 398 automatically. 399 400smtp The Simple Mail Transport Protocol mailer. This does 401 not hide hosts behind a gateway or another other 402 such hack; it assumes a world where everyone is 403 running the name server. This file actually defines 404 four mailers: "smtp" for regular (old-style) SMTP to 405 other servers, "esmtp" for extended SMTP to other 406 servers, "smtp8" to do SMTP to other servers without 407 converting 8-bit data to MIME (essentially, this is 408 your statement that you know the other end is 8-bit 409 clean even if it doesn't say so), and "relay" for 410 transmission to our RELAY_HOST, LUSER_RELAY, or 411 MAILER_HUB. 412 413uucp The Unix-to-Unix Copy Program mailer. Actually, this 414 defines two mailers, "uucp-old" (a.k.a. "uucp") and 415 "uucp-new" (a.k.a. "suucp"). The latter is for when you 416 know that the UUCP mailer at the other end can handle 417 multiple recipients in one transfer. If the smtp mailer 418 is also included in your configuration, two other mailers 419 ("uucp-dom" and "uucp-uudom") are also defined [warning: 420 you MUST specify MAILER(smtp) before MAILER(uucp)]. When you 421 include the uucp mailer, sendmail looks for all names in 422 the $=U class and sends them to the uucp-old mailer; all 423 names in the $=Y class are sent to uucp-new; and all 424 names in the $=Z class are sent to uucp-uudom. Note that 425 this is a function of what version of rmail runs on 426 the receiving end, and hence may be out of your control. 427 See the section below describing UUCP mailers in more 428 detail. 429 430usenet Usenet (network news) delivery. If this is specified, 431 an extra rule is added to ruleset 0 that forwards all 432 local email for users named ``group.usenet'' to the 433 ``inews'' program. Note that this works for all groups, 434 and may be considered a security problem. 435 436fax Facsimile transmission. This is experimental and based 437 on Sam Leffler's HylaFAX software. For more information, 438 see http://www.vix.com/hylafax/. 439 440pop Post Office Protocol. 441 442procmail An interface to procmail (does not come with sendmail). 443 This is designed to be used in mailertables. For example, 444 a common question is "how do I forward all mail for a given 445 domain to a single person?". If you have this mailer 446 defined, you could set up a mailertable reading: 447 448 host.com procmail:/etc/procmailrcs/host.com 449 450 with the file /etc/procmailrcs/host.com reading: 451 452 :0 # forward mail for host.com 453 ! -oi -f $1 person@other.host 454 455 This would arrange for (anything)@host.com to be sent 456 to person@other.host. Within the procmail script, $1 is 457 the name of the sender and $2 is the name of the recipient. 458 If you use this with FEATURE(`local_procmail'), the FEATURE 459 should be listed first. 460 461mail11 The DECnet mail11 mailer, useful only if you have the mail11 462 program from gatekeeper.dec.com:/pub/DEC/gwtools (and 463 DECnet, of course). This is for Phase IV DECnet support; 464 if you have Phase V at your site you may have additional 465 problems. 466 467phquery The phquery program. This is somewhat counterintuitively 468 referenced as the "ph" mailer internally. It can be used 469 to do CCSO name server lookups. The phquery program, which 470 this mailer uses, is distributed with the ph client. 471 472cyrus The cyrus and cyrusbb mailers. The cyrus mailer delivers to 473 a local cyrus user. this mailer can make use of the 474 "user+detail@local.host" syntax; it will deliver the mail to 475 the user's "detail" mailbox if the mailbox's ACL permits. 476 The cyrusbb mailer delivers to a system-wide cyrus mailbox 477 if the mailbox's ACL permits. 478 479 480The local mailer accepts addresses of the form "user+detail", where 481the "+detail" is not used for mailbox matching but is available 482to certain local mail programs (in particular, see 483FEATURE(`local_procmail')). For example, "eric", "eric+sendmail", and 484"eric+sww" all indicate the same user, but additional arguments <null>, 485"sendmail", and "sww" may be provided for use in sorting mail. 486 487 488+----------+ 489| FEATURES | 490+----------+ 491 492Special features can be requested using the "FEATURE" macro. For 493example, the .mc line: 494 495 FEATURE(`use_cw_file') 496 497tells sendmail that you want to have it read an /etc/sendmail.cw 498file to get values for class $=w. The FEATURE may contain a single 499optional parameter -- for example: 500 501 FEATURE(`mailertable', `dbm /usr/lib/mailertable') 502 503The default database map type for the table features can be set with 504 505 define(`DATABASE_MAP_TYPE', `dbm') 506 507which would set it to use ndbm databases. The default is the Berkeley DB 508hash database format. Note that you must still declare a database map type 509if you specify an argument to a FEATURE. DATABASE_MAP_TYPE is only used 510if no argument is given for the FEATURE. 511 512Available features are: 513 514use_cw_file Read the file /etc/sendmail.cw file to get alternate 515 names for this host. This might be used if you were 516 on a host that MXed for a dynamic set of other 517 hosts. If the set is static, just including the line 518 "Cw<name1> <name2> ..." (where the names are fully 519 qualified domain names) is probably superior. 520 The actual filename can be overridden by redefining 521 confCW_FILE. 522 523use_ct_file Read the file /etc/sendmail.ct file to get the names 524 of users that will be ``trusted'', that is, able to 525 set their envelope from address using -f without 526 generating a warning message. 527 The actual filename can be overridden by redefining 528 confCT_FILE. 529 530redirect Reject all mail addressed to "address.REDIRECT" with 531 a ``551 User not local; please try <address>'' message. 532 If this is set, you can alias people who have left 533 to their new address with ".REDIRECT" appended. 534 535nouucp Don't do anything special with UUCP addresses at all. 536 537nocanonify Don't pass addresses to $[ ... $] for canonification. 538 This would generally only be used by sites that only 539 act as mail gateways or which have user agents that do 540 full canonification themselves. You may also want to 541 use "define(`confBIND_OPTS',`-DNSRCH -DEFNAMES')" to 542 turn off the usual resolver options that do a similar 543 thing. 544 545stickyhost If set, email sent to "user@local.host" are marked 546 as "sticky" -- that is, the local addresses aren't 547 matched against UDB and don't go through ruleset 5. 548 This is used if you want a set up where "user" is 549 not necessarily the same as "user@local.host", e.g., 550 to make a distinct domain-wide namespace. Prior to 551 8.7 this was the default, and notsticky was used to 552 turn this off. 553 554mailertable Include a "mailer table" which can be used to override 555 routing for particular domains. The argument of the 556 FEATURE may be the key definition. If none is specified, 557 the definition used is: 558 559 hash -o /etc/mailertable 560 561 Keys in this database are fully qualified domain names 562 or partial domains preceded by a dot -- for example, 563 "vangogh.CS.Berkeley.EDU" or ".CS.Berkeley.EDU". 564 Values must be of the form: 565 mailer:domain 566 where "mailer" is the internal mailer name, and "domain" 567 is where to send the message. These maps are not 568 reflected into the message header. As a special case, 569 the forms: 570 local:user 571 will forward to the indicated user using the local mailer, 572 local: 573 will forward to the original user in the e-mail address 574 using the local mailer, and 575 error:code message 576 will give an error message with the indicated code and 577 message. 578 579domaintable Include a "domain table" which can be used to provide 580 domain name mapping. Use of this should really be 581 limited to your own domains. It may be useful if you 582 change names (e.g., your company changes names from 583 oldname.com to newname.com). The argument of the 584 FEATURE may be the key definition. If none is specified, 585 the definition used is: 586 587 hash -o /etc/domaintable 588 589 The key in this table is the domain name; the value is 590 the new (fully qualified) domain. Anything in the 591 domaintable is reflected into headers; that is, this 592 is done in ruleset 3. 593 594bitdomain Look up bitnet hosts in a table to try to turn them into 595 internet addresses. The table can be built using the 596 bitdomain program contributed by John Gardiner Myers. 597 The argument of the FEATURE may be the key definition; if 598 none is specified, the definition used is: 599 600 hash -o /etc/bitdomain.db 601 602 Keys are the bitnet hostname; values are the corresponding 603 internet hostname. 604 605uucpdomain Similar feature for UUCP hosts. The default map definition 606 is: 607 608 hash -o /etc/uudomain.db 609 610 At the moment there is no automagic tool to build this 611 database. 612 613always_add_domain 614 Include the local host domain even on locally delivered 615 mail. Normally it is not added on unqualified names. 616 However, if you use a shared message store but do not use 617 the same user name space everywhere, you may need the host 618 name on local names. 619 620allmasquerade If masquerading is enabled (using MASQUERADE_AS), this 621 feature will cause recipient addresses to also masquerade 622 as being from the masquerade host. Normally they get 623 the local hostname. Although this may be right for 624 ordinary users, it can break local aliases. For example, 625 if you send to "localalias", the originating sendmail will 626 find that alias and send to all members, but send the 627 message with "To: localalias@masqueradehost". Since that 628 alias likely does not exist, replies will fail. Use this 629 feature ONLY if you can guarantee that the ENTIRE 630 namespace on your masquerade host supersets all the 631 local entries. 632 633limited_masquerade 634 Normally, any hosts listed in $=w are masqueraded. If this 635 feature is given, only the hosts listed in $=M are masqueraded. 636 This is useful if you have several domains with disjoint 637 namespaces hosted on the same machine. 638 639masquerade_entire_domain 640 If masquerading is enabled (using MASQUERADE_AS) and 641 MASQUERADE_DOMAIN (see below) is set, this feature will 642 cause addresses to be rewritten such that the masquerading 643 domains are actually entire domains to be hidden. All 644 hosts within the masquerading domains will be rewritten 645 to the masquerade name (used in MASQUERADE_AS). For example, 646 if you have: 647 648 MASQUERADE_AS(masq.com) 649 MASQUERADE_DOMAIN(foo.org) 650 MASQUERADE_DOMAIN(bar.com) 651 652 then *foo.org and *bar.com are converted to masq.com. Without 653 this feature, only foo.org and bar.com are masqueraded. 654 655 NOTE: only domains within your jurisdiction and 656 current hierarchy should be masqueraded using this. 657 658genericstable This feature will cause certain addresses originating locally 659 (i.e. that are unqualified) or a domain listed in $=G to be 660 looked up in a map and turned into another ("generic") form, 661 which can change both the domain name and the user name. This 662 is similar to the userdb functionality. The same types of 663 addresses as for masquerading are looked up, i.e. only header 664 sender addresses unless the allmasquerade and/or 665 masquerade_envelope features are given. Qualified addresses 666 must have the domain part in the list of names given by the 667 by the macros GENERICS_DOMAIN or GENERICS_DOMAIN_FILE 668 (analogously to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, 669 see below). 670 671 The argument of FEATURE(`genericstable') may be the map 672 definition; the default map definition is: 673 674 hash -o /etc/genericstable 675 676 The key for this table is either the full address or the 677 unqualified username (the former is tried first); the 678 value is the new user address. If the new user address does 679 not include a domain, it will be qualified in the standard 680 manner, i.e. using $j or the masquerade name. Note that the 681 address being looked up must be fully qualified. For local 682 mail, it is necessary to use FEATURE(`always_add_domain') 683 for the addresses to be qualified. 684 685virtusertable A domain-specific form of aliasing, allowing multiple 686 virtual domains to be hosted on one machine. For example, 687 if the virtuser table contained: 688 689 info@foo.com foo-info 690 info@bar.com bar-info 691 @baz.org jane@elsewhere.net 692 693 then mail addressed to info@foo.com will be sent to the 694 address foo-info, mail addressed to info@bar.com will be 695 delivered to bar-info, and mail addressed to anyone at 696 baz.org will be sent to jane@elsewhere.net. The username 697 from the original address is passed as %1 allowing: 698 699 @foo.org %1@elsewhere.com 700 701 meaning someone@foo.org will be sent to someone@elsewhere.com. 702 703 All the host names on the left hand side (foo.com, bar.com, 704 and baz.org) must be in $=w. The default map definition is: 705 706 hash -o /etc/virtusertable 707 708 A new definition can be specified as the second argument of 709 the FEATURE macro, such as 710 711 FEATURE(`virtusertable', `dbm -o /etc/mail/virtusers') 712 713nodns We aren't running DNS at our site (for example, 714 we are UUCP-only connected). It's hard to consider 715 this a "feature", but hey, it had to go somewhere. 716 Actually, as of 8.7 this is a no-op -- remove "dns" from 717 the hosts service switch entry instead. 718 719nullclient This is a special case -- it creates a stripped down 720 configuration file containing nothing but support for 721 forwarding all mail to a central hub via a local 722 SMTP-based network. The argument is the name of that 723 hub. 724 725 The only other feature that should be used in conjunction 726 with this one is "nocanonify" (this causes addresses to 727 be sent unqualified via the SMTP connection; normally 728 they are qualified with the masquerade name, which 729 defaults to the name of the hub machine). No mailers 730 should be defined. No aliasing or forwarding is done. 731 Also, note that absolutely no anti-spam or anti-relaying 732 is done in a null client configuration. More information 733 can be found in the ANTI-SPAM CONFIGURATION CONTROL section. 734 735local_lmtp Use an LMTP capable local mailer. The argument to this 736 feature is the pathname of an LMTP capable mailer. By 737 default, mail.local is used. This is expected to be the 738 mail.local which came with the 8.9 distribution which is 739 LMTP capable. The path to mail.local is set by the 740 confEBINDIR m4 variable -- making the default 741 LOCAL_MAILER_PATH /usr/libexec/mail.local. 742 743local_procmail Use procmail as the local mailer. This mailer can 744 make use of the "user+indicator@local.host" syntax; 745 normally the +indicator is just tossed, but by default 746 it is passed as the -a argument to procmail. The 747 argument to this feature is the pathname of procmail, 748 which defaults to PROCMAIL_MAILER_PATH. Note that this 749 does NOT use PROCMAIL_MAILER_FLAGS or PROCMAIL_MAILER_ARGS 750 for the local mailer; tweak LOCAL_MAILER_FLAGS and 751 LOCAL_MAILER_ARGS instead. 752 753bestmx_is_local Accept mail as though locally addressed for any host that 754 lists us as the best possible MX record. This generates 755 additional DNS traffic, but should be OK for low to 756 medium traffic hosts. The argument may be a set of 757 domains, which will limit the feature to only apply to 758 these domains -- this will reduce unnecessary DNS 759 traffic. THIS FEATURE IS FUNDAMENTALLY INCOMPATIBLE WITH 760 WILDCARD MX RECORDS!!! If you have a wildcard MX record 761 that matches your domain, you cannot use this feature. 762 763smrsh Use the SendMail Restricted SHell (smrsh) provided 764 with the distribution instead of /bin/sh for mailing 765 to programs. This improves the ability of the local 766 system administrator to control what gets run via 767 e-mail. If an argument is provided it is used as the 768 pathname to smrsh; otherwise, the path defined by 769 confEBINDIR is used for the smrsh binary -- by default, 770 /usr/libexec/smrsh is assumed. 771 772promiscuous_relay 773 By default, the sendmail configuration files do not permit 774 mail relaying (that is, accepting mail from outside your 775 domain and sending it to another host outside your domain). 776 This option sets your site to allow mail relaying from any 777 site to any site. In general, it is better to control the 778 relaying more carefully with the access db and the 'R' 779 class ($=R). Domains can be added to class 'R' by the 780 macros RELAY_DOMAIN or RELAY_DOMAIN_FILE (analogously to 781 MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below). 782 783relay_entire_domain 784 By default, only hosts listed as RELAY in the access db 785 will be allowed to relay. This option also allows any 786 host in your domain as defined by the 'm' class ($=m). 787 788relay_hosts_only 789 By default, names that are listed as RELAY in the access 790 db and class 'R' ($=R) are domain names, not host names. 791 For example, if you specify ``foo.com'', then mail to or 792 from foo.com, abc.foo.com, or a.very.deep.domain.foo.com 793 will all be accepted for relaying. This feature changes 794 the behaviour to lookup individual host names only. 795 796relay_based_on_MX 797 Turns on the ability to allow relaying based on the MX 798 records of the host portion of an incoming recipient; that 799 is, if an MX record for host foo.com points to your site, 800 you will accept and relay mail addressed to foo.com. See 801 description below for more information before using this 802 feature. Also, see the KNOWNBUGS entry regarding bestmx 803 map lookups. 804 805 FEATURE(`relay_based_on_MX') does not necessarily allow 806 routing of these messages which you expect to be allowed, 807 if route address syntax (or %-hack syntax) is used. If 808 this is a problem, add entries to the access-table or use 809 FEATURE(`loose_relay_check'). 810 811relay_local_from 812 Allows relaying if the domain portion of the mail sender 813 is a local host. This should only be used if absolutely 814 necessary as it opens a window for spammers. Specifically, 815 they can send mail to your mail server that claims to be 816 from your domain (either directly or via a routed address), 817 and you will go ahead and relay it out to arbitrary hosts 818 on the Internet. 819 820accept_unqualified_senders 821 Normally, MAIL FROM: commands in the SMTP session will be 822 refused if the connection is a network connection and the 823 sender address does not include a domain name. If your 824 setup sends local mail unqualified (i.e. MAIL FROM: <joe>), 825 you will need to use this feature to accept unqualified 826 sender addresses. 827 828accept_unresolvable_domains 829 Normally, MAIL FROM: commands in the SMTP session will be 830 refused if the host part of the argument to MAIL FROM: cannot 831 be located in the host name service (e.g., DNS). If you are 832 inside a firewall that has only a limited view of the 833 Internet host name space, this could cause problems. In this 834 case you probably want to use this feature to accept all 835 domains on input, even if they are unresolvable. 836 837access_db Turns on the access database feature. The access db gives 838 you the ability to allow or refuse to accept mail from 839 specified domains for administrative reasons. By default, 840 the access database specification is: 841 842 hash -o /etc/mail/access 843 844 The format of the database is described below. 845 846blacklist_recipients 847 Turns on the ability to block incoming mail for certain 848 recipient usernames, hostnames, or addresses. For 849 example, you can block incoming mail to user nobody, 850 host foo.mydomain.com, or guest@bar.mydomain.com. 851 These specifications are put in the access db as 852 described below. 853 854rbl Turns on rejection of hosts found in the Realtime Blackhole 855 List. If an argument is provided it is used as the 856 name sever to contact; otherwise, the main RBL server at 857 rbl.maps.vix.com is used. For details, see 858 http://maps.vix.com/rbl/. 859 860loose_relay_check 861 Normally, if a recipient using % addressing is used, e.g. 862 user%site@othersite, and othersite is in class 'R', the 863 check_rcpt ruleset will strip @othersite and recheck 864 user@site for relaying. This feature changes that 865 behavior. It should not be needed for most installations. 866 867 868+-------+ 869| HACKS | 870+-------+ 871 872Some things just can't be called features. To make this clear, 873they go in the hack subdirectory and are referenced using the HACK 874macro. These will tend to be site-dependent. The release 875includes the Berkeley-dependent "cssubdomain" hack (that makes 876sendmail accept local names in either Berkeley.EDU or CS.Berkeley.EDU; 877this is intended as a short-term aid while we move hosts into 878subdomains. 879 880 881+--------------------+ 882| SITE CONFIGURATION | 883+--------------------+ 884 885 ***************************************************** 886 * This section is really obsolete, and is preserved * 887 * only for back compatibility. You should plan on * 888 * using mailertables for new installations. In * 889 * particular, it doesn't work for the newer forms * 890 * of UUCP mailers, such as uucp-uudom. * 891 ***************************************************** 892 893Complex sites will need more local configuration information, such as 894lists of UUCP hosts they speak with directly. This can get a bit more 895tricky. For an example of a "complex" site, see cf/ucbvax.mc. 896 897If your host is known by several different names, you need to augment 898the $=w class. This is a list of names by which you are known, and 899anything sent to an address using a host name in this list will be 900treated as local mail. You can do this in two ways: either create 901the file /etc/sendmail.cw containing a list of your aliases (one per 902line), and use ``FEATURE(`use_cw_file')'' in the .mc file, or add the 903line: 904 905 Cw alias.host.name 906 907at the end of that file. See the ``vangogh.mc'' file for an example. 908Be sure you use the fully-qualified name of the host, rather than a 909short name. 910 911The SITECONFIG macro allows you to indirectly reference site-dependent 912configuration information stored in the siteconfig subdirectory. For 913example, the line 914 915 SITECONFIG(uucp.ucbvax, ucbvax, U) 916 917reads the file uucp.ucbvax for local connection information. The 918second parameter is the local name (in this case just "ucbvax" since 919it is locally connected, and hence a UUCP hostname). The third 920parameter is the name of both a macro to store the local name (in 921this case, $U) and the name of the class (e.g., $=U) in which to store 922the host information read from the file. Another SITECONFIG line reads 923 924 SITECONFIG(uucp.ucbarpa, ucbarpa.Berkeley.EDU, W) 925 926This says that the file uucp.ucbarpa contains the list of UUCP sites 927connected to ucbarpa.Berkeley.EDU. The $=W class will be used to 928store this list, and $W is defined to be ucbarpa.Berkeley.EDU, that 929is, the name of the relay to which the hosts listed in uucp.ucbarpa 930are connected. [The machine ucbarpa is gone now, but I've left 931this out-of-date configuration file around to demonstrate how you 932might do this.] 933 934Note that the case of SITECONFIG with a third parameter of ``U'' is 935special; the second parameter is assumed to be the UUCP name of the 936local site, rather than the name of a remote site, and the UUCP name 937is entered into $=w (the list of local hostnames) as $U.UUCP. 938 939The siteconfig file (e.g., siteconfig/uucp.ucbvax.m4) contains nothing 940more than a sequence of SITE macros describing connectivity. For 941example: 942 943 SITE(cnmat) 944 SITE(sgi olympus) 945 946The second example demonstrates that you can use two names on the 947same line; these are usually aliases for the same host (or are at 948least in the same company). 949 950 951+--------------------+ 952| USING UUCP MAILERS | 953+--------------------+ 954 955It's hard to get UUCP mailers right because of the extremely ad hoc 956nature of UUCP addressing. These config files are really designed 957for domain-based addressing, even for UUCP sites. 958 959There are four UUCP mailers available. The choice of which one to 960use is partly a matter of local preferences and what is running at 961the other end of your UUCP connection. Unlike good protocols that 962define what will go over the wire, UUCP uses the policy that you 963should do what is right for the other end; if they change, you have 964to change. This makes it hard to do the right thing, and discourages 965people from updating their software. In general, if you can avoid 966UUCP, please do. 967 968The major choice is whether to go for a domainized scheme or a 969non-domainized scheme. This depends entirely on what the other 970end will recognize. If at all possible, you should encourage the 971other end to go to a domain-based system -- non-domainized addresses 972don't work entirely properly. 973 974The four mailers are: 975 976 uucp-old (obsolete name: "uucp") 977 This is the oldest, the worst (but the closest to UUCP) way of 978 sending messages accros UUCP connections. It does bangify 979 everything and prepends $U (your UUCP name) to the sender's 980 address (which can already be a bang path itself). It can 981 only send to one address at a time, so it spends a lot of 982 time copying duplicates of messages. Avoid this if at all 983 possible. 984 985 uucp-new (obsolete name: "suucp") 986 The same as above, except that it assumes that in one rmail 987 command you can specify several recipients. It still has a 988 lot of other problems. 989 990 uucp-dom 991 This UUCP mailer keeps everything as domain addresses. 992 Basically, it uses the SMTP mailer rewriting rules. This mailer 993 is only included if MAILER(smtp) is also specified. 994 995 Unfortunately, a lot of UUCP mailer transport agents require 996 bangified addresses in the envelope, although you can use 997 domain-based addresses in the message header. (The envelope 998 shows up as the From_ line on UNIX mail.) So.... 999 1000 uucp-uudom 1001 This is a cross between uucp-new (for the envelope addresses) 1002 and uucp-dom (for the header addresses). It bangifies the 1003 envelope sender (From_ line in messages) without adding the 1004 local hostname, unless there is no host name on the address 1005 at all (e.g., "wolf") or the host component is a UUCP host name 1006 instead of a domain name ("somehost!wolf" instead of 1007 "some.dom.ain!wolf"). This is also included only if MAILER(smtp) 1008 is also specified. 1009 1010Examples: 1011 1012We are on host grasp.insa-lyon.fr (UUCP host name "grasp"). The 1013following summarizes the sender rewriting for various mailers. 1014 1015Mailer sender rewriting in the envelope 1016------ ------ ------------------------- 1017uucp-{old,new} wolf grasp!wolf 1018uucp-dom wolf wolf@grasp.insa-lyon.fr 1019uucp-uudom wolf grasp.insa-lyon.fr!wolf 1020 1021uucp-{old,new} wolf@fr.net grasp!fr.net!wolf 1022uucp-dom wolf@fr.net wolf@fr.net 1023uucp-uudom wolf@fr.net fr.net!wolf 1024 1025uucp-{old,new} somehost!wolf grasp!somehost!wolf 1026uucp-dom somehost!wolf somehost!wolf@grasp.insa-lyon.fr 1027uucp-uudom somehost!wolf grasp.insa-lyon.fr!somehost!wolf 1028 1029If you are using one of the domainized UUCP mailers, you really want 1030to convert all UUCP addresses to domain format -- otherwise, it will 1031do it for you (and probably not the way you expected). For example, 1032if you have the address foo!bar!baz (and you are not sending to foo), 1033the heuristics will add the @uucp.relay.name or @local.host.name to 1034this address. However, if you map foo to foo.host.name first, it 1035will not add the local hostname. You can do this using the uucpdomain 1036feature. 1037 1038 1039+-------------------+ 1040| TWEAKING RULESETS | 1041+-------------------+ 1042 1043For more complex configurations, you can define special rules. 1044The macro LOCAL_RULE_3 introduces rules that are used in canonicalizing 1045the names. Any modifications made here are reflected in the header. 1046 1047A common use is to convert old UUCP addresses to SMTP addresses using 1048the UUCPSMTP macro. For example: 1049 1050 LOCAL_RULE_3 1051 UUCPSMTP(decvax, decvax.dec.com) 1052 UUCPSMTP(research, research.att.com) 1053 1054will cause addresses of the form "decvax!user" and "research!user" 1055to be converted to "user@decvax.dec.com" and "user@research.att.com" 1056respectively. 1057 1058This could also be used to look up hosts in a database map: 1059 1060 LOCAL_RULE_3 1061 R$* < @ $+ > $* $: $1 < @ $(hostmap $2 $) > $3 1062 1063This map would be defined in the LOCAL_CONFIG portion, as shown below. 1064 1065Similarly, LOCAL_RULE_0 can be used to introduce new parsing rules. 1066For example, new rules are needed to parse hostnames that you accept 1067via MX records. For example, you might have: 1068 1069 LOCAL_RULE_0 1070 R$+ <@ host.dom.ain.> $#uucp $@ cnmat $: $1 < @ host.dom.ain.> 1071 1072You would use this if you had installed an MX record for cnmat.Berkeley.EDU 1073pointing at this host; this rule catches the message and forwards it on 1074using UUCP. 1075 1076You can also tweak rulesets 1 and 2 using LOCAL_RULE_1 and LOCAL_RULE_2. 1077These rulesets are normally empty. 1078 1079A similar macro is LOCAL_CONFIG. This introduces lines added after the 1080boilerplate option setting but before rulesets, and can be used to 1081declare local database maps or whatever. For example: 1082 1083 LOCAL_CONFIG 1084 Khostmap hash /etc/hostmap.db 1085 Kyplocal nis -m hosts.byname 1086 1087 1088+---------------------------+ 1089| MASQUERADING AND RELAYING | 1090+---------------------------+ 1091 1092You can have your host masquerade as another using 1093 1094 MASQUERADE_AS(host.domain) 1095 1096This causes mail being sent to be labeled as coming from the 1097indicated host.domain, rather than $j. One normally masquerades as 1098one of one's own subdomains (for example, it's unlikely that I would 1099choose to masquerade as an MIT site). This behaviour is modified by 1100a plethora of FEATUREs; in particular, see masquerade_envelope, 1101allmasquerade, limited_masquerade, and masquerade_entire_domain. 1102 1103The masquerade name is not normally canonified, so it is important 1104that it be your One True Name, that is, fully qualified and not a 1105CNAME. However, if you use a CNAME, the receiving side may canonify 1106it for you, so don't think you can cheat CNAME mapping this way. 1107 1108Normally the only addresses that are masqueraded are those that come 1109from this host (that is, are either unqualified or in $=w, the list 1110of local domain names). You can augment this list using 1111 1112 MASQUERADE_DOMAIN(otherhost.domain) 1113 1114The effect of this is that although mail to user@otherhost.domain 1115will not be delivered locally, any mail including any user@otherhost.domain 1116will, when relayed, be rewritten to have the MASQUERADE_AS address. 1117This can be a space-separated list of names. 1118 1119If these names are in a file, you can use 1120 1121 MASQUERADE_DOMAIN_FILE(filename) 1122 1123to read the list of names from the indicated file. 1124 1125Normally only header addresses are masqueraded. If you want to 1126masquerade the envelope as well, use 1127 1128 FEATURE(`masquerade_envelope') 1129 1130There are always users that need to be "exposed" -- that is, their 1131internal site name should be displayed instead of the masquerade name. 1132Root is an example. You can add users to this list using 1133 1134 EXPOSED_USER(usernames) 1135 1136This adds users to class E; you could also use something like 1137 1138 FE/etc/sendmail.cE 1139 1140You can also arrange to relay all unqualified names (that is, names 1141without @host) to a relay host. For example, if you have a central 1142email server, you might relay to that host so that users don't have 1143to have .forward files or aliases. You can do this using 1144 1145 define(`LOCAL_RELAY', `mailer:hostname') 1146 1147The ``mailer:'' can be omitted, in which case the mailer defaults to 1148"relay". There are some user names that you don't want relayed, perhaps 1149because of local aliases. A common example is root, which may be 1150locally aliased. You can add entries to this list using 1151 1152 LOCAL_USER(usernames) 1153 1154This adds users to class L; you could also use something like 1155 1156 FL/etc/sendmail.cL 1157 1158If you want all incoming mail sent to a centralized hub, as for a 1159shared /var/spool/mail scheme, use 1160 1161 define(`MAIL_HUB', `mailer:hostname') 1162 1163Again, ``mailer:'' defaults to "relay". If you define both LOCAL_RELAY 1164and MAIL_HUB _AND_ you have FEATURE(`stickyhost'), unqualified names will 1165be sent to the LOCAL_RELAY and other local names will be sent to MAIL_HUB. 1166Names in $=L will be delivered locally, so you MUST have aliases or 1167.forward files for them. 1168 1169For example, if you are on machine mastodon.CS.Berkeley.EDU and you have 1170FEATURE(`stickyhost'), the following combinations of settings will have the 1171indicated effects: 1172 1173email sent to.... eric eric@mastodon.CS.Berkeley.EDU 1174 1175LOCAL_RELAY set to mail.CS.Berkeley.EDU (delivered locally) 1176mail.CS.Berkeley.EDU (no local aliasing) (aliasing done) 1177 1178MAIL_HUB set to mammoth.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU 1179mammoth.CS.Berkeley.EDU (aliasing done) (aliasing done) 1180 1181Both LOCAL_RELAY and mail.CS.Berkeley.EDU mammoth.CS.Berkeley.EDU 1182MAIL_HUB set as above (no local aliasing) (aliasing done) 1183 1184If you do not have FEATURE(`stickyhost') set, then LOCAL_RELAY and 1185MAIL_HUB act identically, with MAIL_HUB taking precedence. 1186 1187If you want all outgoing mail to go to a central relay site, define 1188SMART_HOST as well. Briefly: 1189 1190 LOCAL_RELAY applies to unqualified names (e.g., "eric"). 1191 MAIL_HUB applies to names qualified with the name of the 1192 local host (e.g., "eric@mastodon.CS.Berkeley.EDU"). 1193 SMART_HOST applies to names qualified with other hosts. 1194 1195However, beware that other relays (e.g., UUCP_RELAY, BITNET_RELAY, 1196DECNET_RELAY, and FAX_RELAY) take precedence over SMART_HOST, so if you 1197really want absolutely everything to go to a single central site you will 1198need to unset all the other relays -- or better yet, find or build a 1199minimal config file that does this. 1200 1201For duplicate suppression to work properly, the host name is best 1202specified with a terminal dot: 1203 1204 define(`MAIL_HUB', `host.domain.') 1205 note the trailing dot ---^ 1206 1207 1208+---------------------------------+ 1209| ANTI-SPAM CONFIGURATION CONTROL | 1210+---------------------------------+ 1211 1212The primary anti-spam features available in sendmail are: 1213 1214* Relaying is denied by default. 1215* Better checking on sender information. 1216* Access database. 1217* Header checks. 1218 1219Relaying (transmission of messages from a site outside your domain to 1220another site outside your domain) is denied by default. Note that 1221this changed in sendmail 8.9; previous versions allowed relaying by 1222default. If you want to revert to the old behaviour, you will need 1223to use FEATURE(`promiscuous_relay'). You can allow certain domains to 1224relay through your server by adding their domain name or IP address to 1225class 'R' ($=R) using RELAY_DOMAIN() and RELAY_DOMAIN_FILE() or via the 1226access database (described below). 1227 1228If you use 1229 1230 FEATURE(`relay_entire_domain') 1231 1232then any host in any of your local domains (that is, the $=m class) 1233will be relayed (that is, you will accept mail either to or from any 1234host in your domain). 1235 1236You can also allow relaying based on the MX records of the host 1237portion of an incoming recipient address by using 1238 1239 FEATURE(`relay_based_on_MX') 1240 1241For example, if your server receives a recipient of user@domain.com 1242and domain.com lists your server in its MX records, the mail will be 1243accepted for relay to domain.com. Note that this will stop spammers 1244from using your host to relay spam but it will not stop outsiders from 1245using your server as a relay for their site (that is, they set up an 1246MX record pointing to your mail server, and you will relay mail addressed 1247to them without any prior arrangement). Along the same lines, 1248 1249 FEATURE(`relay_local_from') 1250 1251will allow relaying if the sender specifies a return path (i.e. 1252MAIL FROM: <user@domain>) domain which is a local domain. This a 1253dangerous feature as it will allow spammers to spam using your mail 1254server by simply specifying a return address of user@your.domain.com. 1255It should not be used unless absolutely necessary. 1256 1257If source routing is used in the recipient address (i.e. 1258RCPT TO: <user%site.com@othersite.com>), sendmail will check 1259user@site.com for relaying if othersite.com is an allowed relay host 1260in either class 'R', class 'm' if FEATURE(`relay_entire_domain') is used, 1261or the access database if FEATURE(`access_db') is used. To prevent 1262the address from being stripped down, use: 1263 1264 FEATURE(`loose_relay_check') 1265 1266If you think you need to use this feature, you probably do not. This 1267should only be used for sites which have no control over the addresses 1268that they provide a gateway for. Use this FEATURE with caution as it 1269can allow spammers to relay through your server if not setup properly. 1270 1271As of 8.9, sendmail will refuse mail if the MAIL FROM: parameter has 1272an unresolvable domain (i.e., one that DNS, your local name service, 1273or special case rules in ruleset 3 cannot locate). If you want to 1274continue to accept such domains, e.g. because you are inside a 1275firewall that has only a limited view of the Internet host name space 1276(note that you will not be able to return mail to them unless you have 1277some "smart host" forwarder), use 1278 1279 FEATURE(`accept_unresolvable_domains') 1280 1281sendmail will also refuse mail if the MAIL FROM: parameter is not 1282fully qualified (i.e., contains a domain as well as a user). If you 1283want to continue to accept such senders, use 1284 1285 FEATURE(`accept_unqualified_senders') 1286 1287An ``access'' database can be created to accept or reject mail from 1288selected domains. For example, you may choose to reject all mail 1289originating from known spammers. To enable such a database, use 1290 1291 FEATURE(`access_db') 1292 1293The FEATURE macro can accept a second parameter giving the key file 1294definition for the database; for example 1295 1296 FEATURE(`access_db', `hash -o /etc/mail/access') 1297 1298Remember, since /etc/mail/access is a database, after creating the text 1299file as described below, you must use makemap to create the database 1300map. For example: 1301 1302 makemap hash /etc/mail/access < /etc/mail/access 1303 1304The table itself uses e-mail addresses, domain names, and network 1305numbers as keys. For example, 1306 1307 spammer@aol.com REJECT 1308 cyberspammer.com REJECT 1309 192.168.212 REJECT 1310 1311would refuse mail from spammer@aol.com, any user from cyberspammer.com 1312(or any host within the cyberspammer.com domain), and any host on the 1313192.168.212.* network. 1314 1315The value part of the map can contain: 1316 1317 OK Accept mail even if other rules in the 1318 running ruleset would reject it, for example, 1319 if the domain name is unresolvable. 1320 RELAY Accept mail addressed to the indicated domain or 1321 received from the indicated domain for relaying 1322 through your SMTP server. RELAY also serves as 1323 an implicit OK for the other checks. 1324 REJECT Reject the sender or recipient with a general 1325 purpose message. 1326 DISCARD Discard the message completely using the 1327 $#discard mailer. This only works for sender 1328 addresses (i.e., it indicates that you should 1329 discard anything received from the indicated 1330 domain). 1331 ### any text where ### is an RFC 821 compliant error code 1332 and "any text" is a message to return for 1333 the command. 1334 1335For example: 1336 1337 cyberspammer.com 550 We don't accept mail from spammers 1338 okay.cyberspammer.com OK 1339 sendmail.org OK 1340 128.32 RELAY 1341 1342would accept mail from okay.cyberspammer.com, but would reject mail 1343from all other hosts at cyberspammer.com with the indicated message. 1344It would allow accept mail from any hosts in the sendmail.org domain, 1345and allow relaying for the 128.32.*.* network. Note, UUCP users may 1346need to add hostname.UUCP to the access database or class 'R' ($=R). 1347If you also use: 1348 1349 FEATURE(`relay_hosts_only') 1350 1351then the above example will allow relaying for sendmail.org, but not 1352hosts within the sendmail.org domain. Note that this will also require 1353hosts listed in class 'R' ($=R) to be fully qualified host names. 1354 1355You can also use the access database to block sender addresses based on 1356the username portion of the address. For example: 1357 1358 FREE.STEALTH.MAILER@ 550 Spam not accepted 1359 1360Note that you must include the @ after the username to signify that 1361this database entry is for checking only the username portion of the 1362sender address. 1363 1364If you use: 1365 1366 FEATURE(`blacklist_recipients') 1367 1368then you can add entries to the map for local users, hosts in your 1369domains, or addresses in your domain which should not receive mail: 1370 1371 badlocaluser 550 Mailbox disabled for this username 1372 host.mydomain.com 550 That host does not accept mail 1373 user@otherhost.mydomain.com 550 Mailbox disabled for this recipient 1374 1375This would prevent a recipient of badlocaluser@mydomain.com, any 1376user at host.mydomain.com, and the single address 1377user@otherhost.mydomain.com from receiving mail. Enabling this 1378feature will keep you from sending mails to all addresses that 1379have an error message or REJECT as value part in the access map. 1380Taking the example from above: 1381 1382 spammer@aol.com REJECT 1383 cyberspammer.com REJECT 1384 1385Mail can't be sent to spammer@aol.com or anyone at cyberspammer.com. 1386 1387There is also a ``Realtime Blackhole List'' run by the MAPS project 1388at http://maps.vix.com/. This is a database maintained in DNS of 1389spammers. To use this database, use 1390 1391 FEATURE(`rbl') 1392 1393This will cause sendmail to reject mail from any site in the 1394Realtime Blackhole List database. You can specify an alternative 1395RBL name server to contact by specifying an argument to the FEATURE. 1396 1397The features described above make use of the check_relay, check_mail, 1398and check_rcpt rulesets. If you wish to include your own checks, 1399you can put your checks in the rulesets Local_check_relay, 1400Local_check_mail, and Local_check_rcpt. For example if you wanted to 1401block senders with all numeric usernames (i.e. 2312343@bigisp.com), 1402you would use Local_check_mail and the new regex map: 1403 1404 LOCAL_CONFIG 1405 Kallnumbers regex -a@MATCH ^[0-9]+$ 1406 1407 LOCAL_RULESETS 1408 SLocal_check_mail 1409 # check address against various regex checks 1410 R$* $: $>Parse0 $>3 $1 1411 R$+ < @ bigisp.com. > $* $: $(allnumbers $1 $) 1412 R@MATCH $#error $: 553 Header Error 1413 1414These rules are called with the original arguments of the corresponding 1415check_* ruleset. If the local ruleset returns $#OK, no further checking 1416is done by the features described above and the mail is accepted. If the 1417local ruleset resolves to a mailer (such as $#error or $#discard), the 1418appropriate action is taken. Otherwise, the results of the local 1419rewriting are ignored. 1420 1421 1422You can also reject mail on the basis of the contents of headers. 1423This is done by adding a ruleset call to the 'H' header definition command 1424in sendmail.cf. For example, this can be used to check the validity of 1425a Message-ID: header: 1426 1427 LOCAL_RULESETS 1428 HMessage-Id: $>CheckMessageId 1429 1430 SCheckMessageId 1431 R< $+ @ $+ > $@ OK 1432 R$* $#error $: 553 Header Error 1433 1434Users of FEATURE(`nullclient') who desire to use the anti-spam and 1435anti-relaying capabilities should replace FEATURE(`nullclient', `mailhub') 1436with: 1437 1438 undefine(`ALIAS_FILE') 1439 define(`MAIL_HUB', `mailhub') 1440 define(`SMART_HOST', `mailhub') 1441 define(`confFORWARD_PATH', `') 1442 1443where mailhub is the fully qualified hostname for their mail server. 1444The above rules will provide the relaying to the mailhub without local 1445alias and forward file expansion. To match the other behavior of 1446FEATURE(`nullclient'), you should also add these lines along with those 1447listed above: 1448 1449 MASQUERADE_AS(`mailhub') 1450 FEATURE(`allmasquerade') 1451 FEATURE(`masquerade_envelope') 1452 1453 1454+--------------------------------+ 1455| ADDING NEW MAILERS OR RULESETS | 1456+--------------------------------+ 1457 1458Sometimes you may need to add entirely new mailers or rulesets. They 1459should be introduced with the constructs MAILER_DEFINITIONS and 1460LOCAL_RULESETS respectively. For example: 1461 1462 MAILER_DEFINITIONS 1463 Mmymailer, ... 1464 ... 1465 1466 LOCAL_RULESETS 1467 Smyruleset 1468 ... 1469 1470 1471+-------------------------------+ 1472| NON-SMTP BASED CONFIGURATIONS | 1473+-------------------------------+ 1474 1475These configuration files are designed primarily for use by SMTP-based 1476sites. I don't pretend that they are well tuned for UUCP-only or 1477UUCP-primarily nodes (the latter is defined as a small local net 1478connected to the rest of the world via UUCP). However, there is one 1479hook to handle some special cases. 1480 1481You can define a ``smart host'' that understands a richer address syntax 1482using: 1483 1484 define(`SMART_HOST', `mailer:hostname') 1485 1486In this case, the ``mailer:'' defaults to "relay". Any messages that 1487can't be handled using the usual UUCP rules are passed to this host. 1488 1489If you are on a local SMTP-based net that connects to the outside 1490world via UUCP, you can use LOCAL_NET_CONFIG to add appropriate rules. 1491For example: 1492 1493 define(`SMART_HOST', `suucp:uunet') 1494 LOCAL_NET_CONFIG 1495 R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 1496 1497This will cause all names that end in your domain name ($m) via 1498SMTP; anything else will be sent via suucp (smart UUCP) to uunet. 1499If you have FEATURE(`nocanonify'), you may need to omit the dots after 1500the $m. If you are running a local DNS inside your domain which is 1501not otherwise connected to the outside world, you probably want to 1502use: 1503 1504 define(`SMART_HOST', `smtp:fire.wall.com') 1505 LOCAL_NET_CONFIG 1506 R$* < @ $* . > $* $#smtp $@ $2. $: $1 < @ $2. > $3 1507 1508That is, send directly only to things you found in your DNS lookup; 1509anything else goes through SMART_HOST. 1510 1511You may need to turn off the anti-spam rules in order to accept 1512UUCP mail with FEATURE(`promiscuous_relay') and 1513FEATURE(`accept_unresolvable_domains'). 1514 1515 1516+-----------+ 1517| WHO AM I? | 1518+-----------+ 1519 1520Normally, the $j macro is automatically defined to be your fully 1521qualified domain name (FQDN). Sendmail does this by getting your 1522host name using gethostname and then calling gethostbyname on the 1523result. For example, in some environments gethostname returns 1524only the root of the host name (such as "foo"); gethostbyname is 1525supposed to return the FQDN ("foo.bar.com"). In some (fairly rare) 1526cases, gethostbyname may fail to return the FQDN. In this case 1527you MUST define confDOMAIN_NAME to be your fully qualified domain 1528name. This is usually done using: 1529 1530 Dmbar.com 1531 define(`confDOMAIN_NAME', `$w.$m')dnl 1532 1533 1534+--------------------+ 1535| USING MAILERTABLES | 1536+--------------------+ 1537 1538To use FEATURE(`mailertable'), you will have to create an external 1539database containing the routing information for various domains. 1540For example, a mailertable file in text format might be: 1541 1542 .my.domain xnet:%1.my.domain 1543 uuhost1.my.domain suucp:uuhost1 1544 .bitnet smtp:relay.bit.net 1545 1546This should normally be stored in /etc/mailertable. The actual 1547database version of the mailertable is built using: 1548 1549 makemap hash /etc/mailertable.db < /etc/mailertable 1550 1551The semantics are simple. Any LHS entry that does not begin with 1552a dot matches the full host name indicated. LHS entries beginning 1553with a dot match anything ending with that domain name -- that is, 1554they can be thought of as having a leading "*" wildcard. Matching 1555is done in order of most-to-least qualified -- for example, even 1556though ".my.domain" is listed first in the above example, an entry 1557of "uuhost1.my.domain" will match the second entry since it is 1558more explicit. 1559 1560The RHS should always be a "mailer:host" pair. The mailer is the 1561configuration name of a mailer (that is, an `M' line in the 1562sendmail.cf file). The "host" will be the hostname passed to 1563that mailer. In domain-based matches (that is, those with leading 1564dots) the "%1" may be used to interpolate the wildcarded part of 1565the host name. For example, the first line above sends everything 1566addressed to "anything.my.domain" to that same host name, but using 1567the (presumably experimental) xnet mailer. 1568 1569In some cases you may want to temporarily turn off MX records, 1570particularly on gateways. For example, you may want to MX 1571everything in a domain to one machine that then forwards it 1572directly. To do this, you might use the DNS configuration: 1573 1574 *.domain. IN MX 0 relay.machine 1575 1576and on relay.machine use the mailertable: 1577 1578 .domain smtp:[gateway.domain] 1579 1580The [square brackets] turn off MX records for this host only. 1581If you didn't do this, the mailertable would use the MX record 1582again, which would give you an MX loop. 1583 1584 1585+--------------------------------+ 1586| USING USERDB TO MAP FULL NAMES | 1587+--------------------------------+ 1588 1589The user database was not originally intended for mapping full names 1590to login names (e.g., Eric.Allman => eric), but some people are using 1591it that way. (I would recommend that you set up aliases for this 1592purpose instead -- since you can specify multiple alias files, this 1593is fairly easy.) The intent was to locate the default maildrop at 1594a site, but allow you to override this by sending to a specific host. 1595 1596If you decide to set up the user database in this fashion, it is 1597imperative that you not use FEATURE(`stickyhost') -- otherwise, 1598e-mail sent to Full.Name@local.host.name will be rejected. 1599 1600To build the internal form of the user database, use: 1601 1602 makemap btree /usr/data/base.db < /usr/data/base.txt 1603 1604As a general rule, I am adamantly opposed to using full names as 1605e-mail addresses, since they are not in any sense unique. For example, 1606the Unix software-development community has two Andy Tannenbaums, 1607at least two well-known Peter Deutsches, and at one time Bell Labs 1608had two Stephen R. Bournes with offices along the same hallway. 1609Which one will be forced to suffer the indignity of being 1610Stephen_R_Bourne_2? The less famous of the two, or the one that 1611was hired later? 1612 1613Finger should handle full names (and be fuzzy). Mail should use 1614handles, and not be fuzzy. [Not that I expect anyone to pay any 1615attention to my opinions.] 1616 1617 1618+--------------------------------+ 1619| MISCELLANEOUS SPECIAL FEATURES | 1620+--------------------------------+ 1621 1622Plussed users 1623 Sometimes it is convenient to merge configuration on a 1624 centralized mail machine, for example, to forward all 1625 root mail to a mail server. In this case it might be 1626 useful to be able to treat the root addresses as a class 1627 of addresses with subtle differences. You can do this 1628 using plussed users. For example, a client might include 1629 the alias: 1630 1631 root: root+client1@server 1632 1633 On the server, this will match an alias for "root+client1". 1634 If that is not found, the alias "root+*" will be tried, 1635 then "root". 1636 1637LDAP 1638 For notes on use LDAP in sendmail, see 1639 http://www.stanford.edu/~bbense/Inst.html 1640 1641 1642 1643+----------------+ 1644| SECURITY NOTES | 1645+----------------+ 1646 1647A lot of sendmail security comes down to you. Sendmail 8 is much 1648more careful about checking for security problems than previous 1649versions, but there are some things that you still need to watch 1650for. In particular: 1651 1652* Make sure the aliases file isn't writable except by trusted 1653 system personnel. This includes both the text and database 1654 version. 1655 1656* Make sure that other files that sendmail reads, such as the 1657 mailertable, are only writable by trusted system personnel. 1658 1659* The queue directory should not be world writable PARTICULARLY 1660 if your system allows "file giveaways" (that is, if a non-root 1661 user can chown any file they own to any other user). 1662 1663* If your system allows file giveaways, DO NOT create a publically 1664 writable directory for forward files. This will allow anyone 1665 to steal anyone else's e-mail. Instead, create a script that 1666 copies the .forward file from users' home directories once a 1667 night (if you want the non-NFS-mounted forward directory). 1668 1669* If your system allows file giveaways, you'll find that 1670 sendmail is much less trusting of :include: files -- in 1671 particular, you'll have to have /SENDMAIL/ANY/SHELL/ in 1672 /etc/shells before they will be trusted (that is, before 1673 files and programs listed in them will be honored). 1674 1675In general, file giveaways are a mistake -- if you can turn them 1676off I recommend you do so. 1677 1678 1679+--------------------------------+ 1680| TWEAKING CONFIGURATION OPTIONS | 1681+--------------------------------+ 1682 1683There are a large number of configuration options that don't normally 1684need to be changed. However, if you feel you need to tweak them, you 1685can define the following M4 variables. This list is shown in four 1686columns: the name you define, the default value for that definition, 1687the option or macro that is affected (either Ox for an option or Dx 1688for a macro), and a brief description. Greater detail of the semantics 1689can be found in the Installation and Operations Guide. 1690 1691Some options are likely to be deprecated in future versions -- that is, 1692the option is only included to provide back-compatibility. These are 1693marked with "*". 1694 1695Remember that these options are M4 variables, and hence may need to 1696be quoted. In particular, arguments with commas will usually have to 1697be ``double quoted, like this phrase'' to avoid having the comma 1698confuse things. This is common for alias file definitions and for 1699the read timeout. 1700 1701M4 Variable Name Configuration Description & [Default] 1702================ ============= ======================= 1703confMAILER_NAME $n macro [MAILER-DAEMON] The sender name used 1704 for internally generated outgoing 1705 messages. 1706confDOMAIN_NAME $j macro If defined, sets $j. This should 1707 only be done if your system cannot 1708 determine your local domain name, 1709 and then it should be set to 1710 $w.Foo.COM, where Foo.COM is your 1711 domain name. 1712confCF_VERSION $Z macro If defined, this is appended to the 1713 configuration version name. 1714confFROM_HEADER From: [$?x$x <$g>$|$g$.] The format of an 1715 internally generated From: address. 1716confRECEIVED_HEADER Received: 1717 [$?sfrom $s $.$?_($?s$|from $.$_) 1718 $.by $j ($v/$Z)$?r with $r$. id $i$?u 1719 for $u; $|; 1720 $.$b] 1721 The format of the Received: header 1722 in messages passed through this host. 1723 It is unwise to try to change this. 1724confCW_FILE Fw class [/etc/sendmail.cw] Name of file used 1725 to get the local additions to the $=w 1726 (local host names) class. 1727confCT_FILE Ft class [/etc/sendmail.ct] Name of file used 1728 to get the local additions to the $=t 1729 (trusted users) class. 1730confCR_FILE FR class [/etc/mail/relay-domains] Name of 1731 file used to get the local additions 1732 to the $=R (hosts allowed to relay) 1733 class. 1734confTRUSTED_USERS Ct class [no default] Names of users to add to 1735 the list of trusted users. This list 1736 always includes root, uucp, and daemon. 1737 See also FEATURE(`use_ct_file'). 1738confSMTP_MAILER - [esmtp] The mailer name used when 1739 SMTP connectivity is required. 1740 One of "smtp", "smtp8", or "esmtp". 1741confUUCP_MAILER - [uucp-old] The mailer to be used by 1742 default for bang-format recipient 1743 addresses. See also discussion of 1744 $=U, $=Y, and $=Z in the MAILER(uucp) 1745 section. 1746confLOCAL_MAILER - [local] The mailer name used when 1747 local connectivity is required. 1748 Almost always "local". 1749confRELAY_MAILER - [relay] The default mailer name used 1750 for relaying any mail (e.g., to a 1751 BITNET_RELAY, a SMART_HOST, or 1752 whatever). This can reasonably be 1753 "uucp-new" if you are on a 1754 UUCP-connected site. 1755confSEVEN_BIT_INPUT SevenBitInput [False] Force input to seven bits? 1756confEIGHT_BIT_HANDLING EightBitMode [pass8] 8-bit data handling 1757confALIAS_WAIT AliasWait [10m] Time to wait for alias file 1758 rebuild until you get bored and 1759 decide that the apparently pending 1760 rebuild failed. 1761confMIN_FREE_BLOCKS MinFreeBlocks [100] Minimum number of free blocks on 1762 queue filesystem to accept SMTP mail. 1763 (Prior to 8.7 this was minfree/maxsize, 1764 where minfree was the number of free 1765 blocks and maxsize was the maximum 1766 message size. Use confMAX_MESSAGE_SIZE 1767 for the second value now.) 1768confMAX_MESSAGE_SIZE MaxMessageSize [infinite] The maximum size of messages 1769 that will be accepted (in bytes). 1770confBLANK_SUB BlankSub [.] Blank (space) substitution 1771 character. 1772confCON_EXPENSIVE HoldExpensive [False] Avoid connecting immediately 1773 to mailers marked expensive? 1774confCHECKPOINT_INTERVAL CheckpointInterval 1775 [10] Checkpoint queue files every N 1776 recipients. 1777confDELIVERY_MODE DeliveryMode [background] Default delivery mode. 1778confAUTO_REBUILD AutoRebuildAliases 1779 [False] Automatically rebuild alias 1780 file if needed. 1781confERROR_MODE ErrorMode [print] Error message mode. 1782confERROR_MESSAGE ErrorHeader [undefined] Error message header/file. 1783confSAVE_FROM_LINES SaveFromLine Save extra leading From_ lines. 1784confTEMP_FILE_MODE TempFileMode [0600] Temporary file mode. 1785confMATCH_GECOS MatchGECOS [False] Match GECOS field. 1786confMAX_HOP MaxHopCount [25] Maximum hop count. 1787confIGNORE_DOTS* IgnoreDots [False; always False in -bs or -bd mode] 1788 Ignore dot as terminator for incoming 1789 messages? 1790confBIND_OPTS ResolverOptions [undefined] Default options for DNS 1791 resolver. 1792confMIME_FORMAT_ERRORS* SendMimeErrors [True] Send error messages as MIME- 1793 encapsulated messages per RFC 1344. 1794confFORWARD_PATH ForwardPath [$z/.forward.$w:$z/.forward] 1795 The colon-separated list of places to 1796 search for .forward files. N.B.: see 1797 the Security Notes section. 1798confMCI_CACHE_SIZE ConnectionCacheSize 1799 [2] Size of open connection cache. 1800confMCI_CACHE_TIMEOUT ConnectionCacheTimeout 1801 [5m] Open connection cache timeout. 1802confHOST_STATUS_DIRECTORY HostStatusDirectory 1803 [undefined] If set, host status is kept 1804 on disk between sendmail runs in the 1805 named directory tree. This need not be 1806 a full pathname, in which case it is 1807 interpreted relative to the queue 1808 directory. 1809confSINGLE_THREAD_DELIVERY SingleThreadDelivery 1810 [False] If this option and the 1811 HostStatusDirectory option are both 1812 set, single thread deliveries to other 1813 hosts. That is, don't allow any two 1814 sendmails on this host to connect 1815 simultaneously to any other single 1816 host. This can slow down delivery in 1817 some cases, in particular since a 1818 cached but otherwise idle connection 1819 to a host will prevent other sendmails 1820 from connecting to the other host. 1821confUSE_ERRORS_TO* UserErrorsTo [False] Use the Errors-To: header to 1822 deliver error messages. This should 1823 not be necessary because of general 1824 acceptance of the envelope/header 1825 distinction. 1826confLOG_LEVEL LogLevel [9] Log level. 1827confME_TOO MeToo [False] Include sender in group 1828 expansions. 1829confCHECK_ALIASES CheckAliases [False] Check RHS of aliases when 1830 running newaliases. Since this does 1831 DNS lookups on every address, it can 1832 slow down the alias rebuild process 1833 considerably on large alias files. 1834confOLD_STYLE_HEADERS* OldStyleHeaders [True] Assume that headers without 1835 special chars are old style. 1836confDAEMON_OPTIONS DaemonPortOptions 1837 [none] SMTP daemon options. 1838confPRIVACY_FLAGS PrivacyOptions [authwarnings] Privacy flags. 1839confCOPY_ERRORS_TO PostmasterCopy [undefined] Address for additional 1840 copies of all error messages. 1841confQUEUE_FACTOR QueueFactor [600000] Slope of queue-only function. 1842confDONT_PRUNE_ROUTES DontPruneRoutes [False] Don't prune down route-addr 1843 syntax addresses to the minimum 1844 possible. 1845confSAFE_QUEUE* SuperSafe [True] Commit all messages to disk 1846 before forking. 1847confTO_INITIAL Timeout.initial [5m] The timeout waiting for a response 1848 on the initial connect. 1849confTO_CONNECT Timeout.connect [0] The timeout waiting for an initial 1850 connect() to complete. This can only 1851 shorten connection timeouts; the kernel 1852 silently enforces an absolute maximum 1853 (which varies depending on the system). 1854confTO_ICONNECT Timeout.iconnect 1855 [undefined] Like Timeout.connect, but 1856 applies only to the very first attempt 1857 to connect to a host in a message. 1858 This allows a single very fast pass 1859 followed by more careful delivery 1860 attempts in the future. 1861confTO_HELO Timeout.helo [5m] The timeout waiting for a response 1862 to a HELO or EHLO command. 1863confTO_MAIL Timeout.mail [10m] The timeout waiting for a 1864 response to the MAIL command. 1865confTO_RCPT Timeout.rcpt [1h] The timeout waiting for a response 1866 to the RCPT command. 1867confTO_DATAINIT Timeout.datainit 1868 [5m] The timeout waiting for a 354 1869 response from the DATA command. 1870confTO_DATABLOCK Timeout.datablock 1871 [1h] The timeout waiting for a block 1872 during DATA phase. 1873confTO_DATAFINAL Timeout.datafinal 1874 [1h] The timeout waiting for a response 1875 to the final "." that terminates a 1876 message. 1877confTO_RSET Timeout.rset [5m] The timeout waiting for a response 1878 to the RSET command. 1879confTO_QUIT Timeout.quit [2m] The timeout waiting for a response 1880 to the QUIT command. 1881confTO_MISC Timeout.misc [2m] The timeout waiting for a response 1882 to other SMTP commands. 1883confTO_COMMAND Timeout.command [1h] In server SMTP, the timeout waiting 1884 for a command to be issued. 1885confTO_IDENT Timeout.ident [30s] The timeout waiting for a response 1886 to an IDENT query. 1887confTO_FILEOPEN Timeout.fileopen 1888 [60s] The timeout waiting for a file 1889 (e.g., :include: file) to be opened. 1890confTO_QUEUERETURN Timeout.queuereturn 1891 [5d] The timeout before a message is 1892 returned as undeliverable. 1893confTO_QUEUERETURN_NORMAL 1894 Timeout.queuereturn.normal 1895 [undefined] As above, for normal 1896 priority messages. 1897confTO_QUEUERETURN_URGENT 1898 Timeout.queuereturn.urgent 1899 [undefined] As above, for urgent 1900 priority messages. 1901confTO_QUEUERETURN_NONURGENT 1902 Timeout.queuereturn.non-urgent 1903 [undefined] As above, for non-urgent 1904 (low) priority messages. 1905confTO_QUEUEWARN Timeout.queuewarn 1906 [4h] The timeout before a warning 1907 message is sent to the sender telling 1908 them that the message has been deferred. 1909confTO_QUEUEWARN_NORMAL Timeout.queuewarn.normal 1910 [undefined] As above, for normal 1911 priority messages. 1912confTO_QUEUEWARN_URGENT Timeout.queuewarn.urgent 1913 [undefined] As above, for urgent 1914 priority messages. 1915confTO_QUEUEWARN_NONURGENT 1916 Timeout.queuewarn.non-urgent 1917 [undefined] As above, for non-urgent 1918 (low) priority messages. 1919confTO_HOSTSTATUS Timeout.hoststatus 1920 [30m] How long information about host 1921 statuses will be maintained before it 1922 is considered stale and the host should 1923 be retried. This applies both within 1924 a single queue run and to persistent 1925 information (see below). 1926confTIME_ZONE TimeZoneSpec [USE_SYSTEM] Time zone info -- can be 1927 USE_SYSTEM to use the system's idea, 1928 USE_TZ to use the user's TZ envariable, 1929 or something else to force that value. 1930confDEF_USER_ID DefaultUser [1:1] Default user id. 1931confUSERDB_SPEC UserDatabaseSpec 1932 [undefined] User database specification. 1933confFALLBACK_MX FallbackMXhost [undefined] Fallback MX host. 1934confTRY_NULL_MX_LIST TryNullMXList [False] If we are the best MX for a 1935 host and haven't made other 1936 arrangements, try connecting to the 1937 host directly; normally this would be 1938 a config error. 1939confQUEUE_LA QueueLA [8] Load average at which queue-only 1940 function kicks in. 1941confREFUSE_LA RefuseLA [12] Load average at which incoming 1942 SMTP connections are refused. 1943confMAX_DAEMON_CHILDREN MaxDaemonChildren 1944 [undefined] The maximum number of 1945 children the daemon will permit. After 1946 this number, connections will be 1947 rejected. If not set or <= 0, there is 1948 no limit. 1949confCONNECTION_RATE_THROTTLE ConnectionRateThrottle 1950 [undefined] The maximum number of 1951 connections permitted per second. 1952 After this many connections are 1953 accepted, further connections will be 1954 delayed. If not set or <= 0, there is 1955 no limit. 1956confWORK_RECIPIENT_FACTOR 1957 RecipientFactor [30000] Cost of each recipient. 1958confSEPARATE_PROC ForkEachJob [False] Run all deliveries in a separate 1959 process. 1960confWORK_CLASS_FACTOR ClassFactor [1800] Priority multiplier for class. 1961confWORK_TIME_FACTOR RetryFactor [90000] Cost of each delivery attempt. 1962confQUEUE_SORT_ORDER QueueSortOrder [Priority] Queue sort algorithm: 1963 Priority, Host, or Time. 1964confMIN_QUEUE_AGE MinQueueAge [0] The minimum amount of time a job 1965 must sit in the queue between queue 1966 runs. This allows you to set the 1967 queue run interval low for better 1968 responsiveness without trying all 1969 jobs in each run. 1970confDEF_CHAR_SET DefaultCharSet [unknown-8bit] When converting 1971 unlabeled 8 bit input to MIME, the 1972 character set to use by default. 1973confSERVICE_SWITCH_FILE ServiceSwitchFile 1974 [/etc/service.switch] The file to use 1975 for the service switch on systems that 1976 do not have a system-defined switch. 1977confHOSTS_FILE HostsFile [/etc/hosts] The file to use when doing 1978 "file" type access of hosts names. 1979confDIAL_DELAY DialDelay [0s] If a connection fails, wait this 1980 long and try again. Zero means "don't 1981 retry". This is to allow "dial on 1982 demand" connections to have enough time 1983 to complete a connection. 1984confNO_RCPT_ACTION NoRecipientAction 1985 [none] What to do if there are no legal 1986 recipient fields (To:, Cc: or Bcc:) 1987 in the message. Legal values can 1988 be "none" to just leave the 1989 nonconforming message as is, "add-to" 1990 to add a To: header with all the 1991 known recipients (which may expose 1992 blind recipients), "add-apparently-to" 1993 to do the same but use Apparently-To: 1994 instead of To:, "add-bcc" to add an 1995 empty Bcc: header, or 1996 "add-to-undisclosed" to add the header 1997 ``To: undisclosed-recipients:;''. 1998confSAFE_FILE_ENV SafeFileEnvironment 1999 [undefined] If set, sendmail will do a 2000 chroot() into this directory before 2001 writing files. 2002confCOLON_OK_IN_ADDR ColonOkInAddr [True unless Configuration Level > 6] 2003 If set, colons are treated as a regular 2004 character in addresses. If not set, 2005 they are treated as the introducer to 2006 the RFC 822 "group" syntax. Colons are 2007 handled properly in route-addrs. This 2008 option defaults on for V5 and lower 2009 configuration files. 2010confMAX_QUEUE_RUN_SIZE MaxQueueRunSize [0] If set, limit the maximum size of 2011 any given queue run to this number of 2012 entries. Essentially, this will stop 2013 reading the queue directory after this 2014 number of entries are reached; it does 2015 _not_ pick the highest priority jobs, 2016 so this should be as large as your 2017 system can tolerate. If not set, there 2018 is no limit. 2019confDONT_EXPAND_CNAMES DontExpandCnames 2020 [False] If set, $[ ... $] lookups that 2021 do DNS based lookups do not expand 2022 CNAME records. This currently violates 2023 the published standards, but the IETF 2024 seems to be moving toward legalizing 2025 this. For example, if "FTP.Foo.ORG" 2026 is a CNAME for "Cruft.Foo.ORG", then 2027 with this option set a lookup of 2028 "FTP" will return "FTP.Foo.ORG"; if 2029 clear it returns "Cruft.FOO.ORG". N.B. 2030 you may not see any effect until your 2031 downstream neighbors stop doing CNAME 2032 lookups as well. 2033confFROM_LINE UnixFromLine [From $g $d] The From_ line used 2034 when sending to files or programs. 2035confSINGLE_LINE_FROM_HEADER SingleLineFromHeader 2036 [False] From: lines that have 2037 embedded newlines are unwrapped 2038 onto one line. 2039confALLOW_BOGUS_HELO AllowBogusHELO [False] Allow HELO SMTP command that 2040 does not include a host name. 2041confMUST_QUOTE_CHARS MustQuoteChars [.'] Characters to be quoted in a full 2042 name phrase (@,;:\()[] are automatic). 2043confOPERATORS OperatorChars [.:%@!^/[]+] Address operator 2044 characters. 2045confSMTP_LOGIN_MSG SmtpGreetingMessage 2046 [$j Sendmail $v/$Z; $b] 2047 The initial (spontaneous) SMTP 2048 greeting message. The word "ESMTP" 2049 will be inserted between the first and 2050 second words to convince other 2051 sendmails to try to speak ESMTP. 2052confDONT_INIT_GROUPS DontInitGroups [False] If set, the initgroups(3) 2053 routine will never be invoked. You 2054 might want to do this if you are 2055 running NIS and you have a large group 2056 map, since this call does a sequential 2057 scan of the map; in a large site this 2058 can cause your ypserv to run 2059 essentially full time. If you set 2060 this, agents run on behalf of users 2061 will only have their primary 2062 (/etc/passwd) group permissions. 2063confUNSAFE_GROUP_WRITES UnsafeGroupWrites 2064 [False] If set, group-writable 2065 :include: and .forward files are 2066 considered "unsafe", that is, programs 2067 and files cannot be directly referenced 2068 from such files. World-writable files 2069 are always considered unsafe. 2070confDOUBLE_BOUNCE_ADDRESS DoubleBounceAddress 2071 [postmaster] If an error occurs when 2072 sending an error message, send that 2073 "double bounce" error message to this 2074 address. 2075confRUN_AS_USER RunAsUser [undefined] If set, become this user 2076 when reading and delivering mail. 2077 Causes all file reads (e.g., .forward 2078 and :include: files) to be done as 2079 this user. Also, all programs will 2080 be run as this user, and all output 2081 files will be written as this user. 2082 Intended for use only on firewalls 2083 where users do not have accounts. 2084confMAX_RCPTS_PER_MESSAGE MaxRecipientsPerMessage 2085 [infinite] If set, allow no more than 2086 the specified number of recipients in 2087 an SMTP envelope. Further recipients 2088 receive a 452 error code (i.e., they 2089 are deferred for the next delivery 2090 attempt). 2091confDONT_PROBE_INTERFACES DontProbeInterfaces 2092 [False] If set, sendmail will _not_ 2093 insert the names and addresses of any 2094 local interfaces into the $=w class 2095 (list of known "equivalent" addresses). 2096 If you set this, you must also include 2097 some support for these addresses (e.g., 2098 in a mailertable entry) -- otherwise, 2099 mail to addresses in this list will 2100 bounce with a configuration error. 2101confDONT_BLAME_SENDMAIL DontBlameSendmail 2102 [safe] Override sendmail's file 2103 safety checks. This will definitely 2104 compromise system security and should 2105 not be used unless absolutely 2106 necessary. 2107confREJECT_MSG - [550 Access denied] The message 2108 given if the access database contains 2109 REJECT in the value portion. 2110 2111See also the description of OSTYPE for some parameters that can be 2112tweaked (generally pathnames to mailers). 2113 2114 2115+-----------+ 2116| HIERARCHY | 2117+-----------+ 2118 2119Within this directory are several subdirectories, to wit: 2120 2121m4 General support routines. These are typically 2122 very important and should not be changed without 2123 very careful consideration. 2124 2125cf The configuration files themselves. They have 2126 ".mc" suffixes, and must be run through m4 to 2127 become complete. The resulting output should 2128 have a ".cf" suffix. 2129 2130ostype Definitions describing a particular operating 2131 system type. These should always be referenced 2132 using the OSTYPE macro in the .mc file. Examples 2133 include "bsd4.3", "bsd4.4", "sunos3.5", and 2134 "sunos4.1". 2135 2136domain Definitions describing a particular domain, referenced 2137 using the DOMAIN macro in the .mc file. These are 2138 site dependent; for example, "CS.Berkeley.EDU.m4" 2139 describes hosts in the CS.Berkeley.EDU subdomain. 2140 2141mailer Descriptions of mailers. These are referenced using 2142 the MAILER macro in the .mc file. 2143 2144sh Shell files used when building the .cf file from the 2145 .mc file in the cf subdirectory. 2146 2147feature These hold special orthogonal features that you might 2148 want to include. They should be referenced using 2149 the FEATURE macro. 2150 2151hack Local hacks. These can be referenced using the HACK 2152 macro. They shouldn't be of more than voyeuristic 2153 interest outside the .Berkeley.EDU domain, but who knows? 2154 We've all got our own peccadillos. 2155 2156siteconfig Site configuration -- e.g., tables of locally connected 2157 UUCP sites. 2158 2159 2160+------------------------+ 2161| ADMINISTRATIVE DETAILS | 2162+------------------------+ 2163 2164The following sections detail usage of certain internal parts of the 2165sendmail.cf file. Read them carefully if you are trying to modify 2166the current model. If you find the above descriptions adequate, these 2167should be {boring, confusing, tedious, ridiculous} (pick one or more). 2168 2169RULESETS (* means built in to sendmail) 2170 2171 0 * Parsing 2172 1 * Sender rewriting 2173 2 * Recipient rewriting 2174 3 * Canonicalization 2175 4 * Post cleanup 2176 5 * Local address rewrite (after aliasing) 2177 1x mailer rules (sender qualification) 2178 2x mailer rules (recipient qualification) 2179 3x mailer rules (sender header qualification) 2180 4x mailer rules (recipient header qualification) 2181 5x mailer subroutines (general) 2182 6x mailer subroutines (general) 2183 7x mailer subroutines (general) 2184 8x reserved 2185 90 Mailertable host stripping 2186 96 Bottom half of Ruleset 3 (ruleset 6 in old sendmail) 2187 97 Hook for recursive ruleset 0 call (ruleset 7 in old sendmail) 2188 98 Local part of ruleset 0 (ruleset 8 in old sendmail) 2189 99 Guaranteed null (for debugging) 2190 2191 2192MAILERS 2193 2194 0 local, prog local and program mailers 2195 1 [e]smtp, relay SMTP channel 2196 2 uucp-* UNIX-to-UNIX Copy Program 2197 3 netnews Network News delivery 2198 4 fax Sam Leffler's HylaFAX software 2199 5 mail11 DECnet mailer 2200 2201 2202MACROS 2203 2204 A 2205 B Bitnet Relay 2206 C DECnet Relay 2207 D The local domain -- usually not needed 2208 E reserved for X.400 Relay 2209 F FAX Relay 2210 G 2211 H mail Hub (for mail clusters) 2212 I 2213 J 2214 K 2215 L Luser Relay 2216 M Masquerade (who I claim to be) 2217 N 2218 O 2219 P 2220 Q 2221 R Relay (for unqualified names) 2222 S Smart Host 2223 T 2224 U my UUCP name (if I have a UUCP connection) 2225 V UUCP Relay (class V hosts) 2226 W UUCP Relay (class W hosts) 2227 X UUCP Relay (class X hosts) 2228 Y UUCP Relay (all other hosts) 2229 Z Version number 2230 2231 2232CLASSES 2233 2234 A 2235 B domains that are candidates for bestmx lookup 2236 C 2237 D 2238 E addresses that should not seem to come from $M 2239 F hosts we forward for 2240 G domains that should be looked up in genericstable 2241 H 2242 I 2243 J 2244 K 2245 L addresses that should not be forwarded to $R 2246 M domains that should be mapped to $M 2247 N 2248 O operators that indicate network operations (cannot be in local names) 2249 P top level pseudo-domains: BITNET, DECNET, FAX, UUCP, etc. 2250 Q 2251 R domains we are willing to relay (pass anti-spam filters) 2252 S 2253 T 2254 U locally connected UUCP hosts 2255 V UUCP hosts connected to relay $V 2256 W UUCP hosts connected to relay $W 2257 X UUCP hosts connected to relay $X 2258 Y locally connected smart UUCP hosts 2259 Z locally connected domain-ized UUCP hosts 2260 . the class containing only a dot 2261 [ the class containing only a left bracket 2262 2263 2264M4 DIVERSIONS 2265 2266 1 Local host detection and resolution 2267 2 Local Ruleset 3 additions 2268 3 Local Ruleset 0 additions 2269 4 UUCP Ruleset 0 additions 2270 5 locally interpreted names (overrides $R) 2271 6 local configuration (at top of file) 2272 7 mailer definitions 2273 8 2274 9 special local rulesets (1 and 2) 2275