proto.m4 revision 43148
138032Speterdivert(-1) 238032Speter# 338032Speter# Copyright (c) 1998 Sendmail, Inc. All rights reserved. 438032Speter# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved. 538032Speter# Copyright (c) 1988, 1993 638032Speter# The Regents of the University of California. All rights reserved. 738032Speter# 838032Speter# By using this file, you agree to the terms and conditions set 938032Speter# forth in the LICENSE file which can be found at the top level of 1038032Speter# the sendmail distribution. 1138032Speter# 1238032Speter# 1338032Speterdivert(0) 1438032Speter 1542575SpeterVERSIONID(`@(#)proto.m4 8.237 (Berkeley) 12/17/1998') 1638032Speter 1738032SpeterMAILER(local)dnl 1838032Speter 1938032Speter# level 8 config file format 2042575SpeterV8/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley') 2138032Speterdivert(-1) 2238032Speter 2338032Speter# do some sanity checking 2438032Speterifdef(`__OSTYPE__',, 2538032Speter `errprint(`*** ERROR: No system type defined (use OSTYPE macro)')') 2638032Speter 2738032Speter# pick our default mailers 2838032Speterifdef(`confSMTP_MAILER',, `define(`confSMTP_MAILER', `esmtp')') 2938032Speterifdef(`confLOCAL_MAILER',, `define(`confLOCAL_MAILER', `local')') 3038032Speterifdef(`confRELAY_MAILER',, 3138032Speter `define(`confRELAY_MAILER', 3238032Speter `ifdef(`_MAILER_smtp_', `relay', 3338032Speter `ifdef(`_MAILER_uucp', `uucp-new', `unknown')')')') 3438032Speterifdef(`confUUCP_MAILER',, `define(`confUUCP_MAILER', `uucp-old')') 3538032Speterdefine(`_SMTP_', `confSMTP_MAILER')dnl for readability only 3638032Speterdefine(`_LOCAL_', `confLOCAL_MAILER')dnl for readability only 3738032Speterdefine(`_RELAY_', `confRELAY_MAILER')dnl for readability only 3838032Speterdefine(`_UUCP_', `confUUCP_MAILER')dnl for readability only 3938032Speter 4038032Speter# set our default hashed database type 4138032Speterifdef(`DATABASE_MAP_TYPE',, `define(`DATABASE_MAP_TYPE', `hash')') 4238032Speter 4338032Speter# back compatibility with old config files 4438032Speterifdef(`confDEF_GROUP_ID', 4538032Speter `errprint(`*** confDEF_GROUP_ID is obsolete.') 4638032Speter errprint(` Use confDEF_USER_ID with a colon in the value instead.')') 4738032Speterifdef(`confREAD_TIMEOUT', 4838032Speter `errprint(`*** confREAD_TIMEOUT is obsolete.') 4938032Speter errprint(` Use individual confTO_<timeout> parameters instead.')') 5038032Speterifdef(`confMESSAGE_TIMEOUT', 5138032Speter `define(`_ARG_', index(confMESSAGE_TIMEOUT, /)) 5238032Speter ifelse(_ARG_, -1, 5338032Speter `define(`confTO_QUEUERETURN', confMESSAGE_TIMEOUT)', 5438032Speter `define(`confTO_QUEUERETURN', 5538032Speter substr(confMESSAGE_TIMEOUT, 0, _ARG_)) 5638032Speter define(`confTO_QUEUEWARN', 5738032Speter substr(confMESSAGE_TIMEOUT, eval(_ARG_+1)))')') 5838032Speterifdef(`confMIN_FREE_BLOCKS', `ifelse(index(confMIN_FREE_BLOCKS, /), -1,, 5938032Speter `errprint(`*** compound confMIN_FREE_BLOCKS is obsolete.') 6038032Speter errprint(` Use confMAX_MESSAGE_SIZE for the second part of the value.')')') 6138032Speter 6238032Speter# clean option definitions below.... 6338032Speterdefine(`_OPTION', `ifdef(`$2', `O $1=$2', `#O $1`'ifelse($3, `',, `=$3')')')dnl 6438032Speter 6538032Speterdivert(0)dnl 6638032Speter 6738032Speter# override file safeties - setting this option compromises system security 6838032Speter# need to set this now for the sake of class files 6938032Speter_OPTION(DontBlameSendmail, `confDONT_BLAME_SENDMAIL', safe) 7038032Speter 7138032Speter################## 7238032Speter# local info # 7338032Speter################## 7438032Speter 7538032SpeterCwlocalhost 7638032Speterifdef(`USE_CW_FILE', 7738032Speter`# file containing names of hosts for which we receive email 7838032SpeterFw`'confCW_FILE', 7938032Speter `dnl') 8038032Speter 8138032Speter# my official domain name 8238032Speter# ... `define' this only if sendmail cannot automatically determine your domain 8338032Speterifdef(`confDOMAIN_NAME', `Dj`'confDOMAIN_NAME', `#Dj$w.Foo.COM') 8438032Speter 8538032Speterifdef(`_NULL_CLIENT_ONLY_', `divert(-1)')dnl 8638032Speter 8738032SpeterCP. 8838032Speter 8938032Speterifdef(`UUCP_RELAY', 9038032Speter`# UUCP relay host 9138032SpeterDY`'UUCP_RELAY 9238032SpeterCPUUCP 9338032Speter 9438032Speter')dnl 9538032Speterifdef(`BITNET_RELAY', 9638032Speter`# BITNET relay host 9738032SpeterDB`'BITNET_RELAY 9838032SpeterCPBITNET 9938032Speter 10038032Speter')dnl 10138032Speterifdef(`DECNET_RELAY', 10238032Speter`define(`_USE_DECNET_SYNTAX_', 1)dnl 10338032Speter# DECnet relay host 10438032SpeterDC`'DECNET_RELAY 10538032SpeterCPDECNET 10638032Speter 10738032Speter')dnl 10838032Speterifdef(`FAX_RELAY', 10938032Speter`# FAX relay host 11038032SpeterDF`'FAX_RELAY 11138032SpeterCPFAX 11238032Speter 11338032Speter')dnl 11438032Speter# "Smart" relay host (may be null) 11538032SpeterDS`'ifdef(`SMART_HOST', SMART_HOST) 11638032Speter 11738032Speterifdef(`LUSER_RELAY', `dnl 11838032Speter# place to which unknown users should be forwarded 11938032SpeterKuser user -m -a<> 12038032SpeterDL`'LUSER_RELAY', 12138032Speter`dnl') 12238032Speter 12338032Speter# operators that cannot be in local usernames (i.e., network indicators) 12438032SpeterCO @ % ifdef(`_NO_UUCP_', `', `!') 12538032Speter 12638032Speter# a class with just dot (for identifying canonical names) 12738032SpeterC.. 12838032Speter 12938032Speter# a class with just a left bracket (for identifying domain literals) 13038032SpeterC[[ 13138032Speter 13238032Speterifdef(`MAILER_TABLE', `dnl 13338032Speter# Mailer table (overriding domains) 13438032SpeterKmailertable MAILER_TABLE', 13538032Speter`dnl') 13638032Speter 13738032Speterifdef(`DOMAIN_TABLE', `dnl 13838032Speter# Domain table (adding domains) 13938032SpeterKdomaintable DOMAIN_TABLE', 14038032Speter`dnl') 14138032Speter 14238032Speterifdef(`GENERICS_TABLE', `dnl 14338032Speter# Generics table (mapping outgoing addresses) 14438032SpeterKgenerics GENERICS_TABLE', 14538032Speter`dnl') 14638032Speter 14738032Speterifdef(`UUDOMAIN_TABLE', `dnl 14838032Speter# UUCP domain table 14938032SpeterKuudomain UUDOMAIN_TABLE', 15038032Speter`dnl') 15138032Speter 15238032Speterifdef(`BITDOMAIN_TABLE', `dnl 15338032Speter# BITNET mapping table 15438032SpeterKbitdomain BITDOMAIN_TABLE', 15538032Speter`dnl') 15638032Speter 15738032Speterifdef(`VIRTUSER_TABLE', `dnl 15838032Speter# Virtual user table (maps incoming users) 15938032SpeterKvirtuser VIRTUSER_TABLE', 16038032Speter`dnl') 16138032Speter 16238032Speterifdef(`ACCESS_TABLE', `dnl 16338032Speter# Access list database (for spam stomping) 16438032SpeterKaccess ACCESS_TABLE', 16538032Speter`dnl') 16638032Speter 16738032Speterifdef(`_RELAY_MX_SERVED_', `dnl 16838032Speter# MX map (to allow relaying to hosts that we MX for) 16938032SpeterKmxserved bestmx -z: -T<TEMP>', 17038032Speter`dnl') 17138032Speter 17238032Speterifdef(`_ACCEPT_UNRESOLVABLE_DOMAINS_',`dnl',`dnl 17338032Speter# Resolve map (to check if a host exists in check_mail) 17438032SpeterKresolve host -a<OK> -T<TEMP>') 17538032Speter 17638032Speterifdef(`confCR_FILE', `dnl 17738032Speter# Hosts that will permit relaying ($=R) 17838032SpeterFR`'confCR_FILE', 17938032Speter`dnl') 18038032Speter 18138032Speter# who I send unqualified names to (null means deliver locally) 18238032SpeterDR`'ifdef(`LOCAL_RELAY', LOCAL_RELAY) 18338032Speter 18438032Speter# who gets all local email traffic ($R has precedence for unqualified names) 18538032SpeterDH`'ifdef(`MAIL_HUB', MAIL_HUB) 18638032Speter 18738032Speter# dequoting map 18838032SpeterKdequote dequote 18938032Speter 19038032Speterdivert(0)dnl # end of nullclient diversion 19138032Speter# class E: names that should be exposed as from this host, even if we masquerade 19238032Speterifdef(`_NULL_CLIENT_ONLY_', `#', 19338032Speter`# class L: names that should be delivered locally, even if we have a relay 19438032Speter# class M: domains that should be converted to $M 19538032Speter#CL root 19638032Speter')CE root 19738032Speterundivert(5)dnl 19838032Speter 19938032Speter# who I masquerade as (null for no masquerading) (see also $=M) 20038032SpeterDM`'ifdef(`MASQUERADE_NAME', MASQUERADE_NAME) 20138032Speter 20238032Speter# my name for error messages 20338032Speterifdef(`confMAILER_NAME', `Dn`'confMAILER_NAME', `#DnMAILER-DAEMON') 20438032Speter 20538032Speterundivert(6)dnl 20638032Speterinclude(_CF_DIR_`m4/version.m4') 20738032Speter 20838032Speter############### 20938032Speter# Options # 21038032Speter############### 21138032Speter 21238032Speter# strip message body to 7 bits on input? 21338032Speter_OPTION(SevenBitInput, `confSEVEN_BIT_INPUT') 21438032Speter 21538032Speter# 8-bit data handling 21638032Speter_OPTION(EightBitMode, `confEIGHT_BIT_HANDLING', adaptive) 21738032Speter 21838032Speterifdef(`_NULL_CLIENT_ONLY_', `dnl', ` 21938032Speter# wait for alias file rebuild (default units: minutes) 22038032Speter_OPTION(AliasWait, `confALIAS_WAIT', 5m) 22138032Speter 22238032Speter# location of alias file 22342575Speter_OPTION(AliasFile, `ALIAS_FILE', ifdef(`_USE_ETC_MAIL_', /etc/mail/aliases, /etc/aliases)) 22438032Speter') 22538032Speter# minimum number of free blocks on filesystem 22638032Speter_OPTION(MinFreeBlocks, `confMIN_FREE_BLOCKS', 100) 22738032Speter 22838032Speter# maximum message size 22938032Speter_OPTION(MaxMessageSize, `confMAX_MESSAGE_SIZE', 1000000) 23038032Speter 23138032Speter# substitution for space (blank) characters 23238032Speter_OPTION(BlankSub, `confBLANK_SUB', _) 23338032Speter 23438032Speter# avoid connecting to "expensive" mailers on initial submission? 23538032Speter_OPTION(HoldExpensive, `confCON_EXPENSIVE') 23638032Speter 23738032Speter# checkpoint queue runs after every N successful deliveries 23838032Speter_OPTION(CheckpointInterval, `confCHECKPOINT_INTERVAL', 10) 23938032Speter 24038032Speter# default delivery mode 24138032Speter_OPTION(DeliveryMode, `confDELIVERY_MODE', background) 24238032Speter 24338032Speter# automatically rebuild the alias database? 24438032Speter_OPTION(AutoRebuildAliases, `confAUTO_REBUILD') 24538032Speter 24638032Speter# error message header/file 24742575Speter_OPTION(ErrorHeader, `confERROR_MESSAGE', ifdef(`_USE_ETC_MAIL_', /etc/mail/error-header, /etc/sendmail.oE)) 24838032Speter 24938032Speter# error mode 25038032Speter_OPTION(ErrorMode, `confERROR_MODE', print) 25138032Speter 25238032Speter# save Unix-style "From_" lines at top of header? 25338032Speter_OPTION(SaveFromLine, `confSAVE_FROM_LINES') 25438032Speter 25538032Speter# temporary file mode 25638032Speter_OPTION(TempFileMode, `confTEMP_FILE_MODE', 0600) 25738032Speter 25838032Speter# match recipients against GECOS field? 25938032Speter_OPTION(MatchGECOS, `confMATCH_GECOS') 26038032Speter 26138032Speter# maximum hop count 26238032Speter_OPTION(MaxHopCount, `confMAX_HOP', 17) 26338032Speter 26438032Speter# location of help file 26542575SpeterO HelpFile=ifdef(`HELP_FILE', HELP_FILE, ifdef(`_USE_ETC_MAIL_', /etc/mail/helpfile, /usr/lib/sendmail.hf)) 26638032Speter 26738032Speter# ignore dots as terminators in incoming messages? 26838032Speter_OPTION(IgnoreDots, `confIGNORE_DOTS') 26938032Speter 27038032Speter# name resolver options 27138032Speter_OPTION(ResolverOptions, `confBIND_OPTS', +AAONLY) 27238032Speter 27338032Speter# deliver MIME-encapsulated error messages? 27438032Speter_OPTION(SendMimeErrors, `confMIME_FORMAT_ERRORS') 27538032Speter 27638032Speter# Forward file search path 27738032Speter_OPTION(ForwardPath, `confFORWARD_PATH', /var/forward/$u:$z/.forward.$w:$z/.forward) 27838032Speter 27938032Speter# open connection cache size 28038032Speter_OPTION(ConnectionCacheSize, `confMCI_CACHE_SIZE', 2) 28138032Speter 28238032Speter# open connection cache timeout 28338032Speter_OPTION(ConnectionCacheTimeout, `confMCI_CACHE_TIMEOUT', 5m) 28438032Speter 28538032Speter# persistent host status directory 28638032Speter_OPTION(HostStatusDirectory, `confHOST_STATUS_DIRECTORY', .hoststat) 28738032Speter 28838032Speter# single thread deliveries (requires HostStatusDirectory)? 28938032Speter_OPTION(SingleThreadDelivery, `confSINGLE_THREAD_DELIVERY') 29038032Speter 29138032Speter# use Errors-To: header? 29238032Speter_OPTION(UseErrorsTo, `confUSE_ERRORS_TO') 29338032Speter 29438032Speter# log level 29538032Speter_OPTION(LogLevel, `confLOG_LEVEL', 10) 29638032Speter 29738032Speter# send to me too, even in an alias expansion? 29838032Speter_OPTION(MeToo, `confME_TOO') 29938032Speter 30038032Speter# verify RHS in newaliases? 30138032Speter_OPTION(CheckAliases, `confCHECK_ALIASES') 30238032Speter 30338032Speter# default messages to old style headers if no special punctuation? 30438032Speter_OPTION(OldStyleHeaders, `confOLD_STYLE_HEADERS') 30538032Speter 30638032Speter# SMTP daemon options 30738032Speter_OPTION(DaemonPortOptions, `confDAEMON_OPTIONS', Port=esmtp) 30838032Speter 30938032Speter# privacy flags 31038032Speter_OPTION(PrivacyOptions, `confPRIVACY_FLAGS', authwarnings) 31138032Speter 31238032Speter# who (if anyone) should get extra copies of error messages 31338032Speter_OPTION(PostMasterCopy, `confCOPY_ERRORS_TO', Postmaster) 31438032Speter 31538032Speter# slope of queue-only function 31638032Speter_OPTION(QueueFactor, `confQUEUE_FACTOR', 600000) 31738032Speter 31838032Speter# queue directory 31938032SpeterO QueueDirectory=ifdef(`QUEUE_DIR', QUEUE_DIR, /var/spool/mqueue) 32038032Speter 32138032Speter# timeouts (many of these) 32238032Speter_OPTION(Timeout.initial, `confTO_INITIAL', 5m) 32338032Speter_OPTION(Timeout.connect, `confTO_CONNECT', 5m) 32438032Speter_OPTION(Timeout.iconnect, `confTO_ICONNECT', 5m) 32538032Speter_OPTION(Timeout.helo, `confTO_HELO', 5m) 32638032Speter_OPTION(Timeout.mail, `confTO_MAIL', 10m) 32738032Speter_OPTION(Timeout.rcpt, `confTO_RCPT', 1h) 32838032Speter_OPTION(Timeout.datainit, `confTO_DATAINIT', 5m) 32938032Speter_OPTION(Timeout.datablock, `confTO_DATABLOCK', 1h) 33038032Speter_OPTION(Timeout.datafinal, `confTO_DATAFINAL', 1h) 33138032Speter_OPTION(Timeout.rset, `confTO_RSET', 5m) 33238032Speter_OPTION(Timeout.quit, `confTO_QUIT', 2m) 33338032Speter_OPTION(Timeout.misc, `confTO_MISC', 2m) 33438032Speter_OPTION(Timeout.command, `confTO_COMMAND', 1h) 33538032Speter_OPTION(Timeout.ident, `confTO_IDENT', 30s) 33638032Speter_OPTION(Timeout.fileopen, `confTO_FILEOPEN', 60s) 33738032Speter_OPTION(Timeout.queuereturn, `confTO_QUEUERETURN', 5d) 33838032Speter_OPTION(Timeout.queuereturn.normal, `confTO_QUEUERETURN_NORMAL', 5d) 33938032Speter_OPTION(Timeout.queuereturn.urgent, `confTO_QUEUERETURN_URGENT', 2d) 34038032Speter_OPTION(Timeout.queuereturn.non-urgent, `confTO_QUEUERETURN_NONURGENT', 7d) 34138032Speter_OPTION(Timeout.queuewarn, `confTO_QUEUEWARN', 4h) 34238032Speter_OPTION(Timeout.queuewarn.normal, `confTO_QUEUEWARN_NORMAL', 4h) 34338032Speter_OPTION(Timeout.queuewarn.urgent, `confTO_QUEUEWARN_URGENT', 1h) 34438032Speter_OPTION(Timeout.queuewarn.non-urgent, `confTO_QUEUEWARN_NONURGENT', 12h) 34538032Speter_OPTION(Timeout.hoststatus, `confTO_HOSTSTATUS', 30m) 34638032Speter 34738032Speter# should we not prune routes in route-addr syntax addresses? 34838032Speter_OPTION(DontPruneRoutes, `confDONT_PRUNE_ROUTES') 34938032Speter 35038032Speter# queue up everything before forking? 35138032Speter_OPTION(SuperSafe, `confSAFE_QUEUE') 35238032Speter 35338032Speter# status file 35442575SpeterO StatusFile=ifdef(`STATUS_FILE', `STATUS_FILE', ifdef(`_USE_ETC_MAIL_', /etc/mail/statistics, /etc/sendmail.st)) 35538032Speter 35638032Speter# time zone handling: 35738032Speter# if undefined, use system default 35838032Speter# if defined but null, use TZ envariable passed in 35938032Speter# if defined and non-null, use that info 36038032Speterifelse(confTIME_ZONE, `USE_SYSTEM', `#O TimeZoneSpec=', 36138032Speter confTIME_ZONE, `USE_TZ', `O TimeZoneSpec=', 36238032Speter `O TimeZoneSpec=confTIME_ZONE') 36338032Speter 36438032Speter# default UID (can be username or userid:groupid) 36538032Speter_OPTION(DefaultUser, `confDEF_USER_ID', mailnull) 36638032Speter 36738032Speter# list of locations of user database file (null means no lookup) 36842575Speter_OPTION(UserDatabaseSpec, `confUSERDB_SPEC', ifdef(`_USE_ETC_MAIL_', /etc/mail/userdb, /etc/userdb)) 36938032Speter 37038032Speter# fallback MX host 37138032Speter_OPTION(FallbackMXhost, `confFALLBACK_MX', fall.back.host.net) 37238032Speter 37338032Speter# if we are the best MX host for a site, try it directly instead of config err 37438032Speter_OPTION(TryNullMXList, `confTRY_NULL_MX_LIST') 37538032Speter 37638032Speter# load average at which we just queue messages 37738032Speter_OPTION(QueueLA, `confQUEUE_LA', 8) 37838032Speter 37938032Speter# load average at which we refuse connections 38038032Speter_OPTION(RefuseLA, `confREFUSE_LA', 12) 38138032Speter 38238032Speter# maximum number of children we allow at one time 38338032Speter_OPTION(MaxDaemonChildren, `confMAX_DAEMON_CHILDREN', 12) 38438032Speter 38538032Speter# maximum number of new connections per second 38638032Speter_OPTION(ConnectionRateThrottle, `confCONNECTION_RATE_THROTTLE', 3) 38738032Speter 38838032Speter# work recipient factor 38938032Speter_OPTION(RecipientFactor, `confWORK_RECIPIENT_FACTOR', 30000) 39038032Speter 39138032Speter# deliver each queued job in a separate process? 39238032Speter_OPTION(ForkEachJob, `confSEPARATE_PROC') 39338032Speter 39438032Speter# work class factor 39538032Speter_OPTION(ClassFactor, `confWORK_CLASS_FACTOR', 1800) 39638032Speter 39738032Speter# work time factor 39838032Speter_OPTION(RetryFactor, `confWORK_TIME_FACTOR', 90000) 39938032Speter 40038032Speter# shall we sort the queue by hostname first? 40138032Speter_OPTION(QueueSortOrder, `confQUEUE_SORT_ORDER', priority) 40238032Speter 40338032Speter# minimum time in queue before retry 40438032Speter_OPTION(MinQueueAge, `confMIN_QUEUE_AGE', 30m) 40538032Speter 40638032Speter# default character set 40738032Speter_OPTION(DefaultCharSet, `confDEF_CHAR_SET', iso-8859-1) 40838032Speter 40938032Speter# service switch file (ignored on Solaris, Ultrix, OSF/1, others) 41042575Speter_OPTION(ServiceSwitchFile, `confSERVICE_SWITCH_FILE', ifdef(`_USE_ETC_MAIL_', /etc/mail/service.switch, /etc/service.switch)) 41138032Speter 41238032Speter# hosts file (normally /etc/hosts) 41338032Speter_OPTION(HostsFile, `confHOSTS_FILE', /etc/hosts) 41438032Speter 41538032Speter# dialup line delay on connection failure 41638032Speter_OPTION(DialDelay, `confDIAL_DELAY', 10s) 41738032Speter 41838032Speter# action to take if there are no recipients in the message 41938032Speter_OPTION(NoRecipientAction, `confNO_RCPT_ACTION', add-to-undisclosed) 42038032Speter 42138032Speter# chrooted environment for writing to files 42238032Speter_OPTION(SafeFileEnvironment, `confSAFE_FILE_ENV', /arch) 42338032Speter 42438032Speter# are colons OK in addresses? 42538032Speter_OPTION(ColonOkInAddr, `confCOLON_OK_IN_ADDR') 42638032Speter 42738032Speter# how many jobs can you process in the queue? 42838032Speter_OPTION(MaxQueueRunSize, `confMAX_QUEUE_RUN_SIZE', 10000) 42938032Speter 43038032Speter# shall I avoid expanding CNAMEs (violates protocols)? 43138032Speter_OPTION(DontExpandCnames, `confDONT_EXPAND_CNAMES') 43238032Speter 43338032Speter# SMTP initial login message (old $e macro) 43438032Speter_OPTION(SmtpGreetingMessage, `confSMTP_LOGIN_MSG') 43538032Speter 43638032Speter# UNIX initial From header format (old $l macro) 43738032Speter_OPTION(UnixFromLine, `confFROM_LINE') 43838032Speter 43938032Speter# From: lines that have embedded newlines are unwrapped onto one line 44038032Speter_OPTION(SingleLineFromHeader, `confSINGLE_LINE_FROM_HEADER', False) 44138032Speter 44238032Speter# Allow HELO SMTP command that does not `include' a host name 44338032Speter_OPTION(AllowBogusHELO, `confALLOW_BOGUS_HELO', False) 44438032Speter 44538032Speter# Characters to be quoted in a full name phrase (@,;:\()[] are automatic) 44638032Speter_OPTION(MustQuoteChars, `confMUST_QUOTE_CHARS', .) 44738032Speter 44838032Speter# delimiter (operator) characters (old $o macro) 44938032Speter_OPTION(OperatorChars, `confOPERATORS') 45038032Speter 45138032Speter# shall I avoid calling initgroups(3) because of high NIS costs? 45238032Speter_OPTION(DontInitGroups, `confDONT_INIT_GROUPS') 45338032Speter 45438032Speter# are group-writable `:include:' and .forward files (un)trustworthy? 45538032Speter_OPTION(UnsafeGroupWrites, `confUNSAFE_GROUP_WRITES') 45638032Speter 45738032Speter# where do errors that occur when sending errors get sent? 45838032Speter_OPTION(DoubleBounceAddress, `confDOUBLE_BOUNCE_ADDRESS', postmaster) 45938032Speter 46038032Speter# what user id do we assume for the majority of the processing? 46138032Speter_OPTION(RunAsUser, `confRUN_AS_USER', sendmail) 46238032Speter 46338032Speter# maximum number of recipients per SMTP envelope 46438032Speter_OPTION(MaxRecipientsPerMessage, `confMAX_RCPTS_PER_MESSAGE', 100) 46538032Speter 46638032Speter# shall we get local names from our installed interfaces? 46738032Speter_OPTION(DontProbeInterfaces, `confDONT_PROBE_INTERFACES') 46838032Speter 46942575Speterifdef(`confTRUSTED_USER', 47042575Speter`# Trusted user for file ownership and starting the daemon 47142575SpeterO TrustedUser=confTRUSTED_USER 47242575Speter') 47342575Speterifdef(`confCONTROL_SOCKET_NAME', 47442575Speter`# Control socket for daemon management 47542575SpeterO ControlSocketName=confCONTROL_SOCKET_NAME 47642575Speter') 47742575Speterifdef(`confMAX_MIME_HEADER_LENGTH', 47842575Speter`# Maximum MIME header length to protect MUAs 47942575SpeterO MaxMimeHeaderLength=confMAX_MIME_HEADER_LENGTH 48042575Speter') 48143148Speterifdef(`confMAX_HEADER_LINES', 48243148Speter`# Maximum number of header lines and header line length limit 48343148SpeterO MaxHeaderLines=confMAX_HEADER_LINES 48443148Speter') 48542575Speter 48638032Speter########################### 48738032Speter# Message precedences # 48838032Speter########################### 48938032Speter 49038032SpeterPfirst-class=0 49138032SpeterPspecial-delivery=100 49238032SpeterPlist=-30 49338032SpeterPbulk=-60 49438032SpeterPjunk=-100 49538032Speter 49638032Speter##################### 49738032Speter# Trusted users # 49838032Speter##################### 49938032Speter 50038032Speter# this is equivalent to setting class "t" 50142575Speterifdef(`_USE_CT_FILE_', `', `#')Ft`'ifdef(`confCT_FILE', confCT_FILE, ifdef(`_USE_ETC_MAIL_', `/etc/mail/trusted-users', `/etc/sendmail.ct')) 50238032SpeterTroot 50338032SpeterTdaemon 50438032Speterifdef(`_NO_UUCP_', `dnl', `Tuucp') 50538032Speterifdef(`confTRUSTED_USERS', `T`'confTRUSTED_USERS', `dnl') 50638032Speter 50738032Speter######################### 50838032Speter# Format of headers # 50938032Speter######################### 51038032Speter 51138032Speterifdef(`confFROM_HEADER',, `define(`confFROM_HEADER', `$?x$x <$g>$|$g$.')')dnl 51238032SpeterH?P?Return-Path: <$g> 51338032SpeterHReceived: confRECEIVED_HEADER 51438032SpeterH?D?Resent-Date: $a 51538032SpeterH?D?Date: $a 51638032SpeterH?F?Resent-From: confFROM_HEADER 51738032SpeterH?F?From: confFROM_HEADER 51838032SpeterH?x?Full-Name: $x 51938032Speter# HPosted-Date: $a 52038032Speter# H?l?Received-Date: $b 52138032SpeterH?M?Resent-Message-Id: <$t.$i@$j> 52238032SpeterH?M?Message-Id: <$t.$i@$j> 52338032Speterifdef(`_NULL_CLIENT_ONLY_', 52438032Speter `include(_CF_DIR_`'m4/nullrelay.m4)m4exit', 52538032Speter `dnl') 52638032Speter# 52738032Speter###################################################################### 52838032Speter###################################################################### 52938032Speter##### 53038032Speter##### REWRITING RULES 53138032Speter##### 53238032Speter###################################################################### 53338032Speter###################################################################### 53438032Speter 53538032Speter############################################ 53638032Speter### Ruleset 3 -- Name Canonicalization ### 53738032Speter############################################ 53838032SpeterS3 53938032Speter 54038032Speter# handle null input (translate to <@> special case) 54138032SpeterR$@ $@ <@> 54238032Speter 54338032Speter# strip group: syntax (not inside angle brackets!) and trailing semicolon 54438032SpeterR$* $: $1 <@> mark addresses 54538032SpeterR$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr> 54638032SpeterR@ $* <@> $: @ $1 unmark @host:... 54738032SpeterR$* :: $* <@> $: $1 :: $2 unmark node::addr 54838032SpeterR:`include': $* <@> $: :`include': $1 unmark :`include':... 54938032SpeterR$* [ $* : $* ] <@> $: $1 [ $2 : $3 ] unmark IPv6 addrs 55038032SpeterR$* : $* [ $* ] $: $1 : $2 [ $3 ] <@> remark if leading colon 55138032SpeterR$* : $* <@> $: $2 strip colon if marked 55238032SpeterR$* <@> $: $1 unmark 55338032SpeterR$* ; $1 strip trailing semi 55438032SpeterR$* < $* ; > $1 < $2 > bogus bracketed semi 55538032Speter 55638032Speter# null input now results from list:; syntax 55738032SpeterR$@ $@ :; <@> 55838032Speter 55938032Speter# strip angle brackets -- note RFC733 heuristic to get innermost item 56038032SpeterR$* $: < $1 > housekeeping <> 56138032SpeterR$+ < $* > < $2 > strip excess on left 56238032SpeterR< $* > $+ < $1 > strip excess on right 56338032SpeterR<> $@ < @ > MAIL FROM:<> case 56438032SpeterR< $+ > $: $1 remove housekeeping <> 56538032Speter 56638032Speter# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later 56738032SpeterR@ $+ , $+ @ $1 : $2 change all "," to ":" 56838032Speter 56938032Speter# localize and dispose of route-based addresses 57038032SpeterR@ $+ : $+ $@ $>96 < @$1 > : $2 handle <route-addr> 57138032Speter 57238032Speter# find focus for list syntax 57338032SpeterR $+ : $* ; @ $+ $@ $>96 $1 : $2 ; < @ $3 > list syntax 57438032SpeterR $+ : $* ; $@ $1 : $2; list syntax 57538032Speter 57638032Speter# find focus for @ syntax addresses 57738032SpeterR$+ @ $+ $: $1 < @ $2 > focus on domain 57838032SpeterR$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right 57938032SpeterR$+ < @ $+ > $@ $>96 $1 < @ $2 > already canonical 58038032Speter 58138032Speter# do some sanity checking 58238032SpeterR$* < @ $* : $* > $* $1 < @ $2 $3 > $4 nix colons in addrs 58338032Speter 58438032Speterifdef(`_NO_UUCP_', `dnl', 58538032Speter`# convert old-style addresses to a domain-based address 58638032SpeterR$- ! $+ $@ $>96 $2 < @ $1 .UUCP > resolve uucp names 58738032SpeterR$+ . $- ! $+ $@ $>96 $3 < @ $1 . $2 > domain uucps 58838032SpeterR$+ ! $+ $@ $>96 $2 < @ $1 .UUCP > uucp subdomains 58938032Speter') 59038032Speterifdef(`_USE_DECNET_SYNTAX_', 59138032Speter`# convert node::user addresses into a domain-based address 59238032SpeterR$- :: $+ $@ $>96 $2 < @ $1 .DECNET > resolve DECnet names 59338032SpeterR$- . $- :: $+ $@ $>96 $3 < @ $1.$2 .DECNET > numeric DECnet addr 59438032Speter', 59538032Speter `dnl') 59638032Speter# if we have % signs, take the rightmost one 59738032SpeterR$* % $* $1 @ $2 First make them all @s. 59838032SpeterR$* @ $* @ $* $1 % $2 @ $3 Undo all but the last. 59938032SpeterR$* @ $* $@ $>96 $1 < @ $2 > Insert < > and finish 60038032Speter 60138032Speter# else we must be a local name 60238032SpeterR$* $@ $>96 $1 60338032Speter 60438032Speter 60538032Speter################################################ 60638032Speter### Ruleset 96 -- bottom half of ruleset 3 ### 60738032Speter################################################ 60838032Speter 60938032SpeterS96 61038032Speter 61138032Speter# handle special cases for local names 61238032SpeterR$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all 61338032SpeterR$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain 61438032Speterifdef(`_NO_UUCP_', `dnl', 61538032Speter`R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain') 61638032SpeterR$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [a.b.c.d] 61738032SpeterR$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal 61838032SpeterR$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr 61938032Speter 62038032Speterifdef(`DOMAIN_TABLE', `dnl 62138032Speter# look up domains in the domain table 62238032SpeterR$* < @ $+ > $* $: $1 < @ $(domaintable $2 $) > $3', `dnl') 62338032Speter 62438032Speterundivert(2)dnl 62538032Speter 62638032Speterifdef(`BITDOMAIN_TABLE', `dnl 62738032Speter# handle BITNET mapping 62838032SpeterR$* < @ $+ .BITNET > $* $: $1 < @ $(bitdomain $2 $: $2.BITNET $) > $3', `dnl') 62938032Speter 63038032Speterifdef(`UUDOMAIN_TABLE', `dnl 63138032Speter# handle UUCP mapping 63238032SpeterR$* < @ $+ .UUCP > $* $: $1 < @ $(uudomain $2 $: $2.UUCP $) > $3', `dnl') 63338032Speter 63438032Speterifdef(`_NO_UUCP_', `dnl', 63538032Speter`ifdef(`UUCP_RELAY', 63638032Speter`# pass UUCP addresses straight through 63738032SpeterR$* < @ $+ . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', 63838032Speter`# if really UUCP, handle it immediately 63938032Speterifdef(`_CLASS_U_', 64038032Speter`R$* < @ $=U . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 64138032Speterifdef(`_CLASS_V_', 64238032Speter`R$* < @ $=V . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 64338032Speterifdef(`_CLASS_W_', 64438032Speter`R$* < @ $=W . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 64538032Speterifdef(`_CLASS_X_', 64638032Speter`R$* < @ $=X . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 64738032Speterifdef(`_CLASS_Y_', 64838032Speter`R$* < @ $=Y . UUCP > $* $@ $1 < @ $2 . UUCP . > $3', `dnl') 64938032Speter 65038032Speterifdef(`_NO_CANONIFY_', `dnl', `dnl 65138032Speter# try UUCP traffic as a local address 65238032SpeterR$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3 65338032SpeterR$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3') 65438032Speter')') 65538032Speterifdef(`_NO_CANONIFY_', `dnl', `dnl 65638032Speter# pass to name server to make hostname canonical 65738032SpeterR$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4') 65838032Speter 65938032Speter# local host aliases and pseudo-domains are always canonical 66038032SpeterR$* < @ $=w > $* $: $1 < @ $2 . > $3 66138032SpeterR$* < @ $j > $* $: $1 < @ $j . > $2 66238032Speterifdef(`_MASQUERADE_ENTIRE_DOMAIN_', 66338032Speter`R$* < @ $* $=M > $* $: $1 < @ $2 $3 . > $4', 66438032Speter`R$* < @ $=M > $* $: $1 < @ $2 . > $3') 66538032SpeterR$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4 66638032SpeterR$* < @ $* . . > $* $1 < @ $2 . > $3 66738032Speter 66838032Speter 66938032Speter################################################## 67038032Speter### Ruleset 4 -- Final Output Post-rewriting ### 67138032Speter################################################## 67238032SpeterS4 67338032Speter 67438032SpeterR$* <@> $@ handle <> and list:; 67538032Speter 67638032Speter# strip trailing dot off possibly canonical name 67738032SpeterR$* < @ $+ . > $* $1 < @ $2 > $3 67838032Speter 67938032Speter# eliminate internal code -- should never get this far! 68038032SpeterR$* < @ *LOCAL* > $* $1 < @ $j > $2 68138032Speter 68238032Speter# externalize local domain info 68338032SpeterR$* < $+ > $* $1 $2 $3 defocus 68438032SpeterR@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical 68538032SpeterR@ $* $@ @ $1 ... and exit 68638032Speter 68738032Speterifdef(`_NO_UUCP_', `dnl', 68838032Speter`# UUCP must always be presented in old form 68938032SpeterR$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u') 69038032Speter 69138032Speterifdef(`_USE_DECNET_SYNTAX_', 69238032Speter`# put DECnet back in :: form 69338032SpeterR$+ @ $+ . DECNET $2 :: $1 u@h.DECNET => h::u', 69438032Speter `dnl') 69538032Speter# delete duplicate local names 69638032SpeterR$+ % $=w @ $=w $1 @ $2 u%host@host => u@host 69738032Speter 69838032Speter 69938032Speter 70038032Speter############################################################## 70138032Speter### Ruleset 97 -- recanonicalize and call ruleset zero ### 70238032Speter### (used for recursive calls) ### 70338032Speter############################################################## 70438032Speter 70538032SpeterS`'97 70638032SpeterR$* $: $>3 $1 70738032SpeterR$* $@ $>0 $1 70838032Speter 70938032Speter 71038032Speter###################################### 71138032Speter### Ruleset 0 -- Parse Address ### 71238032Speter###################################### 71338032Speter 71438032SpeterS0 71538032Speter 71638032SpeterR$* $: $>Parse0 $1 initial parsing 71738032SpeterR<@> $#_LOCAL_ $: <@> special case error msgs 71838032SpeterR$* $: $>98 $1 handle local hacks 71938032SpeterR$* $: $>Parse1 $1 final parsing 72038032Speter 72138032Speter# 72238032Speter# Parse0 -- do initial syntax checking and eliminate local addresses. 72338032Speter# This should either return with the (possibly modified) input 72438032Speter# or return with a #error mailer. It should not return with a 72538032Speter# #mailer other than the #error mailer. 72638032Speter# 72738032Speter 72838032SpeterSParse0 72938032SpeterR<@> $@ <@> special case error msgs 73038032SpeterR$* : $* ; <@> $#error $@ 5.1.3 $: "List:; syntax illegal for recipient addresses" 73138032Speter#R@ <@ $* > < @ $1 > catch "@@host" bogosity 73238032SpeterR<@ $+> $#error $@ 5.1.3 $: "User address required" 73338032SpeterR$* $: <> $1 73438032SpeterR<> $* < @ [ $+ ] > $* $1 < @ [ $2 ] > $3 73538032SpeterR<> $* <$* : $* > $* $#error $@ 5.1.3 $: "Colon illegal in host name part" 73638032SpeterR<> $* $1 73738032SpeterR$* < @ . $* > $* $#error $@ 5.1.2 $: "Invalid host name" 73838032SpeterR$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "Invalid host name" 73938032Speter 74038032Speter# now delete the local info -- note $=O to find characters that cause forwarding 74138032SpeterR$* < @ > $* $@ $>Parse0 $>3 $1 user@ => user 74238032SpeterR< @ $=w . > : $* $@ $>Parse0 $>3 $2 @here:... -> ... 74338032SpeterR$- < @ $=w . > $: $(dequote $1 $) < @ $2 . > dequote "foo"@here 74438032SpeterR< @ $+ > $#error $@ 5.1.3 $: "User address required" 74538032SpeterR$* $=O $* < @ $=w . > $@ $>Parse0 $>3 $1 $2 $3 ...@here -> ... 74638032SpeterR$- $: $(dequote $1 $) < @ *LOCAL* > dequote "foo" 74738032SpeterR< @ *LOCAL* > $#error $@ 5.1.3 $: "User address required" 74838032SpeterR$* $=O $* < @ *LOCAL* > 74938032Speter $@ $>Parse0 $>3 $1 $2 $3 ...@*LOCAL* -> ... 75038032SpeterR$* < @ *LOCAL* > $: $1 75138032Speter 75238032Speter# 75338032Speter# Parse1 -- the bottom half of ruleset 0. 75438032Speter# 75538032Speter 75638032SpeterSParse1 75738032Speterifdef(`_MAILER_smtp_', 75838032Speter`# handle numeric address spec 75938032SpeterR$* < @ [ $+ ] > $* $: $>98 $1 < @ [ $2 ] > $3 numeric internet spec 76038032SpeterR$* < @ [ $+ ] > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 still numeric: send', 76138032Speter `dnl') 76238032Speter 76338032Speterifdef(`VIRTUSER_TABLE', `dnl 76438032Speter# handle virtual users 76538032SpeterR$+ < @ $=w . > $: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . > 76638032SpeterR<@> $+ + $* < @ $* . > 76738032Speter $: < $(virtuser $1 + * @ $3 $@ $1 $: @ $) > $1 + $2 < @ $3 . > 76838032SpeterR<@> $+ + $* < @ $* . > 76938032Speter $: < $(virtuser $1 @ $3 $@ $1 $: @ $) > $1 + $2 < @ $3 . > 77038032SpeterR<@> $+ < @ $+ . > $: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . > 77138032SpeterR<@> $+ $: $1 77238032SpeterR< error : $- $+ > $* $#error $@ $(dequote $1 $) $: $2 77338032SpeterR< $+ > $+ < @ $+ > $: $>97 $1', 77438032Speter`dnl') 77538032Speter 77638032Speter# short circuit local delivery so forwarded email works 77738032Speterifdef(`_MAILER_usenet_', `dnl 77838032SpeterR$+ . USENET < @ $=w . > $#usenet $: $1 handle usenet specially', `dnl') 77938032Speterifdef(`_STICKY_LOCAL_DOMAIN_', 78038032Speter`R$+ < @ $=w . > $: < $H > $1 < @ $2 . > first try hub 78138032SpeterR< $+ > $+ < $+ > $>95 < $1 > $2 < $3 > yep .... 78238032SpeterR< > $+ + $* < $+ > $#_LOCAL_ $: $1 + $2 plussed name? 78338032SpeterR< > $+ < $+ > $#_LOCAL_ $: @ $1 nope, local address', 78438032Speter`R$=L < @ $=w . > $#_LOCAL_ $: @ $1 special local names 78538032SpeterR$+ < @ $=w . > $#_LOCAL_ $: $1 regular local name') 78638032Speter 78738032Speterifdef(`MAILER_TABLE', `dnl 78838032Speter# not local -- try mailer table lookup 78938032SpeterR$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name 79038032SpeterR< $+ . > $* $: < $1 > $2 strip trailing dot 79138032SpeterR< $+ > $* $: < $(mailertable $1 $) > $2 lookup 79238032SpeterR< $~[ : $+ > $* $>95 < $1 : $2 > $3 check -- resolved? 79338032SpeterR< $+ > $* $: $>90 <$1> $2 try domain', 79438032Speter`dnl') 79538032Speterundivert(4)dnl 79638032Speter 79738032Speterifdef(`_NO_UUCP_', `dnl', 79838032Speter`# resolve remotely connected UUCP links (if any) 79938032Speterifdef(`_CLASS_V_', 80038032Speter`R$* < @ $=V . UUCP . > $* $: $>95 < $V > $1 <@$2.UUCP.> $3', 80138032Speter `dnl') 80238032Speterifdef(`_CLASS_W_', 80338032Speter`R$* < @ $=W . UUCP . > $* $: $>95 < $W > $1 <@$2.UUCP.> $3', 80438032Speter `dnl') 80538032Speterifdef(`_CLASS_X_', 80638032Speter`R$* < @ $=X . UUCP . > $* $: $>95 < $X > $1 <@$2.UUCP.> $3', 80738032Speter `dnl')') 80838032Speter 80938032Speter# resolve fake top level domains by forwarding to other hosts 81038032Speterifdef(`BITNET_RELAY', 81138032Speter`R$*<@$+.BITNET.>$* $: $>95 < $B > $1 <@$2.BITNET.> $3 user@host.BITNET', 81238032Speter `dnl') 81338032Speterifdef(`DECNET_RELAY', 81438032Speter`R$*<@$+.DECNET.>$* $: $>95 < $C > $1 <@$2.DECNET.> $3 user@host.DECNET', 81538032Speter `dnl') 81638032Speterifdef(`_MAILER_pop_', 81738032Speter`R$+ < @ POP. > $#pop $: $1 user@POP', 81838032Speter `dnl') 81938032Speterifdef(`_MAILER_fax_', 82038032Speter`R$+ < @ $+ .FAX. > $#fax $@ $2 $: $1 user@host.FAX', 82138032Speter`ifdef(`FAX_RELAY', 82238032Speter`R$*<@$+.FAX.>$* $: $>95 < $F > $1 <@$2.FAX.> $3 user@host.FAX', 82338032Speter `dnl')') 82438032Speter 82538032Speterifdef(`UUCP_RELAY', 82638032Speter`# forward non-local UUCP traffic to our UUCP relay 82738032SpeterR$*<@$*.UUCP.>$* $: $>95 < $Y > $1 <@$2.UUCP.> $3 uucp mail', 82838032Speter`ifdef(`_MAILER_uucp_', 82938032Speter`# forward other UUCP traffic straight to UUCP 83038032SpeterR$* < @ $+ .UUCP. > $* $#_UUCP_ $@ $2 $: $1 < @ $2 .UUCP. > $3 user@host.UUCP', 83138032Speter `dnl')') 83238032Speterifdef(`_MAILER_usenet_', ` 83338032Speter# addresses sent to net.group.USENET will get forwarded to a newsgroup 83438032SpeterR$+ . USENET $#usenet $: $1', 83538032Speter `dnl') 83638032Speter 83738032Speterifdef(`_LOCAL_RULES_', 83838032Speter`# figure out what should stay in our local mail system 83938032Speterundivert(1)', `dnl') 84038032Speter 84138032Speter# pass names that still have a host to a smarthost (if defined) 84238032SpeterR$* < @ $* > $* $: $>95 < $S > $1 < @ $2 > $3 glue on smarthost name 84338032Speter 84438032Speter# deal with other remote names 84538032Speterifdef(`_MAILER_smtp_', 84638032Speter`R$* < @$* > $* $#_SMTP_ $@ $2 $: $1 < @ $2 > $3 user@host.domain', 84742575Speter`R$* < @$* > $* $#error $@ 5.1.2 $: "Unrecognized host name " $2') 84838032Speter 84938032Speter# handle locally delivered names 85038032SpeterR$=L $#_LOCAL_ $: @ $1 special local names 85138032SpeterR$+ $#_LOCAL_ $: $1 regular local names 85238032Speter 85338032Speter########################################################################### 85438032Speter### Ruleset 5 -- special rewriting after aliases have been expanded ### 85538032Speter########################################################################### 85638032Speter 85738032SpeterS5 85838032Speter 85938032Speter# deal with plussed users so aliases work nicely 86038032SpeterR$+ + * $#_LOCAL_ $@ $&h $: $1 86138032SpeterR$+ + $* $#_LOCAL_ $@ + $2 $: $1 + * 86238032Speter 86338032Speter# prepend an empty "forward host" on the front 86438032SpeterR$+ $: <> $1 86538032Speter 86638032Speterifdef(`LUSER_RELAY', `dnl 86738032Speter# send unrecognized local users to a relay host 86838032SpeterR< > $+ $: < $L . > $(user $1 $) look up user 86938032SpeterR< $* > $+ <> $* $: < > $2 $3 found; strip $L 87038032SpeterR< $* . > $+ $: < $1 > $2 strip extra dot', 87138032Speter`dnl') 87238032Speter 87338032Speter# see if we have a relay or a hub 87438032SpeterR< > $+ $: < $H > $1 try hub 87538032SpeterR< > $+ $: < $R > $1 try relay 87638032SpeterR< > $+ $: < > < $1 $&h > nope, restore +detail 87738032SpeterR< > < $+ + $* > $* < > < $1 > + $2 $3 find the user part 87838032SpeterR< > < $+ > + $* $#_LOCAL_ $@ $2 $: @ $1 strip the extra + 87938032SpeterR< > < $+ > $@ $1 no +detail 88038032SpeterR$+ $: $1 $&h add +detail back in 88138032SpeterR< local : $* > $* $: $>95 < local : $1 > $2 no host extension 88238032SpeterR< error : $* > $* $: $>95 < error : $1 > $2 no host extension 88338032SpeterR< $- : $+ > $+ $: $>95 < $1 : $2 > $3 < @ $2 > 88438032SpeterR< $+ > $+ $@ $>95 < $1 > $2 < @ $1 > 88538032Speter 88638032Speterifdef(`MAILER_TABLE', `dnl 88738032Speter################################################################### 88838032Speter### Ruleset 90 -- try domain part of mailertable entry ### 88938032Speter################################################################### 89038032Speter 89138032SpeterS90 89238032SpeterR$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4 89338032SpeterR$* <$~[ : $+ > $* $>95 < $2 : $3 > $4 check -- resolved? 89438032SpeterR$* < . $+ > $* $@ $>90 $1 . <$2> $3 no -- strip & try again 89538032SpeterR$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "." 89638032SpeterR< $~[ : $+ > $* $>95 < $1 : $2 > $3 "." found? 89738032SpeterR< $* > $* $@ $2 no mailertable match', 89838032Speter`dnl') 89938032Speter 90038032Speter################################################################### 90138032Speter### Ruleset 95 -- canonify mailer:[user@]host syntax to triple ### 90238032Speter################################################################### 90338032Speter 90438032SpeterS95 90538032SpeterR< > $* $@ $1 strip off null relay 90638032SpeterR< error : $- $+ > $* $#error $@ $(dequote $1 $) $: $2 90738032SpeterR< local : $* > $* $>CanonLocal < $1 > $2 90838032SpeterR< $- : $+ @ $+ > $*<$*>$* $# $1 $@ $3 $: $2<@$3> use literal user 90938032SpeterR< $- : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer 91038032SpeterR< $=w > $* $@ $2 delete local host 91138032SpeterR< $+ > $* $#_RELAY_ $@ $1 $: $2 use unqualified mailer 91238032Speter 91338032Speter################################################################### 91438032Speter### Ruleset CanonLocal -- canonify local: syntax ### 91538032Speter################################################################### 91638032Speter 91738032SpeterSCanonLocal 91838032Speter# strip trailing dot from any host name that may appear 91938032SpeterR< $* > $* < @ $* . > $: < $1 > $2 < @ $3 > 92038032Speter 92138032Speter# handle local: syntax -- use old user, either with or without host 92238032SpeterR< > $* < @ $* > $* $#_LOCAL_ $@ $1@$2 $: $1 92338032SpeterR< > $+ $#_LOCAL_ $@ $1 $: $1 92438032Speter 92538032Speter# handle local:user@host syntax -- ignore host part 92638032SpeterR< $+ @ $+ > $* < @ $* > $: < $1 > $3 < @ $4 > 92738032Speter 92838032Speter# handle local:user syntax 92938032SpeterR< $+ > $* <@ $* > $* $#_LOCAL_ $@ $2@$3 $: $1 93038032SpeterR< $+ > $* $#_LOCAL_ $@ $2 $: $1 93138032Speter 93238032Speter################################################################### 93338032Speter### Ruleset 93 -- convert header names to masqueraded form ### 93438032Speter################################################################### 93538032Speter 93638032SpeterS93 93738032Speter 93838032Speterifdef(`GENERICS_TABLE', `dnl 93938032Speter# handle generics database 94038032Speterifdef(`_GENERICS_ENTIRE_DOMAIN_', 94138032Speter`R$+ < @ $* $=G . > $: < $1@$2$3 > $1 < @ $2$3 . > @ mark', 94238032Speter`R$+ < @ $=G . > $: < $1@$2 > $1 < @ $2 . > @ mark') 94338032SpeterR$+ < @ *LOCAL* > $: < $1@$j > $1 < @ *LOCAL* > @ mark 94438032SpeterR< $+ > $+ < $* > @ $: < $(generics $1 $: $) > $2 < $3 > 94538032SpeterR< > $+ < @ $+ > $: < $(generics $1 $: $) > $1 < @ $2 > 94638032SpeterR< $* @ $* > $* < $* > $@ $>3 $1 @ $2 found qualified 94738032SpeterR< $+ > $* < $* > $: $>3 $1 @ *LOCAL* found unqualified 94838032SpeterR< > $* $: $1 not found', 94938032Speter`dnl') 95038032Speter 95138032Speter# special case the users that should be exposed 95238032SpeterR$=E < @ *LOCAL* > $@ $1 < @ $j . > leave exposed 95338032Speterifdef(`_MASQUERADE_ENTIRE_DOMAIN_', 95438032Speter`R$=E < @ $* $=M . > $@ $1 < @ $2 $3 . >', 95538032Speter`R$=E < @ $=M . > $@ $1 < @ $2 . >') 95638032Speterifdef(`_LIMITED_MASQUERADE_', `dnl', 95738032Speter`R$=E < @ $=w . > $@ $1 < @ $2 . >') 95838032Speter 95938032Speter# handle domain-specific masquerading 96038032Speterifdef(`_MASQUERADE_ENTIRE_DOMAIN_', 96138032Speter`R$* < @ $* $=M . > $* $: $1 < @ $2 $3 . @ $M > $4 convert masqueraded doms', 96238032Speter`R$* < @ $=M . > $* $: $1 < @ $2 . @ $M > $3 convert masqueraded doms') 96338032Speterifdef(`_LIMITED_MASQUERADE_', `dnl', 96438032Speter`R$* < @ $=w . > $* $: $1 < @ $2 . @ $M > $3') 96538032SpeterR$* < @ *LOCAL* > $* $: $1 < @ $j . @ $M > $2 96638032SpeterR$* < @ $+ @ > $* $: $1 < @ $2 > $3 $M is null 96738032SpeterR$* < @ $+ @ $+ > $* $: $1 < @ $3 . > $4 $M is not null 96838032Speter 96938032Speter################################################################### 97038032Speter### Ruleset 94 -- convert envelope names to masqueraded form ### 97138032Speter################################################################### 97238032Speter 97338032SpeterS94 97438032Speterifdef(`_MASQUERADE_ENVELOPE_', 97538032Speter`R$+ $@ $>93 $1', 97638032Speter`R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2') 97738032Speter 97838032Speter################################################################### 97938032Speter### Ruleset 98 -- local part of ruleset zero (can be null) ### 98038032Speter################################################################### 98138032Speter 98238032SpeterS98 98338032Speterundivert(3)dnl 98438032Speter 98542575Speterifelse(substr(confDELIVERY_MODE,0,1), `d', `errprint(`WARNING: Antispam rules not available in deferred delivery mode.')') 98638032Speterifdef(`ACCESS_TABLE', `dnl 98738032Speter###################################################################### 98838032Speter### LookUpDomain -- search for domain in access database 98938032Speter### 99038032Speter### Parameters: 99138032Speter### <$1> -- key (domain name) 99238032Speter### <$2> -- default (what to return if not found in db) 99338032Speter### <$3> -- passthru (additional data passed unchanged through) 99438032Speter###################################################################### 99538032Speter 99638032SpeterSLookUpDomain 99738032SpeterR<$+> <$+> <$*> $: < $(access $1 $: ? $) > <$1> <$2> <$3> 99838032SpeterR<?> <$+.$+> <$+> <$*> $@ $>LookUpDomain <$2> <$3> <$4> 99938032SpeterR<?> <$+> <$+> <$*> $@ <$2> <$3> 100038032SpeterR<$*> <$+> <$+> <$*> $@ <$1> <$4> 100138032Speter 100238032Speter###################################################################### 100338032Speter### LookUpAddress -- search for host address in access database 100438032Speter### 100538032Speter### Parameters: 100638032Speter### <$1> -- key (dot quadded host address) 100738032Speter### <$2> -- default (what to return if not found in db) 100838032Speter### <$3> -- passthru (additional data passed through) 100938032Speter###################################################################### 101038032Speter 101138032SpeterSLookUpAddress 101238032SpeterR<$+> <$+> <$*> $: < $(access $1 $: ? $) > <$1> <$2> <$3> 101338032SpeterR<?> <$+.$-> <$+> <$*> $@ $>LookUpAddress <$1> <$3> <$4> 101438032SpeterR<?> <$+> <$+> <$*> $@ <$2> <$3> 101538032SpeterR<$*> <$+> <$+> <$*> $@ <$1> <$4>', 101638032Speter`dnl') 101738032Speter 101838032Speter###################################################################### 101942575Speter### CanonAddr -- Convert an address into a standard form for 102042575Speter### relay checking. Route address syntax is 102142575Speter### crudely converted into a %-hack address. 102242575Speter### 102342575Speter### Parameters: 102442575Speter### $1 -- full recipient address 102542575Speter### 102642575Speter### Returns: 102742575Speter### parsed address, not in source route form 102842575Speter###################################################################### 102942575Speter 103042575SpeterSCanonAddr 103142575SpeterR$* $: $>Parse0 $>3 $1 make domain canonical 103242575SpeterR< @ $+ > : $* @ $* < @ $1 > : $2 % $3 change @ to % in src route 103342575SpeterR$* < @ $+ > : $* : $* $3 $1 < @ $2 > : $4 change to % hack. 103442575SpeterR$* < @ $+ > : $* $3 $1 < @ $2 > 103542575Speter 103642575Speter###################################################################### 103738032Speter### ParseRecipient -- Strip off hosts in $=R as well as possibly 103838032Speter### $* $=m or the access database. 103938032Speter### Check user portion for host separators. 104038032Speter### 104138032Speter### Parameters: 104238032Speter### $1 -- full recipient address 104338032Speter### 104438032Speter### Returns: 104538032Speter### parsed, non-local-relaying address 104638032Speter###################################################################### 104738032Speter 104838032SpeterSParseRecipient 104942575SpeterR$* $: <?> $>CanonAddr $1 105042575SpeterR<?> $* < @ $* . > <?> $1 < @ $2 > strip trailing dots 105142575SpeterR<?> $- < @ $* > $: <?> $(dequote $1 $) < @ $2 > dequote local part 105238032Speter 105338032Speter# if no $=O character, no host in the user portion, we are done 105442575SpeterR<?> $* $=O $* < @ $* > $: <NO> $1 $2 $3 < @ $4> 105542575SpeterR<?> $* $@ $1 105638032Speter 105738032Speterifdef(`_RELAY_ENTIRE_DOMAIN_', `dnl 105838032Speter# if we relay, check username portion for user%host so host can be checked also 105942575SpeterR<NO> $* < @ $* $=m > $: <RELAY> $1 < @ $2 $3 >', `dnl') 106042575Speter 106142575Speterifdef(`_RELAY_MX_SERVED_', `dnl 106242575SpeterR<NO> $* < @ $+ > $: <MX> < : $(mxserved $2 $) : > < $1 < @$2 > > 106342575SpeterR<MX> < : $* <TEMP> : > $* $#error $@ 4.7.1 $: "450 Can not check MX records for recipient host " $1 106442575SpeterR<MX> < $* : $=w. : $* > < $+ > $: <RELAY> $4 106542575SpeterR<MX> < : $* : > < $+ > $: <NO> $2', `dnl') 106642575Speter 106738032Speterifdef(`_RELAY_HOSTS_ONLY_', 106842575Speter`R<NO> $* < @ $=R > $: <RELAY> $1 < @ $2 > 106938032Speterifdef(`ACCESS_TABLE', `dnl 107042575SpeterR<NO> $* < @ $+ > $: <$(access $2 $: NO $)> $1 < @ $2 >',`dnl')', 107142575Speter`R<NO> $* < @ $* $=R > $: <RELAY> $1 < @ $2 $3 > 107238032Speterifdef(`ACCESS_TABLE', `dnl 107342575SpeterR<NO> $* < @ $+ > $: $>LookUpDomain <$2> <NO> <$1 < @ $2 >> 107442575SpeterR<$+> <$+> $: <$1> $2',`dnl')') 107538032Speter 107642575SpeterR<RELAY> $* < @ $* > $@ $>ParseRecipient $1 107742575SpeterR<$-> $* $@ $2 107842575Speter 107938032Speter###################################################################### 108038032Speter### check_relay -- check hostname/address on SMTP startup 108138032Speter###################################################################### 108238032Speter 108338032SpeterSLocal_check_relay 108438032SpeterScheck_relay 108538032SpeterR$* $: $1 $| $>"Local_check_relay" $1 108638032SpeterR$* $| $* $| $#$* $#$3 108738032SpeterR$* $| $* $| $* $@ $>"Basic_check_relay" $1 $| $2 108838032Speter 108938032SpeterSBasic_check_relay 109038032Speter# check for deferred delivery mode 109138032SpeterR$* $: < ${deliveryMode} > $1 109238032SpeterR< d > $* $@ deferred 109338032SpeterR< $* > $* $: $2 109438032Speter 109538032Speterifdef(`ACCESS_TABLE', `dnl 109638032SpeterR$+ $| $+ $: $>LookUpDomain < $1 > <?> < $2 > 109742575SpeterR<?> < $+ > $: $>LookUpAddress < $1 > <?> < $1 > 109842575SpeterR<?> < $+ > $: $1 109942575SpeterR<OK> < $* > $@ OK 110042575SpeterR<RELAY> < $* > $@ RELAY 110138032SpeterR<REJECT> $* $#error $@ 5.7.1 $: "ifdef(`confREJECT_MSG', `confREJECT_MSG', `550 Access denied')" 110238032SpeterR<DISCARD> $* $#discard $: discard 110338032SpeterR<$+> $* $#error $@ 5.7.1 $: $1', `dnl') 110438032Speter 110538032Speterifdef(`_RBL_', `dnl 110642575Speter# DNS based IP address spam lists 110738032SpeterR$* $: $&{client_addr} 110838032SpeterR$-.$-.$-.$- $: $(host $4.$3.$2.$1._RBL_. $: OK $) 110938032SpeterROK $@ OK 111042575SpeterR$+ $#error $@ 5.7.1 $: "Mail from " $&{client_addr} " refused by blackhole site _RBL_"', 111138032Speter`dnl') 111238032Speter 111338032Speter###################################################################### 111438032Speter### check_mail -- check SMTP ``MAIL FROM:'' command argument 111538032Speter###################################################################### 111638032Speter 111738032SpeterSLocal_check_mail 111838032SpeterScheck_mail 111938032SpeterR$* $: $1 $| $>"Local_check_mail" $1 112038032SpeterR$* $| $#$* $#$2 112138032SpeterR$* $| $* $@ $>"Basic_check_mail" $1 112238032Speter 112338032SpeterSBasic_check_mail 112438032Speter# check for deferred delivery mode 112538032SpeterR$* $: < ${deliveryMode} > $1 112638032SpeterR< d > $* $@ deferred 112738032SpeterR< $* > $* $: $2 112838032Speter 112938032SpeterR<> $@ <OK> 113042575SpeterR$* $: <?> $>CanonAddr $1 113142575SpeterR<?> $* < @ $+ . > <?> $1 < @ $2 > strip trailing dots 113238032Speter# handle non-DNS hostnames (*.bitnet, *.decnet, *.uucp, etc) 113338032SpeterR<?> $* < $* $=P > $* $: <OK> $1 < @ $2 $3 > $4 113438032Speterifdef(`_ACCEPT_UNRESOLVABLE_DOMAINS_', 113538032Speter`R<?> $* < @ $+ > $* $: <OK> $1 < @ $2 > $3 ... unresolvable OK', 113638032Speter`R<?> $* < @ $+ > $* $: <? $(resolve $2 $: $2 <PERM> $) > $1 < @ $2 > $3 113738032SpeterR<? $* <$->> $* < @ $+ > $* 113838032Speter $: <$2> $3 < @ $4 > $5') 113938032Speter 114038032Speterifdef(`_ACCEPT_UNQUALIFIED_SENDERS_',`dnl',`dnl 114138032Speter# handle case of @localhost on address 114238032SpeterR<$+> $* < @localhost > $: < ? $&{client_name} > <$1> $2 < @localhost > 114338032SpeterR<$+> $* < @localhost.$m > 114438032Speter $: < ? $&{client_name} > <$1> $2 < @localhost.$m > 114538032Speterifdef(`_NO_UUCP_', `dnl', 114638032Speter`R<$+> $* < @localhost.UUCP > 114738032Speter $: < ? $&{client_name} > <$1> $2 < @localhost.UUCP >') 114838032SpeterR<? $=w> <$+> $* <?> <$2> $3 114938032SpeterR<? $+> <$+> $* $#error $@ 5.5.4 $: "553 Real domain name required" 115038032SpeterR<?> <$+> $* $: <$1> $2') 115138032Speter 115238032Speterifdef(`ACCESS_TABLE', `dnl 115338032Speter# lookup localpart (user@) 115438032SpeterR<$+> $* < @ $+ > $* $: <USER $(access $2@ $: ? $) > <$1> $2 < @ $3 > $4 115538032Speter# no match, try full address (user@domain rest) 115638032SpeterR<USER ?> <$+> $* < @ $* > $* 115738032Speter $: <USER $(access $2@$3$4 $: ? $) > <$1> $2 < @ $3 > $4 115838032Speter# no match, try address (user@domain) 115938032SpeterR<USER ?> <$+> $+ < @ $+ > $* 116038032Speter $: <USER $(access $2@$3 $: ? $) > <$1> $2 < @ $3 > $4 116138032Speter# no match, try (sub)domain (domain) 116238032SpeterR<USER ?> <$+> $* < @ $+ > $* 116338032Speter $: $>LookUpDomain <$3> <$1> <> 116438032Speter# check unqualified user in access database 116538032SpeterR<?> $* $: <USER $(access $1@ $: ? $) > <?> $1 116638032Speter# retransform for further use 116738032SpeterR<USER $+> <$+> $* $: <$1> $3', 116838032Speter`dnl') 116938032Speter 117038032Speterifdef(`_ACCEPT_UNQUALIFIED_SENDERS_',`dnl',`dnl 117138032Speter# handle case of no @domain on address 117238032SpeterR<?> $* $: < ? $&{client_name} > $1 117338032SpeterR<?> $* $@ <OK> ...local unqualed ok 117438032SpeterR<? $+> $* $#error $@ 5.5.4 $: "553 Domain name required" 117538032Speter ...remote is not') 117638032Speter# check results 117738032SpeterR<?> $* $@ <OK> 117838032SpeterR<OK> $* $@ <OK> 117938032SpeterR<TEMP> $* $#error $@ 4.1.8 $: "451 Sender domain must resolve" 118038032SpeterR<PERM> $* $#error $@ 5.1.8 $: "501 Sender domain must exist" 118138032Speterifdef(`ACCESS_TABLE', `dnl 118238032SpeterR<RELAY> $* $@ <RELAY> 118338032SpeterR<DISCARD> $* $#discard $: discard 118438032SpeterR<REJECT> $* $#error $@ 5.7.1 $: "ifdef(`confREJECT_MSG', `confREJECT_MSG', `550 Access denied')" 118538032SpeterR<$+> $* $#error $@ 5.7.1 $: $1 error from access db', 118638032Speter`dnl') 118738032Speter 118838032Speter###################################################################### 118938032Speter### check_rcpt -- check SMTP ``RCPT TO:'' command argument 119038032Speter###################################################################### 119138032Speter 119238032SpeterSLocal_check_rcpt 119338032SpeterScheck_rcpt 119438032SpeterR$* $: $1 $| $>"Local_check_rcpt" $1 119538032SpeterR$* $| $#$* $#$2 119638032SpeterR$* $| $* $@ $>"Basic_check_rcpt" $1 119738032Speter 119838032SpeterSBasic_check_rcpt 119938032Speter# check for deferred delivery mode 120038032SpeterR$* $: < ${deliveryMode} > $1 120138032SpeterR< d > $* $@ deferred 120238032SpeterR< $* > $* $: $2 120338032Speter 120438032Speterifdef(`_LOOSE_RELAY_CHECK_',`dnl 120542575SpeterR$* $: $>CanonAddr $1 120638032SpeterR$* < @ $* . > $1 < @ $2 > strip trailing dots', 120738032Speter`R$* $: $>ParseRecipient $1 strip relayable hosts') 120838032Speter 120942575Speterifdef(`_BESTMX_IS_LOCAL_',`dnl 121042575Speterifelse(_BESTMX_IS_LOCAL_, `', `dnl 121142575Speter# unlimited bestmx 121242575SpeterR$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3', 121342575Speter`dnl 121442575Speter# limit bestmx to $=B 121542575SpeterR$* < @ $* $=B > $* $: $1 < @ $2 $3 . @@ $(bestmx $2 $3 $) > $4') 121642575SpeterR$* $=O $* < @ $* @@ $=w . > $* $@ $>Basic_check_rcpt $1 $2 $3 121742575SpeterR$* < @ $* @@ $=w . > $* $: $1 < @ $3 > $4 121842575SpeterR$* < @ $* @@ $* > $* $: $1 < @ $2 > $4') 121942575Speter 122038032Speterifdef(`_BLACKLIST_RCPT_',`dnl 122138032Speterifdef(`ACCESS_TABLE', `dnl 122238032Speter# blacklist local users or any host from receiving mail 122338032SpeterR$* $: <?> $1 122438032SpeterR<?> $+ < @ $=w > $: <> <USER $1> <FULL $1@$2> <HOST $2> <$1 < @ $2 >> 122538032SpeterR<?> $+ < @ $* > $: <> <FULL $1@$2> <HOST $2> <$1 < @ $2 >> 122638032SpeterR<?> $+ $: <> <USER $1> <$1> 122738032SpeterR<> <USER $+> $* $: <$(access $1 $: $)> $2 122838032SpeterR<> <FULL $+> $* $: <$(access $1 $: $)> $2 122938032SpeterR<OK> <FULL $+> $* $: <$(access $1 $: $)> $2 123038032SpeterR<> <HOST $+> $* $: <$(access $1 $: $)> $2 123138032SpeterR<OK> <HOST $+> $* $: <$(access $1 $: $)> $2 123238032SpeterR<> <$*> $: $1 123338032SpeterR<OK> <$*> $: $1 123438032SpeterR<RELAY> <$*> $: $1 123538032SpeterR<REJECT> $* $#error $@ 5.2.1 $: "550 Mailbox disabled for this recipient" 123638032SpeterR<$+> $* $#error $@ 5.2.1 $: $1 error from access db', `dnl')', `dnl') 123738032Speter 123838032Speterifdef(`_PROMISCUOUS_RELAY_', `dnl', `dnl 123938032Speter# anything terminating locally is ok 124038032Speterifdef(`_RELAY_ENTIRE_DOMAIN_', `dnl 124138032SpeterR$+ < @ $* $=m > $@ OK', `dnl') 124238032SpeterR$+ < @ $=w > $@ OK 124338032Speterifdef(`_RELAY_HOSTS_ONLY_', 124438032Speter`R$+ < @ $=R > $@ OK 124538032Speterifdef(`ACCESS_TABLE', `dnl 124638032SpeterR$+ < @ $* > $: <$(access $2 $: ? $)> <$1 < @ $2 >>',`dnl')', 124738032Speter`R$+ < @ $* $=R > $@ OK 124838032Speterifdef(`ACCESS_TABLE', `dnl 124938032SpeterR$+ < @ $* > $: $>LookUpDomain <$2> <?> <$1 < @ $2 >>',`dnl')') 125038032Speterifdef(`ACCESS_TABLE', `dnl 125138032SpeterR<RELAY> $* $@ RELAY 125238032SpeterR<$*> <$*> $: $2',`dnl') 125338032Speter 125438032Speterifdef(`_RELAY_MX_SERVED_', `dnl 125538032Speter# allow relaying for hosts which we MX serve 125638032SpeterR$+ < @ $* > $: < : $(mxserved $2 $) : > $1 < @ $2 > 125738032SpeterR< : $* <TEMP> : > $* $#error $@ 4.7.1 $: "450 Can not check MX records for recipient host " $1 125838032SpeterR<$* : $=w . : $*> $* $@ OK 125942575SpeterR< : $* : > $* $: $2', 126038032Speter`dnl') 126138032Speter 126238032Speter# check for local user (i.e. unqualified address) 126338032SpeterR$* $: <?> $1 126442575SpeterR<?> $* < @ $+ > $: <REMOTE> $1 < @ $2 > 126538032Speter# local user is ok 126638032SpeterR<?> $+ $@ OK 126738032SpeterR<$+> $* $: $2 126838032Speter 126938032Speter# anything originating locally is ok 127038032SpeterR$* $: <?> $&{client_name} 127138032Speter# check if bracketed IP address (forward lookup != reverse lookup) 127238032SpeterR<?> [$+] $: <BAD> [$1] 127338032Speter# pass to name server to make hostname canonical 127438032SpeterR<?> $* $~P $: <?> $[ $1 $2 $] 127538032SpeterR<$-> $* $: $2 127638032SpeterR$* . $1 strip trailing dots 127738032SpeterR$@ $@ OK 127838032Speterifdef(`_RELAY_ENTIRE_DOMAIN_', `dnl 127938032SpeterR$* $=m $@ OK', `dnl') 128038032SpeterR$=w $@ OK 128138032Speterifdef(`_RELAY_HOSTS_ONLY_', 128238032Speter`R$=R $@ OK 128338032Speterifdef(`ACCESS_TABLE', `dnl 128438032SpeterR$* $: <$(access $1 $: ? $)> <$1>',`dnl')', 128538032Speter`R$* $=R $@ OK 128638032Speterifdef(`ACCESS_TABLE', `dnl 128738032SpeterR$* $: $>LookUpDomain <$1> <?> <$1>',`dnl')') 128838032Speterifdef(`ACCESS_TABLE', `dnl 128938032SpeterR<RELAY> $* $@ RELAY 129038032SpeterR<$*> <$*> $: $2',`dnl') 129138032Speter 129238032Speter# check IP address 129338032SpeterR$* $: $&{client_addr} 129438032SpeterR$@ $@ OK originated locally 129538032SpeterR0 $@ OK originated locally 129638032SpeterR$=R $* $@ OK relayable IP address 129738032Speterifdef(`ACCESS_TABLE', `dnl 129838032SpeterR$* $: $>LookUpAddress <$1> <?> <$1> 129938032SpeterR<RELAY> $* $@ RELAY relayable IP address 130038032SpeterR<$*> <$*> $: $2', `dnl') 130138032SpeterR$* $: [ $1 ] put brackets around it... 130238032SpeterR$=w $@ OK ... and see if it is local 130338032Speter 130438032Speterifdef(`_RELAY_LOCAL_FROM_', `dnl 130538032Speter# anything with a local FROM is ok 130642575SpeterR$* $: $1 $| $>CanonAddr $&f 130738032SpeterR$* $| $+ < @ $=w . > $@ OK FROM local 130838032SpeterR$* $| $* $: $1 130938032Speter', `dnl') 131038032Speter 131138032Speter# anything else is bogus 131238032SpeterR$* $#error $@ 5.7.1 $: "550 Relaying denied"') 131338032Speter 131438032Speterundivert(9)dnl 131538032Speter# 131638032Speter###################################################################### 131738032Speter###################################################################### 131838032Speter##### 131938032Speter`##### MAILER DEFINITIONS' 132038032Speter##### 132138032Speter###################################################################### 132238032Speter###################################################################### 132338032Speterundivert(7)dnl 1324