submit.cf revision 173341
150477Speter#
212029Sache# Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
312029Sache#	All rights reserved.
412029Sache# Copyright (c) 1983, 1995 Eric P. Allman.  All rights reserved.
512029Sache# Copyright (c) 1988, 1993
686072Sache#	The Regents of the University of California.  All rights reserved.
786072Sache#
888473Sphantom# By using this file, you agree to the terms and conditions set
988473Sphantom# forth in the LICENSE file which can be found at the top level of
1077977Sache# the sendmail distribution.
1177977Sache#
1277977Sache#
1388473Sphantom
1477977Sache######################################################################
1577977Sache######################################################################
1688473Sphantom#####
1770484Sphantom#####		SENDMAIL CONFIGURATION FILE
1877977Sache#####
1970484Sphantom##### built by ca@nother.smi.sendmail.com on Wed Oct 31 09:24:27 PDT 2007
2052388Sache##### in /extra/home/ca/sm-8.14.2/OpenSource/sendmail-8.14.2/cf/cf
2177977Sache##### using ../ as configuration include directory
2247831Sfoxfair#####
2323222Swosch######################################################################
2412029Sache#####
2512029Sache#####	DO NOT EDIT THIS FILE!  Only edit the source .mc file.
2688473Sphantom#####
2793885Sphantom######################################################################
2888473Sphantom######################################################################
2988473Sphantom
3093885Sphantom#####  $Id: cfhead.m4,v 8.116 2004/01/28 22:02:22 ca Exp $  #####
3193885Sphantom#####  $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $  #####
32105445Sache#####  $Id: submit.mc,v 8.14 2006/04/05 05:54:41 ca Exp $  #####
3388473Sphantom#####  $Id: msp.m4,v 1.33 2004/02/09 22:32:38 ca Exp $  #####
34105445Sache
3578002Sache#####  $Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $  #####
3612029Sache
3712029Sache
3812029Sache#####  $Id: proto.m4,v 8.732 2007/04/20 00:53:30 ca Exp $  #####
3937481Sbde
4012029Sache# level 10 config file format
4112029SacheV10/Berkeley
4212029Sache
4312029Sache# override file safeties - setting this option compromises system security,
4423224Sadam# addressing the actual file configuration problem is preferred
45100872Sru# need to set this before any file actions are encountered in the cf file
4623224Sadam#O DontBlameSendmail=safe
4723222Swosch
4823222Swosch# default LDAP map specification
4977977Sache# need to set this now before any LDAP maps are defined
5077988Sache#O LDAPDefaultSpec=-h localhost
5123222Swosch
5274398Sache##################
5377977Sache#   local info   #
5477988Sache##################
5541760Sdillon
5623222Swosch# my LDAP cluster
5777977Sache# need to set this before any LDAP lookups are done (including classes)
5877988Sache#D{sendmailMTACluster}$m
5923222Swosch
6055075SacheCwlocalhost
6177977Sache
6277988Sache# my official domain name
6355075Sache# ... define this only if sendmail cannot automatically determine your domain
6488314Sache#Dj$w.Foo.COM
6588314Sache
6688314Sache# host/domain names ending with a token in class P are canonical
6788314SacheCP.
6878002Sache
6977977Sache# "Smart" relay host (may be null)
7078002SacheDS
7178002Sache
7293889Sphantom
7393889Sphantom# operators that cannot be in local usernames (i.e., network indicators)
7412029SacheCO @ % !
7512029Sache
76# a class with just dot (for identifying canonical names)
77C..
78
79# a class with just a left bracket (for identifying domain literals)
80C[[
81
82
83# Resolve map (to check if a host exists in check_mail)
84Kresolve host -a<OKR> -T<TEMP>
85C{ResOk}OKR
86
87
88# Hosts for which relaying is permitted ($=R)
89FR-o /etc/mail/relay-domains
90
91# arithmetic map
92Karith arith
93
94
95
96
97
98# dequoting map
99Kdequote dequote
100
101# class E: names that should be exposed as from this host, even if we masquerade
102# class L: names that should be delivered locally, even if we have a relay
103# class M: domains that should be converted to $M
104# class N: domains that should not be converted to $M
105#CL root
106
107
108
109# my name for error messages
110DnMAILER-DAEMON
111
112
113D{MTAHost}[127.0.0.1]
114
115
116# Configuration version number
117DZ8.14.2/Submit
118
119
120###############
121#   Options   #
122###############
123
124# strip message body to 7 bits on input?
125O SevenBitInput=False
126
127# 8-bit data handling
128#O EightBitMode=pass8
129
130# wait for alias file rebuild (default units: minutes)
131O AliasWait=10
132
133# location of alias file
134#O AliasFile=/etc/mail/aliases
135
136# minimum number of free blocks on filesystem
137O MinFreeBlocks=100
138
139# maximum message size
140#O MaxMessageSize=0
141
142# substitution for space (blank) characters
143O BlankSub=.
144
145# avoid connecting to "expensive" mailers on initial submission?
146O HoldExpensive=False
147
148# checkpoint queue runs after every N successful deliveries
149#O CheckpointInterval=10
150
151# default delivery mode
152O DeliveryMode=i
153
154# error message header/file
155#O ErrorHeader=/etc/mail/error-header
156
157# error mode
158#O ErrorMode=print
159
160# save Unix-style "From_" lines at top of header?
161#O SaveFromLine=False
162
163# queue file mode (qf files)
164O QueueFileMode=0660
165
166# temporary file mode
167O TempFileMode=0600
168
169# match recipients against GECOS field?
170#O MatchGECOS=False
171
172# maximum hop count
173#O MaxHopCount=25
174
175# location of help file
176O HelpFile=/etc/mail/helpfile
177
178# ignore dots as terminators in incoming messages?
179#O IgnoreDots=False
180
181# name resolver options
182#O ResolverOptions=+AAONLY
183
184# deliver MIME-encapsulated error messages?
185O SendMimeErrors=True
186
187# Forward file search path
188O ForwardPath
189
190# open connection cache size
191O ConnectionCacheSize=2
192
193# open connection cache timeout
194O ConnectionCacheTimeout=5m
195
196# persistent host status directory
197#O HostStatusDirectory=.hoststat
198
199# single thread deliveries (requires HostStatusDirectory)?
200#O SingleThreadDelivery=False
201
202# use Errors-To: header?
203O UseErrorsTo=False
204
205# log level
206O LogLevel=9
207
208# send to me too, even in an alias expansion?
209#O MeToo=True
210
211# verify RHS in newaliases?
212O CheckAliases=False
213
214# default messages to old style headers if no special punctuation?
215O OldStyleHeaders=True
216
217# SMTP daemon options
218
219O DaemonPortOptions=Name=NoMTA, Addr=127.0.0.1, M=E
220
221# SMTP client options
222#O ClientPortOptions=Family=inet, Address=0.0.0.0
223
224# Modifiers to define {daemon_flags} for direct submissions
225#O DirectSubmissionModifiers
226
227# Use as mail submission program? See sendmail/SECURITY
228O UseMSP=True
229
230# privacy flags
231O PrivacyOptions=goaway,noetrn,restrictqrun
232
233# who (if anyone) should get extra copies of error messages
234#O PostmasterCopy=Postmaster
235
236# slope of queue-only function
237#O QueueFactor=600000
238
239# limit on number of concurrent queue runners
240#O MaxQueueChildren
241
242# maximum number of queue-runners per queue-grouping with multiple queues
243#O MaxRunnersPerQueue=1
244
245# priority of queue runners (nice(3))
246#O NiceQueueRun
247
248# shall we sort the queue by hostname first?
249#O QueueSortOrder=priority
250
251# minimum time in queue before retry
252#O MinQueueAge=30m
253
254# how many jobs can you process in the queue?
255#O MaxQueueRunSize=0
256
257# perform initial split of envelope without checking MX records
258#O FastSplit=1
259
260# queue directory
261O QueueDirectory=/var/spool/clientmqueue
262
263# key for shared memory; 0 to turn off, -1 to auto-select
264#O SharedMemoryKey=0
265
266# file to store auto-selected key for shared memory (SharedMemoryKey = -1)
267#O SharedMemoryKeyFile
268
269# timeouts (many of these)
270#O Timeout.initial=5m
271#O Timeout.connect=5m
272#O Timeout.aconnect=0s
273#O Timeout.iconnect=5m
274#O Timeout.helo=5m
275#O Timeout.mail=10m
276#O Timeout.rcpt=1h
277#O Timeout.datainit=5m
278#O Timeout.datablock=1h
279#O Timeout.datafinal=1h
280#O Timeout.rset=5m
281#O Timeout.quit=2m
282#O Timeout.misc=2m
283#O Timeout.command=1h
284#O Timeout.ident=5s
285#O Timeout.fileopen=60s
286#O Timeout.control=2m
287O Timeout.queuereturn=5d
288#O Timeout.queuereturn.normal=5d
289#O Timeout.queuereturn.urgent=2d
290#O Timeout.queuereturn.non-urgent=7d
291#O Timeout.queuereturn.dsn=5d
292O Timeout.queuewarn=4h
293#O Timeout.queuewarn.normal=4h
294#O Timeout.queuewarn.urgent=1h
295#O Timeout.queuewarn.non-urgent=12h
296#O Timeout.queuewarn.dsn=4h
297#O Timeout.hoststatus=30m
298#O Timeout.resolver.retrans=5s
299#O Timeout.resolver.retrans.first=5s
300#O Timeout.resolver.retrans.normal=5s
301#O Timeout.resolver.retry=4
302#O Timeout.resolver.retry.first=4
303#O Timeout.resolver.retry.normal=4
304#O Timeout.lhlo=2m
305#O Timeout.auth=10m
306#O Timeout.starttls=1h
307
308# time for DeliverBy; extension disabled if less than 0
309#O DeliverByMin=0
310
311# should we not prune routes in route-addr syntax addresses?
312#O DontPruneRoutes=False
313
314# queue up everything before forking?
315O SuperSafe=True
316
317# status file
318O StatusFile=/var/spool/clientmqueue/sm-client.st
319
320# time zone handling:
321#  if undefined, use system default
322#  if defined but null, use TZ envariable passed in
323#  if defined and non-null, use that info
324O TimeZoneSpec=
325
326# default UID (can be username or userid:groupid)
327#O DefaultUser=mailnull
328
329# list of locations of user database file (null means no lookup)
330#O UserDatabaseSpec=/etc/mail/userdb
331
332# fallback MX host
333#O FallbackMXhost=fall.back.host.net
334
335# fallback smart host
336#O FallbackSmartHost=fall.back.host.net
337
338# if we are the best MX host for a site, try it directly instead of config err
339#O TryNullMXList=False
340
341# load average at which we just queue messages
342#O QueueLA=8
343
344# load average at which we refuse connections
345#O RefuseLA=12
346
347# log interval when refusing connections for this long
348#O RejectLogInterval=3h
349
350# load average at which we delay connections; 0 means no limit
351#O DelayLA=0
352
353# maximum number of children we allow at one time
354#O MaxDaemonChildren=0
355
356# maximum number of new connections per second
357#O ConnectionRateThrottle=0
358
359# Width of the window 
360#O ConnectionRateWindowSize=60s
361
362# work recipient factor
363#O RecipientFactor=30000
364
365# deliver each queued job in a separate process?
366#O ForkEachJob=False
367
368# work class factor
369#O ClassFactor=1800
370
371# work time factor
372#O RetryFactor=90000
373
374# default character set
375#O DefaultCharSet=unknown-8bit
376
377# service switch file (name hardwired on Solaris, Ultrix, OSF/1, others)
378#O ServiceSwitchFile=/etc/mail/service.switch
379
380# hosts file (normally /etc/hosts)
381#O HostsFile=/etc/hosts
382
383# dialup line delay on connection failure
384#O DialDelay=0s
385
386# action to take if there are no recipients in the message
387#O NoRecipientAction=none
388
389# chrooted environment for writing to files
390#O SafeFileEnvironment
391
392# are colons OK in addresses?
393#O ColonOkInAddr=True
394
395# shall I avoid expanding CNAMEs (violates protocols)?
396#O DontExpandCnames=False
397
398# SMTP initial login message (old $e macro)
399O SmtpGreetingMessage=$j Sendmail $v/$Z; $b
400
401# UNIX initial From header format (old $l macro)
402O UnixFromLine=From $g $d
403
404# From: lines that have embedded newlines are unwrapped onto one line
405#O SingleLineFromHeader=False
406
407# Allow HELO SMTP command that does not include a host name
408#O AllowBogusHELO=False
409
410# Characters to be quoted in a full name phrase (@,;:\()[] are automatic)
411#O MustQuoteChars=.
412
413# delimiter (operator) characters (old $o macro)
414O OperatorChars=.:%@!^/[]+
415
416# shall I avoid calling initgroups(3) because of high NIS costs?
417O DontInitGroups=True
418
419# are group-writable :include: and .forward files (un)trustworthy?
420# True (the default) means they are not trustworthy.
421#O UnsafeGroupWrites=True
422
423
424# where do errors that occur when sending errors get sent?
425#O DoubleBounceAddress=postmaster
426
427# issue temporary errors (4xy) instead of permanent errors (5xy)?
428#O SoftBounce=False
429
430# where to save bounces if all else fails
431#O DeadLetterDrop=/var/tmp/dead.letter
432
433# what user id do we assume for the majority of the processing?
434O RunAsUser=smmsp
435
436# maximum number of recipients per SMTP envelope
437#O MaxRecipientsPerMessage=0
438
439# limit the rate recipients per SMTP envelope are accepted
440# once the threshold number of recipients have been rejected
441#O BadRcptThrottle=0
442
443# shall we get local names from our installed interfaces?
444O DontProbeInterfaces=True
445
446# Return-Receipt-To: header implies DSN request
447#O RrtImpliesDsn=False
448
449# override connection address (for testing)
450#O ConnectOnlyTo=0.0.0.0
451
452# Trusted user for file ownership and starting the daemon
453O TrustedUser=smmsp
454
455# Control socket for daemon management
456#O ControlSocketName=/var/spool/mqueue/.control
457
458# Maximum MIME header length to protect MUAs
459#O MaxMimeHeaderLength=0/0
460
461# Maximum length of the sum of all headers
462#O MaxHeadersLength=32768
463
464# Maximum depth of alias recursion
465#O MaxAliasRecursion=10
466
467# location of pid file
468O PidFile=/var/spool/clientmqueue/sm-client.pid
469
470# Prefix string for the process title shown on 'ps' listings
471#O ProcessTitlePrefix=prefix
472
473# Data file (df) memory-buffer file maximum size
474#O DataFileBufferSize=4096
475
476# Transcript file (xf) memory-buffer file maximum size
477#O XscriptFileBufferSize=4096
478
479# lookup type to find information about local mailboxes
480#O MailboxDatabase=pw
481
482# override compile time flag REQUIRES_DIR_FSYNC
483#O RequiresDirfsync=true
484
485# list of authentication mechanisms
486#O AuthMechanisms=EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5
487
488# Authentication realm
489#O AuthRealm
490
491# default authentication information for outgoing connections
492#O DefaultAuthInfo=/etc/mail/default-auth-info
493
494# SMTP AUTH flags
495#O AuthOptions
496
497# SMTP AUTH maximum encryption strength
498#O AuthMaxBits
499
500# SMTP STARTTLS server options
501#O TLSSrvOptions
502
503# Input mail filters
504#O InputMailFilters
505
506
507# CA directory
508#O CACertPath
509# CA file
510#O CACertFile
511# Server Cert
512#O ServerCertFile
513# Server private key
514#O ServerKeyFile
515# Client Cert
516#O ClientCertFile
517# Client private key
518#O ClientKeyFile
519# File containing certificate revocation lists 
520#O CRLFile
521# DHParameters (only required if DSA/DH is used)
522#O DHParameters
523# Random data source (required for systems without /dev/urandom under OpenSSL)
524#O RandFile
525
526# Maximum number of "useless" commands before slowing down
527#O MaxNOOPCommands=20
528
529# Name to use for EHLO (defaults to $j)
530#O HeloName
531
532############################
533# QUEUE GROUP DEFINITIONS  #
534############################
535
536
537###########################
538#   Message precedences   #
539###########################
540
541Pfirst-class=0
542Pspecial-delivery=100
543Plist=-30
544Pbulk=-60
545Pjunk=-100
546
547#####################
548#   Trusted users   #
549#####################
550
551# this is equivalent to setting class "t"
552#Ft/etc/mail/trusted-users
553Troot
554Tdaemon
555Tuucp
556
557#########################
558#   Format of headers   #
559#########################
560
561H?P?Return-Path: <$g>
562HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
563	$.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.)
564	$.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}
565	(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u
566	for $u; $|;
567	$.$b
568H?D?Resent-Date: $a
569H?D?Date: $a
570H?F?Resent-From: $?x$x <$g>$|$g$.
571H?F?From: $?x$x <$g>$|$g$.
572H?x?Full-Name: $x
573# HPosted-Date: $a
574# H?l?Received-Date: $b
575H?M?Resent-Message-Id: <$t.$i@$j>
576H?M?Message-Id: <$t.$i@$j>
577
578#
579######################################################################
580######################################################################
581#####
582#####			REWRITING RULES
583#####
584######################################################################
585######################################################################
586
587############################################
588###  Ruleset 3 -- Name Canonicalization  ###
589############################################
590Scanonify=3
591
592# handle null input (translate to <@> special case)
593R$@			$@ <@>
594
595# strip group: syntax (not inside angle brackets!) and trailing semicolon
596R$*			$: $1 <@>			mark addresses
597R$* < $* > $* <@>	$: $1 < $2 > $3			unmark <addr>
598R@ $* <@>		$: @ $1				unmark @host:...
599R$* [ IPv6 : $+ ] <@>	$: $1 [ IPv6 : $2 ]		unmark IPv6 addr
600R$* :: $* <@>		$: $1 :: $2			unmark node::addr
601R:include: $* <@>	$: :include: $1			unmark :include:...
602R$* : $* [ $* ]		$: $1 : $2 [ $3 ] <@>		remark if leading colon
603R$* : $* <@>		$: $2				strip colon if marked
604R$* <@>			$: $1				unmark
605R$* ;			   $1				strip trailing semi
606R$* < $+ :; > $*	$@ $2 :; <@>			catch <list:;>
607R$* < $* ; >		   $1 < $2 >			bogus bracketed semi
608
609# null input now results from list:; syntax
610R$@			$@ :; <@>
611
612# strip angle brackets -- note RFC733 heuristic to get innermost item
613R$*			$: < $1 >			housekeeping <>
614R$+ < $* >		   < $2 >			strip excess on left
615R< $* > $+		   < $1 >			strip excess on right
616R<>			$@ < @ >			MAIL FROM:<> case
617R< $+ >			$: $1				remove housekeeping <>
618
619# strip route address <@a,@b,@c:user@d> -> <user@d>
620R@ $+ , $+		$2
621R@ [ $* ] : $+		$2
622R@ $+ : $+		$2
623
624# find focus for list syntax
625R $+ : $* ; @ $+	$@ $>Canonify2 $1 : $2 ; < @ $3 >	list syntax
626R $+ : $* ;		$@ $1 : $2;			list syntax
627
628# find focus for @ syntax addresses
629R$+ @ $+		$: $1 < @ $2 >			focus on domain
630R$+ < $+ @ $+ >		$1 $2 < @ $3 >			move gaze right
631R$+ < @ $+ >		$@ $>Canonify2 $1 < @ $2 >	already canonical
632
633
634# convert old-style addresses to a domain-based address
635R$- ! $+		$@ $>Canonify2 $2 < @ $1 .UUCP >	resolve uucp names
636R$+ . $- ! $+		$@ $>Canonify2 $3 < @ $1 . $2 >		domain uucps
637R$+ ! $+		$@ $>Canonify2 $2 < @ $1 .UUCP >	uucp subdomains
638
639# convert node::user addresses into a domain-based address
640R$- :: $+		$@ $>Canonify2 $2 < @ $1 .DECNET >	resolve DECnet names
641R$- . $- :: $+		$@ $>Canonify2 $3 < @ $1.$2 .DECNET >	numeric DECnet addr
642
643# if we have % signs, take the rightmost one
644R$* % $*		$1 @ $2				First make them all @s.
645R$* @ $* @ $*		$1 % $2 @ $3			Undo all but the last.
646R$* @ $*		$@ $>Canonify2 $1 < @ $2 >	Insert < > and finish
647
648# else we must be a local name
649R$*			$@ $>Canonify2 $1
650
651
652################################################
653###  Ruleset 96 -- bottom half of ruleset 3  ###
654################################################
655
656SCanonify2=96
657
658# handle special cases for local names
659R$* < @ localhost > $*		$: $1 < @ $j . > $2		no domain at all
660R$* < @ localhost . $m > $*	$: $1 < @ $j . > $2		local domain
661R$* < @ localhost . UUCP > $*	$: $1 < @ $j . > $2		.UUCP domain
662
663# check for IPv4/IPv6 domain literal
664R$* < @ [ $+ ] > $*		$: $1 < @@ [ $2 ] > $3		mark [addr]
665R$* < @@ $=w > $*		$: $1 < @ $j . > $3		self-literal
666R$* < @@ $+ > $*		$@ $1 < @ $2 > $3		canon IP addr
667
668
669
670
671
672# if really UUCP, handle it immediately
673
674# try UUCP traffic as a local address
675R$* < @ $+ . UUCP > $*		$: $1 < @ $[ $2 $] . UUCP . > $3
676R$* < @ $+ . . UUCP . > $*	$@ $1 < @ $2 . > $3
677
678# hostnames ending in class P are always canonical
679R$* < @ $* $=P > $*		$: $1 < @ $2 $3 . > $4
680R$* < @ $* $~P > $*		$: $&{daemon_flags} $| $1 < @ $2 $3 > $4
681R$* CC $* $| $* < @ $+.$+ > $*	$: $3 < @ $4.$5 . > $6
682R$* CC $* $| $*			$: $3
683# pass to name server to make hostname canonical
684R$* $| $* < @ $* > $*		$: $2 < @ $[ $3 $] > $4
685R$* $| $*			$: $2
686
687# local host aliases and pseudo-domains are always canonical
688R$* < @ $=w > $*		$: $1 < @ $2 . > $3
689R$* < @ $=M > $*		$: $1 < @ $2 . > $3
690R$* < @ $* . . > $*		$1 < @ $2 . > $3
691
692
693##################################################
694###  Ruleset 4 -- Final Output Post-rewriting  ###
695##################################################
696Sfinal=4
697
698R$+ :; <@>		$@ $1 :				handle <list:;>
699R$* <@>			$@				handle <> and list:;
700
701# strip trailing dot off possibly canonical name
702R$* < @ $+ . > $*	$1 < @ $2 > $3
703
704# eliminate internal code
705R$* < @ *LOCAL* > $*	$1 < @ $j > $2
706
707# externalize local domain info
708R$* < $+ > $*		$1 $2 $3			defocus
709R@ $+ : @ $+ : $+	@ $1 , @ $2 : $3		<route-addr> canonical
710R@ $*			$@ @ $1				... and exit
711
712# UUCP must always be presented in old form
713R$+ @ $- . UUCP		$2!$1				u@h.UUCP => h!u
714
715# put DECnet back in :: form
716R$+ @ $+ . DECNET	$2 :: $1			u@h.DECNET => h::u
717# delete duplicate local names
718R$+ % $=w @ $=w		$1 @ $2				u%host@host => u@host
719
720
721
722##############################################################
723###   Ruleset 97 -- recanonicalize and call ruleset zero   ###
724###		   (used for recursive calls)		   ###
725##############################################################
726
727SRecurse=97
728R$*			$: $>canonify $1
729R$*			$@ $>parse $1
730
731
732######################################
733###   Ruleset 0 -- Parse Address   ###
734######################################
735
736Sparse=0
737
738R$*			$: $>Parse0 $1		initial parsing
739R<@>			$#local $: <@>		special case error msgs
740R$*			$: $>ParseLocal $1	handle local hacks
741R$*			$: $>Parse1 $1		final parsing
742
743#
744#  Parse0 -- do initial syntax checking and eliminate local addresses.
745#	This should either return with the (possibly modified) input
746#	or return with a #error mailer.  It should not return with a
747#	#mailer other than the #error mailer.
748#
749
750SParse0
751R<@>			$@ <@>			special case error msgs
752R$* : $* ; <@>		$#error $@ 5.1.3 $: "553 List:; syntax illegal for recipient addresses"
753R@ <@ $* >		< @ $1 >		catch "@@host" bogosity
754R<@ $+>			$#error $@ 5.1.3 $: "553 User address required"
755R$+ <@>			$#error $@ 5.1.3 $: "553 Hostname required"
756R$*			$: <> $1
757R<> $* < @ [ $* ] : $+ > $*	$1 < @ [ $2 ] : $3 > $4
758R<> $* < @ [ $* ] , $+ > $*	$1 < @ [ $2 ] , $3 > $4
759R<> $* < @ [ $* ] $+ > $*	$#error $@ 5.1.2 $: "553 Invalid address"
760R<> $* < @ [ $+ ] > $*		$1 < @ [ $2 ] > $3
761R<> $* <$* : $* > $*	$#error $@ 5.1.3 $: "553 Colon illegal in host name part"
762R<> $*			$1
763R$* < @ . $* > $*	$#error $@ 5.1.2 $: "553 Invalid host name"
764R$* < @ $* .. $* > $*	$#error $@ 5.1.2 $: "553 Invalid host name"
765R$* < @ $* @ > $*	$#error $@ 5.1.2 $: "553 Invalid route address"
766R$* @ $* < @ $* > $*	$#error $@ 5.1.3 $: "553 Invalid route address"
767R$* , $~O $*		$#error $@ 5.1.3 $: "553 Invalid route address"
768
769
770# now delete the local info -- note $=O to find characters that cause forwarding
771R$* < @ > $*		$@ $>Parse0 $>canonify $1	user@ => user
772R< @ $=w . > : $*	$@ $>Parse0 $>canonify $2	@here:... -> ...
773R$- < @ $=w . >		$: $(dequote $1 $) < @ $2 . >	dequote "foo"@here
774R< @ $+ >		$#error $@ 5.1.3 $: "553 User address required"
775R$* $=O $* < @ $=w . >	$@ $>Parse0 $>canonify $1 $2 $3	...@here -> ...
776R$- 			$: $(dequote $1 $) < @ *LOCAL* >	dequote "foo"
777R< @ *LOCAL* >		$#error $@ 5.1.3 $: "553 User address required"
778R$* $=O $* < @ *LOCAL* >
779			$@ $>Parse0 $>canonify $1 $2 $3	...@*LOCAL* -> ...
780R$* < @ *LOCAL* >	$: $1
781
782#
783#  Parse1 -- the bottom half of ruleset 0.
784#
785
786SParse1
787
788# handle numeric address spec
789R$* < @ [ $+ ] > $*	$: $>ParseLocal $1 < @ [ $2 ] > $3	numeric internet spec
790R$* < @ [ $+ ] > $*	$: $1 < @ [ $2 ] : $S > $3	Add smart host to path
791R$* < @ [ $+ ] : > $*		$#esmtp $@ [$2] $: $1 < @ [$2] > $3	no smarthost: send
792R$* < @ [ $+ ] : $- : $*> $*	$#$3 $@ $4 $: $1 < @ [$2] > $5	smarthost with mailer
793R$* < @ [ $+ ] : $+ > $*	$#esmtp $@ $3 $: $1 < @ [$2] > $4	smarthost without mailer
794
795
796# short circuit local delivery so forwarded email works
797
798
799R$=L < @ $=w . >	$#local $: @ $1			special local names
800R$+ < @ $=w . >		$#local $: $1			regular local name
801
802
803# resolve remotely connected UUCP links (if any)
804
805# resolve fake top level domains by forwarding to other hosts
806
807
808
809# pass names that still have a host to a smarthost (if defined)
810R$* < @ $* > $*		$: $>MailerToTriple < $S > $1 < @ $2 > $3	glue on smarthost name
811
812# deal with other remote names
813R$* < @$* > $*		$#esmtp $@ $2 $: $1 < @ $2 > $3	user@host.domain
814
815# handle locally delivered names
816R$=L			$#local $: @ $1		special local names
817R$+			$#local $: $1			regular local names
818
819###########################################################################
820###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
821###########################################################################
822
823SLocal_localaddr
824Slocaladdr=5
825R$+			$: $1 $| $>"Local_localaddr" $1
826R$+ $| $#ok		$@ $1			no change
827R$+ $| $#$*		$#$2
828R$+ $| $*		$: $1
829
830
831
832
833# deal with plussed users so aliases work nicely
834R$+ + *			$#local $@ $&h $: $1
835R$+ + $*		$#local $@ + $2 $: $1 + *
836
837# prepend an empty "forward host" on the front
838R$+			$: <> $1
839
840
841
842R< > $+			$: < > < $1 <> $&h >		nope, restore +detail
843
844R< > < $+ <> + $* >	$: < > < $1 + $2 >		check whether +detail
845R< > < $+ <> $* >	$: < > < $1 >			else discard
846R< > < $+ + $* > $*	   < > < $1 > + $2 $3		find the user part
847R< > < $+ > + $*	$#local $@ $2 $: @ $1		strip the extra +
848R< > < $+ >		$@ $1				no +detail
849R$+			$: $1 <> $&h			add +detail back in
850
851R$+ <> + $*		$: $1 + $2			check whether +detail
852R$+ <> $*		$: $1				else discard
853R< local : $* > $*	$: $>MailerToTriple < local : $1 > $2	no host extension
854R< error : $* > $*	$: $>MailerToTriple < error : $1 > $2	no host extension
855
856R< $~[ : $+ > $+	$: $>MailerToTriple < $1 : $2 > $3 < @ $2 >
857
858R< $+ > $+		$@ $>MailerToTriple < $1 > $2 < @ $1 >
859
860
861###################################################################
862###  Ruleset 95 -- canonify mailer:[user@]host syntax to triple	###
863###################################################################
864
865SMailerToTriple=95
866R< > $*				$@ $1			strip off null relay
867R< error : $-.$-.$- : $+ > $* 	$#error $@ $1.$2.$3 $: $4
868R< error : $- : $+ > $*		$#error $@ $(dequote $1 $) $: $2
869R< error : $+ > $*		$#error $: $1
870R< local : $* > $*		$>CanonLocal < $1 > $2
871R< $~[ : $+ @ $+ > $*<$*>$*	$# $1 $@ $3 $: $2<@$3>	use literal user
872R< $~[ : $+ > $*		$# $1 $@ $2 $: $3	try qualified mailer
873R< $=w > $*			$@ $2			delete local host
874R< $+ > $*			$#relay $@ $1 $: $2	use unqualified mailer
875
876###################################################################
877###  Ruleset CanonLocal -- canonify local: syntax		###
878###################################################################
879
880SCanonLocal
881# strip local host from routed addresses
882R< $* > < @ $+ > : $+		$@ $>Recurse $3
883R< $* > $+ $=O $+ < @ $+ >	$@ $>Recurse $2 $3 $4
884
885# strip trailing dot from any host name that may appear
886R< $* > $* < @ $* . >		$: < $1 > $2 < @ $3 >
887
888# handle local: syntax -- use old user, either with or without host
889R< > $* < @ $* > $*		$#local $@ $1@$2 $: $1
890R< > $+				$#local $@ $1    $: $1
891
892# handle local:user@host syntax -- ignore host part
893R< $+ @ $+ > $* < @ $* >	$: < $1 > $3 < @ $4 >
894
895# handle local:user syntax
896R< $+ > $* <@ $* > $*		$#local $@ $2@$3 $: $1
897R< $+ > $* 			$#local $@ $2    $: $1
898
899###################################################################
900###  Ruleset 93 -- convert header names to masqueraded form	###
901###################################################################
902
903SMasqHdr=93
904
905
906# do not masquerade anything in class N
907R$* < @ $* $=N . >	$@ $1 < @ $2 $3 . >
908
909R$* < @ *LOCAL* >	$@ $1 < @ $j . >
910
911###################################################################
912###  Ruleset 94 -- convert envelope names to masqueraded form	###
913###################################################################
914
915SMasqEnv=94
916R$* < @ *LOCAL* > $*	$: $1 < @ $j . > $2
917
918###################################################################
919###  Ruleset 98 -- local part of ruleset zero (can be null)	###
920###################################################################
921
922SParseLocal=98
923
924
925
926
927######################################################################
928###  CanonAddr --	Convert an address into a standard form for
929###			relay checking.  Route address syntax is
930###			crudely converted into a %-hack address.
931###
932###	Parameters:
933###		$1 -- full recipient address
934###
935###	Returns:
936###		parsed address, not in source route form
937######################################################################
938
939SCanonAddr
940R$*			$: $>Parse0 $>canonify $1	make domain canonical
941
942
943######################################################################
944###  ParseRecipient --	Strip off hosts in $=R as well as possibly
945###			$* $=m or the access database.
946###			Check user portion for host separators.
947###
948###	Parameters:
949###		$1 -- full recipient address
950###
951###	Returns:
952###		parsed, non-local-relaying address
953######################################################################
954
955SParseRecipient
956R$*				$: <?> $>CanonAddr $1
957R<?> $* < @ $* . >		<?> $1 < @ $2 >			strip trailing dots
958R<?> $- < @ $* >		$: <?> $(dequote $1 $) < @ $2 >	dequote local part
959
960# if no $=O character, no host in the user portion, we are done
961R<?> $* $=O $* < @ $* >		$: <NO> $1 $2 $3 < @ $4>
962R<?> $*				$@ $1
963
964
965R<NO> $* < @ $* $=R >		$: <RELAY> $1 < @ $2 $3 >
966
967
968
969R<RELAY> $* < @ $* >		$@ $>ParseRecipient $1
970R<$+> $*			$@ $2
971
972
973######################################################################
974###  check_relay -- check hostname/address on SMTP startup
975######################################################################
976
977
978
979SLocal_check_relay
980Scheck_relay
981R$*			$: $1 $| $>"Local_check_relay" $1
982R$* $| $* $| $#$*	$#$3
983R$* $| $* $| $*		$@ $>"Basic_check_relay" $1 $| $2
984
985SBasic_check_relay
986# check for deferred delivery mode
987R$*			$: < $&{deliveryMode} > $1
988R< d > $*		$@ deferred
989R< $* > $*		$: $2
990
991
992
993
994######################################################################
995###  check_mail -- check SMTP `MAIL FROM:' command argument
996######################################################################
997
998SLocal_check_mail
999Scheck_mail
1000R$*			$: $1 $| $>"Local_check_mail" $1
1001R$* $| $#$*		$#$2
1002R$* $| $*		$@ $>"Basic_check_mail" $1
1003
1004SBasic_check_mail
1005# check for deferred delivery mode
1006R$*			$: < $&{deliveryMode} > $1
1007R< d > $*		$@ deferred
1008R< $* > $*		$: $2
1009
1010# authenticated?
1011R$*			$: $1 $| $>"tls_client" $&{verify} $| MAIL
1012R$* $| $#$+		$#$2
1013R$* $| $*		$: $1
1014
1015R<>			$@ <OK>			we MUST accept <> (RFC 1123)
1016R$+			$: <?> $1
1017R<?><$+>		$: <@> <$1>
1018R<?>$+			$: <@> <$1>
1019R$*			$: $&{daemon_flags} $| $1
1020R$* f $* $| <@> < $* @ $- >	$: < ? $&{client_name} > < $3 @ $4 >
1021R$* u $* $| <@> < $* >	$: <?> < $3 >
1022R$* $| $*		$: $2
1023# handle case of @localhost on address
1024R<@> < $* @ localhost >	$: < ? $&{client_name} > < $1 @ localhost >
1025R<@> < $* @ [127.0.0.1] >
1026			$: < ? $&{client_name} > < $1 @ [127.0.0.1] >
1027R<@> < $* @ localhost.$m >
1028			$: < ? $&{client_name} > < $1 @ localhost.$m >
1029R<@> < $* @ localhost.UUCP >
1030			$: < ? $&{client_name} > < $1 @ localhost.UUCP >
1031R<@> $*			$: $1			no localhost as domain
1032R<? $=w> $*		$: $2			local client: ok
1033R<? $+> <$+>		$#error $@ 5.5.4 $: "553 Real domain name required for sender address"
1034R<?> $*			$: $1
1035R$*			$: <?> $>CanonAddr $1		canonify sender address and mark it
1036R<?> $* < @ $+ . >	<?> $1 < @ $2 >			strip trailing dots
1037# handle non-DNS hostnames (*.bitnet, *.decnet, *.uucp, etc)
1038R<?> $* < @ $* $=P >	$: <OKR> $1 < @ $2 $3 >
1039R<?> $* < @ $j >	$: <OKR> $1 < @ $j >
1040R<?> $* < @ $+ >	$: <? $(resolve $2 $: $2 <PERM> $) > $1 < @ $2 >
1041R<? $* <$->> $* < @ $+ >
1042			$: <$2> $3 < @ $4 >
1043
1044
1045# handle case of no @domain on address
1046R<?> $*			$: $&{daemon_flags} $| <?> $1
1047R$* u $* $| <?> $*	$: <OKR> $3
1048R$* $| $*		$: $2
1049R<?> $*			$: < ? $&{client_addr} > $1
1050R<?> $*			$@ <OKR>			...local unqualed ok
1051R<? $+> $*		$#error $@ 5.5.4 $: "553 Domain name required for sender address " $&f
1052							...remote is not
1053# check results
1054R<?> $*			$: @ $1		mark address: nothing known about it
1055R<$={ResOk}> $*		$: @ $2		domain ok
1056R<TEMP> $*		$#error $@ 4.1.8 $: "451 Domain of sender address " $&f " does not resolve"
1057R<PERM> $*		$#error $@ 5.1.8 $: "553 Domain of sender address " $&f " does not exist"
1058
1059
1060
1061######################################################################
1062###  check_rcpt -- check SMTP `RCPT TO:' command argument
1063######################################################################
1064
1065SLocal_check_rcpt
1066Scheck_rcpt
1067R$*			$: $1 $| $>"Local_check_rcpt" $1
1068R$* $| $#$*		$#$2
1069R$* $| $*		$@ $>"Basic_check_rcpt" $1
1070
1071SBasic_check_rcpt
1072# empty address?
1073R<>			$#error $@ nouser $: "553 User address required"
1074R$@			$#error $@ nouser $: "553 User address required"
1075# check for deferred delivery mode
1076R$*			$: < $&{deliveryMode} > $1
1077R< d > $*		$@ deferred
1078R< $* > $*		$: $2
1079
1080
1081######################################################################
1082R$*			$: $1 $| @ $>"Rcpt_ok" $1
1083R$* $| @ $#TEMP $+	$: $1 $| T $2
1084R$* $| @ $#$*		$#$2
1085R$* $| @ RELAY		$@ RELAY
1086R$* $| @ $*		$: O $| $>"Relay_ok" $1
1087R$* $| T $+		$: T $2 $| $>"Relay_ok" $1
1088R$* $| $#TEMP $+	$#error $2
1089R$* $| $#$*		$#$2
1090R$* $| RELAY		$@ RELAY
1091R T $+ $| $*		$#error $1
1092# anything else is bogus
1093R$*			$#error $@ 5.7.1 $: "550 Relaying denied"
1094
1095
1096######################################################################
1097### Rcpt_ok: is the recipient ok?
1098######################################################################
1099SRcpt_ok
1100R$*			$: $>ParseRecipient $1		strip relayable hosts
1101
1102
1103
1104
1105# authenticated via TLS?
1106R$*			$: $1 $| $>RelayTLS	client authenticated?
1107R$* $| $# $+		$# $2			error/ok?
1108R$* $| $*		$: $1			no
1109
1110R$*			$: $1 $| $>"Local_Relay_Auth" $&{auth_type}
1111R$* $| $# $*		$# $2
1112R$* $| NO		$: $1
1113R$* $| $*		$: $1 $| $&{auth_type}
1114R$* $|			$: $1
1115R$* $| $={TrustAuthMech}	$# RELAY
1116R$* $| $*		$: $1
1117# anything terminating locally is ok
1118R$+ < @ $=w >		$@ RELAY
1119R$+ < @ $* $=R >	$@ RELAY
1120
1121
1122
1123
1124# check for local user (i.e. unqualified address)
1125R$*			$: <?> $1
1126R<?> $* < @ $+ >	$: <REMOTE> $1 < @ $2 >
1127# local user is ok
1128R<?> $+			$@ RELAY
1129R<$+> $*		$: $2
1130
1131######################################################################
1132### Relay_ok: is the relay/sender ok?
1133######################################################################
1134SRelay_ok
1135# anything originating locally is ok
1136# check IP address
1137R$*			$: $&{client_addr}
1138R$@			$@ RELAY		originated locally
1139R0			$@ RELAY		originated locally
1140R127.0.0.1		$@ RELAY		originated locally
1141RIPv6:::1		$@ RELAY		originated locally
1142R$=R $*			$@ RELAY		relayable IP address
1143R$*			$: [ $1 ]		put brackets around it...
1144R$=w			$@ RELAY		... and see if it is local
1145
1146
1147# check client name: first: did it resolve?
1148R$*			$: < $&{client_resolve} >
1149R<TEMP>			$#TEMP $@ 4.4.0 $: "450 Relaying temporarily denied. Cannot resolve PTR record for " $&{client_addr}
1150R<FORGED>		$#error $@ 5.7.1 $: "550 Relaying denied. IP name possibly forged " $&{client_name}
1151R<FAIL>			$#error $@ 5.7.1 $: "550 Relaying denied. IP name lookup failed " $&{client_name}
1152R$*			$: <@> $&{client_name}
1153# pass to name server to make hostname canonical
1154R<@> $* $=P 		$:<?>  $1 $2
1155R<@> $+			$:<?>  $[ $1 $]
1156R$* .			$1			strip trailing dots
1157R<?> $=w		$@ RELAY
1158R<?> $* $=R			$@ RELAY
1159
1160
1161
1162
1163
1164######################################################################
1165###  trust_auth: is user trusted to authenticate as someone else?
1166###
1167###	Parameters:
1168###		$1: AUTH= parameter from MAIL command
1169######################################################################
1170
1171SLocal_trust_auth
1172Strust_auth
1173R$*			$: $&{auth_type} $| $1
1174# required by RFC 2554 section 4.
1175R$@ $| $*		$#error $@ 5.7.1 $: "550 not authenticated"
1176R$* $| $&{auth_authen}		$@ identical
1177R$* $| <$&{auth_authen}>	$@ identical
1178R$* $| $*		$: $1 $| $>"Local_trust_auth" $2
1179R$* $| $#$*		$#$2
1180R$*			$#error $@ 5.7.1 $: "550 " $&{auth_authen} " not allowed to act as " $&{auth_author}
1181
1182######################################################################
1183###  Relay_Auth: allow relaying based on authentication?
1184###
1185###	Parameters:
1186###		$1: ${auth_type}
1187######################################################################
1188SLocal_Relay_Auth
1189
1190######################################################################
1191###  srv_features: which features to offer to a client?
1192###	(done in server)
1193######################################################################
1194Ssrv_features
1195
1196
1197######################################################################
1198###  try_tls: try to use STARTTLS?
1199###	(done in client)
1200######################################################################
1201Stry_tls
1202
1203
1204######################################################################
1205###  tls_rcpt: is connection with server "good" enough?
1206###	(done in client, per recipient)
1207###
1208###	Parameters:
1209###		$1: recipient
1210######################################################################
1211Stls_rcpt
1212
1213
1214######################################################################
1215###  tls_client: is connection with client "good" enough?
1216###	(done in server)
1217###
1218###	Parameters:
1219###		${verify} $| (MAIL|STARTTLS)
1220######################################################################
1221Stls_client
1222R$* $| $*	$@ $>"TLS_connection" $1
1223
1224######################################################################
1225###  tls_server: is connection with server "good" enough?
1226###	(done in client)
1227###
1228###	Parameter:
1229###		${verify}
1230######################################################################
1231Stls_server
1232R$*		$@ $>"TLS_connection" $1
1233
1234######################################################################
1235###  TLS_connection: is TLS connection "good" enough?
1236###
1237###	Parameters:
1238###		${verify}
1239###		Requirement: RHS from access map, may be ? for none.
1240######################################################################
1241STLS_connection
1242RSOFTWARE	$#error $@ 4.7.0 $: "403 TLS handshake."
1243
1244
1245######################################################################
1246###  RelayTLS: allow relaying based on TLS authentication
1247###
1248###	Parameters:
1249###		none
1250######################################################################
1251SRelayTLS
1252# authenticated?
1253
1254######################################################################
1255###  authinfo: lookup authinfo in the access map
1256###
1257###	Parameters:
1258###		$1: {server_name}
1259###		$2: {server_addr}
1260######################################################################
1261Sauthinfo
1262
1263
1264
1265
1266
1267
1268
1269
1270SLocal_localaddr
1271R$+			$: $>ParseRecipient $1
1272R$* < @ $+ > $*		$#relay $@ ${MTAHost} $: $1 < @ $2 > $3
1273# DECnet
1274R$+ :: $+		$#relay $@ ${MTAHost} $: $1 :: $2
1275R$*			$#relay $@ ${MTAHost} $: $1 < @ $j >
1276#
1277######################################################################
1278######################################################################
1279#####
1280#####			MAIL FILTER DEFINITIONS
1281#####
1282######################################################################
1283######################################################################
1284
1285#
1286######################################################################
1287######################################################################
1288#####
1289#####			MAILER DEFINITIONS
1290#####
1291######################################################################
1292######################################################################
1293
1294
1295##################################################
1296###   Local and Program Mailer specification   ###
1297##################################################
1298
1299#####  $Id: local.m4,v 8.59 2004/11/23 00:37:25 ca Exp $  #####
1300
1301#
1302#  Envelope sender rewriting
1303#
1304SEnvFromL
1305R<@>			$n			errors to mailer-daemon
1306R@ <@ $*>		$n			temporarily bypass Sun bogosity
1307R$+			$: $>AddDomain $1	add local domain if needed
1308R$*			$: $>MasqEnv $1		do masquerading
1309
1310#
1311#  Envelope recipient rewriting
1312#
1313SEnvToL
1314R$+ < @ $* >		$: $1			strip host part
1315R$+ + $*		$: < $&{addr_type} > $1 + $2	mark with addr type
1316R<e s> $+ + $*		$: $1			remove +detail for sender
1317R< $* > $+		$: $2			else remove mark
1318
1319#
1320#  Header sender rewriting
1321#
1322SHdrFromL
1323R<@>			$n			errors to mailer-daemon
1324R@ <@ $*>		$n			temporarily bypass Sun bogosity
1325R$+			$: $>AddDomain $1	add local domain if needed
1326R$*			$: $>MasqHdr $1		do masquerading
1327
1328#
1329#  Header recipient rewriting
1330#
1331SHdrToL
1332R$+			$: $>AddDomain $1	add local domain if needed
1333R$* < @ *LOCAL* > $*	$: $1 < @ $j . > $2
1334
1335#
1336#  Common code to add local domain name (only if always-add-domain)
1337#
1338SAddDomain
1339
1340Mlocal,		P=[IPC], F=lmDFMuXkw5, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
1341		T=DNS/RFC822/SMTP,
1342		A=TCP $h
1343Mprog,		P=[IPC], F=lmDFMuXk5, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
1344		T=X-Unix/X-Unix/X-Unix,
1345		A=TCP $h
1346
1347#####################################
1348###   SMTP Mailer specification   ###
1349#####################################
1350
1351#####  $Id: smtp.m4,v 8.65 2006/07/12 21:08:10 ca Exp $  #####
1352
1353#
1354#  common sender and masquerading recipient rewriting
1355#
1356SMasqSMTP
1357R$* < @ $* > $*		$@ $1 < @ $2 > $3		already fully qualified
1358R$+			$@ $1 < @ *LOCAL* >		add local qualification
1359
1360#
1361#  convert pseudo-domain addresses to real domain addresses
1362#
1363SPseudoToReal
1364
1365# pass <route-addr>s through
1366R< @ $+ > $*		$@ < @ $1 > $2			resolve <route-addr>
1367
1368# output fake domains as user%fake@relay
1369
1370# do UUCP heuristics; note that these are shared with UUCP mailers
1371R$+ < @ $+ .UUCP. >	$: < $2 ! > $1			convert to UUCP form
1372R$+ < @ $* > $*		$@ $1 < @ $2 > $3		not UUCP form
1373
1374# leave these in .UUCP form to avoid further tampering
1375R< $&h ! > $- ! $+	$@ $2 < @ $1 .UUCP. >
1376R< $&h ! > $-.$+ ! $+	$@ $3 < @ $1.$2 >
1377R< $&h ! > $+		$@ $1 < @ $&h .UUCP. >
1378R< $+ ! > $+		$: $1 ! $2 < @ $Y >		use UUCP_RELAY
1379R$+ < @ $~[ $* : $+ >	$@ $1 < @ $4 >			strip mailer: part
1380R$+ < @ >		$: $1 < @ *LOCAL* >		if no UUCP_RELAY
1381
1382
1383#
1384#  envelope sender rewriting
1385#
1386SEnvFromSMTP
1387R$+			$: $>PseudoToReal $1		sender/recipient common
1388R$* :; <@>		$@				list:; special case
1389R$*			$: $>MasqSMTP $1		qualify unqual'ed names
1390R$+			$: $>MasqEnv $1			do masquerading
1391
1392
1393#
1394#  envelope recipient rewriting --
1395#  also header recipient if not masquerading recipients
1396#
1397SEnvToSMTP
1398R$+			$: $>PseudoToReal $1		sender/recipient common
1399R$+			$: $>MasqSMTP $1		qualify unqual'ed names
1400R$* < @ *LOCAL* > $*	$: $1 < @ $j . > $2
1401
1402#
1403#  header sender and masquerading header recipient rewriting
1404#
1405SHdrFromSMTP
1406R$+			$: $>PseudoToReal $1		sender/recipient common
1407R:; <@>			$@				list:; special case
1408
1409# do special header rewriting
1410R$* <@> $*		$@ $1 <@> $2			pass null host through
1411R< @ $* > $*		$@ < @ $1 > $2			pass route-addr through
1412R$*			$: $>MasqSMTP $1		qualify unqual'ed names
1413R$+			$: $>MasqHdr $1			do masquerading
1414
1415
1416#
1417#  relay mailer header masquerading recipient rewriting
1418#
1419SMasqRelay
1420R$+			$: $>MasqSMTP $1
1421R$+			$: $>MasqHdr $1
1422
1423Msmtp,		P=[IPC], F=mDFMuXk5, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1424		T=DNS/RFC822/SMTP,
1425		A=TCP $h
1426Mesmtp,		P=[IPC], F=mDFMuXak5, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1427		T=DNS/RFC822/SMTP,
1428		A=TCP $h
1429Msmtp8,		P=[IPC], F=mDFMuX8k5, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1430		T=DNS/RFC822/SMTP,
1431		A=TCP $h
1432Mdsmtp,		P=[IPC], F=mDFMuXa%k5, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1433		T=DNS/RFC822/SMTP,
1434		A=TCP $h
1435Mrelay,		P=[IPC], F=mDFMuXa8k, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,
1436		T=DNS/RFC822/SMTP,
1437		A=TCP $h
1438
1439### submit.mc ###
1440# divert(-1)
1441# #
1442# # Copyright (c) 2001-2003 Sendmail, Inc. and its suppliers.
1443# #	All rights reserved.
1444# #
1445# # By using this file, you agree to the terms and conditions set
1446# # forth in the LICENSE file which can be found at the top level of
1447# # the sendmail distribution.
1448# #
1449# #
1450# 
1451# #
1452# #  This is the prototype file for a set-group-ID sm-msp sendmail that
1453# #  acts as a initial mail submission program.
1454# #
1455# 
1456# divert(0)dnl
1457# VERSIONID(`$Id: submit.mc,v 8.14 2006/04/05 05:54:41 ca Exp $')
1458# define(`confCF_VERSION', `Submit')dnl
1459# define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining
1460# define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
1461# define(`confTIME_ZONE', `USE_TZ')dnl
1462# define(`confDONT_INIT_GROUPS', `True')dnl
1463# dnl
1464# dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1]
1465# FEATURE(`msp', `[127.0.0.1]')dnl
1466