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*67819SericVERSIONID(`@(#)proto.m4 8.56 (Berkeley) 10/16/94') 1251222Seric 1351322SericMAILER(local)dnl 1451222Seric 1567696Seric# level 6 config file format 1667696SericV6 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 13567550Seric# 8-bit data handling 13667550SericO8`'confEIGHT_BIT_HANDLING 13767550Seric 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 25367810Seric# should we not prune routes in route-addr syntax addresses? 25467810SericOR`'confDONT_PRUNE_ROUTES 25567810Seric 25657944Seric# queue up everything before forking? 25764033SericOs`'confSAFE_QUEUE 25857944Seric 25957944Seric# status file 26064033SericOS`'ifdef(`STATUS_FILE', STATUS_FILE, /etc/sendmail.st) 26157944Seric 26257944Seric# default message timeout interval 26364033SericOT`'confMESSAGE_TIMEOUT 26457944Seric 26557944Seric# time zone handling: 26657944Seric# if undefined, use system default 26757944Seric# if defined but null, use TZ envariable passed in 26857944Seric# if defined and non-null, use that info 26957944Sericifelse(confTIME_ZONE, `USE_SYSTEM', `#Ot', 27064341Seric confTIME_ZONE, `USE_TZ', `Ot', 27164033Seric `Ot`'confTIME_ZONE') 27257944Seric 27357944Seric# default UID 27464033SericOu`'confDEF_USER_ID 27557944Seric 27651887Seric# list of locations of user database file (null means no lookup) 27758720SericOU`'ifdef(`confUSERDB_SPEC', `confUSERDB_SPEC') 27851222Seric 27958860Seric# fallback MX host 28058860Sericifdef(`confFALLBACK_MX', 28164033Seric OV`'confFALLBACK_MX, 28258860Seric #OVfall.back.host.net) 28358860Seric 28463858Seric# if we are the best MX host for a site, try it directly instead of config err 28564033SericOw`'confTRY_NULL_MX_LIST 28663858Seric 28757944Seric# load average at which we just queue messages 28864033SericOx`'confQUEUE_LA 28957944Seric 29057944Seric# load average at which we refuse connections 29164033SericOX`'confREFUSE_LA 29257944Seric 29357944Seric# work recipient factor 29457944Sericifdef(`confWORK_RECIPIENT_FACTOR', 29564033Seric Oy`'confWORK_RECIPIENT_FACTOR, 29657944Seric #Oy30000) 29757944Seric 29857944Seric# deliver each queued job in a separate process? 29964033SericOY`'confSEPARATE_PROC 30057944Seric 30157944Seric# work class factor 30257944Sericifdef(`confWORK_CLASS_FACTOR', 30364033Seric Oz`'confWORK_CLASS_FACTOR, 30457944Seric #Oz1800) 30557944Seric 30657944Seric# work time factor 30757944Sericifdef(`confWORK_TIME_FACTOR', 30864033Seric OZ`'confWORK_TIME_FACTOR, 30957944Seric #OZ90000) 31057944Seric 31167697Seric# do our SMTP peers choke on multi-line greeting messages? 31267697SericO BrokenSmtpPeers=confBROKEN_SMTP_PEERS 31367697Seric 31467697Seric# shall we sort the queue by hostname first? 31567697SericO SortQueueByHost=confSORT_QUEUE_BY_HOST 31667697Seric 31757944Seric########################### 31857944Seric# Message precedences # 31957944Seric########################### 32057944Seric 32157944SericPfirst-class=0 32257944SericPspecial-delivery=100 32358070SericPlist=-30 32457944SericPbulk=-60 32557944SericPjunk=-100 32657944Seric 32757944Seric##################### 32857944Seric# Trusted users # 32957944Seric##################### 33057944Seric 33157944SericTroot 33257944SericTdaemon 33357944SericTuucp 33457944Seric 33557944Seric######################### 33657944Seric# Format of headers # 33757944Seric######################### 33857944Seric 33958679SericH?P?Return-Path: $g 340*67819SericHReceived: confRECEIVED_HEADER 34157944SericH?D?Resent-Date: $a 34257944SericH?D?Date: $a 34357944SericH?F?Resent-From: $q 34457944SericH?F?From: $q 34557944SericH?x?Full-Name: $x 34657944SericHSubject: 34757944Seric# HPosted-Date: $a 34857944Seric# H?l?Received-Date: $b 34957944SericH?M?Resent-Message-Id: <$t.$i@$j> 35057944SericH?M?Message-Id: <$t.$i@$j> 35151222Seric# 35251222Seric###################################################################### 35351222Seric###################################################################### 35451222Seric##### 35551222Seric##### REWRITING RULES 35651222Seric##### 35751222Seric###################################################################### 35851222Seric###################################################################### 35951222Seric 36058678Sericundivert(9)dnl 36151222Seric 36251222Seric########################################### 36351222Seric### Rulset 3 -- Name Canonicalization ### 36451222Seric########################################### 36551260SericS3 36651222Seric 36764802Seric# handle null input (translate to <@> special case) 36858499SericR$@ $@ <@> 36958174Seric 37051222Seric# basic textual canonicalization -- note RFC733 heuristic here 37164144SericR$*<$*>$*<$*>$* $2$3<$4>$5 strip multiple <> <> 37258158SericR$*<$*<$+>$*>$* <$3>$5 2-level <> nesting 37358499SericR$*<>$* $@ <@> MAIL FROM:<> case 37451222SericR$*<$+>$* $2 basic RFC821/822 parsing 37551222Seric 37664802Seric# handle list:; syntax as special case 37764802SericR$*:;$* $@ $1 :; <@> 37864802Seric 37951222Seric# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later 38055416SericR@ $+ , $+ @ $1 : $2 change all "," to ":" 38151222Seric 38251222Seric# localize and dispose of route-based addresses 38367469SericR@ $+ : $+ $@ $>96 < @$1 > : $2 handle <route-addr> 38451222Seric 38551222Seric# find focus for list syntax 38667469SericR $+ : $* ; @ $+ $@ $>96 $1 : $2 ; < @ $3 > list syntax 38755416SericR $+ : $* ; $@ $1 : $2; list syntax 38851222Seric 38951222Seric# find focus for @ syntax addresses 39055416SericR$+ @ $+ $: $1 < @ $2 > focus on domain 39155416SericR$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right 39267469SericR$+ < @ $+ > $@ $>96 $1 < @ $2 > already canonical 39351222Seric 39464968Seric# do some sanity checking 39564968SericR$* < @ $* : $* > $* $1 < @ $2 $3 > $4 nix colons in addrs 39664968Seric 39758288Sericifdef(`_NO_UUCP_', `dnl', 39858288Seric`# convert old-style addresses to a domain-based address 39967469SericR$- ! $+ $@ $>96 $2 < @ $1 .UUCP > resolve uucp names 40067469SericR$+ . $- ! $+ $@ $>96 $3 < @ $1 . $2 > domain uucps 40167469SericR$+ ! $+ $@ $>96 $2 < @ $1 .UUCP > uucp subdomains') 40251222Seric 40351222Seric# if we have % signs, take the rightmost one 40455416SericR$* % $* $1 @ $2 First make them all @s. 40555416SericR$* @ $* @ $* $1 % $2 @ $3 Undo all but the last. 40667469SericR$* @ $* $@ $>96 $1 < @ $2 > Insert < > and finish 40751222Seric 40851222Seric# else we must be a local name 40951222Seric 41051222Seric 41160894Seric################################################ 41267469Seric### Ruleset 96 -- bottom half of ruleset 3 ### 41360894Seric################################################ 41451222Seric 41557245Seric# At this point, everything should be in a "local_part<@domain>extra" format. 41667469SericS96 41751222Seric 41851222Seric# handle special cases for local names 41960262SericR$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all 42060262SericR$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain 42160262Sericifdef(`_NO_UUCP_', `dnl', 42260262Seric`R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain') 42365825SericR$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [a.b.c.d] 42465825SericR$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal 42566306SericR$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr 42663754Sericifdef(`DOMAIN_TABLE', ` 42767450Seric# look up domains in the domain table 42867450SericR$* < @ $+ > $* $: $1 < @ $(domaintable $2 $) > $3', 42963754Seric`dnl') 43051889Sericundivert(2)dnl 43151222Seric 43259081Sericifdef(`_NO_UUCP_', `dnl', 43359081Seric`ifdef(`UUCP_RELAY', 43451274Seric`# pass UUCP addresses straight through 43564971SericR$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', 43651274Seric`# if really UUCP, handle it immediately 43751322Sericifdef(`_CLASS_U_', 43864971Seric`R$* < @ $=U . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 43951322Sericifdef(`_CLASS_V_', 44064971Seric`R$* < @ $=V . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 44151322Sericifdef(`_CLASS_W_', 44264971Seric`R$* < @ $=W . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 44351322Sericifdef(`_CLASS_X_', 44464971Seric`R$* < @ $=X . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 44551322Sericifdef(`_CLASS_Y_', 44664971Seric`R$* < @ $=Y . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 44751267Seric 44851267Seric# try UUCP traffic as a local address 44964971SericR$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3 45067469SericR$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3') 45159081Seric') 45265061Sericifdef(`_NO_CANONIFY_', `dnl', 45359081Seric`# pass to name server to make hostname canonical 45461470SericR$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4') 45561470Seric 45665061Seric# local host aliases and pseudo-domains are always canonical 45765061SericR$* < @ $=w > $* $: $1 < @ $2 . > $3 45864971SericR$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4 45965061SericR$* < @ $* . . > $* $1 < @ $2 . > $3 46064971Seric 46151322Seric# if this is the local hostname, make sure we treat is as canonical 46251322SericR$* < @ $j > $* $: $1 < @ $j . > $2 46351222Seric 46451322Seric 46551222Seric################################################## 46651222Seric### Ruleset 4 -- Final Output Post-rewriting ### 46751222Seric################################################## 46851222SericS4 46951222Seric 47058499SericR$*<@> $@ $1 handle <> and list:; 47151222Seric 47251322Seric# strip trailing dot off possibly canonical name 47351322SericR$* < @ $+ . > $* $1 < @ $2 > $3 47451322Seric 47551222Seric# externalize local domain info 47651322SericR$* < $+ > $* $1 $2 $3 defocus 47751322SericR@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical 47851997SericR@ $* $@ @ $1 ... and exit 47951222Seric 48058288Sericifdef(`_NO_UUCP_', `dnl', 48158288Seric`# UUCP must always be presented in old form 48258288SericR$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u') 48351222Seric 48451222Seric# delete duplicate local names 48551322SericR$+ % $=w @ $=w $1 @ $j u%host@host => u@host 48651222Seric 48751222Seric 48851222Seric 48960894Seric############################################################## 49067469Seric### Ruleset 97 -- recanonicalize and call ruleset zero ### 49160894Seric### (used for recursive calls) ### 49260894Seric############################################################## 49351222Seric 49467469SericS`'97 49551222SericR$* $: $>3 $1 49651222SericR$* $@ $>0 $1 49751222Seric 49851222Seric 49951222Seric###################################### 50051222Seric### Ruleset 0 -- Parse Address ### 50151222Seric###################################### 50251222Seric 50351222SericS0 50451222Seric 50567118SericR<@> $#_LOCAL_ $: <@> special case error msgs 50666035SericR$* : $* ; $#error $@ USAGE $: "list:; syntax illegal for recipient addresses" 50765048SericR<@ $+> $#error $@ USAGE $: "user address required" 50867118SericR$* <$* : $* > $* $#error $@ USAGE $: "colon illegal in host name part" 50967132SericR$* < @ . > $* $#error $@ USAGE $: "invalid host name" 51058340Seric 51155416Sericifdef(`_MAILER_smtp_', 51255416Seric`# handle numeric address spec 51367469SericR$* < @ [ $+ ] > $* $: $>98 $1 < @ [ $2 ] > $3 numeric internet spec 51465191SericR$* < @ [ $+ ] > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 still numeric: send', 51563858Seric `dnl') 51651222Seric 51751887Seric# now delete the local info -- note $=O to find characters that cause forwarding 51867469SericR$* < @ > $* $@ $>97 $1 user@ => user 51967469SericR< @ $=w . > : $* $@ $>97 $2 @here:... -> ... 52067469SericR$* $=O $* < @ $=w . > $@ $>97 $1 $2 $3 ...@here -> ... 52163967Seric 52263967Seric# handle local hacks 52367469SericR$* $: $>98 $1 52466048Seric 52566048Seric# short circuit local delivery so forwarded email works 52666048Sericifdef(`_LOCAL_NOT_STICKY_', 52766048Seric`R$=L < @ $=w . > $#_LOCAL_ $: @ $1 special local names 52866048SericR$+ < @ $=w . > $#_LOCAL_ $: $1 dispose directly', 52966048Seric`R$+ < @ $=w . > $: $1 < @ $2 . @ $H > first try hub 53067469SericR$+ < $+ @ $+ > $#_LOCAL_ $: $1 yep .... 53167543SericR$=D . $+ < $+ @ > $#_LOCAL_ $: $1 . $2 dotted name? 53267469SericR$+ < $+ @ > $#_LOCAL_ $: @ $1 nope, local address') 53366090Sericifdef(`MAILER_TABLE', 53466090Seric` 53566090Seric# not local -- try mailer table lookup 53666090SericR$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name 53766090SericR< $+ . > $* $: < $1 > $2 strip trailing dot 53866090SericR< $+ > $* $: < $(mailertable $1 $) > $2 lookup 53966090SericR< $- : $+ > $* $# $1 $@ $2 $: $3 check -- resolved? 54066090SericR< $+ > $* $: $>90 <$1> $2 try domain', 54166090Seric`dnl') 54251260Sericundivert(4)dnl 54351260Seric 54461468Sericifdef(`_NO_UUCP_', `dnl', 54561468Seric`# resolve remotely connected UUCP links (if any) 54651285Sericifdef(`_CLASS_V_', 54767469Seric`R$* < @ $=V . UUCP . > $* $: $>95 < $V > $1 <@$2.UUCP.> $3', 54852044Seric `dnl') 54951285Sericifdef(`_CLASS_W_', 55067469Seric`R$* < @ $=W . UUCP . > $* $: $>95 < $W > $1 <@$2.UUCP.> $3', 55152044Seric `dnl') 55251285Sericifdef(`_CLASS_X_', 55367469Seric`R$* < @ $=X . UUCP . > $* $: $>95 < $X > $1 <@$2.UUCP.> $3', 55461468Seric `dnl')') 55551260Seric 55651222Seric# resolve fake top level domains by forwarding to other hosts 55751222Sericifdef(`BITNET_RELAY', 55867469Seric`R$*<@$+.BITNET.>$* $: $>95 < $B > $1 <@$2.BITNET.> $3 user@host.BITNET', 55951222Seric `dnl') 56065149Sericifdef(`_MAILER_pop_', 56165149Seric`R$+ < @ POP. > $#pop $: $1 user@POP', 56265149Seric `dnl') 56358364Sericifdef(`_MAILER_fax_', 56464971Seric`R$+ < @ $+ .FAX. > $#fax $@ $2 $: $1 user@host.FAX', 56558364Seric`ifdef(`FAX_RELAY', 56667469Seric`R$*<@$+.FAX.>$* $: $>95 < $F > $1 <@$2.FAX.> $3 user@host.FAX', 56758364Seric `dnl')') 56851222Seric 56951260Sericifdef(`UUCP_RELAY', 57051260Seric`# forward non-local UUCP traffic to our UUCP relay 57167469SericR$*<@$*.UUCP.>$* $: $>95 < $Y > $1 <@$2.UUCP.> $3 uucp mail', 57255416Seric`ifdef(`_MAILER_uucp_', 57351260Seric`# forward other UUCP traffic straight to UUCP 57465557SericR$* < @ $+ .UUCP. > $* $#uucp $@ $2 $: $1 < @ $2 .UUCP. > $3 user@host.UUCP', 57551260Seric `dnl')') 57663967Sericifdef(`_MAILER_usenet_', ` 57763754Seric# addresses sent to net.group.USENET will get forwarded to a newsgroup 57865851SericR$+ . USENET $#usenet $: $1', 57963860Seric `dnl') 58063754Seric 58158070Sericifdef(`_LOCAL_RULES_', 58258070Seric`# figure out what should stay in our local mail system 58363754Sericundivert(1)', `dnl') 58463754Seric 58564321Seric# pass names that still have a host to a smarthost (if defined) 58667469SericR$* < @ $* > $* $: $>95 < $S > $1 < @ $2 > $3 glue on smarthost name 58763754Seric 58864321Seric# deal with other remote names 58963946Sericifdef(`_MAILER_smtp_', 59063973Seric`R$* < @$* > $* $#_SMTP_ $@ $2 $: $1 < @ $2 > $3 user@host.domain', 59164321Seric`R$* < @$* > $* $#error $@NOHOST $: Unrecognized host name $2') 59251222Seric 59367469Seric# if this is quoted, strip the quotes and try again 59458811SericR$+ $: $(dequote $1 $) strip quotes 59567469SericR$+ $=O $+ $@ $>97 $1 $2 $3 try again 59658811Seric 59758811Seric# handle locally delivered names 59863998SericR$=L $#_LOCAL_ $: @ $1 special local names 59963998SericR$+ $#_LOCAL_ $: $1 regular local names 60051222Seric 60155416Seric########################################################################### 60255416Seric### Ruleset 5 -- special rewriting after aliases have been expanded ### 60355416Seric### (new sendmail only) ### 60455416Seric########################################################################### 60551222Seric 60651322SericS5 60751322Seric 60867538Seric# if we have a "special dotted user", convert it back to the base name 60967538SericR$=D . * $#_LOCAL_ $: $1 61067538SericR$=D . $+ $#_LOCAL_ $: $1 . * 61167538Seric 61258808Seric# see if we have a relay or a hub 61366048SericR$+ $: < $R > $1 try relay 61466048SericR< > $+ $: < $H > $1 try hub 61566048SericR< > $+ $@ $1 nope, give up 61667469SericR< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 > 61767469SericR< $+ > $+ $@ $>95 < $1 > $2 < @ $1 > 61860540Sericifdef(`MAILER_TABLE', 61960540Seric` 62060540Seric 62163858Seric################################################################### 62263858Seric### Ruleset 90 -- try domain part of mailertable entry ### 62363858Seric### (new sendmail only) ### 62463858Seric################################################################### 62560540Seric 62660540SericS90 62766091SericR$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4 62866081SericR$* <$- : $+ > $* $# $2 $@ $3 $: $4 check -- resolved? 62966081SericR$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again 63066094SericR$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "." 63166090SericR<$- : $+ > $* $# $1 $@ $2 $: $3 "." found? 63266090SericR< $* > $* $@ $2 no mailertable match', 63360540Seric`dnl') 63463858Seric 63563858Seric################################################################### 63667469Seric### Ruleset 95 -- canonify mailer:host syntax to triple ### 63764010Seric################################################################### 63864010Seric 63967469SericS95 64064010SericR< > $* $@ $1 strip off null relay 64164010SericR< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer 64264010SericR< $=w > $* $@ $2 delete local host 64364010SericR< $+ > $* $#_RELAY_ $@ $1 $: $2 use unqualified mailer 64464010Seric 64564010Seric################################################################### 64667469Seric### Ruleset 98 -- local part of ruleset zero (can be null) ### 64763858Seric################################################################### 64863858Seric 64967469SericS98 65063858Sericundivert(3)dnl 65151222Seric# 65251222Seric###################################################################### 65351222Seric###################################################################### 65451222Seric##### 65556790Seric`##### MAILER DEFINITIONS' 65651222Seric##### 65751222Seric###################################################################### 65851222Seric###################################################################### 65951222Sericundivert(7)dnl 660