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