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