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