151222Sericdivert(-1) 251222Seric# 351222Seric# Copyright (c) 1983 Eric P. Allman 451222Seric# Copyright (c) 1988 The Regents of the University of California. 551222Seric# All rights reserved. 651222Seric# 751222Seric# %sccs.include.redist.sh% 851222Seric# 951222Sericdivert(0) 1051222Seric 11*61468SericVERSIONID(`@(#)proto.m4 6.44 (Berkeley) 06/05/93') 1251222Seric 1351322SericMAILER(local)dnl 1451222Seric 1560894Sericifdef(`_OLD_SENDMAIL_', 1660894Seric`define(`_SET_96_', 6)dnl 1760894Sericdefine(`_SET_97_', 7)dnl', 1858119Seric`# level 4 config file format 1960894SericV4 2060894Sericdefine(`_SET_96_', 96)dnl 2160894Sericdefine(`_SET_97_', 97)dnl') 2252646Seric 2351222Seric################## 2451222Seric# local info # 2551222Seric################## 2651222Seric 2760212SericCP. 2860212Seric 2951889SericCwlocalhost 3051887Sericifdef(`USE_CW_FILE', 3151889Seric`# file containing names of hosts for which we receive email 3258406SericCONCAT(`Fw', confCW_FILE)', `dnl') 3351222Seric 3451222Sericifdef(`UUCP_RELAY', 3551222Seric`# UUCP relay host 3651281SericCONCAT(DY, UUCP_RELAY) 3760212SericCPUUCP 3857944Seric 3951222Seric')dnl 4051222Sericifdef(`BITNET_RELAY', 4151222Seric`# BITNET relay host 4251222SericCONCAT(DB, BITNET_RELAY) 4360212SericCPBITNET 4457944Seric 4551222Seric')dnl 4651222Sericifdef(`CSNET_RELAY', 4751222Seric`# CSNET relay host 4851222SericCONCAT(DC, CSNET_RELAY) 4960212SericCPCSNET 5057944Seric 5151222Seric')dnl 5258364Sericifdef(`FAX_RELAY', 5358364Seric`# FAX relay host 5458364SericCONCAT(DF, FAX_RELAY) 5560212SericCPFAX 5658364Seric 5758364Seric')dnl 5858070Sericifdef(`SMART_HOST', 5958070Seric`# "Smart" UUCP relay host 6058070SericCONCAT(DS, SMART_HOST) 6151222Seric 6258070Seric')dnl 6358781Sericifdef(`MAILER_TABLE', 6458781Seric`# Mailer table (overriding domains) 6558781SericKmailertable MAILER_TABLE 6658781Seric 6758781Seric')dnl 6851222Seric# who I send unqualified names to (null means deliver locally) 6951222SericCONCAT(DR, ifdef(`LOCAL_RELAY', LOCAL_RELAY)) 7051222Seric 7157527Seric# who gets all local email traffic ($R has precedence for unqualified names) 7257527SericCONCAT(DH, ifdef(`MAIL_HUB', MAIL_HUB)) 7357527Seric 7458070Seric# my official hostname ($w or $w.$D) 7558070SericCONCAT(Dj$w, ifdef(`NEED_DOMAIN', .$D)) 7658070Seric 7758070Seric# who I masquerade as (can be $j) 7858070SericCONCAT(DM, ifdef(`MASQUERADE_NAME', MASQUERADE_NAME, $j)) 7958070Seric 8057245Seric# class L: names that should be delivered locally, even if we have a relay 8157245Seric# class E: names that should be exposed as from this host, even if we masquerade 8251279SericCLroot 8357245SericCEroot 8451279Sericundivert(5)dnl 8551279Seric 8651222Seric# operators that cannot be in local usernames (i.e., network indicators) 8758288SericCO @ % ifdef(`_NO_UUCP_', `', `!') 8851222Seric 8951322Seric# a class with just dot (for identifying canonical names) 9051322SericC.. 9151322Seric 9258808Sericifdef(`_OLD_SENDMAIL_', `dnl', 9358808Seric`# dequoting map 9458808SericKdequote dequote') 9557944Seric 9659033Sericundivert(6)dnl 9759033Seric 9857944Seric###################### 9957944Seric# Special macros # 10057944Seric###################### 10157944Seric 10257944Seric# SMTP initial login message 10357944SericCONCAT(De, confSMTP_LOGIN_MSG) 10457944Seric 10557944Seric# UNIX initial From header format 10657944SericCONCAT(Dl, confFROM_LINE) 10757944Seric 10857944Seric# my name for error messages 10957944SericCONCAT(Dn, confMAILER_NAME) 11057944Seric 11157944Seric# delimiter (operator) characters 11257944SericCONCAT(Do, confOPERATORS) 11357944Seric 11457944Seric# format of a total name 11557944SericCONCAT(Dq, ifdef(`confFROM_HEADER', confFROM_HEADER, 11657944Seric ifdef(`_OLD_SENDMAIL_', `$g$?x ($x)$.', `$?x$x <$g>$|$g$.'))) 11757944Sericinclude(`../m4/version.m4') 11857944Seric 11957944Seric############### 12057944Seric# Options # 12157944Seric############### 12257944Seric 12359887Seric# strip message body to 7 bits on input? 12459887SericCONCAT(O7, confSEVEN_BIT_INPUT) 12557944Seric 12657944Seric# wait (in minutes) for alias file rebuild 12757944SericCONCAT(Oa, confALIAS_WAIT) 12857944Seric 12957944Seric# location of alias file 13057944SericCONCAT(OA, ifdef(`ALIAS_FILE', ALIAS_FILE, /etc/aliases)) 13157944Seric 13258084Seric# minimum number of free blocks on filesystem 13358084SericCONCAT(Ob, confMIN_FREE_BLOCKS) 13458084Seric 13557944Seric# substitution for space (blank) characters 13657944SericCONCAT(OB, confBLANK_SUB) 13757944Seric 13857944Seric# connect to "expensive" mailers on initial submission? 13957944SericCONCAT(Oc, confCON_EXPENSIVE) 14057944Seric 14157944Seric# checkpoint queue runs after every N successful deliveries 14257944SericCONCAT(OC, confCHECKPOINT_INTERVAL) 14357944Seric 14457944Seric# default delivery mode 14557944SericCONCAT(Od, confDELIVERY_MODE) 14657944Seric 14757944Seric# automatically rebuild the alias database? 14857944SericCONCAT(OD, confAUTO_REBUILD) 14957944Seric 15057944Seric# error message header/file */ 15157944Sericifdef(`confERROR_MESSAGE', 15257944Seric concat(OE, confERROR_MESSAGE), 15357944Seric #OE/etc/sendmail.oE) 15457944Seric 15557944Seric# error mode 15657944Sericifdef(`confERROR_MODE', 15757944Seric concat(Oe, confERROR_MODE), 15857944Seric #Oep) 15957944Seric 16057944Seric# save Unix-style "From_" lines at top of header? 16157944SericCONCAT(Of, confSAVE_FROM_LINES) 16257944Seric 16357944Seric# temporary file mode 16457944SericCONCAT(OF, confTEMP_FILE_MODE) 16557944Seric 16657944Seric# match recipients against GECOS field? 16757944SericCONCAT(OG, confMATCH_GECOS) 16857944Seric 16957944Seric# default GID 17057944SericCONCAT(Og, confDEF_GROUP_ID) 17157944Seric 17257944Seric# maximum hop count 17357944SericCONCAT(Oh, confMAX_HOP) 17457944Seric 17557944Seric# location of help file 17657944SericCONCAT(OH, ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf)) 17757944Seric 17857944Seric# ignore dots as terminators in incoming messages? 17957944SericCONCAT(Oi, confIGNORE_DOTS) 18057944Seric 18157944Seric# Insist that the BIND name server be running to resolve names 18257944Sericifdef(`confBIND_OPTS', 18357944Seric CONCAT(OI, confBIND_OPTS), 18457944Seric #OI) 18557944Seric 18659887Seric# deliver MIME-encapsulated error messages? 18759887SericCONCAT(Oj, confMIME_FORMAT_ERRORS) 18859887Seric 18957944Seric# Forward file search path 19057944Sericifdef(`confFORWARD_PATH', 19157944Seric CONCAT(OJ, confFORWARD_PATH), 19257944Seric #OJ/var/forward/$u:$z/.forward.$w:$z/.forward) 19357944Seric 19457944Seric# open connection cache size 19557944SericCONCAT(Ok, confMCI_CACHE_SIZE) 19657944Seric 19757944Seric# open connection cache timeout 19857944SericCONCAT(OK, confMCI_CACHE_TIMEOUT) 19957944Seric 20061106Seric# use Errors-To: header? 20161106SericCONCAT(Ol, confUSE_ERRORS_TO) 20261106Seric 20357944Seric# log level 20457944SericCONCAT(OL, confLOG_LEVEL) 20557944Seric 20657944Seric# send to me too, even in an alias expansion? 20757944SericCONCAT(Om, confME_TOO) 20857944Seric 20957944Seric# verify RHS in newaliases? 21057944SericCONCAT(On, confCHECK_ALIASES) 21157944Seric 21257944Seric# default messages to old style headers if no special punctuation? 21357944SericCONCAT(Oo, confOLD_STYLE_HEADERS) 21457944Seric 21558860Seric# SMTP daemon options 21658860Sericifdef(`confDAEMON_OPTIONS', 21758860Seric CONCAT(OO, confDAEMON_OPTIONS), 21858860Seric #OOPort=esmtp) 21958860Seric 22058084Seric# privacy flags 22158084SericCONCAT(Op, confPRIVACY_FLAGS) 22258084Seric 22357944Seric# who (if anyone) should get extra copies of error messages 22457944Sericifdef(`confCOPY_ERRORS_TO', 22557944Seric CONCAT(OP, confCOPY_ERRORS_TO), 22657944Seric #OPPostmaster) 22757944Seric 22857944Seric# slope of queue-only function 22957944Sericifdef(`confQUEUE_FACTOR', 23057944Seric CONCAT(Oq, confQUEUE_FACTOR), 23157944Seric #Oq600000) 23257944Seric 23357944Seric# queue directory 23457944SericCONCAT(OQ, ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue)) 23557944Seric 23657944Seric# read timeout -- now OK per RFC 1123 section 5.3.2 23758119Sericifdef(`confREAD_TIMEOUT', 23858119Seric CONCAT(Or, confREAD_TIMEOUT), 23958119Seric #Ordatablock=10m) 24057944Seric 24157944Seric# queue up everything before forking? 24257944SericCONCAT(Os, confSAFE_QUEUE) 24357944Seric 24457944Seric# status file 24557944SericCONCAT(OS, ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st)) 24657944Seric 24757944Seric# default message timeout interval 24857944SericCONCAT(OT, confMESSAGE_TIMEOUT) 24957944Seric 25057944Seric# time zone handling: 25157944Seric# if undefined, use system default 25257944Seric# if defined but null, use TZ envariable passed in 25357944Seric# if defined and non-null, use that info 25457944Sericifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot', 25557944Seric confTIME_ZONE, `USE_TZ', `', 25657944Seric `CONCAT(Ot, confTIME_ZONE)') 25757944Seric 25857944Seric# default UID 25957944SericCONCAT(Ou, confDEF_USER_ID) 26057944Seric 26151887Seric# list of locations of user database file (null means no lookup) 26258720SericOU`'ifdef(`confUSERDB_SPEC', `confUSERDB_SPEC') 26351222Seric 26458860Seric# fallback MX host 26558860Sericifdef(`confFALLBACK_MX', 26658860Seric CONCAT(OV, confFALLBACK_MX), 26758860Seric #OVfall.back.host.net) 26858860Seric 26957944Seric# load average at which we just queue messages 27057944SericCONCAT(Ox, confQUEUE_LA) 27157944Seric 27257944Seric# load average at which we refuse connections 27357944SericCONCAT(OX, confREFUSE_LA) 27457944Seric 27557944Seric# work recipient factor 27657944Sericifdef(`confWORK_RECIPIENT_FACTOR', 27757944Seric CONCAT(Oy, confWORK_RECIPIENT_FACTOR), 27857944Seric #Oy30000) 27957944Seric 28057944Seric# deliver each queued job in a separate process? 28157944SericCONCAT(OY, confSEPARATE_PROC) 28257944Seric 28357944Seric# work class factor 28457944Sericifdef(`confWORK_CLASS_FACTOR', 28557944Seric CONCAT(Oz, confWORK_CLASS_FACTOR), 28657944Seric #Oz1800) 28757944Seric 28857944Seric# work time factor 28957944Sericifdef(`confWORK_TIME_FACTOR', 29057944Seric CONCAT(OZ, confWORK_TIME_FACTOR), 29157944Seric #OZ90000) 29257944Seric 29357944Seric########################### 29457944Seric# Message precedences # 29557944Seric########################### 29657944Seric 29757944SericPfirst-class=0 29857944SericPspecial-delivery=100 29958070SericPlist=-30 30057944SericPbulk=-60 30157944SericPjunk=-100 30257944Seric 30357944Seric##################### 30457944Seric# Trusted users # 30557944Seric##################### 30657944Seric 30757944SericTroot 30857944SericTdaemon 30957944SericTuucp 31057944Seric 31157944Seric######################### 31257944Seric# Format of headers # 31357944Seric######################### 31457944Seric 31558679SericH?P?Return-Path: $g 31660894SericHReceived: $?sfrom $s $.$?_($_) $.by $j ($v/$Z)$?r with $r$. id $i; $b 31757944SericH?D?Resent-Date: $a 31857944SericH?D?Date: $a 31957944SericH?F?Resent-From: $q 32057944SericH?F?From: $q 32157944SericH?x?Full-Name: $x 32257944SericHSubject: 32357944Seric# HPosted-Date: $a 32457944Seric# H?l?Received-Date: $b 32557944SericH?M?Resent-Message-Id: <$t.$i@$j> 32657944SericH?M?Message-Id: <$t.$i@$j> 32751222Seric# 32851222Seric###################################################################### 32951222Seric###################################################################### 33051222Seric##### 33151222Seric##### REWRITING RULES 33251222Seric##### 33351222Seric###################################################################### 33451222Seric###################################################################### 33551222Seric 33658678Sericundivert(9)dnl 33751222Seric 33851222Seric########################################### 33951222Seric### Rulset 3 -- Name Canonicalization ### 34051222Seric########################################### 34151260SericS3 34251222Seric 34358499Seric# handle null input and list syntax (translate to <@> special case) 34458499SericR$@ $@ <@> 34558707SericR$*:;$* $@ $1 :; <@> 34658174Seric 34751222Seric# basic textual canonicalization -- note RFC733 heuristic here 34857012SericR$*<$*>$*<$*>$* <$2>$3$4$5 strip multiple <> <> 34958158SericR$*<$*<$+>$*>$* <$3>$5 2-level <> nesting 35058499SericR$*<>$* $@ <@> MAIL FROM:<> case 35151222SericR$*<$+>$* $2 basic RFC821/822 parsing 35251222Seric 35351222Seric# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later 35455416SericR@ $+ , $+ @ $1 : $2 change all "," to ":" 35551222Seric 35651222Seric# localize and dispose of route-based addresses 35760894SericR@ $+ : $+ $@ $>_SET_96_ < @$1 > : $2 handle <route-addr> 35851222Seric 35951222Seric# find focus for list syntax 36060894SericR $+ : $* ; @ $+ $@ $>_SET_96_ $1 : $2 ; < @ $3 > list syntax 36155416SericR $+ : $* ; $@ $1 : $2; list syntax 36251222Seric 36351222Seric# find focus for @ syntax addresses 36455416SericR$+ @ $+ $: $1 < @ $2 > focus on domain 36555416SericR$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right 36660894SericR$+ < @ $+ > $@ $>_SET_96_ $1 < @ $2 > already canonical 36751222Seric 36858288Sericifdef(`_NO_UUCP_', `dnl', 36958288Seric`# convert old-style addresses to a domain-based address 37060894SericR$- ! $+ $@ $>_SET_96_ $2 < @ $1 .UUCP > resolve uucp names 37160894SericR$+ . $- ! $+ $@ $>_SET_96_ $3 < @ $1 . $2 > domain uucps 37260894SericR$+ ! $+ $@ $>_SET_96_ $2 < @ $1 .UUCP > uucp subdomains') 37351222Seric 37451222Seric# if we have % signs, take the rightmost one 37555416SericR$* % $* $1 @ $2 First make them all @s. 37655416SericR$* @ $* @ $* $1 % $2 @ $3 Undo all but the last. 37760894SericR$* @ $* $@ $>_SET_96_ $1 < @ $2 > Insert < > and finish 37851222Seric 37951222Seric# else we must be a local name 38051222Seric 38151222Seric 38260894Seric################################################ 38360894Seric### Ruleset _SET_96_ -- bottom half of ruleset 3 ### 38460894Seric################################################ 38551222Seric 38657245Seric# At this point, everything should be in a "local_part<@domain>extra" format. 38760894SericS`'_SET_96_ 38851222Seric 38951222Seric# handle special cases for local names 39060262SericR$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all 39160262SericR$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain 39260262Sericifdef(`_NO_UUCP_', `dnl', 39360262Seric`R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain') 39451889Sericundivert(2)dnl 39551222Seric 39659081Sericifdef(`_NO_UUCP_', `dnl', 39759081Seric`ifdef(`UUCP_RELAY', 39851274Seric`# pass UUCP addresses straight through 39955416SericR$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP > $3', 40051274Seric`# if really UUCP, handle it immediately 40151322Sericifdef(`_CLASS_U_', 40255416Seric`R$* < @ $=U . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl') 40351322Sericifdef(`_CLASS_V_', 40455416Seric`R$* < @ $=V . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl') 40551322Sericifdef(`_CLASS_W_', 40655416Seric`R$* < @ $=W . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl') 40751322Sericifdef(`_CLASS_X_', 40855416Seric`R$* < @ $=X . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl') 40951322Sericifdef(`_CLASS_Y_', 41055416Seric`R$* < @ $=Y . UUCP > $* $@ $1 < @ $2 . UUCP > $3', `dnl') 41151267Seric 41251267Seric# try UUCP traffic as a local address 41355416SericR$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP > $3 41451992Sericifdef(`_OLD_SENDMAIL_', 41555416Seric`R$* < @ $+ . $+ . UUCP > $* $@ $1 < @ $2 . $3 . > $4', 41655416Seric`R$* < @ $+ . . UUCP > $* $@ $1 < @ $2 . > $3')') 41759081Seric') 41859081Sericifdef(`_NO_CANONIFY_', `dnl', 41959081Seric`# pass to name server to make hostname canonical 42060212SericR$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4 42159081Seric') 42251889Sericundivert(8)dnl 42351889Seric 42451322Seric# if this is the local hostname, make sure we treat is as canonical 42551322SericR$* < @ $j > $* $: $1 < @ $j . > $2 42651222Seric 42751322Seric 42851222Seric################################################## 42951222Seric### Ruleset 4 -- Final Output Post-rewriting ### 43051222Seric################################################## 43151222SericS4 43251222Seric 43358499SericR$*<@> $@ $1 handle <> and list:; 43451222Seric 43551222Seric# resolve numeric addresses to name if possible 43651322SericR$* < @ [ $+ ] > $* $: $1 < @ $[ [$2] $] > $3 lookup numeric internet addr 43751222Seric 43851322Seric# strip trailing dot off possibly canonical name 43951322SericR$* < @ $+ . > $* $1 < @ $2 > $3 44051322Seric 44151222Seric# externalize local domain info 44251322SericR$* < $+ > $* $1 $2 $3 defocus 44351322SericR@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical 44451997SericR@ $* $@ @ $1 ... and exit 44551222Seric 44658288Sericifdef(`_NO_UUCP_', `dnl', 44758288Seric`# UUCP must always be presented in old form 44858288SericR$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u') 44951222Seric 45051222Seric# delete duplicate local names 45151322SericR$+ % $=w @ $=w $1 @ $j u%host@host => u@host 45251222Seric 45351222Seric 45451222Seric 45560894Seric############################################################## 45660894Seric### Ruleset _SET_97_ -- recanonicalize and call ruleset zero ### 45760894Seric### (used for recursive calls) ### 45860894Seric############################################################## 45951222Seric 46060894SericS`'_SET_97_ 46151222SericR$* $: $>3 $1 46251222SericR$* $@ $>0 $1 46351222Seric 46451222Seric 46551222Seric###################################### 46651222Seric### Ruleset 0 -- Parse Address ### 46751222Seric###################################### 46851222Seric 46951222SericS0 47051222Seric 47158562SericR<@> $#local $: <> special case error msgs 47259887SericR$*:;<@> $#error $@ USAGE $: "list:; syntax illegal for recipient addresses" 47358340Seric 47455416Sericifdef(`_MAILER_smtp_', 47555416Seric`# handle numeric address spec 47651322SericR$* < @ [ $+ ] > $* $: $1 < @ $[ [$2] $] > $3 numeric internet addr 47755416SericR$* < @ [ $+ ] > $* $#smtp $@ [$2] $: $1 @ [$2] $3 numeric internet spec', 47856785Seric`dnl') 47951222Seric 48051887Seric# now delete the local info -- note $=O to find characters that cause forwarding 48160894SericR$* < @ > $* $@ $>_SET_97_ $1 user@ => user 48260894SericR< @ $=w . > : $* $@ $>_SET_97_ $2 @here:... -> ... 48360894SericR$* $=O $* < @ $=w . > $@ $>_SET_97_ $1 $2 $3 ...@here -> ... 48458781Sericifdef(`MAILER_TABLE', 48558781Seric` 48658781Seric# try mailer table lookup 48760540SericR$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name 48861106SericR< $+ . > $* $: < $1 > $2 strip trailing dot 48961106SericR< $+ > $* $: < $(mailertable .$1 $) > $3 lookup 49061106SericR< $- : $+ > $* $# $1 $@ $2 $: $3 check -- resolved? 49161106SericR< $- . $+ > $* $: $>90 <$2> $3 try domain', 49258781Seric`dnl') 49351222Seric 49451222Seric# short circuit local delivery so forwarded email works 49558516Sericifdef(`_LOCAL_NOT_STICKY_', 49660894Seric`R$=L < @ $=w . > $#local $: @ $1 special local names 49760894SericR$+ < @ $=w . > $#local $: $1 dispose directly', 49860894Seric`R$+ < @ $=w . > $: $1 < @ $2 @ $H > first try hub 49951992Sericifdef(`_OLD_SENDMAIL_', 50059635Seric`R$+ < $+ @ $-:$+ > $# $3 $@ $4 $: $1 < $2 > yep .... 50159635SericR$+ < $+ @ $+ > $#relay $@ $3 $: $1 < $2 > yep .... 50257527SericR$+ < $+ @ > $#local $: $1 nope, local address', 50357527Seric`R$+ < $+ @ $+ > $#local $: $1 yep .... 50458516SericR$+ < $+ @ > $#local $: @ $1 nope, local address')') 50551222Sericundivert(3)dnl 50651260Sericundivert(4)dnl 50751260Seric 508*61468Sericifdef(`_NO_UUCP_', `dnl', 509*61468Seric`# resolve remotely connected UUCP links (if any) 51051285Sericifdef(`_CLASS_V_', 51159635Seric`R$* < @ $=V . UUCP > $* $#smtp $@ $V $: <@ $V> : $1 @ $2.UUCP $3', 51252044Seric `dnl') 51351285Sericifdef(`_CLASS_W_', 51459635Seric`R$* < @ $=W . UUCP > $* $#smtp $@ $W $: <@ $W> : $1 @ $2.UUCP $3', 51552044Seric `dnl') 51651285Sericifdef(`_CLASS_X_', 51759635Seric`R$* < @ $=X . UUCP > $* $#smtp $@ $X $: <@ $X> : $1 @ $2.UUCP $3', 518*61468Seric `dnl')') 51951260Seric 52051222Seric# resolve fake top level domains by forwarding to other hosts 52151222Sericifdef(`BITNET_RELAY', 522*61468Seric`R$*<@$+.BITNET>$* $#smtp $@ $B $: $1 <@$2.BITNET> $3 user@host.BITNET', 52351222Seric `dnl') 52451222Sericifdef(`CSNET_RELAY', 525*61468Seric`R$*<@$+.CSNET>$* $#smtp $@ $C $: $1 <@$2.CSNET> $3 user@host.CSNET', 52651222Seric `dnl') 52758364Sericifdef(`_MAILER_fax_', 52858364Seric`R$+ < @ $+ .FAX > $#fax $@ $2 $: $1 user@host.FAX', 52958364Seric`ifdef(`FAX_RELAY', 530*61468Seric`R$*<@$+.FAX>$* $#smtp $@ $F $: $1 <@$2.FAX> $3 user@host.FAX', 53158364Seric `dnl')') 53251222Seric 53351260Sericifdef(`UUCP_RELAY', 53451260Seric`# forward non-local UUCP traffic to our UUCP relay 535*61468SericR$*<@$*.UUCP>$* $#smtp $@ $Y $: <@ $Y> : $1 @ $2.UUCP $3 uucp mail', 53655416Seric`ifdef(`_MAILER_uucp_', 53751260Seric`# forward other UUCP traffic straight to UUCP 53859604SericR< @ $+ .UUCP > : $+ $#uucp $@ $1 $: $2 @host.UUCP:... 53951322SericR$+ < @ $+ .UUCP > $#uucp $@ $2 $: $1 user@host.UUCP', 54051260Seric `dnl')') 54151222Seric 54258070Sericifdef(`_LOCAL_RULES_', 54358070Seric`# figure out what should stay in our local mail system 54458070Sericundivert(1)', 54558070Seric`ifdef(`_MAILER_smtp_', 54655416Seric`# deal with other remote names 54759635SericR$* < @ $* > $* $#smtp $@ $2 $: $1 < @ $2 > $3 user@host.domain')') 54858070Sericifdef(`SMART_HOST', ` 54958070Seric# pass names that still have a host to a smarthost 55058070SericR$* < @ $* > $* $: < $S > $1 < @ $2 > $3 glue on smarthost name 55159635SericR<$-:$+> $* < @$* > $* $# $1 $@ $2 $: $3 < @ $4 > $5 if non-null, use it 55259635SericR<$+> $* < @$* > $* $#suucp $@ $1 $: $2 < @ $3 > $4 if non-null, use it 55358070SericR<> $* < @ $* > $* $1 < @ $2 > $3 else strip off gunk', 55458070Seric`ifdef(`_LOCAL_RULES_', ` 55558070Seric# reject messages that have host names we do not understand 55658070SericR$* < @ $* > $* $#error $@ NOHOST $: Unrecognized host name $2', 55758070Seric`dnl')') 55858084Sericifdef(`_MAILER_USENET_', ` 55958084Seric# addresses sent to net.group.USENET will get forwarded to a newsgroup 56058096SericR$+ . USENET $# usenet $: $1') 56151222Seric 56251992Sericifdef(`_OLD_SENDMAIL_', 56351887Seric`# forward remaining names to local relay, if any 56452041SericR$=L $#local $: $1 special local names 56552041SericR$+ $: $1 < @ $R > append relay 56657527SericR$+ < @ > $: $1 < @ $H > no relay, try hub 56757527SericR$+ < @ > $#local $: $1 no relay or hub: local 56860894SericR$+ < @ $=w > $#local $: $1 we are relay/hub: local 56958070SericR$+ < @ $-:$+ > $# $2 $@ $3 $: $1 deliver to relay/hub 57058771SericR$+ < @ $+ > $#relay $@ $2 $: $1 deliver to relay/hub', 57158811Seric 57258811Seric`# if this is quoted, strip the quotes and try again 57358811SericR$+ $: $(dequote $1 $) strip quotes 57460894SericR$* $=O $* $@ $>_SET_97_ $1 $2 $3 try again 57558811Seric 57658811Seric# handle locally delivered names 57752041SericR$=L $#local $: @ $1 special local names 57852041SericR$+ $#local $: $1 regular local names 57951222Seric 58055416Seric########################################################################### 58155416Seric### Ruleset 5 -- special rewriting after aliases have been expanded ### 58255416Seric### (new sendmail only) ### 58355416Seric########################################################################### 58451222Seric 58551322SericS5 58651322Seric 58758808Seric# see if we have a relay or a hub 58858808SericR$+ $: $1 < @ $R > 58957527SericR$+ < @ > $: $1 < @ $H > no relay, try hub 59060894SericR$+ < @ $=w > $@ $1 we are relay/hub: local 59158070SericR$+ < @ $-:$+ > $# $2 $@ $3 $: $1 send to relay or hub 59258808Sericifdef(`_MAILER_smtp_', 59358808Seric`R$+ < @ $+ > $#relay $@ $2 $: $1 send to relay or hub')') 59460540Sericifdef(`MAILER_TABLE', 59560540Seric` 59660540Seric 59760540Seric########################################################################### 59860540Seric### Ruleset 90 -- try domain part of mailertable entry ### 59960540Seric### (new sendmail only) ### 60060540Seric########################################################################### 60160540Seric 60260540SericS90 60361106SericR<$- . $+ > $* $: < $(mailertable .$2 $) > $3 lookup 60460540SericR<$- : $+ > $* $# $1 $@ $2 $: $3 check -- resolved? 60560894SericR<$- . $+ > $* $@ $>90 <$2> $3 no -- strip & try again 60660540SericR<$*> $* $@ $2 no match', 60760540Seric`dnl') 60851222Seric# 60951222Seric###################################################################### 61051222Seric###################################################################### 61151222Seric##### 61256790Seric`##### MAILER DEFINITIONS' 61351222Seric##### 61451222Seric###################################################################### 61551222Seric###################################################################### 61651222Sericundivert(7)dnl 617