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