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