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