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