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