151222Sericdivert(-1) 251222Seric# 368840Seric# Copyright (c) 1983, 1995 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*69625SericVERSIONID(`@(#)proto.m4 8.73 (Berkeley) 05/23/95') 1251222Seric 1351322SericMAILER(local)dnl 1451222Seric 1567696Seric# level 6 config file format 1668651SericV6/Berkeley 1768651Sericdivert(-1) 1868651Seric 1968830Seric# do some sanity checking 2068830Sericifdef(`__OSTYPE__',, 2168830Seric `errprint(`*** ERROR: No system type defined (use OSTYPE macro)')') 2268830Seric 2368651Seric# pick our default mailers 2468651Sericifdef(`confSMTP_MAILER',, `define(`confSMTP_MAILER', `smtp')') 2568651Sericifdef(`confLOCAL_MAILER',, `define(`confLOCAL_MAILER', `local')') 2664010Sericifdef(`confRELAY_MAILER',, 2764010Seric `define(`confRELAY_MAILER', 2864010Seric `ifdef(`_MAILER_smtp_', `relay', 2968651Seric `ifdef(`_MAILER_uucp', `suucp', `unknown')')')') 3063998Sericdefine(`_SMTP_', `confSMTP_MAILER')dnl for readability only 3163998Sericdefine(`_LOCAL_', `confLOCAL_MAILER')dnl for readability only 3264010Sericdefine(`_RELAY_', `confRELAY_MAILER')dnl for readability only 3352646Seric 3468651Seric# back compatibility with old config files 3568651Sericifdef(`confDEF_GROUP_ID', 3668651Seric `errprint(`*** confDEF_GROUP_ID is obsolete.') 3768651Seric errprint(` Use confDEF_USER_ID with a colon in the value instead.')') 3868651Sericifdef(`confREAD_TIMEOUT', 3968651Seric `errprint(`*** confREAD_TIMEOUT is obsolete.') 4068651Seric errprint(` Use individual confTO_<timeout> parameters instead.')') 4168651Sericifdef(`confMESSAGE_TIMEOUT', 4268651Seric `define(`_ARG_', index(confMESSAGE_TIMEOUT, /)) 4368651Seric ifelse(_ARG_, -1, 4468651Seric `define(`confTO_QUEUERETURN', confMESSAGE_TIMEOUT)', 4568651Seric `define(`confTO_QUEUERETURN', 4668651Seric substr(confMESSAGE_TIMEOUT, 0, _ARG_)) 4768651Seric define(`confTO_QUEUEWARN', 4868651Seric substr(confMESSAGE_TIMEOUT, eval(_ARG_+1)))')') 4968651Sericifdef(`confMIN_FREE_BLOCKS', `ifelse(index(confMIN_FREE_BLOCKS, /), -1,, 5068651Seric `errprint(`*** compound confMIN_FREE_BLOCKS is obsolete.') 5168651Seric errprint(` Use confMAX_MESSAGE_SIZE for the second part of the value.')')') 5268651Seric 5368651Seric# clean option definitions below.... 5468651Sericdefine(`_OPTION', `ifdef(`$2', `O $1=$2', `#O $1`'ifelse($3, `',, `=$3')')')dnl 5568651Seric 5668651Sericdivert(0)dnl 5768651Seric 5851222Seric################## 5951222Seric# local info # 6051222Seric################## 6151222Seric 6251889SericCwlocalhost 6351887Sericifdef(`USE_CW_FILE', 6451889Seric`# file containing names of hosts for which we receive email 6564033SericFw`'confCW_FILE', 6664033Seric `dnl') 6768651Seric 6864321Seric# my official domain name 6968651Seric# ... define this only if sendmail cannot automatically determine your domain 7068651Sericifdef(`confDOMAIN_NAME', `Dj`'confDOMAIN_NAME', `#Dj$w.Foo.COM') 7151222Seric 7268651Sericifdef(`_NULL_CLIENT_ONLY_', `divert(-1)')dnl 7364321Seric 7464321SericCP. 7564321Seric 7651222Sericifdef(`UUCP_RELAY', 7751222Seric`# UUCP relay host 7864033SericDY`'UUCP_RELAY 7960212SericCPUUCP 8057944Seric 8151222Seric')dnl 8251222Sericifdef(`BITNET_RELAY', 8351222Seric`# BITNET relay host 8464033SericDB`'BITNET_RELAY 8560212SericCPBITNET 8657944Seric 8751222Seric')dnl 88*69625Sericifdef(`DECNET_RELAY', 89*69625Seric# DECnet relay host 90*69625SericDC`'DECNET_RELAY 91*69625SericCPDECNET 92*69625Seric 93*69625Seric')dnl 9458364Sericifdef(`FAX_RELAY', 9558364Seric`# FAX relay host 9664033SericDF`'FAX_RELAY 9760212SericCPFAX 9858364Seric 9958364Seric')dnl 10064321Seric# "Smart" relay host (may be null) 10164321SericDS`'ifdef(`SMART_HOST', SMART_HOST) 10251222Seric 10367914Sericifdef(`LUSER_RELAY', 10467914Seric`# place to which unknown users should be forwarded 10567914SericKuser user -m -a<> 10667914SericDL`'LUSER_RELAY 10767914Seric', `dnl') 10867914Seric 10968651Seric# operators that cannot be in local usernames (i.e., network indicators) 11068651SericCO @ % ifdef(`_NO_UUCP_', `', `!') 11168651Seric 11268651Seric# a class with just dot (for identifying canonical names) 11368651SericC.. 11468651Seric 11558781Sericifdef(`MAILER_TABLE', 11658781Seric`# Mailer table (overriding domains) 11758781SericKmailertable MAILER_TABLE 11858781Seric 11958781Seric')dnl 12063754Sericifdef(`DOMAIN_TABLE', 12163754Seric`# Domain table (adding domains) 12263754SericKdomaintable DOMAIN_TABLE 12363754Seric 12463754Seric')dnl 12551222Seric# who I send unqualified names to (null means deliver locally) 12664033SericDR`'ifdef(`LOCAL_RELAY', LOCAL_RELAY) 12751222Seric 12857527Seric# who gets all local email traffic ($R has precedence for unqualified names) 12964033SericDH`'ifdef(`MAIL_HUB', MAIL_HUB) 13057527Seric 13157245Seric# class L: names that should be delivered locally, even if we have a relay 13257245Seric# class E: names that should be exposed as from this host, even if we masquerade 13367538Seric#CL root 13467538SericCE root 13551279Sericundivert(5)dnl 13651279Seric 13767469Seric# dequoting map 13867469SericKdequote dequote 13957944Seric 14068651Sericdivert(0)dnl 14168651Seric# who I masquerade as (null for no masquerading) 14268651SericDM`'ifdef(`MASQUERADE_NAME', MASQUERADE_NAME) 14368651Seric 14459033Sericundivert(6)dnl 14559033Seric 14657944Seric###################### 14757944Seric# Special macros # 14857944Seric###################### 14957944Seric 15057944Seric# SMTP initial login message 15164033SericDe`'confSMTP_LOGIN_MSG 15257944Seric 15357944Seric# UNIX initial From header format 15464033SericDl`'confFROM_LINE 15557944Seric 15657944Seric# my name for error messages 15764033SericDn`'confMAILER_NAME 15857944Seric 15957944Seric# delimiter (operator) characters 16064033SericDo`'confOPERATORS 16157944Seric 16257944Seric# format of a total name 16367538SericDq`'ifdef(`confFROM_HEADER', confFROM_HEADER, `$?x$x <$g>$|$g$.') 16457944Sericinclude(`../m4/version.m4') 16557944Seric 16657944Seric############### 16757944Seric# Options # 16857944Seric############### 16957944Seric 17059887Seric# strip message body to 7 bits on input? 17168651Seric_OPTION(SevenBitInput, `confSEVEN_BIT_INPUT') 17257944Seric 17367550Seric# 8-bit data handling 17468651Seric_OPTION(EightBitMode, `confEIGHT_BIT_HANDLING', adaptive) 17567550Seric 17668651Seric# wait for alias file rebuild (default units: minutes) 17768651Seric_OPTION(AliasWait, `confALIAS_WAIT', 5m) 17857944Seric 17957944Seric# location of alias file 18068651SericO AliasFile=ifdef(`ALIAS_FILE', `ALIAS_FILE', /etc/aliases) 18157944Seric 18258084Seric# minimum number of free blocks on filesystem 18368651Seric_OPTION(MinFreeBlocks, `confMIN_FREE_BLOCKS', 100) 18458084Seric 18568651Seric# maximum message size 18668651Seric_OPTION(MaxMessageSize, `confMAX_MESSAGE_SIZE', 1000000) 18768651Seric 18857944Seric# substitution for space (blank) characters 18968651Seric_OPTION(BlankSub, `confBLANK_SUB', _) 19057944Seric 19165618Seric# avoid connecting to "expensive" mailers on initial submission? 19268651Seric_OPTION(HoldExpensive, `confCON_EXPENSIVE') 19357944Seric 19457944Seric# checkpoint queue runs after every N successful deliveries 19568651Seric_OPTION(CheckpointInterval, `confCHECKPOINT_INTERVAL', 10) 19657944Seric 19757944Seric# default delivery mode 19868651Seric_OPTION(DeliveryMode, `confDELIVERY_MODE', background) 19957944Seric 20057944Seric# automatically rebuild the alias database? 20168651Seric_OPTION(AutoRebuildAliases, `confAUTO_REBUILD') 20257944Seric 20364033Seric# error message header/file 20468651Seric_OPTION(ErrorHeader, `confERROR_MESSAGE', /etc/sendmail.oE) 20557944Seric 20657944Seric# error mode 20768651Seric_OPTION(ErrorMode, `confERROR_MODE', print) 20857944Seric 20957944Seric# save Unix-style "From_" lines at top of header? 21068651Seric_OPTION(SaveFromLine, `confSAVE_FROM_LINES') 21157944Seric 21257944Seric# temporary file mode 21368651Seric_OPTION(TempFileMode, `confTEMP_FILE_MODE', 0600) 21457944Seric 21557944Seric# match recipients against GECOS field? 21668651Seric_OPTION(MatchGECOS, `confMATCH_GECOS') 21757944Seric 21857944Seric# maximum hop count 21968651Seric_OPTION(MaxHopCount, `confMAX_HOP', 17) 22057944Seric 22157944Seric# location of help file 22268651SericO HelpFile=ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf) 22357944Seric 22457944Seric# ignore dots as terminators in incoming messages? 22568651Seric_OPTION(IgnoreDots, `confIGNORE_DOTS') 22657944Seric 22768651Seric# name resolver options 22868651Seric_OPTION(ResolverOptions, `confBIND_OPTS', +AAONLY) 22957944Seric 23059887Seric# deliver MIME-encapsulated error messages? 23168651Seric_OPTION(SendMimeErrors, `confMIME_FORMAT_ERRORS') 23259887Seric 23357944Seric# Forward file search path 23468651Seric_OPTION(ForwardPath, `confFORWARD_PATH', /var/forward/$u:$z/.forward.$w:$z/.forward) 23557944Seric 23657944Seric# open connection cache size 23768651Seric_OPTION(ConnectionCacheSize, `confMCI_CACHE_SIZE', 2) 23857944Seric 23957944Seric# open connection cache timeout 24068651Seric_OPTION(ConnectionCacheTimeout, `confMCI_CACHE_TIMEOUT', 5m) 24157944Seric 24261106Seric# use Errors-To: header? 24368651Seric_OPTION(UseErrorsTo, `confUSE_ERRORS_TO') 24461106Seric 24557944Seric# log level 24668651Seric_OPTION(LogLevel, `confLOG_LEVEL', 10) 24757944Seric 24857944Seric# send to me too, even in an alias expansion? 24968651Seric_OPTION(MeToo, `confME_TOO') 25057944Seric 25157944Seric# verify RHS in newaliases? 25268651Seric_OPTION(CheckAliases, `confCHECK_ALIASES') 25357944Seric 25457944Seric# default messages to old style headers if no special punctuation? 25568651Seric_OPTION(OldStyleHeaders, `confOLD_STYLE_HEADERS') 25657944Seric 25758860Seric# SMTP daemon options 25868651Seric_OPTION(DaemonPortOptions, `confDAEMON_OPTIONS', Port=esmtp) 25958860Seric 26058084Seric# privacy flags 26168651Seric_OPTION(PrivacyOptions, `confPRIVACY_FLAGS', authwarnings) 26258084Seric 26357944Seric# who (if anyone) should get extra copies of error messages 26468651Seric_OPTION(PostMasterCopy, `confCOPY_ERRORS_TO', Postmaster) 26557944Seric 26657944Seric# slope of queue-only function 26768651Seric_OPTION(QueueFactor, `confQUEUE_FACTOR', 600000) 26857944Seric 26957944Seric# queue directory 27068651SericO QueueDirectory=ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue) 27157944Seric 27268651Seric# timeouts (many of these) 27368651Seric_OPTION(Timeout.initial, `confTO_INITIAL', 5m) 27468651Seric_OPTION(Timeout.helo, `confTO_HELO', 5m) 27568651Seric_OPTION(Timeout.mail, `confTO_MAIL', 10m) 27668651Seric_OPTION(Timeout.rcpt, `confTO_RCPT', 1h) 27768651Seric_OPTION(Timeout.datainit, `confTO_DATAINIT', 5m) 27868651Seric_OPTION(Timeout.datablock, `confTO_DATABLOCK', 1h) 27968651Seric_OPTION(Timeout.datafinal, `confTO_DATAFINAL', 1h) 28068651Seric_OPTION(Timeout.rset, `confTO_RSET', 5m) 28168651Seric_OPTION(Timeout.quit, `confTO_QUIT', 2m) 28268651Seric_OPTION(Timeout.misc, `confTO_MISC', 2m) 28368651Seric_OPTION(Timeout.command, `confTO_COMMAND', 1h) 28468651Seric_OPTION(Timeout.ident, `confTO_IDENT', 30s) 28568651Seric_OPTION(Timeout.fileopen, `confTO_FILEOPEN', 60s) 28668651Seric_OPTION(Timeout.queuereturn, `confTO_QUEUERETURN', 5d) 28768651Seric_OPTION(Timeout.queuereturn.normal, `confTO_QUEUERETURN_NORMAL', 5d) 28868651Seric_OPTION(Timeout.queuereturn.urgent, `confTO_QUEUERETURN_URGENT', 2d) 28968651Seric_OPTION(Timeout.queuereturn.non-urgent, `confTO_QUEUERETURN_NONURGENT', 7d) 29068651Seric_OPTION(Timeout.queuewarn, `confTO_QUEUEWARN', 4h) 29168651Seric_OPTION(Timeout.queuewarn.normal, `confTO_QUEUEWARN_NORMAL', 4h) 29268651Seric_OPTION(Timeout.queuewarn.urgent, `confTO_QUEUEWARN_URGENT', 1h) 29368651Seric_OPTION(Timeout.queuewarn.non-urgent, `confTO_QUEUEWARN_NONURGENT', 12h) 29457944Seric 29567810Seric# should we not prune routes in route-addr syntax addresses? 29668651Seric_OPTION(DontPruneRoutes, `confDONT_PRUNE_ROUTES') 29767810Seric 29857944Seric# queue up everything before forking? 29968651Seric_OPTION(SuperSafe, `confSAFE_QUEUE') 30057944Seric 30157944Seric# status file 30268651Seric_OPTION(StatusFile, `STATUS_FILE', /etc/sendmail.st) 30357944Seric 30457944Seric# time zone handling: 30557944Seric# if undefined, use system default 30657944Seric# if defined but null, use TZ envariable passed in 30757944Seric# if defined and non-null, use that info 30868651Sericifelse(confTIME_ZONE, `USE_SYSTEM', `#O TimeZoneSpec=', 30968651Seric confTIME_ZONE, `USE_TZ', `O TimeZoneSpec=', 31068651Seric `O TimeZoneSpec=confTIME_ZONE') 31157944Seric 31268651Seric# default UID (can be username or userid:groupid) 31368651Seric_OPTION(DefaultUser, `confDEF_USER_ID', nobody) 31457944Seric 31551887Seric# list of locations of user database file (null means no lookup) 31668651Seric_OPTION(UserDatabaseSpec, `confUSERDB_SPEC', /etc/userdb) 31751222Seric 31858860Seric# fallback MX host 31968651Seric_OPTION(FallbackMXhost, `confFALLBACK_MX', fall.back.host.net) 32058860Seric 32163858Seric# if we are the best MX host for a site, try it directly instead of config err 32268651Seric_OPTION(TryNullMXList, `confTRY_NULL_MX_LIST') 32363858Seric 32457944Seric# load average at which we just queue messages 32568651Seric_OPTION(QueueLA, `confQUEUE_LA', 8) 32657944Seric 32757944Seric# load average at which we refuse connections 32868651Seric_OPTION(RefuseLA, `confREFUSE_LA', 12) 32957944Seric 33057944Seric# work recipient factor 33168651Seric_OPTION(RecipientFactor, `confWORK_RECIPIENT_FACTOR', 30000) 33257944Seric 33357944Seric# deliver each queued job in a separate process? 33468651Seric_OPTION(ForkEachJob, `confSEPARATE_PROC') 33557944Seric 33657944Seric# work class factor 33768651Seric_OPTION(ClassFactor, `confWORK_CLASS_FACTOR', 1800) 33857944Seric 33957944Seric# work time factor 34068651Seric_OPTION(RetryFactor, `confWORK_TIME_FACTOR', 90000) 34157944Seric 34267697Seric# shall we sort the queue by hostname first? 34368651Seric_OPTION(QueueSortOrder, `confQUEUE_SORT_ORDER', priority) 34467697Seric 34568651Seric# minimum time in queue before retry 34668651Seric_OPTION(MinQueueAge, `confMIN_QUEUE_AGE', 30m) 34768651Seric 34868651Seric# default character set 34968651Seric_OPTION(DefaultCharSet, `confDEF_CHAR_SET', iso-8859-1) 35068651Seric 35168651Seric# service switch file (ignored on Solaris, Ultrix, OSF/1, others) 35268651Seric_OPTION(ServiceSwitchFile, `confSERVICE_SWITCH_FILE', /etc/service.switch) 35368651Seric 35468651Seric# dialup line delay on connection failure 35568651Seric_OPTION(DialDelay, `confDIAL_DELAY', 10s) 35668651Seric 35768651Seric# action to take if there are no recipients in the message 35868651Seric_OPTION(NoRecipientAction, `confNO_RCPT_ACTION', add-to-undisclosed) 35968651Seric 36068651Seric# chrooted environment for writing to files 36168651Seric_OPTION(SafeFileEnvironment, `confSAFE_FILE_ENV', /arch) 36268651Seric 36368806Seric# are colons OK in addresses? 36468806Seric_OPTION(ColonOkInAddr, `confCOLON_OK_IN_ADDR') 36568806Seric 36657944Seric########################### 36757944Seric# Message precedences # 36857944Seric########################### 36957944Seric 37057944SericPfirst-class=0 37157944SericPspecial-delivery=100 37258070SericPlist=-30 37357944SericPbulk=-60 37457944SericPjunk=-100 37557944Seric 37657944Seric##################### 37757944Seric# Trusted users # 37857944Seric##################### 37957944Seric 38068651Seric# this is equivalent to setting class "t" 38168651Seric#Ft/etc/sendmail.trusted 38257944SericTroot 38357944SericTdaemon 38457944SericTuucp 38557944Seric 38657944Seric######################### 38757944Seric# Format of headers # 38857944Seric######################### 38957944Seric 39058679SericH?P?Return-Path: $g 39167819SericHReceived: confRECEIVED_HEADER 39257944SericH?D?Resent-Date: $a 39357944SericH?D?Date: $a 39457944SericH?F?Resent-From: $q 39557944SericH?F?From: $q 39657944SericH?x?Full-Name: $x 39757944SericHSubject: 39857944Seric# HPosted-Date: $a 39957944Seric# H?l?Received-Date: $b 40057944SericH?M?Resent-Message-Id: <$t.$i@$j> 40157944SericH?M?Message-Id: <$t.$i@$j> 40268651Sericifdef(`_NULL_CLIENT_ONLY_', 40368651Seric `include(../m4/nullrelay.m4)m4exit', 40468651Seric `dnl') 40551222Seric# 40651222Seric###################################################################### 40751222Seric###################################################################### 40851222Seric##### 40951222Seric##### REWRITING RULES 41051222Seric##### 41151222Seric###################################################################### 41251222Seric###################################################################### 41351222Seric 41458678Sericundivert(9)dnl 41551222Seric 41651222Seric########################################### 41751222Seric### Rulset 3 -- Name Canonicalization ### 41851222Seric########################################### 41951260SericS3 42051222Seric 42164802Seric# handle null input (translate to <@> special case) 42258499SericR$@ $@ <@> 42358174Seric 42468763Seric# strip group: syntax (not inside angle brackets!) and trailing semicolon 42568763SericR$* $: $1 <@> mark addresses 42668763SericR$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr> 427*69625SericR$* :: $* <@> $: $1 :: $2 unmark node::addr 42869215SericR:include: $* <@> $: :include: $1 unmark :include:... 42968763SericR$* : $* <@> $: $2 strip colon if marked 43068763SericR$* <@> $: $1 unmark 43168763SericR$* ; $: $1 strip trailing semi 43268763Seric 43368763Seric# null input now results from list:; syntax 43468763SericR$@ $@ :; <@> 43568763Seric 43651222Seric# basic textual canonicalization -- note RFC733 heuristic here 43764144SericR$*<$*>$*<$*>$* $2$3<$4>$5 strip multiple <> <> 43858158SericR$*<$*<$+>$*>$* <$3>$5 2-level <> nesting 43958499SericR$*<>$* $@ <@> MAIL FROM:<> case 44051222SericR$*<$+>$* $2 basic RFC821/822 parsing 44151222Seric 44251222Seric# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later 44355416SericR@ $+ , $+ @ $1 : $2 change all "," to ":" 44451222Seric 44551222Seric# localize and dispose of route-based addresses 44667469SericR@ $+ : $+ $@ $>96 < @$1 > : $2 handle <route-addr> 44751222Seric 44851222Seric# find focus for list syntax 44967469SericR $+ : $* ; @ $+ $@ $>96 $1 : $2 ; < @ $3 > list syntax 45055416SericR $+ : $* ; $@ $1 : $2; list syntax 45151222Seric 45251222Seric# find focus for @ syntax addresses 45355416SericR$+ @ $+ $: $1 < @ $2 > focus on domain 45455416SericR$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right 45567469SericR$+ < @ $+ > $@ $>96 $1 < @ $2 > already canonical 45651222Seric 45764968Seric# do some sanity checking 45864968SericR$* < @ $* : $* > $* $1 < @ $2 $3 > $4 nix colons in addrs 45964968Seric 46058288Sericifdef(`_NO_UUCP_', `dnl', 46158288Seric`# convert old-style addresses to a domain-based address 46267469SericR$- ! $+ $@ $>96 $2 < @ $1 .UUCP > resolve uucp names 46367469SericR$+ . $- ! $+ $@ $>96 $3 < @ $1 . $2 > domain uucps 464*69625SericR$+ ! $+ $@ $>96 $2 < @ $1 .UUCP > uucp subdomains 465*69625Seric') 466*69625Sericifdef(`DECNET_RELAY', 467*69625Seric`# convert node::user addresses into a domain-based address 468*69625SericR$- :: $+ $@ $>96 $2 < @ $1 .DECNET > resolve DECnet names 469*69625Seric', 470*69625Seric `dnl') 47151222Seric# if we have % signs, take the rightmost one 47255416SericR$* % $* $1 @ $2 First make them all @s. 47355416SericR$* @ $* @ $* $1 % $2 @ $3 Undo all but the last. 47467469SericR$* @ $* $@ $>96 $1 < @ $2 > Insert < > and finish 47551222Seric 47651222Seric# else we must be a local name 47769542SericR$* $@ $>96 $1 47851222Seric 47951222Seric 48060894Seric################################################ 48167469Seric### Ruleset 96 -- bottom half of ruleset 3 ### 48260894Seric################################################ 48351222Seric 48467469SericS96 48551222Seric 48651222Seric# handle special cases for local names 48760262SericR$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all 48860262SericR$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain 48960262Sericifdef(`_NO_UUCP_', `dnl', 49060262Seric`R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain') 49165825SericR$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [a.b.c.d] 49265825SericR$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal 49366306SericR$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr 49463754Sericifdef(`DOMAIN_TABLE', ` 49567450Seric# look up domains in the domain table 49667450SericR$* < @ $+ > $* $: $1 < @ $(domaintable $2 $) > $3', 49763754Seric`dnl') 49851889Sericundivert(2)dnl 49951222Seric 50059081Sericifdef(`_NO_UUCP_', `dnl', 50159081Seric`ifdef(`UUCP_RELAY', 50251274Seric`# pass UUCP addresses straight through 50364971SericR$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', 50451274Seric`# if really UUCP, handle it immediately 50551322Sericifdef(`_CLASS_U_', 50664971Seric`R$* < @ $=U . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 50751322Sericifdef(`_CLASS_V_', 50864971Seric`R$* < @ $=V . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 50951322Sericifdef(`_CLASS_W_', 51064971Seric`R$* < @ $=W . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 51151322Sericifdef(`_CLASS_X_', 51264971Seric`R$* < @ $=X . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 51351322Sericifdef(`_CLASS_Y_', 51464971Seric`R$* < @ $=Y . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 51551267Seric 51651267Seric# try UUCP traffic as a local address 51764971SericR$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3 51867469SericR$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3') 51959081Seric') 52065061Sericifdef(`_NO_CANONIFY_', `dnl', 52159081Seric`# pass to name server to make hostname canonical 52261470SericR$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4') 52361470Seric 52465061Seric# local host aliases and pseudo-domains are always canonical 52565061SericR$* < @ $=w > $* $: $1 < @ $2 . > $3 52664971SericR$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4 52765061SericR$* < @ $* . . > $* $1 < @ $2 . > $3 52864971Seric 52951322Seric# if this is the local hostname, make sure we treat is as canonical 53051322SericR$* < @ $j > $* $: $1 < @ $j . > $2 53151222Seric 53251322Seric 53351222Seric################################################## 53451222Seric### Ruleset 4 -- Final Output Post-rewriting ### 53551222Seric################################################## 53651222SericS4 53751222Seric 53869215SericR$* <@> $@ handle <> and list:; 53951222Seric 54051322Seric# strip trailing dot off possibly canonical name 54151322SericR$* < @ $+ . > $* $1 < @ $2 > $3 54251322Seric 54351222Seric# externalize local domain info 54451322SericR$* < $+ > $* $1 $2 $3 defocus 54551322SericR@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical 54651997SericR@ $* $@ @ $1 ... and exit 54751222Seric 54858288Sericifdef(`_NO_UUCP_', `dnl', 54958288Seric`# UUCP must always be presented in old form 55058288SericR$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u') 55151222Seric 55251222Seric# delete duplicate local names 55351322SericR$+ % $=w @ $=w $1 @ $j u%host@host => u@host 55451222Seric 55551222Seric 55651222Seric 55760894Seric############################################################## 55867469Seric### Ruleset 97 -- recanonicalize and call ruleset zero ### 55960894Seric### (used for recursive calls) ### 56060894Seric############################################################## 56151222Seric 56267469SericS`'97 56351222SericR$* $: $>3 $1 56451222SericR$* $@ $>0 $1 56551222Seric 56651222Seric 56751222Seric###################################### 56851222Seric### Ruleset 0 -- Parse Address ### 56951222Seric###################################### 57051222Seric 57151222SericS0 57251222Seric 57367118SericR<@> $#_LOCAL_ $: <@> special case error msgs 57468852SericR$* : $* ; <@> $#error $@ 5.1.3 $: "list:; syntax illegal for recipient addresses" 57568852SericR<@ $+> $#error $@ 5.1.1 $: "user address required" 57668852SericR$* <$* : $* > $* $#error $@ 5.1.1 $: "colon illegal in host name part" 57768852SericR$* < @ . > $* $#error $@ 5.1.2 $: "invalid host name" 57858340Seric 57955416Sericifdef(`_MAILER_smtp_', 58055416Seric`# handle numeric address spec 58167469SericR$* < @ [ $+ ] > $* $: $>98 $1 < @ [ $2 ] > $3 numeric internet spec 58265191SericR$* < @ [ $+ ] > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 still numeric: send', 58363858Seric `dnl') 58451222Seric 58551887Seric# now delete the local info -- note $=O to find characters that cause forwarding 58667469SericR$* < @ > $* $@ $>97 $1 user@ => user 58767469SericR< @ $=w . > : $* $@ $>97 $2 @here:... -> ... 58867469SericR$* $=O $* < @ $=w . > $@ $>97 $1 $2 $3 ...@here -> ... 58963967Seric 59063967Seric# handle local hacks 59167469SericR$* $: $>98 $1 59266048Seric 59366048Seric# short circuit local delivery so forwarded email works 59467914Sericifdef(`_STICKY_LOCAL_DOMAIN_', 59567914Seric`R$+ < @ $=w . > $: < $H > $1 < @ $2 . > first try hub 59668698SericR< $+ > $+ < $+ > $>95 < $1 > $2 < $3 > yep .... 59768155SericR< > $+ + $* < $+ > $#_LOCAL_ $: $1 + $2 plussed name? 59867914SericR< > $+ < $+ > $#_LOCAL_ $: @ $1 nope, local address', 59968698Seric`R$=L < @ $=w . > $#_LOCAL_ $: @ $1 special local names 60068155SericR$+ < @ $=w . > $#_LOCAL_ $: $1 regular local name') 60166090Sericifdef(`MAILER_TABLE', 60266090Seric` 60366090Seric# not local -- try mailer table lookup 60466090SericR$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name 60566090SericR< $+ . > $* $: < $1 > $2 strip trailing dot 60666090SericR< $+ > $* $: < $(mailertable $1 $) > $2 lookup 60766090SericR< $- : $+ > $* $# $1 $@ $2 $: $3 check -- resolved? 60866090SericR< $+ > $* $: $>90 <$1> $2 try domain', 60966090Seric`dnl') 61051260Sericundivert(4)dnl 61151260Seric 61261468Sericifdef(`_NO_UUCP_', `dnl', 61361468Seric`# resolve remotely connected UUCP links (if any) 61451285Sericifdef(`_CLASS_V_', 61567469Seric`R$* < @ $=V . UUCP . > $* $: $>95 < $V > $1 <@$2.UUCP.> $3', 61652044Seric `dnl') 61751285Sericifdef(`_CLASS_W_', 61867469Seric`R$* < @ $=W . UUCP . > $* $: $>95 < $W > $1 <@$2.UUCP.> $3', 61952044Seric `dnl') 62051285Sericifdef(`_CLASS_X_', 62167469Seric`R$* < @ $=X . UUCP . > $* $: $>95 < $X > $1 <@$2.UUCP.> $3', 62261468Seric `dnl')') 62351260Seric 62451222Seric# resolve fake top level domains by forwarding to other hosts 62551222Sericifdef(`BITNET_RELAY', 62667469Seric`R$*<@$+.BITNET.>$* $: $>95 < $B > $1 <@$2.BITNET.> $3 user@host.BITNET', 62751222Seric `dnl') 628*69625Sericifdef(`DECNET_RELAY', 629*69625Seric`R$*<@$+.DECNET.>$* $: $>95 < $C > $1 <@$2.DECNET.> $3 user@host.DECNET', 630*69625Seric `dnl') 63165149Sericifdef(`_MAILER_pop_', 63265149Seric`R$+ < @ POP. > $#pop $: $1 user@POP', 63365149Seric `dnl') 63458364Sericifdef(`_MAILER_fax_', 63564971Seric`R$+ < @ $+ .FAX. > $#fax $@ $2 $: $1 user@host.FAX', 63658364Seric`ifdef(`FAX_RELAY', 63767469Seric`R$*<@$+.FAX.>$* $: $>95 < $F > $1 <@$2.FAX.> $3 user@host.FAX', 63858364Seric `dnl')') 63951222Seric 64051260Sericifdef(`UUCP_RELAY', 64151260Seric`# forward non-local UUCP traffic to our UUCP relay 64267469SericR$*<@$*.UUCP.>$* $: $>95 < $Y > $1 <@$2.UUCP.> $3 uucp mail', 64355416Seric`ifdef(`_MAILER_uucp_', 64451260Seric`# forward other UUCP traffic straight to UUCP 64565557SericR$* < @ $+ .UUCP. > $* $#uucp $@ $2 $: $1 < @ $2 .UUCP. > $3 user@host.UUCP', 64651260Seric `dnl')') 64763967Sericifdef(`_MAILER_usenet_', ` 64863754Seric# addresses sent to net.group.USENET will get forwarded to a newsgroup 64965851SericR$+ . USENET $#usenet $: $1', 65063860Seric `dnl') 65163754Seric 65258070Sericifdef(`_LOCAL_RULES_', 65358070Seric`# figure out what should stay in our local mail system 65463754Sericundivert(1)', `dnl') 65563754Seric 65664321Seric# pass names that still have a host to a smarthost (if defined) 65767469SericR$* < @ $* > $* $: $>95 < $S > $1 < @ $2 > $3 glue on smarthost name 65863754Seric 65964321Seric# deal with other remote names 66063946Sericifdef(`_MAILER_smtp_', 66163973Seric`R$* < @$* > $* $#_SMTP_ $@ $2 $: $1 < @ $2 > $3 user@host.domain', 66268852Seric`R$* < @$* > $* $#error $@ 5.1.2 $: Unrecognized host name $2') 66351222Seric 66467469Seric# if this is quoted, strip the quotes and try again 66558811SericR$+ $: $(dequote $1 $) strip quotes 66667469SericR$+ $=O $+ $@ $>97 $1 $2 $3 try again 66758811Seric 66858811Seric# handle locally delivered names 66963998SericR$=L $#_LOCAL_ $: @ $1 special local names 67063998SericR$+ $#_LOCAL_ $: $1 regular local names 67151222Seric 67255416Seric########################################################################### 67355416Seric### Ruleset 5 -- special rewriting after aliases have been expanded ### 67455416Seric########################################################################### 67551222Seric 67651322SericS5 67751322Seric 67869542Seric# deal with plussed users so aliases work nicely 67969542SericR$+ + * $#_LOCAL_ $@ $&h $: $1 68069542SericR$+ + $* $#_LOCAL_ $@ $2 $: $1 + * 68167538Seric 68267914Seric# prepend an empty "forward host" on the front 68367914SericR$+ $: <> $1 68467914Seric 68567914Sericifdef(`LUSER_RELAY', 68667914Seric`# send unrecognized local users to a relay host 68768149SericR< > $+ + $* $: < $L . > $( user $1 $) + $2 68868149SericR< > $+ $: < $L . > $( user $1 $) look up user 68968149SericR< $* > $+ <> $* $: < > $2 $3 found; strip $L 69068149SericR< $* . > $+ $: < $1 > $2 strip extra dot') 69167914Seric 69268149Seric# handle plussed local names 69368149SericR< > $+ + $* $#_LOCAL_ $@ $2 $: $1 69468149Seric 69558808Seric# see if we have a relay or a hub 69668698SericR< > $+ $: < $H > $1 try hub 69767914SericR< > $+ $: < $R > $1 try relay 69866048SericR< > $+ $@ $1 nope, give up 69967469SericR< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 > 70067469SericR< $+ > $+ $@ $>95 < $1 > $2 < @ $1 > 70160540Sericifdef(`MAILER_TABLE', 70260540Seric` 70360540Seric 70463858Seric################################################################### 70563858Seric### Ruleset 90 -- try domain part of mailertable entry ### 70663858Seric################################################################### 70760540Seric 70860540SericS90 70966091SericR$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4 71066081SericR$* <$- : $+ > $* $# $2 $@ $3 $: $4 check -- resolved? 71166081SericR$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again 71266094SericR$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "." 71366090SericR<$- : $+ > $* $# $1 $@ $2 $: $3 "." found? 71466090SericR< $* > $* $@ $2 no mailertable match', 71560540Seric`dnl') 71663858Seric 71763858Seric################################################################### 71867469Seric### Ruleset 95 -- canonify mailer:host syntax to triple ### 71964010Seric################################################################### 72064010Seric 72167469SericS95 72264010SericR< > $* $@ $1 strip off null relay 72364010SericR< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer 72464010SericR< $=w > $* $@ $2 delete local host 72564010SericR< $+ > $* $#_RELAY_ $@ $1 $: $2 use unqualified mailer 72664010Seric 72764010Seric################################################################### 72867469Seric### Ruleset 98 -- local part of ruleset zero (can be null) ### 72963858Seric################################################################### 73063858Seric 73167469SericS98 73263858Sericundivert(3)dnl 73351222Seric# 73451222Seric###################################################################### 73551222Seric###################################################################### 73651222Seric##### 73756790Seric`##### MAILER DEFINITIONS' 73851222Seric##### 73951222Seric###################################################################### 74051222Seric###################################################################### 74151222Sericundivert(7)dnl 742