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