1# 2# Copyright (c) 1983 Eric P. Allman 3# Copyright (c) 1988, 1993 4# The Regents of the University of California. All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: 9# 1. Redistributions of source code must retain the above copyright 10# notice, this list of conditions and the following disclaimer. 11# 2. Redistributions in binary form must reproduce the above copyright 12# notice, this list of conditions and the following disclaimer in the 13# documentation and/or other materials provided with the distribution. 14# 3. All advertising materials mentioning features or use of this software 15# must display the following acknowledgement: 16# This product includes software developed by the University of 17# California, Berkeley and its contributors. 18# 4. Neither the name of the University nor the names of its contributors 19# may be used to endorse or promote products derived from this software 20# without specific prior written permission. 21# 22# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32# SUCH DAMAGE. 33# 34 35 36###################################################################### 37###################################################################### 38##### 39##### SENDMAIL CONFIGURATION FILE 40##### 41##### built by eric@vangogh.CS.Berkeley.EDU on Mon Apr 18 22:20:59 PDT 1994 42##### in /usr/src/usr.sbin/sendmail/cf/cf 43##### 44###################################################################### 45###################################################################### 46 47##### @(#)cf.m4 8.4 (Berkeley) 12/24/93 ##### 48 49##### @(#)ultrix4.1-cs-hidden.mc 8.1 (Berkeley) 6/7/93 ##### 50 51##### @(#)ultrix4.1.m4 8.1 (Berkeley) 6/7/93 ##### 52 53##### @(#)cs.hidden.m4 8.1 (Berkeley) 6/7/93 ##### 54 55##### @(#)cs.exposed.m4 8.1 (Berkeley) 6/7/93 ##### 56 57##### @(#)Berkeley.m4 8.5 (Berkeley) 2/18/94 ##### 58 59##### @(#)redirect.m4 8.2 (Berkeley) 12/27/93 ##### 60 61 62 63 64##### @(#)use_cw_file.m4 8.1 (Berkeley) 6/7/93 ##### 65 66 67##### @(#)cssubdomain.m4 8.1 (Berkeley) 6/7/93 ##### 68 69 70 71 72##### @(#)proto.m4 8.45 (Berkeley) 3/4/94 ##### 73 74 75# level 5 config file format 76V5 77 78################## 79# local info # 80################## 81 82Cwlocalhost 83# file containing names of hosts for which we receive email 84Fw-o /etc/sendmail.cw 85 86 87CP. 88 89# UUCP relay host 90DYucbvax.Berkeley.EDU 91CPUUCP 92 93# BITNET relay host 94DBCMSA.Berkeley.EDU 95CPBITNET 96 97# "Smart" relay host (may be null) 98DS 99 100# who I send unqualified names to (null means deliver locally) 101DR 102 103# who gets all local email traffic ($R has precedence for unqualified names) 104DH 105 106# who I masquerade as (null for no masquerading) 107DMCS.Berkeley.EDU 108 109# class L: names that should be delivered locally, even if we have a relay 110# class E: names that should be exposed as from this host, even if we masquerade 111#CLroot 112CEroot 113 114# operators that cannot be in local usernames (i.e., network indicators) 115CO @ % ! 116 117# a class with just dot (for identifying canonical names) 118C.. 119 120# dequoting map 121Kdequote dequote 122 123 124CPREDIRECT 125 126###################### 127# Special macros # 128###################### 129 130# SMTP initial login message 131De$j Sendmail $v/$Z ready at $b 132 133# UNIX initial From header format 134DlFrom $g $d 135 136# my name for error messages 137DnMAILER-DAEMON 138 139# delimiter (operator) characters 140Do.:%@!^/[] 141 142# format of a total name 143Dq$?x$x <$g>$|$g$. 144 145# Configuration version number 146DZ8.6.9 147 148 149############### 150# Options # 151############### 152 153# strip message body to 7 bits on input? 154O7False 155 156# wait (in minutes) for alias file rebuild 157Oa10 158 159# location of alias file 160OA/etc/aliases 161 162# minimum number of free blocks on filesystem 163Ob4 164 165# substitution for space (blank) characters 166OB. 167 168# avoid connecting to "expensive" mailers on initial submission? 169OcFalse 170 171# checkpoint queue runs after every N successful deliveries 172OC10 173 174# default delivery mode 175Odbackground 176 177# automatically rebuild the alias database? 178ODFalse 179 180# error message header/file 181#OE/etc/sendmail.oE 182 183# error mode 184#Oep 185 186# save Unix-style "From_" lines at top of header? 187OfFalse 188 189# temporary file mode 190OF0600 191 192# match recipients against GECOS field? 193OGFalse 194 195# default GID 196Og1 197 198# maximum hop count 199Oh17 200 201# location of help file 202OH/usr/lib/sendmail.hf 203 204# ignore dots as terminators in incoming messages? 205OiFalse 206 207# Insist that the BIND name server be running to resolve names 208OI 209 210# deliver MIME-encapsulated error messages? 211OjTrue 212 213# Forward file search path 214OJ$z/.forward.$w:$z/.forward 215 216# open connection cache size 217Ok2 218 219# open connection cache timeout 220OK5m 221 222# use Errors-To: header? 223OlFalse 224 225# log level 226OL9 227 228# send to me too, even in an alias expansion? 229OmFalse 230 231# verify RHS in newaliases? 232OnTrue 233 234# default messages to old style headers if no special punctuation? 235OoTrue 236 237# SMTP daemon options 238#OOPort=esmtp 239 240# privacy flags 241Opauthwarnings 242 243# who (if anyone) should get extra copies of error messages 244#OPPostmaster 245 246# slope of queue-only function 247#Oq600000 248 249# queue directory 250OQ/var/spool/mqueue 251 252# read timeout -- now OK per RFC 1123 section 5.3.2 253#Ordatablock=10m 254 255# queue up everything before forking? 256OsTrue 257 258# status file 259OS/etc/sendmail.st 260 261# default message timeout interval 262OT5d/4h 263 264# time zone handling: 265# if undefined, use system default 266# if defined but null, use TZ envariable passed in 267# if defined and non-null, use that info 268#Ot 269 270# default UID 271Ou1 272 273# list of locations of user database file (null means no lookup) 274OU/usr/sww/share/lib/users.cs.db,/usr/sww/share/lib/users.eecs.db 275 276# fallback MX host 277#OVfall.back.host.net 278 279# if we are the best MX host for a site, try it directly instead of config err 280OwFalse 281 282# load average at which we just queue messages 283Ox8 284 285# load average at which we refuse connections 286OX12 287 288# work recipient factor 289#Oy30000 290 291# deliver each queued job in a separate process? 292OYFalse 293 294# work class factor 295#Oz1800 296 297# work time factor 298#OZ90000 299 300########################### 301# Message precedences # 302########################### 303 304Pfirst-class=0 305Pspecial-delivery=100 306Plist=-30 307Pbulk=-60 308Pjunk=-100 309 310##################### 311# Trusted users # 312##################### 313 314Troot 315Tdaemon 316Tuucp 317 318######################### 319# Format of headers # 320######################### 321 322H?P?Return-Path: $g 323HReceived: $?sfrom $s $.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b 324H?D?Resent-Date: $a 325H?D?Date: $a 326H?F?Resent-From: $q 327H?F?From: $q 328H?x?Full-Name: $x 329HSubject: 330# HPosted-Date: $a 331# H?l?Received-Date: $b 332H?M?Resent-Message-Id: <$t.$i@$j> 333H?M?Message-Id: <$t.$i@$j> 334# 335###################################################################### 336###################################################################### 337##### 338##### REWRITING RULES 339##### 340###################################################################### 341###################################################################### 342 343 344########################################### 345### Rulset 3 -- Name Canonicalization ### 346########################################### 347S3 348 349# handle null input (translate to <@> special case) 350R$@ $@ <@> 351 352# basic textual canonicalization -- note RFC733 heuristic here 353R$*<$*>$*<$*>$* $2$3<$4>$5 strip multiple <> <> 354R$*<$*<$+>$*>$* <$3>$5 2-level <> nesting 355R$*<>$* $@ <@> MAIL FROM:<> case 356R$*<$+>$* $2 basic RFC821/822 parsing 357 358# handle list:; syntax as special case 359R$*:;$* $@ $1 :; <@> 360 361# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later 362R@ $+ , $+ @ $1 : $2 change all "," to ":" 363 364# localize and dispose of route-based addresses 365R@ $+ : $+ $@ $>96 < @$1 > : $2 handle <route-addr> 366 367# find focus for list syntax 368R $+ : $* ; @ $+ $@ $>96 $1 : $2 ; < @ $3 > list syntax 369R $+ : $* ; $@ $1 : $2; list syntax 370 371# find focus for @ syntax addresses 372R$+ @ $+ $: $1 < @ $2 > focus on domain 373R$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right 374R$+ < @ $+ > $@ $>96 $1 < @ $2 > already canonical 375 376# do some sanity checking 377R$* < @ $* : $* > $* $1 < @ $2 $3 > $4 nix colons in addrs 378 379# convert old-style addresses to a domain-based address 380R$- ! $+ $@ $>96 $2 < @ $1 .UUCP > resolve uucp names 381R$+ . $- ! $+ $@ $>96 $3 < @ $1 . $2 > domain uucps 382R$+ ! $+ $@ $>96 $2 < @ $1 .UUCP > uucp subdomains 383 384# if we have % signs, take the rightmost one 385R$* % $* $1 @ $2 First make them all @s. 386R$* @ $* @ $* $1 % $2 @ $3 Undo all but the last. 387R$* @ $* $@ $>96 $1 < @ $2 > Insert < > and finish 388 389# else we must be a local name 390 391 392################################################ 393### Ruleset 96 -- bottom half of ruleset 3 ### 394################################################ 395 396# At this point, everything should be in a "local_part<@domain>extra" format. 397S96 398 399# handle special cases for local names 400R$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all 401R$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain 402R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain 403R$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [a.b.c.d] 404R$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal 405R$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr 406 407# find possible (old & new) versions of our name via short circuit hack 408# (this code should exist ONLY during the transition from .Berkeley.EDU 409# names to .CS.Berkeley.EDU names -- probably not more than a few months) 410R$* < @ $=w .CS.Berkeley.EDU > $* $: $1 < @ $j > $3 411R$* < @ $=w .Berkeley.EDU> $* $: $1 < @ $j > $3 412 413# pass UUCP addresses straight through 414R$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP . > $3 415 416# pass to name server to make hostname canonical 417R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4 418 419# local host aliases and pseudo-domains are always canonical 420R$* < @ $=w > $* $: $1 < @ $2 . > $3 421R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4 422R$* < @ $* . . > $* $1 < @ $2 . > $3 423 424# if this is the local hostname, make sure we treat is as canonical 425R$* < @ $j > $* $: $1 < @ $j . > $2 426 427 428################################################## 429### Ruleset 4 -- Final Output Post-rewriting ### 430################################################## 431S4 432 433R$*<@> $@ $1 handle <> and list:; 434 435# strip trailing dot off possibly canonical name 436R$* < @ $+ . > $* $1 < @ $2 > $3 437 438# externalize local domain info 439R$* < $+ > $* $1 $2 $3 defocus 440R@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical 441R@ $* $@ @ $1 ... and exit 442 443# UUCP must always be presented in old form 444R$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u 445 446# delete duplicate local names 447R$+ % $=w @ $=w $1 @ $j u%host@host => u@host 448 449 450 451############################################################## 452### Ruleset 97 -- recanonicalize and call ruleset zero ### 453### (used for recursive calls) ### 454############################################################## 455 456S97 457R$* $: $>3 $1 458R$* $@ $>0 $1 459 460 461###################################### 462### Ruleset 0 -- Parse Address ### 463###################################### 464 465S0 466 467R<@> $#local $: <> special case error msgs 468R$* : $* ; $#error $@ USAGE $: "list:; syntax illegal for recipient addresses" 469R<@ $+> $#error $@ USAGE $: "user address required" 470R<$* : $* > $#error $@ USAGE $: "colon illegal in host name part" 471 472# handle numeric address spec 473R$* < @ [ $+ ] > $* $: $>98 $1 < @ [ $2 ] > $3 numeric internet spec 474R$* < @ [ $+ ] > $* $#smtp $@ [$2] $: $1 < @ [$2] > $3 still numeric: send 475 476# now delete the local info -- note $=O to find characters that cause forwarding 477R$* < @ > $* $@ $>97 $1 user@ => user 478R< @ $=w . > : $* $@ $>97 $2 @here:... -> ... 479R$* $=O $* < @ $=w . > $@ $>97 $1 $2 $3 ...@here -> ... 480 481# handle local hacks 482R$* $: $>98 $1 483 484# short circuit local delivery so forwarded email works 485R$+ < @ $=w . > $: $1 < @ $2 . @ $H > first try hub 486R$+ < $+ @ $+ > $#local $: $1 yep .... 487R$+ < $+ @ > $#local $: @ $1 nope, local address 488 489# resolve remotely connected UUCP links (if any) 490 491# resolve fake top level domains by forwarding to other hosts 492R$*<@$+.BITNET.>$* $: $>95 < $B > $1 <@$2.BITNET.> $3 user@host.BITNET 493 494# forward non-local UUCP traffic to our UUCP relay 495R$*<@$*.UUCP.>$* $: $>95 < $Y > $1 <@$2.UUCP.> $3 uucp mail 496 497 498# pass names that still have a host to a smarthost (if defined) 499R$* < @ $* > $* $: $>95 < $S > $1 < @ $2 > $3 glue on smarthost name 500 501# deal with other remote names 502R$* < @$* > $* $#smtp $@ $2 $: $1 < @ $2 > $3 user@host.domain 503 504# if this is quoted, strip the quotes and try again 505R$+ $: $(dequote $1 $) strip quotes 506R$+ $=O $+ $@ $>97 $1 $2 $3 try again 507 508# handle locally delivered names 509R$=L $#local $: @ $1 special local names 510R$+ $#local $: $1 regular local names 511 512########################################################################### 513### Ruleset 5 -- special rewriting after aliases have been expanded ### 514### (new sendmail only) ### 515########################################################################### 516 517S5 518 519# see if we have a relay or a hub 520R$+ $: < $R > $1 try relay 521R< > $+ $: < $H > $1 try hub 522R< > $+ $@ $1 nope, give up 523R< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 > 524R< $+ > $+ $@ $>95 < $1 > $2 < @ $1 > 525 526################################################################### 527### Ruleset 95 -- canonify mailer:host syntax to triple ### 528################################################################### 529 530S95 531R< > $* $@ $1 strip off null relay 532R< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer 533R< $=w > $* $@ $2 delete local host 534R< $+ > $* $#relay $@ $1 $: $2 use unqualified mailer 535 536################################################################### 537### Ruleset 98 -- local part of ruleset zero (can be null) ### 538################################################################### 539 540S98 541 542# addresses sent to foo@host.REDIRECT will give a 551 error code 543R$* < @ $+ .REDIRECT. > $# error $@ NOUSER $: "551 User not local; please try " <$1@$2> 544# 545###################################################################### 546###################################################################### 547##### 548##### MAILER DEFINITIONS 549##### 550###################################################################### 551###################################################################### 552 553 554################################################## 555### Local and Program Mailer specification ### 556################################################## 557 558##### @(#)local.m4 8.6 (Berkeley) 10/24/93 ##### 559 560Mlocal, P=/bin/mail, F=lsDFMrmn, S=10, R=20/40, 561 A=mail -d $u 562Mprog, P=/bin/sh, F=lsDFMeu, S=10, R=20/40, D=$z:/, 563 A=sh -c $u 564 565S10 566R<@> $n errors to mailer-daemon 567R$+ $: $>40 $1 568 569S20 570R$+ < @ $* > $: $1 strip host part 571 572S40 573 574##################################### 575### SMTP Mailer specification ### 576##################################### 577 578##### @(#)smtp.m4 8.15 (Berkeley) 2/14/94 ##### 579 580Msmtp, P=[IPC], F=mDFMuX, S=11/31, R=21, E=\r\n, 581 L=990, A=IPC $h 582Mesmtp, P=[IPC], F=mDFMuXa, S=11/31, R=21, E=\r\n, 583 L=990, A=IPC $h 584Mrelay, P=[IPC], F=mDFMuXa, S=11/31, R=61, E=\r\n, 585 L=2040, A=IPC $h 586 587# 588# envelope sender and masquerading recipient rewriting 589# 590S11 591R$+ $: $>51 $1 sender/recipient common 592R$* :; <@> $@ $1 :; list:; special case 593R$* $@ $>61 $1 qualify unqual'ed names 594 595 596# 597# header recipient rewriting if not masquerading recipients 598# 599S21 600 601# do sender/recipient common rewriting 602R$+ $: $>51 $1 603 604# unqualified names (e.g., "eric") are qualified by local host 605R$* < @ $* > $* $@ $1 < @ $2 > $3 already qualified 606R$+ $: $1 < @ $j > add local domain 607 608 609# 610# header sender and masquerading recipient rewriting 611# 612S31 613R$+ $: $>51 $1 sender/recipient common 614R$* :; <@> $@ $1 :; list:; special case 615 616# do special header rewriting 617R$* <@> $* $@ $1 <@> $2 pass null host through 618R< @ $* > $* $@ < @ $1 > $2 pass route-addr through 619R$=E < @ $=w . > $@ $1 < @ $2 > exposed user as is 620R$* < @ $=w . > $: $1 < @ $2 @ $M > masquerade as domain 621R$* < @ $+ @ > $@ $1 < @ $2 > in case $M undefined 622R$* < @ $+ @ $+ > $@ $1 < @ $3 > $M is defined -- use it 623R$* $@ $>61 $1 qualify unqual'ed names 624 625 626# 627# convert pseudo-domain addresses to real domain addresses 628# 629S51 630 631# pass <route-addr>s through 632R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr> 633 634# output fake domains as user%fake@relay 635R$+ <@ $+ .BITNET. > $: $1 % $2 .BITNET < @ $B > user@host.BITNET 636R$+.BITNET <@ $+:$+ > $: $1 .BITNET < @ $3 > strip mailer: part 637 638# do UUCP heuristics; note that these are shared with UUCP mailers 639R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form 640R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form 641 642# leave these in .UUCP form to avoid further tampering 643R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. > 644R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 > 645R< $&h ! > $+ $@ $1 < @ $&h .UUCP. > 646R< $+ ! > $+ $: $1 ! $2 < @ $Y > 647R$+ < @ > $: $1 < @ $j > in case $Y undefined 648R$+ < @ $+ : $+ > $: $1 < @ $3 > strip mailer: part 649 650 651# 652# common sender and masquerading recipient rewriting 653# 654S61 655 656R$* < @ $* > $* $@ $1 < @ $2 > $3 already qualified 657R$=E $@ $1 < @ $j> show exposed names 658R$+ $: $1 < @ $M > user w/o host 659R$+ <@> $: $1 < @ $j > in case $M undefined 660