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