151222Sericdivert(-1) 251222Seric# 351222Seric# Copyright (c) 1983 Eric P. Allman 463592Sbostic# Copyright (c) 1988, 1993 563592Sbostic# The Regents of the University of California. All rights reserved. 651222Seric# 751222Seric# %sccs.include.redist.sh% 851222Seric# 951222Sericdivert(0) 1051222Seric 11*67550SericVERSIONID(`@(#)proto.m4 8.52 (Berkeley) 07/23/94') 1251222Seric 1351322SericMAILER(local)dnl 1451222Seric 1567469Seric# level 5 config file format 1664260SericV5 1764010Sericifdef(`confSMTP_MAILER',, `define(`confSMTP_MAILER', `smtp')')dnl 1863998Sericifdef(`confLOCAL_MAILER',, `define(`confLOCAL_MAILER', `local')')dnl 1964010Sericifdef(`confRELAY_MAILER',, 2064010Seric `define(`confRELAY_MAILER', 2164010Seric `ifdef(`_MAILER_smtp_', `relay', 2264010Seric `ifdef(`_MAILER_uucp', `suucp', `unknown')')')')dnl 2363998Sericdefine(`_SMTP_', `confSMTP_MAILER')dnl for readability only 2463998Sericdefine(`_LOCAL_', `confLOCAL_MAILER')dnl for readability only 2564010Sericdefine(`_RELAY_', `confRELAY_MAILER')dnl for readability only 2652646Seric 2751222Seric################## 2851222Seric# local info # 2951222Seric################## 3051222Seric 3151889SericCwlocalhost 3251887Sericifdef(`USE_CW_FILE', 3351889Seric`# file containing names of hosts for which we receive email 3464033SericFw`'confCW_FILE', 3564033Seric `dnl') 3664321Sericifdef(`confDOMAIN_NAME', ` 3764321Seric# my official domain name 3864321SericDj`'confDOMAIN_NAME', 3964321Seric `dnl') 4051222Seric 4164321Sericifdef(`_NULL_CLIENT_ONLY_', 4264321Seric`include(../m4/nullrelay.m4)m4exit', 4364321Seric `dnl') 4464321Seric 4564321SericCP. 4664321Seric 4751222Sericifdef(`UUCP_RELAY', 4851222Seric`# UUCP relay host 4964033SericDY`'UUCP_RELAY 5060212SericCPUUCP 5157944Seric 5251222Seric')dnl 5351222Sericifdef(`BITNET_RELAY', 5451222Seric`# BITNET relay host 5564033SericDB`'BITNET_RELAY 5660212SericCPBITNET 5757944Seric 5851222Seric')dnl 5958364Sericifdef(`FAX_RELAY', 6058364Seric`# FAX relay host 6164033SericDF`'FAX_RELAY 6260212SericCPFAX 6358364Seric 6458364Seric')dnl 6564321Seric# "Smart" relay host (may be null) 6664321SericDS`'ifdef(`SMART_HOST', SMART_HOST) 6751222Seric 6858781Sericifdef(`MAILER_TABLE', 6958781Seric`# Mailer table (overriding domains) 7058781SericKmailertable MAILER_TABLE 7158781Seric 7258781Seric')dnl 7363754Sericifdef(`DOMAIN_TABLE', 7463754Seric`# Domain table (adding domains) 7563754SericKdomaintable DOMAIN_TABLE 7663754Seric 7763754Seric')dnl 7851222Seric# who I send unqualified names to (null means deliver locally) 7964033SericDR`'ifdef(`LOCAL_RELAY', LOCAL_RELAY) 8051222Seric 8157527Seric# who gets all local email traffic ($R has precedence for unqualified names) 8264033SericDH`'ifdef(`MAIL_HUB', MAIL_HUB) 8357527Seric 8466085Seric# who I masquerade as (null for no masquerading) 8566085SericDM`'ifdef(`MASQUERADE_NAME', MASQUERADE_NAME) 8658070Seric 8757245Seric# class L: names that should be delivered locally, even if we have a relay 8857245Seric# class E: names that should be exposed as from this host, even if we masquerade 8967538Seric# class D: dotted names, e.g., root.machinename 9067538Seric#CL root 9167538SericCE root 9251279Sericundivert(5)dnl 9367538Sericifdef(`__DOTTED_USER_LIST__', 9467538Seric `__DOTTED_USER_LIST__', 9567538Seric `#CD postmaster') 9651279Seric 9751222Seric# operators that cannot be in local usernames (i.e., network indicators) 9858288SericCO @ % ifdef(`_NO_UUCP_', `', `!') 9951222Seric 10051322Seric# a class with just dot (for identifying canonical names) 10151322SericC.. 10251322Seric 10367469Seric# dequoting map 10467469SericKdequote dequote 10557944Seric 10659033Sericundivert(6)dnl 10759033Seric 10857944Seric###################### 10957944Seric# Special macros # 11057944Seric###################### 11157944Seric 11257944Seric# SMTP initial login message 11364033SericDe`'confSMTP_LOGIN_MSG 11457944Seric 11557944Seric# UNIX initial From header format 11664033SericDl`'confFROM_LINE 11757944Seric 11857944Seric# my name for error messages 11964033SericDn`'confMAILER_NAME 12057944Seric 12157944Seric# delimiter (operator) characters 12264033SericDo`'confOPERATORS 12357944Seric 12457944Seric# format of a total name 12567538SericDq`'ifdef(`confFROM_HEADER', confFROM_HEADER, `$?x$x <$g>$|$g$.') 12657944Sericinclude(`../m4/version.m4') 12757944Seric 12857944Seric############### 12957944Seric# Options # 13057944Seric############### 13157944Seric 13259887Seric# strip message body to 7 bits on input? 13364033SericO7`'confSEVEN_BIT_INPUT 13457944Seric 135*67550Seric# 8-bit data handling 136*67550SericO8`'confEIGHT_BIT_HANDLING 137*67550Seric 13857944Seric# wait (in minutes) for alias file rebuild 13964033SericOa`'confALIAS_WAIT 14057944Seric 14157944Seric# location of alias file 14265825SericOA`'ifdef(`ALIAS_FILE', `ALIAS_FILE', /etc/aliases) 14357944Seric 14458084Seric# minimum number of free blocks on filesystem 14564033SericOb`'confMIN_FREE_BLOCKS 14658084Seric 14757944Seric# substitution for space (blank) characters 14864033SericOB`'confBLANK_SUB 14957944Seric 15065618Seric# avoid connecting to "expensive" mailers on initial submission? 15164033SericOc`'confCON_EXPENSIVE 15257944Seric 15357944Seric# checkpoint queue runs after every N successful deliveries 15464033SericOC`'confCHECKPOINT_INTERVAL 15557944Seric 15657944Seric# default delivery mode 15764033SericOd`'confDELIVERY_MODE 15857944Seric 15957944Seric# automatically rebuild the alias database? 16064033SericOD`'confAUTO_REBUILD 16157944Seric 16264033Seric# error message header/file 16357944Sericifdef(`confERROR_MESSAGE', 16464033Seric OE`'confERROR_MESSAGE, 16557944Seric #OE/etc/sendmail.oE) 16657944Seric 16757944Seric# error mode 16857944Sericifdef(`confERROR_MODE', 16964033Seric Oe`'confERROR_MODE, 17057944Seric #Oep) 17157944Seric 17257944Seric# save Unix-style "From_" lines at top of header? 17364033SericOf`'confSAVE_FROM_LINES 17457944Seric 17557944Seric# temporary file mode 17664033SericOF`'confTEMP_FILE_MODE 17757944Seric 17857944Seric# match recipients against GECOS field? 17964033SericOG`'confMATCH_GECOS 18057944Seric 18157944Seric# default GID 18264033SericOg`'confDEF_GROUP_ID 18357944Seric 18457944Seric# maximum hop count 18564033SericOh`'confMAX_HOP 18657944Seric 18757944Seric# location of help file 18864033SericOH`'ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf) 18957944Seric 19057944Seric# ignore dots as terminators in incoming messages? 19164033SericOi`'confIGNORE_DOTS 19257944Seric 19357944Seric# Insist that the BIND name server be running to resolve names 19457944Sericifdef(`confBIND_OPTS', 19564033Seric OI`'confBIND_OPTS, 19657944Seric #OI) 19757944Seric 19859887Seric# deliver MIME-encapsulated error messages? 19964033SericOj`'confMIME_FORMAT_ERRORS 20059887Seric 20157944Seric# Forward file search path 20257944Sericifdef(`confFORWARD_PATH', 20364033Seric OJ`'confFORWARD_PATH, 20457944Seric #OJ/var/forward/$u:$z/.forward.$w:$z/.forward) 20557944Seric 20657944Seric# open connection cache size 20764033SericOk`'confMCI_CACHE_SIZE 20857944Seric 20957944Seric# open connection cache timeout 21064033SericOK`'confMCI_CACHE_TIMEOUT 21157944Seric 21261106Seric# use Errors-To: header? 21364033SericOl`'confUSE_ERRORS_TO 21461106Seric 21557944Seric# log level 21664033SericOL`'confLOG_LEVEL 21757944Seric 21857944Seric# send to me too, even in an alias expansion? 21964033SericOm`'confME_TOO 22057944Seric 22157944Seric# verify RHS in newaliases? 22264033SericOn`'confCHECK_ALIASES 22357944Seric 22457944Seric# default messages to old style headers if no special punctuation? 22564033SericOo`'confOLD_STYLE_HEADERS 22657944Seric 22758860Seric# SMTP daemon options 22858860Sericifdef(`confDAEMON_OPTIONS', 22964033Seric OO`'confDAEMON_OPTIONS, 23058860Seric #OOPort=esmtp) 23158860Seric 23258084Seric# privacy flags 23364033SericOp`'confPRIVACY_FLAGS 23458084Seric 23557944Seric# who (if anyone) should get extra copies of error messages 23657944Sericifdef(`confCOPY_ERRORS_TO', 23764033Seric OP`'confCOPY_ERRORS_TO, 23857944Seric #OPPostmaster) 23957944Seric 24057944Seric# slope of queue-only function 24157944Sericifdef(`confQUEUE_FACTOR', 24264033Seric Oq`'confQUEUE_FACTOR, 24357944Seric #Oq600000) 24457944Seric 24557944Seric# queue directory 24664033SericOQ`'ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue) 24757944Seric 24857944Seric# read timeout -- now OK per RFC 1123 section 5.3.2 24958119Sericifdef(`confREAD_TIMEOUT', 25064033Seric Or`'confREAD_TIMEOUT, 25158119Seric #Ordatablock=10m) 25257944Seric 25357944Seric# queue up everything before forking? 25464033SericOs`'confSAFE_QUEUE 25557944Seric 25657944Seric# status file 25764033SericOS`'ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st) 25857944Seric 25957944Seric# default message timeout interval 26064033SericOT`'confMESSAGE_TIMEOUT 26157944Seric 26257944Seric# time zone handling: 26357944Seric# if undefined, use system default 26457944Seric# if defined but null, use TZ envariable passed in 26557944Seric# if defined and non-null, use that info 26657944Sericifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot', 26764341Seric confTIME_ZONE, `USE_TZ', `Ot', 26864033Seric `Ot`'confTIME_ZONE') 26957944Seric 27057944Seric# default UID 27164033SericOu`'confDEF_USER_ID 27257944Seric 27351887Seric# list of locations of user database file (null means no lookup) 27458720SericOU`'ifdef(`confUSERDB_SPEC', `confUSERDB_SPEC') 27551222Seric 27658860Seric# fallback MX host 27758860Sericifdef(`confFALLBACK_MX', 27864033Seric OV`'confFALLBACK_MX, 27958860Seric #OVfall.back.host.net) 28058860Seric 28163858Seric# if we are the best MX host for a site, try it directly instead of config err 28264033SericOw`'confTRY_NULL_MX_LIST 28363858Seric 28457944Seric# load average at which we just queue messages 28564033SericOx`'confQUEUE_LA 28657944Seric 28757944Seric# load average at which we refuse connections 28864033SericOX`'confREFUSE_LA 28957944Seric 29057944Seric# work recipient factor 29157944Sericifdef(`confWORK_RECIPIENT_FACTOR', 29264033Seric Oy`'confWORK_RECIPIENT_FACTOR, 29357944Seric #Oy30000) 29457944Seric 29557944Seric# deliver each queued job in a separate process? 29664033SericOY`'confSEPARATE_PROC 29757944Seric 29857944Seric# work class factor 29957944Sericifdef(`confWORK_CLASS_FACTOR', 30064033Seric Oz`'confWORK_CLASS_FACTOR, 30157944Seric #Oz1800) 30257944Seric 30357944Seric# work time factor 30457944Sericifdef(`confWORK_TIME_FACTOR', 30564033Seric OZ`'confWORK_TIME_FACTOR, 30657944Seric #OZ90000) 30757944Seric 30857944Seric########################### 30957944Seric# Message precedences # 31057944Seric########################### 31157944Seric 31257944SericPfirst-class=0 31357944SericPspecial-delivery=100 31458070SericPlist=-30 31557944SericPbulk=-60 31657944SericPjunk=-100 31757944Seric 31857944Seric##################### 31957944Seric# Trusted users # 32057944Seric##################### 32157944Seric 32257944SericTroot 32357944SericTdaemon 32457944SericTuucp 32557944Seric 32657944Seric######################### 32757944Seric# Format of headers # 32857944Seric######################### 32957944Seric 33058679SericH?P?Return-Path: $g 33166015SericHReceived: $?sfrom $s $.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b 33257944SericH?D?Resent-Date: $a 33357944SericH?D?Date: $a 33457944SericH?F?Resent-From: $q 33557944SericH?F?From: $q 33657944SericH?x?Full-Name: $x 33757944SericHSubject: 33857944Seric# HPosted-Date: $a 33957944Seric# H?l?Received-Date: $b 34057944SericH?M?Resent-Message-Id: <$t.$i@$j> 34157944SericH?M?Message-Id: <$t.$i@$j> 34251222Seric# 34351222Seric###################################################################### 34451222Seric###################################################################### 34551222Seric##### 34651222Seric##### REWRITING RULES 34751222Seric##### 34851222Seric###################################################################### 34951222Seric###################################################################### 35051222Seric 35158678Sericundivert(9)dnl 35251222Seric 35351222Seric########################################### 35451222Seric### Rulset 3 -- Name Canonicalization ### 35551222Seric########################################### 35651260SericS3 35751222Seric 35864802Seric# handle null input (translate to <@> special case) 35958499SericR$@ $@ <@> 36058174Seric 36151222Seric# basic textual canonicalization -- note RFC733 heuristic here 36264144SericR$*<$*>$*<$*>$* $2$3<$4>$5 strip multiple <> <> 36358158SericR$*<$*<$+>$*>$* <$3>$5 2-level <> nesting 36458499SericR$*<>$* $@ <@> MAIL FROM:<> case 36551222SericR$*<$+>$* $2 basic RFC821/822 parsing 36651222Seric 36764802Seric# handle list:; syntax as special case 36864802SericR$*:;$* $@ $1 :; <@> 36964802Seric 37051222Seric# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later 37155416SericR@ $+ , $+ @ $1 : $2 change all "," to ":" 37251222Seric 37351222Seric# localize and dispose of route-based addresses 37467469SericR@ $+ : $+ $@ $>96 < @$1 > : $2 handle <route-addr> 37551222Seric 37651222Seric# find focus for list syntax 37767469SericR $+ : $* ; @ $+ $@ $>96 $1 : $2 ; < @ $3 > list syntax 37855416SericR $+ : $* ; $@ $1 : $2; list syntax 37951222Seric 38051222Seric# find focus for @ syntax addresses 38155416SericR$+ @ $+ $: $1 < @ $2 > focus on domain 38255416SericR$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right 38367469SericR$+ < @ $+ > $@ $>96 $1 < @ $2 > already canonical 38451222Seric 38564968Seric# do some sanity checking 38664968SericR$* < @ $* : $* > $* $1 < @ $2 $3 > $4 nix colons in addrs 38764968Seric 38858288Sericifdef(`_NO_UUCP_', `dnl', 38958288Seric`# convert old-style addresses to a domain-based address 39067469SericR$- ! $+ $@ $>96 $2 < @ $1 .UUCP > resolve uucp names 39167469SericR$+ . $- ! $+ $@ $>96 $3 < @ $1 . $2 > domain uucps 39267469SericR$+ ! $+ $@ $>96 $2 < @ $1 .UUCP > uucp subdomains') 39351222Seric 39451222Seric# if we have % signs, take the rightmost one 39555416SericR$* % $* $1 @ $2 First make them all @s. 39655416SericR$* @ $* @ $* $1 % $2 @ $3 Undo all but the last. 39767469SericR$* @ $* $@ $>96 $1 < @ $2 > Insert < > and finish 39851222Seric 39951222Seric# else we must be a local name 40051222Seric 40151222Seric 40260894Seric################################################ 40367469Seric### Ruleset 96 -- bottom half of ruleset 3 ### 40460894Seric################################################ 40551222Seric 40657245Seric# At this point, everything should be in a "local_part<@domain>extra" format. 40767469SericS96 40851222Seric 40951222Seric# handle special cases for local names 41060262SericR$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all 41160262SericR$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain 41260262Sericifdef(`_NO_UUCP_', `dnl', 41360262Seric`R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain') 41465825SericR$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [a.b.c.d] 41565825SericR$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal 41666306SericR$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr 41763754Sericifdef(`DOMAIN_TABLE', ` 41867450Seric# look up domains in the domain table 41967450SericR$* < @ $+ > $* $: $1 < @ $(domaintable $2 $) > $3', 42063754Seric`dnl') 42151889Sericundivert(2)dnl 42251222Seric 42359081Sericifdef(`_NO_UUCP_', `dnl', 42459081Seric`ifdef(`UUCP_RELAY', 42551274Seric`# pass UUCP addresses straight through 42664971SericR$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', 42751274Seric`# if really UUCP, handle it immediately 42851322Sericifdef(`_CLASS_U_', 42964971Seric`R$* < @ $=U . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 43051322Sericifdef(`_CLASS_V_', 43164971Seric`R$* < @ $=V . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 43251322Sericifdef(`_CLASS_W_', 43364971Seric`R$* < @ $=W . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 43451322Sericifdef(`_CLASS_X_', 43564971Seric`R$* < @ $=X . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 43651322Sericifdef(`_CLASS_Y_', 43764971Seric`R$* < @ $=Y . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 43851267Seric 43951267Seric# try UUCP traffic as a local address 44064971SericR$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3 44167469SericR$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3') 44259081Seric') 44365061Sericifdef(`_NO_CANONIFY_', `dnl', 44459081Seric`# pass to name server to make hostname canonical 44561470SericR$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4') 44661470Seric 44765061Seric# local host aliases and pseudo-domains are always canonical 44865061SericR$* < @ $=w > $* $: $1 < @ $2 . > $3 44964971SericR$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4 45065061SericR$* < @ $* . . > $* $1 < @ $2 . > $3 45164971Seric 45251322Seric# if this is the local hostname, make sure we treat is as canonical 45351322SericR$* < @ $j > $* $: $1 < @ $j . > $2 45451222Seric 45551322Seric 45651222Seric################################################## 45751222Seric### Ruleset 4 -- Final Output Post-rewriting ### 45851222Seric################################################## 45951222SericS4 46051222Seric 46158499SericR$*<@> $@ $1 handle <> and list:; 46251222Seric 46351322Seric# strip trailing dot off possibly canonical name 46451322SericR$* < @ $+ . > $* $1 < @ $2 > $3 46551322Seric 46651222Seric# externalize local domain info 46751322SericR$* < $+ > $* $1 $2 $3 defocus 46851322SericR@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical 46951997SericR@ $* $@ @ $1 ... and exit 47051222Seric 47158288Sericifdef(`_NO_UUCP_', `dnl', 47258288Seric`# UUCP must always be presented in old form 47358288SericR$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u') 47451222Seric 47551222Seric# delete duplicate local names 47651322SericR$+ % $=w @ $=w $1 @ $j u%host@host => u@host 47751222Seric 47851222Seric 47951222Seric 48060894Seric############################################################## 48167469Seric### Ruleset 97 -- recanonicalize and call ruleset zero ### 48260894Seric### (used for recursive calls) ### 48360894Seric############################################################## 48451222Seric 48567469SericS`'97 48651222SericR$* $: $>3 $1 48751222SericR$* $@ $>0 $1 48851222Seric 48951222Seric 49051222Seric###################################### 49151222Seric### Ruleset 0 -- Parse Address ### 49251222Seric###################################### 49351222Seric 49451222SericS0 49551222Seric 49667118SericR<@> $#_LOCAL_ $: <@> special case error msgs 49766035SericR$* : $* ; $#error $@ USAGE $: "list:; syntax illegal for recipient addresses" 49865048SericR<@ $+> $#error $@ USAGE $: "user address required" 49967118SericR$* <$* : $* > $* $#error $@ USAGE $: "colon illegal in host name part" 50067132SericR$* < @ . > $* $#error $@ USAGE $: "invalid host name" 50158340Seric 50255416Sericifdef(`_MAILER_smtp_', 50355416Seric`# handle numeric address spec 50467469SericR$* < @ [ $+ ] > $* $: $>98 $1 < @ [ $2 ] > $3 numeric internet spec 50565191SericR$* < @ [ $+ ] > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 still numeric: send', 50663858Seric `dnl') 50751222Seric 50851887Seric# now delete the local info -- note $=O to find characters that cause forwarding 50967469SericR$* < @ > $* $@ $>97 $1 user@ => user 51067469SericR< @ $=w . > : $* $@ $>97 $2 @here:... -> ... 51167469SericR$* $=O $* < @ $=w . > $@ $>97 $1 $2 $3 ...@here -> ... 51263967Seric 51363967Seric# handle local hacks 51467469SericR$* $: $>98 $1 51566048Seric 51666048Seric# short circuit local delivery so forwarded email works 51766048Sericifdef(`_LOCAL_NOT_STICKY_', 51866048Seric`R$=L < @ $=w . > $#_LOCAL_ $: @ $1 special local names 51966048SericR$+ < @ $=w . > $#_LOCAL_ $: $1 dispose directly', 52066048Seric`R$+ < @ $=w . > $: $1 < @ $2 . @ $H > first try hub 52167469SericR$+ < $+ @ $+ > $#_LOCAL_ $: $1 yep .... 52267543SericR$=D . $+ < $+ @ > $#_LOCAL_ $: $1 . $2 dotted name? 52367469SericR$+ < $+ @ > $#_LOCAL_ $: @ $1 nope, local address') 52466090Sericifdef(`MAILER_TABLE', 52566090Seric` 52666090Seric# not local -- try mailer table lookup 52766090SericR$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name 52866090SericR< $+ . > $* $: < $1 > $2 strip trailing dot 52966090SericR< $+ > $* $: < $(mailertable $1 $) > $2 lookup 53066090SericR< $- : $+ > $* $# $1 $@ $2 $: $3 check -- resolved? 53166090SericR< $+ > $* $: $>90 <$1> $2 try domain', 53266090Seric`dnl') 53351260Sericundivert(4)dnl 53451260Seric 53561468Sericifdef(`_NO_UUCP_', `dnl', 53661468Seric`# resolve remotely connected UUCP links (if any) 53751285Sericifdef(`_CLASS_V_', 53867469Seric`R$* < @ $=V . UUCP . > $* $: $>95 < $V > $1 <@$2.UUCP.> $3', 53952044Seric `dnl') 54051285Sericifdef(`_CLASS_W_', 54167469Seric`R$* < @ $=W . UUCP . > $* $: $>95 < $W > $1 <@$2.UUCP.> $3', 54252044Seric `dnl') 54351285Sericifdef(`_CLASS_X_', 54467469Seric`R$* < @ $=X . UUCP . > $* $: $>95 < $X > $1 <@$2.UUCP.> $3', 54561468Seric `dnl')') 54651260Seric 54751222Seric# resolve fake top level domains by forwarding to other hosts 54851222Sericifdef(`BITNET_RELAY', 54967469Seric`R$*<@$+.BITNET.>$* $: $>95 < $B > $1 <@$2.BITNET.> $3 user@host.BITNET', 55051222Seric `dnl') 55165149Sericifdef(`_MAILER_pop_', 55265149Seric`R$+ < @ POP. > $#pop $: $1 user@POP', 55365149Seric `dnl') 55458364Sericifdef(`_MAILER_fax_', 55564971Seric`R$+ < @ $+ .FAX. > $#fax $@ $2 $: $1 user@host.FAX', 55658364Seric`ifdef(`FAX_RELAY', 55767469Seric`R$*<@$+.FAX.>$* $: $>95 < $F > $1 <@$2.FAX.> $3 user@host.FAX', 55858364Seric `dnl')') 55951222Seric 56051260Sericifdef(`UUCP_RELAY', 56151260Seric`# forward non-local UUCP traffic to our UUCP relay 56267469SericR$*<@$*.UUCP.>$* $: $>95 < $Y > $1 <@$2.UUCP.> $3 uucp mail', 56355416Seric`ifdef(`_MAILER_uucp_', 56451260Seric`# forward other UUCP traffic straight to UUCP 56565557SericR$* < @ $+ .UUCP. > $* $#uucp $@ $2 $: $1 < @ $2 .UUCP. > $3 user@host.UUCP', 56651260Seric `dnl')') 56763967Sericifdef(`_MAILER_usenet_', ` 56863754Seric# addresses sent to net.group.USENET will get forwarded to a newsgroup 56965851SericR$+ . USENET $#usenet $: $1', 57063860Seric `dnl') 57163754Seric 57258070Sericifdef(`_LOCAL_RULES_', 57358070Seric`# figure out what should stay in our local mail system 57463754Sericundivert(1)', `dnl') 57563754Seric 57664321Seric# pass names that still have a host to a smarthost (if defined) 57767469SericR$* < @ $* > $* $: $>95 < $S > $1 < @ $2 > $3 glue on smarthost name 57863754Seric 57964321Seric# deal with other remote names 58063946Sericifdef(`_MAILER_smtp_', 58163973Seric`R$* < @$* > $* $#_SMTP_ $@ $2 $: $1 < @ $2 > $3 user@host.domain', 58264321Seric`R$* < @$* > $* $#error $@NOHOST $: Unrecognized host name $2') 58351222Seric 58467469Seric# if this is quoted, strip the quotes and try again 58558811SericR$+ $: $(dequote $1 $) strip quotes 58667469SericR$+ $=O $+ $@ $>97 $1 $2 $3 try again 58758811Seric 58858811Seric# handle locally delivered names 58963998SericR$=L $#_LOCAL_ $: @ $1 special local names 59063998SericR$+ $#_LOCAL_ $: $1 regular local names 59151222Seric 59255416Seric########################################################################### 59355416Seric### Ruleset 5 -- special rewriting after aliases have been expanded ### 59455416Seric### (new sendmail only) ### 59555416Seric########################################################################### 59651222Seric 59751322SericS5 59851322Seric 59967538Seric# if we have a "special dotted user", convert it back to the base name 60067538SericR$=D . * $#_LOCAL_ $: $1 60167538SericR$=D . $+ $#_LOCAL_ $: $1 . * 60267538Seric 60358808Seric# see if we have a relay or a hub 60466048SericR$+ $: < $R > $1 try relay 60566048SericR< > $+ $: < $H > $1 try hub 60666048SericR< > $+ $@ $1 nope, give up 60767469SericR< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 > 60867469SericR< $+ > $+ $@ $>95 < $1 > $2 < @ $1 > 60960540Sericifdef(`MAILER_TABLE', 61060540Seric` 61160540Seric 61263858Seric################################################################### 61363858Seric### Ruleset 90 -- try domain part of mailertable entry ### 61463858Seric### (new sendmail only) ### 61563858Seric################################################################### 61660540Seric 61760540SericS90 61866091SericR$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4 61966081SericR$* <$- : $+ > $* $# $2 $@ $3 $: $4 check -- resolved? 62066081SericR$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again 62166094SericR$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "." 62266090SericR<$- : $+ > $* $# $1 $@ $2 $: $3 "." found? 62366090SericR< $* > $* $@ $2 no mailertable match', 62460540Seric`dnl') 62563858Seric 62663858Seric################################################################### 62767469Seric### Ruleset 95 -- canonify mailer:host syntax to triple ### 62864010Seric################################################################### 62964010Seric 63067469SericS95 63164010SericR< > $* $@ $1 strip off null relay 63264010SericR< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer 63364010SericR< $=w > $* $@ $2 delete local host 63464010SericR< $+ > $* $#_RELAY_ $@ $1 $: $2 use unqualified mailer 63564010Seric 63664010Seric################################################################### 63767469Seric### Ruleset 98 -- local part of ruleset zero (can be null) ### 63863858Seric################################################################### 63963858Seric 64067469SericS98 64163858Sericundivert(3)dnl 64251222Seric# 64351222Seric###################################################################### 64451222Seric###################################################################### 64551222Seric##### 64656790Seric`##### MAILER DEFINITIONS' 64751222Seric##### 64851222Seric###################################################################### 64951222Seric###################################################################### 65051222Sericundivert(7)dnl 651