16f4c5567Sericdivert(-1) 26f4c5567Seric# 3e8a06660Seric# Copyright (c) 1983, 1995 Eric P. Allman 494a19095Sbostic# Copyright (c) 1988, 1993 594a19095Sbostic# The Regents of the University of California. All rights reserved. 66f4c5567Seric# 76f4c5567Seric# %sccs.include.redist.sh% 86f4c5567Seric# 96f4c5567Sericdivert(0) 106f4c5567Seric 11*8a820e23SericVERSIONID(`@(#)proto.m4 8.80 (Berkeley) 06/10/95') 126f4c5567Seric 1363eeb308SericMAILER(local)dnl 146f4c5567Seric 15444240c0Seric# level 6 config file format 1633714691SericV6/Berkeley 1733714691Sericdivert(-1) 1833714691Seric 19cce2d2c9Seric# do some sanity checking 20cce2d2c9Sericifdef(`__OSTYPE__',, 21cce2d2c9Seric `errprint(`*** ERROR: No system type defined (use OSTYPE macro)')') 22cce2d2c9Seric 2333714691Seric# pick our default mailers 2433714691Sericifdef(`confSMTP_MAILER',, `define(`confSMTP_MAILER', `smtp')') 2533714691Sericifdef(`confLOCAL_MAILER',, `define(`confLOCAL_MAILER', `local')') 26aeacfb61Sericifdef(`confRELAY_MAILER',, 27aeacfb61Seric `define(`confRELAY_MAILER', 28aeacfb61Seric `ifdef(`_MAILER_smtp_', `relay', 2933714691Seric `ifdef(`_MAILER_uucp', `suucp', `unknown')')')') 3019110660Sericdefine(`_SMTP_', `confSMTP_MAILER')dnl for readability only 31d6e720f1Sericdefine(`_LOCAL_', `confLOCAL_MAILER')dnl for readability only 32aeacfb61Sericdefine(`_RELAY_', `confRELAY_MAILER')dnl for readability only 33472f2a37Seric 3433714691Seric# back compatibility with old config files 3533714691Sericifdef(`confDEF_GROUP_ID', 3633714691Seric `errprint(`*** confDEF_GROUP_ID is obsolete.') 3733714691Seric errprint(` Use confDEF_USER_ID with a colon in the value instead.')') 3833714691Sericifdef(`confREAD_TIMEOUT', 3933714691Seric `errprint(`*** confREAD_TIMEOUT is obsolete.') 4033714691Seric errprint(` Use individual confTO_<timeout> parameters instead.')') 4133714691Sericifdef(`confMESSAGE_TIMEOUT', 4233714691Seric `define(`_ARG_', index(confMESSAGE_TIMEOUT, /)) 4333714691Seric ifelse(_ARG_, -1, 4433714691Seric `define(`confTO_QUEUERETURN', confMESSAGE_TIMEOUT)', 4533714691Seric `define(`confTO_QUEUERETURN', 4633714691Seric substr(confMESSAGE_TIMEOUT, 0, _ARG_)) 4733714691Seric define(`confTO_QUEUEWARN', 4833714691Seric substr(confMESSAGE_TIMEOUT, eval(_ARG_+1)))')') 4933714691Sericifdef(`confMIN_FREE_BLOCKS', `ifelse(index(confMIN_FREE_BLOCKS, /), -1,, 5033714691Seric `errprint(`*** compound confMIN_FREE_BLOCKS is obsolete.') 5133714691Seric errprint(` Use confMAX_MESSAGE_SIZE for the second part of the value.')')') 5233714691Seric 5333714691Seric# clean option definitions below.... 5433714691Sericdefine(`_OPTION', `ifdef(`$2', `O $1=$2', `#O $1`'ifelse($3, `',, `=$3')')')dnl 5533714691Seric 5633714691Sericdivert(0)dnl 5733714691Seric 586f4c5567Seric################## 596f4c5567Seric# local info # 606f4c5567Seric################## 616f4c5567Seric 6231695942SericCwlocalhost 63b1286b66Sericifdef(`USE_CW_FILE', 6431695942Seric`# file containing names of hosts for which we receive email 653727fc2bSericFw`'confCW_FILE', 663727fc2bSeric `dnl') 678a1641c9Seric 6833714691Seric# my official domain name 6933714691Seric# ... define this only if sendmail cannot automatically determine your domain 7033714691Sericifdef(`confDOMAIN_NAME', `Dj`'confDOMAIN_NAME', `#Dj$w.Foo.COM') 7133714691Seric 7233714691Sericifdef(`_NULL_CLIENT_ONLY_', `divert(-1)')dnl 738a1641c9Seric 748a1641c9SericCP. 756f4c5567Seric 766f4c5567Sericifdef(`UUCP_RELAY', 776f4c5567Seric`# UUCP relay host 783727fc2bSericDY`'UUCP_RELAY 79a8d79e3dSericCPUUCP 800fc742e1Seric 816f4c5567Seric')dnl 826f4c5567Sericifdef(`BITNET_RELAY', 836f4c5567Seric`# BITNET relay host 843727fc2bSericDB`'BITNET_RELAY 85a8d79e3dSericCPBITNET 860fc742e1Seric 876f4c5567Seric')dnl 881ad646abSericifdef(`DECNET_RELAY', 89a50668adSeric`define(`_USE_DECNET_SYNTAX_')dnl 901ad646abSeric# DECnet relay host 911ad646abSericDC`'DECNET_RELAY 921ad646abSericCPDECNET 931ad646abSeric 941ad646abSeric')dnl 955caa7271Sericifdef(`FAX_RELAY', 965caa7271Seric`# FAX relay host 973727fc2bSericDF`'FAX_RELAY 98a8d79e3dSericCPFAX 995caa7271Seric 1005caa7271Seric')dnl 1018a1641c9Seric# "Smart" relay host (may be null) 1028a1641c9SericDS`'ifdef(`SMART_HOST', SMART_HOST) 1036f4c5567Seric 10480df0526Sericifdef(`LUSER_RELAY', 10580df0526Seric`# place to which unknown users should be forwarded 10680df0526SericKuser user -m -a<> 10780df0526SericDL`'LUSER_RELAY 10880df0526Seric', `dnl') 10980df0526Seric 11033714691Seric# operators that cannot be in local usernames (i.e., network indicators) 11133714691SericCO @ % ifdef(`_NO_UUCP_', `', `!') 11233714691Seric 11333714691Seric# a class with just dot (for identifying canonical names) 11433714691SericC.. 11533714691Seric 1163be47185Sericifdef(`MAILER_TABLE', 1173be47185Seric`# Mailer table (overriding domains) 1183be47185SericKmailertable MAILER_TABLE 1193be47185Seric 1203be47185Seric')dnl 121f6f96ca7Sericifdef(`DOMAIN_TABLE', 122f6f96ca7Seric`# Domain table (adding domains) 123f6f96ca7SericKdomaintable DOMAIN_TABLE 124f6f96ca7Seric 125f6f96ca7Seric')dnl 1266f4c5567Seric# who I send unqualified names to (null means deliver locally) 1273727fc2bSericDR`'ifdef(`LOCAL_RELAY', LOCAL_RELAY) 1286f4c5567Seric 129525ff8d9Seric# who gets all local email traffic ($R has precedence for unqualified names) 1303727fc2bSericDH`'ifdef(`MAIL_HUB', MAIL_HUB) 131525ff8d9Seric 13282027dd5Seric# class L: names that should be delivered locally, even if we have a relay 13382027dd5Seric# class E: names that should be exposed as from this host, even if we masquerade 13471b259abSeric#CL root 13582027dd5SericCE root 13671dc253dSericundivert(5)dnl 13771dc253dSeric 13898c7c04fSeric# dequoting map 13998c7c04fSericKdequote dequote 1406f4c5567Seric 14133714691Sericdivert(0)dnl 14233714691Seric# who I masquerade as (null for no masquerading) 14333714691SericDM`'ifdef(`MASQUERADE_NAME', MASQUERADE_NAME) 14433714691Seric 14516748008Sericundivert(6)dnl 14616748008Seric 1470fc742e1Seric###################### 1480fc742e1Seric# Special macros # 1490fc742e1Seric###################### 1506f4c5567Seric 1510fc742e1Seric# SMTP initial login message 1523727fc2bSericDe`'confSMTP_LOGIN_MSG 1530fc742e1Seric 1540fc742e1Seric# UNIX initial From header format 1553727fc2bSericDl`'confFROM_LINE 1560fc742e1Seric 1570fc742e1Seric# my name for error messages 1583727fc2bSericDn`'confMAILER_NAME 1590fc742e1Seric 1600fc742e1Seric# delimiter (operator) characters 1613727fc2bSericDo`'confOPERATORS 1620fc742e1Seric 1630fc742e1Seric# format of a total name 164b3d9bc08SericDq`'ifdef(`confFROM_HEADER', confFROM_HEADER, `$?x$x <$g>$|$g$.') 1656f4c5567Sericinclude(`../m4/version.m4') 1660fc742e1Seric 1670fc742e1Seric############### 1680fc742e1Seric# Options # 1690fc742e1Seric############### 1700fc742e1Seric 17170de6e01Seric# strip message body to 7 bits on input? 17233714691Seric_OPTION(SevenBitInput, `confSEVEN_BIT_INPUT') 1730fc742e1Seric 174f3e98e3bSeric# 8-bit data handling 17533714691Seric_OPTION(EightBitMode, `confEIGHT_BIT_HANDLING', adaptive) 176f3e98e3bSeric 17733714691Seric# wait for alias file rebuild (default units: minutes) 17833714691Seric_OPTION(AliasWait, `confALIAS_WAIT', 5m) 1790fc742e1Seric 1800fc742e1Seric# location of alias file 18133714691SericO AliasFile=ifdef(`ALIAS_FILE', `ALIAS_FILE', /etc/aliases) 1820fc742e1Seric 1832188aa70Seric# minimum number of free blocks on filesystem 18433714691Seric_OPTION(MinFreeBlocks, `confMIN_FREE_BLOCKS', 100) 18533714691Seric 18633714691Seric# maximum message size 18733714691Seric_OPTION(MaxMessageSize, `confMAX_MESSAGE_SIZE', 1000000) 1882188aa70Seric 1890fc742e1Seric# substitution for space (blank) characters 19033714691Seric_OPTION(BlankSub, `confBLANK_SUB', _) 1910fc742e1Seric 1925724067cSeric# avoid connecting to "expensive" mailers on initial submission? 19333714691Seric_OPTION(HoldExpensive, `confCON_EXPENSIVE') 1940fc742e1Seric 1950fc742e1Seric# checkpoint queue runs after every N successful deliveries 19633714691Seric_OPTION(CheckpointInterval, `confCHECKPOINT_INTERVAL', 10) 1970fc742e1Seric 1980fc742e1Seric# default delivery mode 19933714691Seric_OPTION(DeliveryMode, `confDELIVERY_MODE', background) 2000fc742e1Seric 2010fc742e1Seric# automatically rebuild the alias database? 20233714691Seric_OPTION(AutoRebuildAliases, `confAUTO_REBUILD') 2030fc742e1Seric 2043727fc2bSeric# error message header/file 20533714691Seric_OPTION(ErrorHeader, `confERROR_MESSAGE', /etc/sendmail.oE) 2060fc742e1Seric 2070fc742e1Seric# error mode 20833714691Seric_OPTION(ErrorMode, `confERROR_MODE', print) 2090fc742e1Seric 2100fc742e1Seric# save Unix-style "From_" lines at top of header? 21133714691Seric_OPTION(SaveFromLine, `confSAVE_FROM_LINES') 2120fc742e1Seric 2130fc742e1Seric# temporary file mode 21433714691Seric_OPTION(TempFileMode, `confTEMP_FILE_MODE', 0600) 2150fc742e1Seric 2160fc742e1Seric# match recipients against GECOS field? 21733714691Seric_OPTION(MatchGECOS, `confMATCH_GECOS') 2180fc742e1Seric 2190fc742e1Seric# maximum hop count 22033714691Seric_OPTION(MaxHopCount, `confMAX_HOP', 17) 2210fc742e1Seric 2220fc742e1Seric# location of help file 22333714691SericO HelpFile=ifdef(`HELP_FILE', HELP_FILE, /usr/lib/sendmail.hf) 2240fc742e1Seric 2250fc742e1Seric# ignore dots as terminators in incoming messages? 22633714691Seric_OPTION(IgnoreDots, `confIGNORE_DOTS') 2270fc742e1Seric 22833714691Seric# name resolver options 22933714691Seric_OPTION(ResolverOptions, `confBIND_OPTS', +AAONLY) 2300fc742e1Seric 23170de6e01Seric# deliver MIME-encapsulated error messages? 23233714691Seric_OPTION(SendMimeErrors, `confMIME_FORMAT_ERRORS') 23370de6e01Seric 2340fc742e1Seric# Forward file search path 23533714691Seric_OPTION(ForwardPath, `confFORWARD_PATH', /var/forward/$u:$z/.forward.$w:$z/.forward) 2360fc742e1Seric 2370fc742e1Seric# open connection cache size 23833714691Seric_OPTION(ConnectionCacheSize, `confMCI_CACHE_SIZE', 2) 2390fc742e1Seric 2400fc742e1Seric# open connection cache timeout 24133714691Seric_OPTION(ConnectionCacheTimeout, `confMCI_CACHE_TIMEOUT', 5m) 2420fc742e1Seric 243bd6adeb9Seric# use Errors-To: header? 24433714691Seric_OPTION(UseErrorsTo, `confUSE_ERRORS_TO') 245bd6adeb9Seric 2460fc742e1Seric# log level 24733714691Seric_OPTION(LogLevel, `confLOG_LEVEL', 10) 2480fc742e1Seric 2490fc742e1Seric# send to me too, even in an alias expansion? 25033714691Seric_OPTION(MeToo, `confME_TOO') 2510fc742e1Seric 2520fc742e1Seric# verify RHS in newaliases? 25333714691Seric_OPTION(CheckAliases, `confCHECK_ALIASES') 2540fc742e1Seric 2550fc742e1Seric# default messages to old style headers if no special punctuation? 25633714691Seric_OPTION(OldStyleHeaders, `confOLD_STYLE_HEADERS') 2570fc742e1Seric 2588bcc474dSeric# SMTP daemon options 25933714691Seric_OPTION(DaemonPortOptions, `confDAEMON_OPTIONS', Port=esmtp) 2608bcc474dSeric 2612188aa70Seric# privacy flags 26233714691Seric_OPTION(PrivacyOptions, `confPRIVACY_FLAGS', authwarnings) 2632188aa70Seric 2640fc742e1Seric# who (if anyone) should get extra copies of error messages 26533714691Seric_OPTION(PostMasterCopy, `confCOPY_ERRORS_TO', Postmaster) 2660fc742e1Seric 2670fc742e1Seric# slope of queue-only function 26833714691Seric_OPTION(QueueFactor, `confQUEUE_FACTOR', 600000) 2690fc742e1Seric 2700fc742e1Seric# queue directory 27133714691SericO QueueDirectory=ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue) 2720fc742e1Seric 27333714691Seric# timeouts (many of these) 27433714691Seric_OPTION(Timeout.initial, `confTO_INITIAL', 5m) 27533714691Seric_OPTION(Timeout.helo, `confTO_HELO', 5m) 27633714691Seric_OPTION(Timeout.mail, `confTO_MAIL', 10m) 27733714691Seric_OPTION(Timeout.rcpt, `confTO_RCPT', 1h) 27833714691Seric_OPTION(Timeout.datainit, `confTO_DATAINIT', 5m) 27933714691Seric_OPTION(Timeout.datablock, `confTO_DATABLOCK', 1h) 28033714691Seric_OPTION(Timeout.datafinal, `confTO_DATAFINAL', 1h) 28133714691Seric_OPTION(Timeout.rset, `confTO_RSET', 5m) 28233714691Seric_OPTION(Timeout.quit, `confTO_QUIT', 2m) 28333714691Seric_OPTION(Timeout.misc, `confTO_MISC', 2m) 28433714691Seric_OPTION(Timeout.command, `confTO_COMMAND', 1h) 28533714691Seric_OPTION(Timeout.ident, `confTO_IDENT', 30s) 28633714691Seric_OPTION(Timeout.fileopen, `confTO_FILEOPEN', 60s) 28733714691Seric_OPTION(Timeout.queuereturn, `confTO_QUEUERETURN', 5d) 28833714691Seric_OPTION(Timeout.queuereturn.normal, `confTO_QUEUERETURN_NORMAL', 5d) 28933714691Seric_OPTION(Timeout.queuereturn.urgent, `confTO_QUEUERETURN_URGENT', 2d) 29033714691Seric_OPTION(Timeout.queuereturn.non-urgent, `confTO_QUEUERETURN_NONURGENT', 7d) 29133714691Seric_OPTION(Timeout.queuewarn, `confTO_QUEUEWARN', 4h) 29233714691Seric_OPTION(Timeout.queuewarn.normal, `confTO_QUEUEWARN_NORMAL', 4h) 29333714691Seric_OPTION(Timeout.queuewarn.urgent, `confTO_QUEUEWARN_URGENT', 1h) 29433714691Seric_OPTION(Timeout.queuewarn.non-urgent, `confTO_QUEUEWARN_NONURGENT', 12h) 2950fc742e1Seric 2964517714dSeric# should we not prune routes in route-addr syntax addresses? 29733714691Seric_OPTION(DontPruneRoutes, `confDONT_PRUNE_ROUTES') 2984517714dSeric 2990fc742e1Seric# queue up everything before forking? 30033714691Seric_OPTION(SuperSafe, `confSAFE_QUEUE') 3010fc742e1Seric 3020fc742e1Seric# status file 303dbb1cce8SericO StatusFile=ifdef(`STATUS_FILE', `STATUS_FILE', /etc/sendmail.st) 3040fc742e1Seric 3050fc742e1Seric# time zone handling: 3060fc742e1Seric# if undefined, use system default 3070fc742e1Seric# if defined but null, use TZ envariable passed in 3080fc742e1Seric# if defined and non-null, use that info 30933714691Sericifelse(confTIME_ZONE, `USE_SYSTEM', `#O TimeZoneSpec=', 31033714691Seric confTIME_ZONE, `USE_TZ', `O TimeZoneSpec=', 31133714691Seric `O TimeZoneSpec=confTIME_ZONE') 3120fc742e1Seric 31333714691Seric# default UID (can be username or userid:groupid) 31433714691Seric_OPTION(DefaultUser, `confDEF_USER_ID', nobody) 3150fc742e1Seric 3160fc742e1Seric# list of locations of user database file (null means no lookup) 31733714691Seric_OPTION(UserDatabaseSpec, `confUSERDB_SPEC', /etc/userdb) 3180fc742e1Seric 3198bcc474dSeric# fallback MX host 32033714691Seric_OPTION(FallbackMXhost, `confFALLBACK_MX', fall.back.host.net) 3218bcc474dSeric 32211f06b84Seric# if we are the best MX host for a site, try it directly instead of config err 32333714691Seric_OPTION(TryNullMXList, `confTRY_NULL_MX_LIST') 32411f06b84Seric 3250fc742e1Seric# load average at which we just queue messages 32633714691Seric_OPTION(QueueLA, `confQUEUE_LA', 8) 3270fc742e1Seric 3280fc742e1Seric# load average at which we refuse connections 32933714691Seric_OPTION(RefuseLA, `confREFUSE_LA', 12) 3300fc742e1Seric 3310fc742e1Seric# work recipient factor 33233714691Seric_OPTION(RecipientFactor, `confWORK_RECIPIENT_FACTOR', 30000) 3330fc742e1Seric 3340fc742e1Seric# deliver each queued job in a separate process? 33533714691Seric_OPTION(ForkEachJob, `confSEPARATE_PROC') 3360fc742e1Seric 3370fc742e1Seric# work class factor 33833714691Seric_OPTION(ClassFactor, `confWORK_CLASS_FACTOR', 1800) 3390fc742e1Seric 3400fc742e1Seric# work time factor 34133714691Seric_OPTION(RetryFactor, `confWORK_TIME_FACTOR', 90000) 3420fc742e1Seric 3437837870bSeric# shall we sort the queue by hostname first? 34433714691Seric_OPTION(QueueSortOrder, `confQUEUE_SORT_ORDER', priority) 34533714691Seric 34633714691Seric# minimum time in queue before retry 34733714691Seric_OPTION(MinQueueAge, `confMIN_QUEUE_AGE', 30m) 34833714691Seric 34933714691Seric# default character set 35033714691Seric_OPTION(DefaultCharSet, `confDEF_CHAR_SET', iso-8859-1) 35133714691Seric 35233714691Seric# service switch file (ignored on Solaris, Ultrix, OSF/1, others) 35333714691Seric_OPTION(ServiceSwitchFile, `confSERVICE_SWITCH_FILE', /etc/service.switch) 35433714691Seric 35533714691Seric# dialup line delay on connection failure 35633714691Seric_OPTION(DialDelay, `confDIAL_DELAY', 10s) 35733714691Seric 35833714691Seric# action to take if there are no recipients in the message 35933714691Seric_OPTION(NoRecipientAction, `confNO_RCPT_ACTION', add-to-undisclosed) 36033714691Seric 36133714691Seric# chrooted environment for writing to files 36233714691Seric_OPTION(SafeFileEnvironment, `confSAFE_FILE_ENV', /arch) 3637837870bSeric 3640d03837eSeric# are colons OK in addresses? 3650d03837eSeric_OPTION(ColonOkInAddr, `confCOLON_OK_IN_ADDR') 3660d03837eSeric 3675280284eSeric# how many jobs can you process in the queue? 3685280284eSeric_OPTION(MaxQueueRunSize, `confMAX_QUEUE_RUN_SIZE', 10000) 3695280284eSeric 370*8a820e23Seric# shall I avoid expanding CNAMEs (violates protocols)? 371*8a820e23Seric_OPTION(DontExpandCnames, `confDONT_EXPAND_CNAMES') 372*8a820e23Seric 3730fc742e1Seric########################### 3740fc742e1Seric# Message precedences # 3750fc742e1Seric########################### 3760fc742e1Seric 3770fc742e1SericPfirst-class=0 3780fc742e1SericPspecial-delivery=100 37985afb57eSericPlist=-30 3800fc742e1SericPbulk=-60 3810fc742e1SericPjunk=-100 3820fc742e1Seric 3830fc742e1Seric##################### 3840fc742e1Seric# Trusted users # 3850fc742e1Seric##################### 3860fc742e1Seric 38733714691Seric# this is equivalent to setting class "t" 38833714691Seric#Ft/etc/sendmail.trusted 3890fc742e1SericTroot 3900fc742e1SericTdaemon 3910fc742e1SericTuucp 3920fc742e1Seric 3930fc742e1Seric######################### 3940fc742e1Seric# Format of headers # 3950fc742e1Seric######################### 3960fc742e1Seric 397d5ba2395SericH?P?Return-Path: $g 3980c76e09cSericHReceived: confRECEIVED_HEADER 3990fc742e1SericH?D?Resent-Date: $a 4000fc742e1SericH?D?Date: $a 4010fc742e1SericH?F?Resent-From: $q 4020fc742e1SericH?F?From: $q 4030fc742e1SericH?x?Full-Name: $x 4040fc742e1SericHSubject: 4050fc742e1Seric# HPosted-Date: $a 4060fc742e1Seric# H?l?Received-Date: $b 4070fc742e1SericH?M?Resent-Message-Id: <$t.$i@$j> 4080fc742e1SericH?M?Message-Id: <$t.$i@$j> 40933714691Sericifdef(`_NULL_CLIENT_ONLY_', 41033714691Seric `include(../m4/nullrelay.m4)m4exit', 41133714691Seric `dnl') 4126f4c5567Seric# 4136f4c5567Seric###################################################################### 4146f4c5567Seric###################################################################### 4156f4c5567Seric##### 4166f4c5567Seric##### REWRITING RULES 4176f4c5567Seric##### 4186f4c5567Seric###################################################################### 4196f4c5567Seric###################################################################### 4206f4c5567Seric 4218d35298dSericundivert(9)dnl 4226f4c5567Seric 4236f4c5567Seric########################################### 4246f4c5567Seric### Rulset 3 -- Name Canonicalization ### 4256f4c5567Seric########################################### 42671e1a4d1SericS3 4276f4c5567Seric 4283669020aSeric# handle null input (translate to <@> special case) 4291c0b669eSericR$@ $@ <@> 430f2ad5decSeric 431afc39b13Seric# strip group: syntax (not inside angle brackets!) and trailing semicolon 432afc39b13SericR$* $: $1 <@> mark addresses 433afc39b13SericR$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr> 4341ad646abSericR$* :: $* <@> $: $1 :: $2 unmark node::addr 4358aa7ff3bSericR:`include': $* <@> $: :`include': $1 unmark :`include':... 436afc39b13SericR$* : $* <@> $: $2 strip colon if marked 437afc39b13SericR$* <@> $: $1 unmark 438afc39b13SericR$* ; $: $1 strip trailing semi 439afc39b13Seric 440afc39b13Seric# null input now results from list:; syntax 441afc39b13SericR$@ $@ :; <@> 442afc39b13Seric 4436f4c5567Seric# basic textual canonicalization -- note RFC733 heuristic here 4448d0fcb8eSericR$*<$*>$*<$*>$* $2$3<$4>$5 strip multiple <> <> 44585ebc819SericR$*<$*<$+>$*>$* <$3>$5 2-level <> nesting 4461c0b669eSericR$*<>$* $@ <@> MAIL FROM:<> case 4476f4c5567SericR$*<$+>$* $2 basic RFC821/822 parsing 4486f4c5567Seric 4496f4c5567Seric# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later 4506f4c5567SericR@ $+ , $+ @ $1 : $2 change all "," to ":" 4516f4c5567Seric 4526f4c5567Seric# localize and dispose of route-based addresses 45398c7c04fSericR@ $+ : $+ $@ $>96 < @$1 > : $2 handle <route-addr> 4546f4c5567Seric 4556f4c5567Seric# find focus for list syntax 45698c7c04fSericR $+ : $* ; @ $+ $@ $>96 $1 : $2 ; < @ $3 > list syntax 4576f4c5567SericR $+ : $* ; $@ $1 : $2; list syntax 4586f4c5567Seric 4596f4c5567Seric# find focus for @ syntax addresses 4606f4c5567SericR$+ @ $+ $: $1 < @ $2 > focus on domain 4616f4c5567SericR$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right 46298c7c04fSericR$+ < @ $+ > $@ $>96 $1 < @ $2 > already canonical 4636f4c5567Seric 464af3c6a2dSeric# do some sanity checking 465af3c6a2dSericR$* < @ $* : $* > $* $1 < @ $2 $3 > $4 nix colons in addrs 466af3c6a2dSeric 46790caf1e3Sericifdef(`_NO_UUCP_', `dnl', 46890caf1e3Seric`# convert old-style addresses to a domain-based address 46998c7c04fSericR$- ! $+ $@ $>96 $2 < @ $1 .UUCP > resolve uucp names 47098c7c04fSericR$+ . $- ! $+ $@ $>96 $3 < @ $1 . $2 > domain uucps 4711ad646abSericR$+ ! $+ $@ $>96 $2 < @ $1 .UUCP > uucp subdomains 4721ad646abSeric') 473a50668adSericifdef(`_USE_DECNET_SYNTAX_', 4741ad646abSeric`# convert node::user addresses into a domain-based address 4751ad646abSericR$- :: $+ $@ $>96 $2 < @ $1 .DECNET > resolve DECnet names 476a50668adSericR$- . $- :: $+ $@ $>96 $3 < @ $1.$2 .DECNET > numeric DECnet addr 4771ad646abSeric', 4781ad646abSeric `dnl') 4796f4c5567Seric# if we have % signs, take the rightmost one 4806f4c5567SericR$* % $* $1 @ $2 First make them all @s. 4816f4c5567SericR$* @ $* @ $* $1 % $2 @ $3 Undo all but the last. 48298c7c04fSericR$* @ $* $@ $>96 $1 < @ $2 > Insert < > and finish 4836f4c5567Seric 4846f4c5567Seric# else we must be a local name 4853f9306bfSericR$* $@ $>96 $1 4866f4c5567Seric 4876f4c5567Seric 488585ddacfSeric################################################ 48998c7c04fSeric### Ruleset 96 -- bottom half of ruleset 3 ### 490585ddacfSeric################################################ 4916f4c5567Seric 49298c7c04fSericS96 4936f4c5567Seric 4946f4c5567Seric# handle special cases for local names 495fde20765SericR$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all 496fde20765SericR$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain 497fde20765Sericifdef(`_NO_UUCP_', `dnl', 498fde20765Seric`R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain') 49929627271SericR$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [a.b.c.d] 50029627271SericR$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal 501aabb28c9SericR$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr 502f6f96ca7Sericifdef(`DOMAIN_TABLE', ` 5034e4d6dd0Seric# look up domains in the domain table 5044e4d6dd0SericR$* < @ $+ > $* $: $1 < @ $(domaintable $2 $) > $3', 505f6f96ca7Seric`dnl') 50631695942Sericundivert(2)dnl 5076f4c5567Seric 50860f3bdf6Sericifdef(`_NO_UUCP_', `dnl', 50960f3bdf6Seric`ifdef(`UUCP_RELAY', 510788179f5Seric`# pass UUCP addresses straight through 511a6293a76SericR$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', 512788179f5Seric`# if really UUCP, handle it immediately 51363eeb308Sericifdef(`_CLASS_U_', 514a6293a76Seric`R$* < @ $=U . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 51563eeb308Sericifdef(`_CLASS_V_', 516a6293a76Seric`R$* < @ $=V . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 51763eeb308Sericifdef(`_CLASS_W_', 518a6293a76Seric`R$* < @ $=W . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 51963eeb308Sericifdef(`_CLASS_X_', 520a6293a76Seric`R$* < @ $=X . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 52163eeb308Sericifdef(`_CLASS_Y_', 522a6293a76Seric`R$* < @ $=Y . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 523a027f997Seric 524a027f997Seric# try UUCP traffic as a local address 525a6293a76SericR$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3 52698c7c04fSericR$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3') 52760f3bdf6Seric') 52823e264c3Sericifdef(`_NO_CANONIFY_', `dnl', 52960f3bdf6Seric`# pass to name server to make hostname canonical 5302f61eeb4SericR$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4') 5312f61eeb4Seric 53223e264c3Seric# local host aliases and pseudo-domains are always canonical 53323e264c3SericR$* < @ $=w > $* $: $1 < @ $2 . > $3 534a6293a76SericR$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4 53523e264c3SericR$* < @ $* . . > $* $1 < @ $2 . > $3 536a6293a76Seric 53763eeb308Seric# if this is the local hostname, make sure we treat is as canonical 53863eeb308SericR$* < @ $j > $* $: $1 < @ $j . > $2 5396f4c5567Seric 5406f4c5567Seric 5416f4c5567Seric################################################## 5426f4c5567Seric### Ruleset 4 -- Final Output Post-rewriting ### 5436f4c5567Seric################################################## 5446f4c5567SericS4 5456f4c5567Seric 54692b77a19SericR$* <@> $@ handle <> and list:; 5476f4c5567Seric 54863eeb308Seric# strip trailing dot off possibly canonical name 54963eeb308SericR$* < @ $+ . > $* $1 < @ $2 > $3 55063eeb308Seric 5516f4c5567Seric# externalize local domain info 5526f4c5567SericR$* < $+ > $* $1 $2 $3 defocus 5536f4c5567SericR@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical 5541f23b499SericR@ $* $@ @ $1 ... and exit 5556f4c5567Seric 55690caf1e3Sericifdef(`_NO_UUCP_', `dnl', 55790caf1e3Seric`# UUCP must always be presented in old form 55890caf1e3SericR$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u') 5596f4c5567Seric 560a50668adSericifdef(`_USE_DECNET_SYNTAX_', 561a50668adSeric`# put DECnet back in :: form 562a50668adSericR$+ @ $+ . DECNET $2 :: $1 u@h.DECNET => h::u', 563a50668adSeric `dnl') 5646f4c5567Seric# delete duplicate local names 565b47d0647SericR$+ % $=w @ $=w $1 @ $j u%host@host => u@host 5666f4c5567Seric 5676f4c5567Seric 5686f4c5567Seric 569585ddacfSeric############################################################## 57098c7c04fSeric### Ruleset 97 -- recanonicalize and call ruleset zero ### 5716f4c5567Seric### (used for recursive calls) ### 572585ddacfSeric############################################################## 5736f4c5567Seric 57498c7c04fSericS`'97 5756f4c5567SericR$* $: $>3 $1 5766f4c5567SericR$* $@ $>0 $1 5776f4c5567Seric 5786f4c5567Seric 5796f4c5567Seric###################################### 5806f4c5567Seric### Ruleset 0 -- Parse Address ### 5816f4c5567Seric###################################### 5826f4c5567Seric 5836f4c5567SericS0 5846f4c5567Seric 5859ea84951SericR<@> $#_LOCAL_ $: <@> special case error msgs 586970fb21aSericR$* : $* ; <@> $#error $@ 5.1.3 $: "list:; syntax illegal for recipient addresses" 587970fb21aSericR<@ $+> $#error $@ 5.1.1 $: "user address required" 588970fb21aSericR$* <$* : $* > $* $#error $@ 5.1.1 $: "colon illegal in host name part" 589970fb21aSericR$* < @ . > $* $#error $@ 5.1.2 $: "invalid host name" 5901c5e29abSeric 5914cad3747Sericifdef(`_MAILER_smtp_', 5924cad3747Seric`# handle numeric address spec 59398c7c04fSericR$* < @ [ $+ ] > $* $: $>98 $1 < @ [ $2 ] > $3 numeric internet spec 5940df17a5aSericR$* < @ [ $+ ] > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 still numeric: send', 5953c5c069fSeric `dnl') 5966f4c5567Seric 597b1286b66Seric# now delete the local info -- note $=O to find characters that cause forwarding 59898c7c04fSericR$* < @ > $* $@ $>97 $1 user@ => user 59998c7c04fSericR< @ $=w . > : $* $@ $>97 $2 @here:... -> ... 60098c7c04fSericR$* $=O $* < @ $=w . > $@ $>97 $1 $2 $3 ...@here -> ... 6018e83e806Seric 6028e83e806Seric# handle local hacks 60398c7c04fSericR$* $: $>98 $1 604ee3aff56Seric 605ee3aff56Seric# short circuit local delivery so forwarded email works 606372f243aSericifdef(`_MAILER_usenet_', 607372f243aSeric`R$+ . USENET < @ $=w . > $#usenet $: $1 handle usenet specially', 608372f243aSeric `dnl') 60980df0526Sericifdef(`_STICKY_LOCAL_DOMAIN_', 61080df0526Seric`R$+ < @ $=w . > $: < $H > $1 < @ $2 . > first try hub 6119e90d93dSericR< $+ > $+ < $+ > $>95 < $1 > $2 < $3 > yep .... 612b9996d05SericR< > $+ + $* < $+ > $#_LOCAL_ $: $1 + $2 plussed name? 61380df0526SericR< > $+ < $+ > $#_LOCAL_ $: @ $1 nope, local address', 614ee3aff56Seric`R$=L < @ $=w . > $#_LOCAL_ $: @ $1 special local names 615b9996d05SericR$+ < @ $=w . > $#_LOCAL_ $: $1 regular local name') 61621933f06Sericifdef(`MAILER_TABLE', 61721933f06Seric` 61821933f06Seric# not local -- try mailer table lookup 61921933f06SericR$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name 62021933f06SericR< $+ . > $* $: < $1 > $2 strip trailing dot 62121933f06SericR< $+ > $* $: < $(mailertable $1 $) > $2 lookup 62221933f06SericR< $- : $+ > $* $# $1 $@ $2 $: $3 check -- resolved? 62321933f06SericR< $+ > $* $: $>90 <$1> $2 try domain', 62421933f06Seric`dnl') 62571e1a4d1Sericundivert(4)dnl 62671e1a4d1Seric 62707da7f83Sericifdef(`_NO_UUCP_', `dnl', 62807da7f83Seric`# resolve remotely connected UUCP links (if any) 629138c6544Sericifdef(`_CLASS_V_', 63098c7c04fSeric`R$* < @ $=V . UUCP . > $* $: $>95 < $V > $1 <@$2.UUCP.> $3', 6316dafc3b0Seric `dnl') 632138c6544Sericifdef(`_CLASS_W_', 63398c7c04fSeric`R$* < @ $=W . UUCP . > $* $: $>95 < $W > $1 <@$2.UUCP.> $3', 6346dafc3b0Seric `dnl') 635138c6544Sericifdef(`_CLASS_X_', 63698c7c04fSeric`R$* < @ $=X . UUCP . > $* $: $>95 < $X > $1 <@$2.UUCP.> $3', 63707da7f83Seric `dnl')') 63871e1a4d1Seric 6396f4c5567Seric# resolve fake top level domains by forwarding to other hosts 6406f4c5567Sericifdef(`BITNET_RELAY', 64198c7c04fSeric`R$*<@$+.BITNET.>$* $: $>95 < $B > $1 <@$2.BITNET.> $3 user@host.BITNET', 6426f4c5567Seric `dnl') 6431ad646abSericifdef(`DECNET_RELAY', 6441ad646abSeric`R$*<@$+.DECNET.>$* $: $>95 < $C > $1 <@$2.DECNET.> $3 user@host.DECNET', 6451ad646abSeric `dnl') 646d5e4353cSericifdef(`_MAILER_pop_', 647d5e4353cSeric`R$+ < @ POP. > $#pop $: $1 user@POP', 648d5e4353cSeric `dnl') 6495caa7271Sericifdef(`_MAILER_fax_', 650a6293a76Seric`R$+ < @ $+ .FAX. > $#fax $@ $2 $: $1 user@host.FAX', 6515caa7271Seric`ifdef(`FAX_RELAY', 65298c7c04fSeric`R$*<@$+.FAX.>$* $: $>95 < $F > $1 <@$2.FAX.> $3 user@host.FAX', 6535caa7271Seric `dnl')') 6546f4c5567Seric 65571e1a4d1Sericifdef(`UUCP_RELAY', 65671e1a4d1Seric`# forward non-local UUCP traffic to our UUCP relay 65798c7c04fSericR$*<@$*.UUCP.>$* $: $>95 < $Y > $1 <@$2.UUCP.> $3 uucp mail', 6584cad3747Seric`ifdef(`_MAILER_uucp_', 65971e1a4d1Seric`# forward other UUCP traffic straight to UUCP 6600a7545bbSericR$* < @ $+ .UUCP. > $* $#uucp $@ $2 $: $1 < @ $2 .UUCP. > $3 user@host.UUCP', 66171e1a4d1Seric `dnl')') 6628e83e806Sericifdef(`_MAILER_usenet_', ` 663f6f96ca7Seric# addresses sent to net.group.USENET will get forwarded to a newsgroup 664a6e5b286SericR$+ . USENET $#usenet $: $1', 665f6f96ca7Seric `dnl') 666f6f96ca7Seric 66785afb57eSericifdef(`_LOCAL_RULES_', 66885afb57eSeric`# figure out what should stay in our local mail system 669f6f96ca7Sericundivert(1)', `dnl') 670f6f96ca7Seric 6718a1641c9Seric# pass names that still have a host to a smarthost (if defined) 67298c7c04fSericR$* < @ $* > $* $: $>95 < $S > $1 < @ $2 > $3 glue on smarthost name 673f6f96ca7Seric 6748a1641c9Seric# deal with other remote names 675b501d107Sericifdef(`_MAILER_smtp_', 67619110660Seric`R$* < @$* > $* $#_SMTP_ $@ $2 $: $1 < @ $2 > $3 user@host.domain', 677970fb21aSeric`R$* < @$* > $* $#error $@ 5.1.2 $: Unrecognized host name $2') 6786f4c5567Seric 67998c7c04fSeric# if this is quoted, strip the quotes and try again 680d31361c2SericR$+ $: $(dequote $1 $) strip quotes 68198c7c04fSericR$+ $=O $+ $@ $>97 $1 $2 $3 try again 682d31361c2Seric 683d31361c2Seric# handle locally delivered names 684d6e720f1SericR$=L $#_LOCAL_ $: @ $1 special local names 685d6e720f1SericR$+ $#_LOCAL_ $: $1 regular local names 6866f4c5567Seric 6874cad3747Seric########################################################################### 6884cad3747Seric### Ruleset 5 -- special rewriting after aliases have been expanded ### 6894cad3747Seric########################################################################### 6906f4c5567Seric 69163eeb308SericS5 69263eeb308Seric 6933f9306bfSeric# deal with plussed users so aliases work nicely 6943f9306bfSericR$+ + * $#_LOCAL_ $@ $&h $: $1 6953f9306bfSericR$+ + $* $#_LOCAL_ $@ $2 $: $1 + * 696b3d9bc08Seric 69780df0526Seric# prepend an empty "forward host" on the front 69880df0526SericR$+ $: <> $1 69980df0526Seric 70080df0526Sericifdef(`LUSER_RELAY', 70180df0526Seric`# send unrecognized local users to a relay host 702708f9b8bSericR< > $+ + $* $: < $L . > $( user $1 $) + $2 703708f9b8bSericR< > $+ $: < $L . > $( user $1 $) look up user 704708f9b8bSericR< $* > $+ <> $* $: < > $2 $3 found; strip $L 705708f9b8bSericR< $* . > $+ $: < $1 > $2 strip extra dot') 706708f9b8bSeric 707708f9b8bSeric# handle plussed local names 708708f9b8bSericR< > $+ + $* $#_LOCAL_ $@ $2 $: $1 70980df0526Seric 710fdf362d5Seric# see if we have a relay or a hub 711ee3aff56SericR< > $+ $: < $H > $1 try hub 7129e90d93dSericR< > $+ $: < $R > $1 try relay 713ee3aff56SericR< > $+ $@ $1 nope, give up 71498c7c04fSericR< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 > 71598c7c04fSericR< $+ > $+ $@ $>95 < $1 > $2 < @ $1 > 716bc926da7Sericifdef(`MAILER_TABLE', 717bc926da7Seric` 718bc926da7Seric 71911f06b84Seric################################################################### 720bc926da7Seric### Ruleset 90 -- try domain part of mailertable entry ### 72111f06b84Seric################################################################### 722bc926da7Seric 723bc926da7SericS90 724833e6943SericR$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4 72574fcb73aSericR$* <$- : $+ > $* $# $2 $@ $3 $: $4 check -- resolved? 72674fcb73aSericR$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again 727a69811b9SericR$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "." 72821933f06SericR<$- : $+ > $* $# $1 $@ $2 $: $3 "." found? 72921933f06SericR< $* > $* $@ $2 no mailertable match', 730bc926da7Seric`dnl') 73111f06b84Seric 73211f06b84Seric################################################################### 73398c7c04fSeric### Ruleset 95 -- canonify mailer:host syntax to triple ### 734aeacfb61Seric################################################################### 735aeacfb61Seric 73698c7c04fSericS95 737aeacfb61SericR< > $* $@ $1 strip off null relay 738aeacfb61SericR< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer 739aeacfb61SericR< $=w > $* $@ $2 delete local host 740aeacfb61SericR< $+ > $* $#_RELAY_ $@ $1 $: $2 use unqualified mailer 741aeacfb61Seric 742aeacfb61Seric################################################################### 74398c7c04fSeric### Ruleset 98 -- local part of ruleset zero (can be null) ### 74411f06b84Seric################################################################### 74511f06b84Seric 74698c7c04fSericS98 74711f06b84Sericundivert(3)dnl 7486f4c5567Seric# 7496f4c5567Seric###################################################################### 7506f4c5567Seric###################################################################### 7516f4c5567Seric##### 7521297e20cSeric`##### MAILER DEFINITIONS' 7536f4c5567Seric##### 7546f4c5567Seric###################################################################### 7556f4c5567Seric###################################################################### 7566f4c5567Sericundivert(7)dnl 757