2 # Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
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.
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.
14 ######################################################################
15 ######################################################################
17 ##### SENDMAIL CONFIGURATION FILE
19 ##### built by ca@nother.smi.sendmail.com on Wed Oct 31 09:24:27 PDT 2007
20 ##### in /extra/home/ca/sm-8.14.2/OpenSource/sendmail-8.14.2/cf/cf
21 ##### using ../ as configuration include directory
23 ######################################################################
25 ##### DO NOT EDIT THIS FILE! Only edit the source .mc file.
27 ######################################################################
28 ######################################################################
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-ultrix4.mc,v 8.11 1999/02/07 07:26:03 gshapiro Exp $ #####
34 ##### $Id: ultrix4.m4,v 8.11 1999/02/07 07:26:24 gshapiro Exp $ #####
37 ##### $Id: generic.m4,v 8.15 1999/04/04 00:51:09 ca Exp $ #####
39 ##### $Id: redirect.m4,v 8.15 1999/08/06 01:47:36 gshapiro Exp $ #####
41 ##### $Id: use_cw_file.m4,v 8.11 2001/08/26 20:58:57 gshapiro Exp $ #####
45 ##### $Id: proto.m4,v 8.732 2007/04/20 00:53:30 ca Exp $ #####
47 # level 10 config file format
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
55 # default LDAP map specification
56 # need to set this now before any LDAP maps are defined
57 #O LDAPDefaultSpec=-h localhost
64 # need to set this before any LDAP lookups are done (including classes)
65 #D{sendmailMTACluster}$m
68 # file containing names of hosts for which we receive email
69 Fw/etc/mail/local-host-names
71 # my official domain name
72 # ... define this only if sendmail cannot automatically determine your domain
75 # host/domain names ending with a token in class P are canonical
78 # "Smart" relay host (may be null)
82 # operators that cannot be in local usernames (i.e., network indicators)
85 # a class with just dot (for identifying canonical names)
88 # a class with just a left bracket (for identifying domain literals)
92 # Resolve map (to check if a host exists in check_mail)
93 Kresolve host -a<OKR> -T<TEMP>
97 # Hosts for which relaying is permitted ($=R)
98 FR-o /etc/mail/relay-domains
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
119 # my name for error messages
125 # Configuration version number
133 # strip message body to 7 bits on input?
134 O SevenBitInput=False
136 # 8-bit data handling
137 #O EightBitMode=pass8
139 # wait for alias file rebuild (default units: minutes)
142 # location of alias file
143 O AliasFile=/etc/mail/aliases
145 # minimum number of free blocks on filesystem
148 # maximum message size
151 # substitution for space (blank) characters
154 # avoid connecting to "expensive" mailers on initial submission?
155 O HoldExpensive=False
157 # checkpoint queue runs after every N successful deliveries
158 #O CheckpointInterval=10
160 # default delivery mode
161 O DeliveryMode=background
163 # error message header/file
164 #O ErrorHeader=/etc/mail/error-header
169 # save Unix-style "From_" lines at top of header?
170 #O SaveFromLine=False
172 # queue file mode (qf files)
173 #O QueueFileMode=0600
175 # temporary file mode
178 # match recipients against GECOS field?
184 # location of help file
185 O HelpFile=/etc/mail/helpfile
187 # ignore dots as terminators in incoming messages?
190 # name resolver options
191 #O ResolverOptions=+AAONLY
193 # deliver MIME-encapsulated error messages?
194 O SendMimeErrors=True
196 # Forward file search path
197 O ForwardPath=$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward
199 # open connection cache size
200 O ConnectionCacheSize=2
202 # open connection cache timeout
203 O ConnectionCacheTimeout=5m
205 # persistent host status directory
206 #O HostStatusDirectory=.hoststat
208 # single thread deliveries (requires HostStatusDirectory)?
209 #O SingleThreadDelivery=False
211 # use Errors-To: header?
217 # send to me too, even in an alias expansion?
220 # verify RHS in newaliases?
223 # default messages to old style headers if no special punctuation?
224 O OldStyleHeaders=True
226 # SMTP daemon options
227 O DaemonPortOptions=Name=MTA
228 O DaemonPortOptions=Port=587, Name=MSA, M=E
230 # SMTP client options
231 #O ClientPortOptions=Family=inet, Address=0.0.0.0
233 # Modifiers to define {daemon_flags} for direct submissions
234 #O DirectSubmissionModifiers
236 # Use as mail submission program? See sendmail/SECURITY
240 O PrivacyOptions=authwarnings
242 # who (if anyone) should get extra copies of error messages
243 #O PostmasterCopy=Postmaster
245 # slope of queue-only function
246 #O QueueFactor=600000
248 # limit on number of concurrent queue runners
251 # maximum number of queue-runners per queue-grouping with multiple queues
252 #O MaxRunnersPerQueue=1
254 # priority of queue runners (nice(3))
257 # shall we sort the queue by hostname first?
258 #O QueueSortOrder=priority
260 # minimum time in queue before retry
263 # how many jobs can you process in the queue?
266 # perform initial split of envelope without checking MX records
270 O QueueDirectory=/var/spool/mqueue
272 # key for shared memory; 0 to turn off, -1 to auto-select
275 # file to store auto-selected key for shared memory (SharedMemoryKey = -1)
276 #O SharedMemoryKeyFile
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
286 #O Timeout.datainit=5m
287 #O Timeout.datablock=1h
288 #O Timeout.datafinal=1h
292 #O Timeout.command=1h
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
315 #O Timeout.starttls=1h
317 # time for DeliverBy; extension disabled if less than 0
320 # should we not prune routes in route-addr syntax addresses?
321 #O DontPruneRoutes=False
323 # queue up everything before forking?
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
335 # default UID (can be username or userid:groupid)
336 #O DefaultUser=mailnull
338 # list of locations of user database file (null means no lookup)
339 #O UserDatabaseSpec=/etc/mail/userdb
342 #O FallbackMXhost=fall.back.host.net
344 # fallback smart host
345 #O FallbackSmartHost=fall.back.host.net
347 # if we are the best MX host for a site, try it directly instead of config err
348 #O TryNullMXList=False
350 # load average at which we just queue messages
353 # load average at which we refuse connections
356 # log interval when refusing connections for this long
357 #O RejectLogInterval=3h
359 # load average at which we delay connections; 0 means no limit
362 # maximum number of children we allow at one time
363 #O MaxDaemonChildren=0
365 # maximum number of new connections per second
366 #O ConnectionRateThrottle=0
368 # Width of the window
369 #O ConnectionRateWindowSize=60s
371 # work recipient factor
372 #O RecipientFactor=30000
374 # deliver each queued job in a separate process?
383 # default character set
384 #O DefaultCharSet=unknown-8bit
386 # service switch file (name hardwired on Solaris, Ultrix, OSF/1, others)
387 #O ServiceSwitchFile=/etc/mail/service.switch
389 # hosts file (normally /etc/hosts)
390 #O HostsFile=/etc/hosts
392 # dialup line delay on connection failure
395 # action to take if there are no recipients in the message
396 #O NoRecipientAction=none
398 # chrooted environment for writing to files
399 #O SafeFileEnvironment
401 # are colons OK in addresses?
402 #O ColonOkInAddr=True
404 # shall I avoid expanding CNAMEs (violates protocols)?
405 #O DontExpandCnames=False
407 # SMTP initial login message (old $e macro)
408 O SmtpGreetingMessage=$j Sendmail $v/$Z; $b
410 # UNIX initial From header format (old $l macro)
411 O UnixFromLine=From $g $d
413 # From: lines that have embedded newlines are unwrapped onto one line
414 #O SingleLineFromHeader=False
416 # Allow HELO SMTP command that does not include a host name
417 #O AllowBogusHELO=False
419 # Characters to be quoted in a full name phrase (@,;:\()[] are automatic)
422 # delimiter (operator) characters (old $o macro)
423 O OperatorChars=.:%@!^/[]+
425 # shall I avoid calling initgroups(3) because of high NIS costs?
426 #O DontInitGroups=False
428 # are group-writable :include: and .forward files (un)trustworthy?
429 # True (the default) means they are not trustworthy.
430 #O UnsafeGroupWrites=True
433 # where do errors that occur when sending errors get sent?
434 #O DoubleBounceAddress=postmaster
436 # issue temporary errors (4xy) instead of permanent errors (5xy)?
439 # where to save bounces if all else fails
440 #O DeadLetterDrop=/var/tmp/dead.letter
442 # what user id do we assume for the majority of the processing?
443 #O RunAsUser=sendmail
445 # maximum number of recipients per SMTP envelope
446 #O MaxRecipientsPerMessage=0
448 # limit the rate recipients per SMTP envelope are accepted
449 # once the threshold number of recipients have been rejected
452 # shall we get local names from our installed interfaces?
453 #O DontProbeInterfaces=False
455 # Return-Receipt-To: header implies DSN request
456 #O RrtImpliesDsn=False
458 # override connection address (for testing)
459 #O ConnectOnlyTo=0.0.0.0
461 # Trusted user for file ownership and starting the daemon
464 # Control socket for daemon management
465 #O ControlSocketName=/var/spool/mqueue/.control
467 # Maximum MIME header length to protect MUAs
468 #O MaxMimeHeaderLength=0/0
470 # Maximum length of the sum of all headers
471 O MaxHeadersLength=32768
473 # Maximum depth of alias recursion
474 #O MaxAliasRecursion=10
476 # location of pid file
477 #O PidFile=/var/run/sendmail.pid
479 # Prefix string for the process title shown on 'ps' listings
480 #O ProcessTitlePrefix=prefix
482 # Data file (df) memory-buffer file maximum size
483 #O DataFileBufferSize=4096
485 # Transcript file (xf) memory-buffer file maximum size
486 #O XscriptFileBufferSize=4096
488 # lookup type to find information about local mailboxes
489 #O MailboxDatabase=pw
491 # override compile time flag REQUIRES_DIR_FSYNC
492 #O RequiresDirfsync=true
494 # list of authentication mechanisms
495 #O AuthMechanisms=EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5
497 # Authentication realm
500 # default authentication information for outgoing connections
501 #O DefaultAuthInfo=/etc/mail/default-auth-info
506 # SMTP AUTH maximum encryption strength
509 # SMTP STARTTLS server options
528 # File containing certificate revocation lists
530 # DHParameters (only required if DSA/DH is used)
532 # Random data source (required for systems without /dev/urandom under OpenSSL)
535 # Maximum number of "useless" commands before slowing down
536 #O MaxNOOPCommands=20
538 # Name to use for EHLO (defaults to $j)
541 ############################
542 # QUEUE GROUP DEFINITIONS #
543 ############################
546 ###########################
547 # Message precedences #
548 ###########################
551 Pspecial-delivery=100
556 #####################
558 #####################
560 # this is equivalent to setting class "t"
561 #Ft/etc/mail/trusted-users
566 #########################
567 # Format of headers #
568 #########################
570 H?P?Return-Path: <$g>
571 HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
572 $.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.)
573 $.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}
574 (version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u
579 H?F?Resent-From: $?x$x <$g>$|$g$.
580 H?F?From: $?x$x <$g>$|$g$.
583 # H?l?Received-Date: $b
584 H?M?Resent-Message-Id: <$t.$i@$j>
585 H?M?Message-Id: <$t.$i@$j>
588 ######################################################################
589 ######################################################################
591 ##### REWRITING RULES
593 ######################################################################
594 ######################################################################
596 ############################################
597 ### Ruleset 3 -- Name Canonicalization ###
598 ############################################
601 # handle null input (translate to <@> special case)
604 # strip group: syntax (not inside angle brackets!) and trailing semicolon
605 R$* $: $1 <@> mark addresses
606 R$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr>
607 R@ $* <@> $: @ $1 unmark @host:...
608 R$* [ IPv6 : $+ ] <@> $: $1 [ IPv6 : $2 ] unmark IPv6 addr
609 R$* :: $* <@> $: $1 :: $2 unmark node::addr
610 R:include: $* <@> $: :include: $1 unmark :include:...
611 R$* : $* [ $* ] $: $1 : $2 [ $3 ] <@> remark if leading colon
612 R$* : $* <@> $: $2 strip colon if marked
614 R$* ; $1 strip trailing semi
615 R$* < $+ :; > $* $@ $2 :; <@> catch <list:;>
616 R$* < $* ; > $1 < $2 > bogus bracketed semi
618 # null input now results from list:; syntax
621 # strip angle brackets -- note RFC733 heuristic to get innermost item
622 R$* $: < $1 > housekeeping <>
623 R$+ < $* > < $2 > strip excess on left
624 R< $* > $+ < $1 > strip excess on right
625 R<> $@ < @ > MAIL FROM:<> case
626 R< $+ > $: $1 remove housekeeping <>
628 # strip route address <@a,@b,@c:user@d> -> <user@d>
633 # find focus for list syntax
634 R $+ : $* ; @ $+ $@ $>Canonify2 $1 : $2 ; < @ $3 > list syntax
635 R $+ : $* ; $@ $1 : $2; list syntax
637 # find focus for @ syntax addresses
638 R$+ @ $+ $: $1 < @ $2 > focus on domain
639 R$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right
640 R$+ < @ $+ > $@ $>Canonify2 $1 < @ $2 > already canonical
643 # convert old-style addresses to a domain-based address
644 R$- ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > resolve uucp names
645 R$+ . $- ! $+ $@ $>Canonify2 $3 < @ $1 . $2 > domain uucps
646 R$+ ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > uucp subdomains
648 # if we have % signs, take the rightmost one
649 R$* % $* $1 @ $2 First make them all @s.
650 R$* @ $* @ $* $1 % $2 @ $3 Undo all but the last.
651 R$* @ $* $@ $>Canonify2 $1 < @ $2 > Insert < > and finish
653 # else we must be a local name
654 R$* $@ $>Canonify2 $1
657 ################################################
658 ### Ruleset 96 -- bottom half of ruleset 3 ###
659 ################################################
663 # handle special cases for local names
664 R$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all
665 R$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain
666 R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain
668 # check for IPv4/IPv6 domain literal
669 R$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [addr]
670 R$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal
671 R$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr
677 # if really UUCP, handle it immediately
679 # try UUCP traffic as a local address
680 R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3
681 R$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3
683 # hostnames ending in class P are always canonical
684 R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4
685 R$* < @ $* $~P > $* $: $&{daemon_flags} $| $1 < @ $2 $3 > $4
686 R$* CC $* $| $* < @ $+.$+ > $* $: $3 < @ $4.$5 . > $6
687 R$* CC $* $| $* $: $3
688 # pass to name server to make hostname canonical
689 R$* $| $* < @ $* > $* $: $2 < @ $[ $3 $] > $4
692 # local host aliases and pseudo-domains are always canonical
693 R$* < @ $=w > $* $: $1 < @ $2 . > $3
694 R$* < @ $=M > $* $: $1 < @ $2 . > $3
695 R$* < @ $* . . > $* $1 < @ $2 . > $3
698 ##################################################
699 ### Ruleset 4 -- Final Output Post-rewriting ###
700 ##################################################
703 R$+ :; <@> $@ $1 : handle <list:;>
704 R$* <@> $@ handle <> and list:;
706 # strip trailing dot off possibly canonical name
707 R$* < @ $+ . > $* $1 < @ $2 > $3
709 # eliminate internal code
710 R$* < @ *LOCAL* > $* $1 < @ $j > $2
712 # externalize local domain info
713 R$* < $+ > $* $1 $2 $3 defocus
714 R@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical
715 R@ $* $@ @ $1 ... and exit
717 # UUCP must always be presented in old form
718 R$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u
720 # delete duplicate local names
721 R$+ % $=w @ $=w $1 @ $2 u%host@host => u@host
725 ##############################################################
726 ### Ruleset 97 -- recanonicalize and call ruleset zero ###
727 ### (used for recursive calls) ###
728 ##############################################################
735 ######################################
736 ### Ruleset 0 -- Parse Address ###
737 ######################################
741 R$* $: $>Parse0 $1 initial parsing
742 R<@> $#local $: <@> special case error msgs
743 R$* $: $>ParseLocal $1 handle local hacks
744 R$* $: $>Parse1 $1 final parsing
747 # Parse0 -- do initial syntax checking and eliminate local addresses.
748 # This should either return with the (possibly modified) input
749 # or return with a #error mailer. It should not return with a
750 # #mailer other than the #error mailer.
754 R<@> $@ <@> special case error msgs
755 R$* : $* ; <@> $#error $@ 5.1.3 $: "553 List:; syntax illegal for recipient addresses"
756 R@ <@ $* > < @ $1 > catch "@@host" bogosity
757 R<@ $+> $#error $@ 5.1.3 $: "553 User address required"
758 R$+ <@> $#error $@ 5.1.3 $: "553 Hostname required"
760 R<> $* < @ [ $* ] : $+ > $* $1 < @ [ $2 ] : $3 > $4
761 R<> $* < @ [ $* ] , $+ > $* $1 < @ [ $2 ] , $3 > $4
762 R<> $* < @ [ $* ] $+ > $* $#error $@ 5.1.2 $: "553 Invalid address"
763 R<> $* < @ [ $+ ] > $* $1 < @ [ $2 ] > $3
764 R<> $* <$* : $* > $* $#error $@ 5.1.3 $: "553 Colon illegal in host name part"
766 R$* < @ . $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
767 R$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
768 R$* < @ $* @ > $* $#error $@ 5.1.2 $: "553 Invalid route address"
769 R$* @ $* < @ $* > $* $#error $@ 5.1.3 $: "553 Invalid route address"
770 R$* , $~O $* $#error $@ 5.1.3 $: "553 Invalid route address"
773 # now delete the local info -- note $=O to find characters that cause forwarding
774 R$* < @ > $* $@ $>Parse0 $>canonify $1 user@ => user
775 R< @ $=w . > : $* $@ $>Parse0 $>canonify $2 @here:... -> ...
776 R$- < @ $=w . > $: $(dequote $1 $) < @ $2 . > dequote "foo"@here
777 R< @ $+ > $#error $@ 5.1.3 $: "553 User address required"
778 R$* $=O $* < @ $=w . > $@ $>Parse0 $>canonify $1 $2 $3 ...@here -> ...
779 R$- $: $(dequote $1 $) < @ *LOCAL* > dequote "foo"
780 R< @ *LOCAL* > $#error $@ 5.1.3 $: "553 User address required"
781 R$* $=O $* < @ *LOCAL* >
782 $@ $>Parse0 $>canonify $1 $2 $3 ...@*LOCAL* -> ...
783 R$* < @ *LOCAL* > $: $1
786 # Parse1 -- the bottom half of ruleset 0.
791 # handle numeric address spec
792 R$* < @ [ $+ ] > $* $: $>ParseLocal $1 < @ [ $2 ] > $3 numeric internet spec
793 R$* < @ [ $+ ] > $* $: $1 < @ [ $2 ] : $S > $3 Add smart host to path
794 R$* < @ [ $+ ] : > $* $#esmtp $@ [$2] $: $1 < @ [$2] > $3 no smarthost: send
795 R$* < @ [ $+ ] : $- : $*> $* $#$3 $@ $4 $: $1 < @ [$2] > $5 smarthost with mailer
796 R$* < @ [ $+ ] : $+ > $* $#esmtp $@ $3 $: $1 < @ [$2] > $4 smarthost without mailer
799 # short circuit local delivery so forwarded email works
802 R$=L < @ $=w . > $#local $: @ $1 special local names
803 R$+ < @ $=w . > $#local $: $1 regular local name
806 # resolve remotely connected UUCP links (if any)
808 # resolve fake top level domains by forwarding to other hosts
812 # pass names that still have a host to a smarthost (if defined)
813 R$* < @ $* > $* $: $>MailerToTriple < $S > $1 < @ $2 > $3 glue on smarthost name
815 # deal with other remote names
816 R$* < @$* > $* $#esmtp $@ $2 $: $1 < @ $2 > $3 user@host.domain
818 # handle locally delivered names
819 R$=L $#local $: @ $1 special local names
820 R$+ $#local $: $1 regular local names
822 ###########################################################################
823 ### Ruleset 5 -- special rewriting after aliases have been expanded ###
824 ###########################################################################
828 R$+ $: $1 $| $>"Local_localaddr" $1
829 R$+ $| $#ok $@ $1 no change
836 # deal with plussed users so aliases work nicely
837 R$+ + * $#local $@ $&h $: $1
838 R$+ + $* $#local $@ + $2 $: $1 + *
840 # prepend an empty "forward host" on the front
845 R< > $+ $: < > < $1 <> $&h > nope, restore +detail
847 R< > < $+ <> + $* > $: < > < $1 + $2 > check whether +detail
848 R< > < $+ <> $* > $: < > < $1 > else discard
849 R< > < $+ + $* > $* < > < $1 > + $2 $3 find the user part
850 R< > < $+ > + $* $#local $@ $2 $: @ $1 strip the extra +
851 R< > < $+ > $@ $1 no +detail
852 R$+ $: $1 <> $&h add +detail back in
854 R$+ <> + $* $: $1 + $2 check whether +detail
855 R$+ <> $* $: $1 else discard
856 R< local : $* > $* $: $>MailerToTriple < local : $1 > $2 no host extension
857 R< error : $* > $* $: $>MailerToTriple < error : $1 > $2 no host extension
859 R< $~[ : $+ > $+ $: $>MailerToTriple < $1 : $2 > $3 < @ $2 >
861 R< $+ > $+ $@ $>MailerToTriple < $1 > $2 < @ $1 >
864 ###################################################################
865 ### Ruleset 95 -- canonify mailer:[user@]host syntax to triple ###
866 ###################################################################
869 R< > $* $@ $1 strip off null relay
870 R< error : $-.$-.$- : $+ > $* $#error $@ $1.$2.$3 $: $4
871 R< error : $- : $+ > $* $#error $@ $(dequote $1 $) $: $2
872 R< error : $+ > $* $#error $: $1
873 R< local : $* > $* $>CanonLocal < $1 > $2
874 R< $~[ : $+ @ $+ > $*<$*>$* $# $1 $@ $3 $: $2<@$3> use literal user
875 R< $~[ : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
876 R< $=w > $* $@ $2 delete local host
877 R< $+ > $* $#relay $@ $1 $: $2 use unqualified mailer
879 ###################################################################
880 ### Ruleset CanonLocal -- canonify local: syntax ###
881 ###################################################################
884 # strip local host from routed addresses
885 R< $* > < @ $+ > : $+ $@ $>Recurse $3
886 R< $* > $+ $=O $+ < @ $+ > $@ $>Recurse $2 $3 $4
888 # strip trailing dot from any host name that may appear
889 R< $* > $* < @ $* . > $: < $1 > $2 < @ $3 >
891 # handle local: syntax -- use old user, either with or without host
892 R< > $* < @ $* > $* $#local $@ $1@$2 $: $1
893 R< > $+ $#local $@ $1 $: $1
895 # handle local:user@host syntax -- ignore host part
896 R< $+ @ $+ > $* < @ $* > $: < $1 > $3 < @ $4 >
898 # handle local:user syntax
899 R< $+ > $* <@ $* > $* $#local $@ $2@$3 $: $1
900 R< $+ > $* $#local $@ $2 $: $1
902 ###################################################################
903 ### Ruleset 93 -- convert header names to masqueraded form ###
904 ###################################################################
909 # do not masquerade anything in class N
910 R$* < @ $* $=N . > $@ $1 < @ $2 $3 . >
912 R$* < @ *LOCAL* > $@ $1 < @ $j . >
914 ###################################################################
915 ### Ruleset 94 -- convert envelope names to masqueraded form ###
916 ###################################################################
919 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
921 ###################################################################
922 ### Ruleset 98 -- local part of ruleset zero (can be null) ###
923 ###################################################################
927 # addresses sent to foo@host.REDIRECT will give a 551 error code
928 R$* < @ $+ .REDIRECT. > $: $1 < @ $2 . REDIRECT . > < ${opMode} >
929 R$* < @ $+ .REDIRECT. > <i> $: $1 < @ $2 . REDIRECT. >
930 R$* < @ $+ .REDIRECT. > < $- > $#error $@ 5.1.1 $: "551 User has moved; please try " <$1@$2>
936 ######################################################################
937 ### CanonAddr -- Convert an address into a standard form for
938 ### relay checking. Route address syntax is
939 ### crudely converted into a %-hack address.
942 ### $1 -- full recipient address
945 ### parsed address, not in source route form
946 ######################################################################
949 R$* $: $>Parse0 $>canonify $1 make domain canonical
952 ######################################################################
953 ### ParseRecipient -- Strip off hosts in $=R as well as possibly
954 ### $* $=m or the access database.
955 ### Check user portion for host separators.
958 ### $1 -- full recipient address
961 ### parsed, non-local-relaying address
962 ######################################################################
965 R$* $: <?> $>CanonAddr $1
966 R<?> $* < @ $* . > <?> $1 < @ $2 > strip trailing dots
967 R<?> $- < @ $* > $: <?> $(dequote $1 $) < @ $2 > dequote local part
969 # if no $=O character, no host in the user portion, we are done
970 R<?> $* $=O $* < @ $* > $: <NO> $1 $2 $3 < @ $4>
974 R<NO> $* < @ $* $=R > $: <RELAY> $1 < @ $2 $3 >
978 R<RELAY> $* < @ $* > $@ $>ParseRecipient $1
982 ######################################################################
983 ### check_relay -- check hostname/address on SMTP startup
984 ######################################################################
990 R$* $: $1 $| $>"Local_check_relay" $1
991 R$* $| $* $| $#$* $#$3
992 R$* $| $* $| $* $@ $>"Basic_check_relay" $1 $| $2
995 # check for deferred delivery mode
996 R$* $: < $&{deliveryMode} > $1
997 R< d > $* $@ deferred
1003 ######################################################################
1004 ### check_mail -- check SMTP `MAIL FROM:' command argument
1005 ######################################################################
1009 R$* $: $1 $| $>"Local_check_mail" $1
1011 R$* $| $* $@ $>"Basic_check_mail" $1
1014 # check for deferred delivery mode
1015 R$* $: < $&{deliveryMode} > $1
1016 R< d > $* $@ deferred
1020 R$* $: $1 $| $>"tls_client" $&{verify} $| MAIL
1024 R<> $@ <OK> we MUST accept <> (RFC 1123)
1026 R<?><$+> $: <@> <$1>
1028 R$* $: $&{daemon_flags} $| $1
1029 R$* f $* $| <@> < $* @ $- > $: < ? $&{client_name} > < $3 @ $4 >
1030 R$* u $* $| <@> < $* > $: <?> < $3 >
1032 # handle case of @localhost on address
1033 R<@> < $* @ localhost > $: < ? $&{client_name} > < $1 @ localhost >
1034 R<@> < $* @ [127.0.0.1] >
1035 $: < ? $&{client_name} > < $1 @ [127.0.0.1] >
1036 R<@> < $* @ localhost.$m >
1037 $: < ? $&{client_name} > < $1 @ localhost.$m >
1038 R<@> < $* @ localhost.UUCP >
1039 $: < ? $&{client_name} > < $1 @ localhost.UUCP >
1040 R<@> $* $: $1 no localhost as domain
1041 R<? $=w> $* $: $2 local client: ok
1042 R<? $+> <$+> $#error $@ 5.5.4 $: "553 Real domain name required for sender address"
1044 R$* $: <?> $>CanonAddr $1 canonify sender address and mark it
1045 R<?> $* < @ $+ . > <?> $1 < @ $2 > strip trailing dots
1046 # handle non-DNS hostnames (*.bitnet, *.decnet, *.uucp, etc)
1047 R<?> $* < @ $* $=P > $: <OKR> $1 < @ $2 $3 >
1048 R<?> $* < @ $j > $: <OKR> $1 < @ $j >
1049 R<?> $* < @ $+ > $: <? $(resolve $2 $: $2 <PERM> $) > $1 < @ $2 >
1050 R<? $* <$->> $* < @ $+ >
1054 # handle case of no @domain on address
1055 R<?> $* $: $&{daemon_flags} $| <?> $1
1056 R$* u $* $| <?> $* $: <OKR> $3
1058 R<?> $* $: < ? $&{client_addr} > $1
1059 R<?> $* $@ <OKR> ...local unqualed ok
1060 R<? $+> $* $#error $@ 5.5.4 $: "553 Domain name required for sender address " $&f
1063 R<?> $* $: @ $1 mark address: nothing known about it
1064 R<$={ResOk}> $* $: @ $2 domain ok
1065 R<TEMP> $* $#error $@ 4.1.8 $: "451 Domain of sender address " $&f " does not resolve"
1066 R<PERM> $* $#error $@ 5.1.8 $: "553 Domain of sender address " $&f " does not exist"
1070 ######################################################################
1071 ### check_rcpt -- check SMTP `RCPT TO:' command argument
1072 ######################################################################
1076 R$* $: $1 $| $>"Local_check_rcpt" $1
1078 R$* $| $* $@ $>"Basic_check_rcpt" $1
1082 R<> $#error $@ nouser $: "553 User address required"
1083 R$@ $#error $@ nouser $: "553 User address required"
1084 # check for deferred delivery mode
1085 R$* $: < $&{deliveryMode} > $1
1086 R< d > $* $@ deferred
1090 ######################################################################
1091 R$* $: $1 $| @ $>"Rcpt_ok" $1
1092 R$* $| @ $#TEMP $+ $: $1 $| T $2
1094 R$* $| @ RELAY $@ RELAY
1095 R$* $| @ $* $: O $| $>"Relay_ok" $1
1096 R$* $| T $+ $: T $2 $| $>"Relay_ok" $1
1097 R$* $| $#TEMP $+ $#error $2
1099 R$* $| RELAY $@ RELAY
1100 R T $+ $| $* $#error $1
1101 # anything else is bogus
1102 R$* $#error $@ 5.7.1 $: "550 Relaying denied"
1105 ######################################################################
1106 ### Rcpt_ok: is the recipient ok?
1107 ######################################################################
1109 R$* $: $>ParseRecipient $1 strip relayable hosts
1114 # authenticated via TLS?
1115 R$* $: $1 $| $>RelayTLS client authenticated?
1116 R$* $| $# $+ $# $2 error/ok?
1119 R$* $: $1 $| $>"Local_Relay_Auth" $&{auth_type}
1122 R$* $| $* $: $1 $| $&{auth_type}
1124 R$* $| $={TrustAuthMech} $# RELAY
1126 # anything terminating locally is ok
1127 R$+ < @ $=w > $@ RELAY
1128 R$+ < @ $* $=R > $@ RELAY
1133 # check for local user (i.e. unqualified address)
1135 R<?> $* < @ $+ > $: <REMOTE> $1 < @ $2 >
1140 ######################################################################
1141 ### Relay_ok: is the relay/sender ok?
1142 ######################################################################
1144 # anything originating locally is ok
1146 R$* $: $&{client_addr}
1147 R$@ $@ RELAY originated locally
1148 R0 $@ RELAY originated locally
1149 R127.0.0.1 $@ RELAY originated locally
1150 RIPv6:::1 $@ RELAY originated locally
1151 R$=R $* $@ RELAY relayable IP address
1152 R$* $: [ $1 ] put brackets around it...
1153 R$=w $@ RELAY ... and see if it is local
1156 # check client name: first: did it resolve?
1157 R$* $: < $&{client_resolve} >
1158 R<TEMP> $#TEMP $@ 4.4.0 $: "450 Relaying temporarily denied. Cannot resolve PTR record for " $&{client_addr}
1159 R<FORGED> $#error $@ 5.7.1 $: "550 Relaying denied. IP name possibly forged " $&{client_name}
1160 R<FAIL> $#error $@ 5.7.1 $: "550 Relaying denied. IP name lookup failed " $&{client_name}
1161 R$* $: <@> $&{client_name}
1162 # pass to name server to make hostname canonical
1163 R<@> $* $=P $:<?> $1 $2
1164 R<@> $+ $:<?> $[ $1 $]
1165 R$* . $1 strip trailing dots
1167 R<?> $* $=R $@ RELAY
1173 ######################################################################
1174 ### trust_auth: is user trusted to authenticate as someone else?
1177 ### $1: AUTH= parameter from MAIL command
1178 ######################################################################
1182 R$* $: $&{auth_type} $| $1
1183 # required by RFC 2554 section 4.
1184 R$@ $| $* $#error $@ 5.7.1 $: "550 not authenticated"
1185 R$* $| $&{auth_authen} $@ identical
1186 R$* $| <$&{auth_authen}> $@ identical
1187 R$* $| $* $: $1 $| $>"Local_trust_auth" $2
1189 R$* $#error $@ 5.7.1 $: "550 " $&{auth_authen} " not allowed to act as " $&{auth_author}
1191 ######################################################################
1192 ### Relay_Auth: allow relaying based on authentication?
1195 ### $1: ${auth_type}
1196 ######################################################################
1199 ######################################################################
1200 ### srv_features: which features to offer to a client?
1201 ### (done in server)
1202 ######################################################################
1206 ######################################################################
1207 ### try_tls: try to use STARTTLS?
1208 ### (done in client)
1209 ######################################################################
1213 ######################################################################
1214 ### tls_rcpt: is connection with server "good" enough?
1215 ### (done in client, per recipient)
1219 ######################################################################
1223 ######################################################################
1224 ### tls_client: is connection with client "good" enough?
1225 ### (done in server)
1228 ### ${verify} $| (MAIL|STARTTLS)
1229 ######################################################################
1231 R$* $| $* $@ $>"TLS_connection" $1
1233 ######################################################################
1234 ### tls_server: is connection with server "good" enough?
1235 ### (done in client)
1239 ######################################################################
1241 R$* $@ $>"TLS_connection" $1
1243 ######################################################################
1244 ### TLS_connection: is TLS connection "good" enough?
1248 ### Requirement: RHS from access map, may be ? for none.
1249 ######################################################################
1251 RSOFTWARE $#error $@ 4.7.0 $: "403 TLS handshake."
1254 ######################################################################
1255 ### RelayTLS: allow relaying based on TLS authentication
1259 ######################################################################
1263 ######################################################################
1264 ### authinfo: lookup authinfo in the access map
1267 ### $1: {server_name}
1268 ### $2: {server_addr}
1269 ######################################################################
1277 ######################################################################
1278 ######################################################################
1280 ##### MAIL FILTER DEFINITIONS
1282 ######################################################################
1283 ######################################################################
1286 ######################################################################
1287 ######################################################################
1289 ##### MAILER DEFINITIONS
1291 ######################################################################
1292 ######################################################################
1295 ##################################################
1296 ### Local and Program Mailer specification ###
1297 ##################################################
1299 ##### $Id: local.m4,v 8.59 2004/11/23 00:37:25 ca Exp $ #####
1302 # Envelope sender rewriting
1305 R<@> $n errors to mailer-daemon
1306 R@ <@ $*> $n temporarily bypass Sun bogosity
1307 R$+ $: $>AddDomain $1 add local domain if needed
1308 R$* $: $>MasqEnv $1 do masquerading
1311 # Envelope recipient rewriting
1314 R$+ < @ $* > $: $1 strip host part
1315 R$+ + $* $: < $&{addr_type} > $1 + $2 mark with addr type
1316 R<e s> $+ + $* $: $1 remove +detail for sender
1317 R< $* > $+ $: $2 else remove mark
1320 # Header sender rewriting
1323 R<@> $n errors to mailer-daemon
1324 R@ <@ $*> $n temporarily bypass Sun bogosity
1325 R$+ $: $>AddDomain $1 add local domain if needed
1326 R$* $: $>MasqHdr $1 do masquerading
1329 # Header recipient rewriting
1332 R$+ $: $>AddDomain $1 add local domain if needed
1333 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1336 # Common code to add local domain name (only if always-add-domain)
1340 Mlocal, P=/bin/mail, F=lsDFMAw5:/|@qPrmn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
1341 T=DNS/RFC822/X-Unix,
1343 Mprog, P=/bin/sh, F=lsDFMoqeu9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
1344 T=X-Unix/X-Unix/X-Unix,
1347 #####################################
1348 ### SMTP Mailer specification ###
1349 #####################################
1351 ##### $Id: smtp.m4,v 8.65 2006/07/12 21:08:10 ca Exp $ #####
1354 # common sender and masquerading recipient rewriting
1357 R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
1358 R$+ $@ $1 < @ *LOCAL* > add local qualification
1361 # convert pseudo-domain addresses to real domain addresses
1365 # pass <route-addr>s through
1366 R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr>
1368 # output fake domains as user%fake@relay
1370 # do UUCP heuristics; note that these are shared with UUCP mailers
1371 R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form
1372 R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form
1374 # leave these in .UUCP form to avoid further tampering
1375 R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. >
1376 R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 >
1377 R< $&h ! > $+ $@ $1 < @ $&h .UUCP. >
1378 R< $+ ! > $+ $: $1 ! $2 < @ $Y > use UUCP_RELAY
1379 R$+ < @ $~[ $* : $+ > $@ $1 < @ $4 > strip mailer: part
1380 R$+ < @ > $: $1 < @ *LOCAL* > if no UUCP_RELAY
1384 # envelope sender rewriting
1387 R$+ $: $>PseudoToReal $1 sender/recipient common
1388 R$* :; <@> $@ list:; special case
1389 R$* $: $>MasqSMTP $1 qualify unqual'ed names
1390 R$+ $: $>MasqEnv $1 do masquerading
1394 # envelope recipient rewriting --
1395 # also header recipient if not masquerading recipients
1398 R$+ $: $>PseudoToReal $1 sender/recipient common
1399 R$+ $: $>MasqSMTP $1 qualify unqual'ed names
1400 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1403 # header sender and masquerading header recipient rewriting
1406 R$+ $: $>PseudoToReal $1 sender/recipient common
1407 R:; <@> $@ list:; special case
1409 # do special header rewriting
1410 R$* <@> $* $@ $1 <@> $2 pass null host through
1411 R< @ $* > $* $@ < @ $1 > $2 pass route-addr through
1412 R$* $: $>MasqSMTP $1 qualify unqual'ed names
1413 R$+ $: $>MasqHdr $1 do masquerading
1417 # relay mailer header masquerading recipient rewriting
1420 R$+ $: $>MasqSMTP $1
1423 Msmtp, P=[IPC], F=mDFMuX, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1426 Mesmtp, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1429 Msmtp8, P=[IPC], F=mDFMuX8, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1432 Mdsmtp, P=[IPC], F=mDFMuXa%, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1435 Mrelay, P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,
1439 ### generic-ultrix4.mc ###
1442 # # Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
1443 # # All rights reserved.
1444 # # Copyright (c) 1983 Eric P. Allman. All rights reserved.
1445 # # Copyright (c) 1988, 1993
1446 # # The Regents of the University of California. All rights reserved.
1448 # # By using this file, you agree to the terms and conditions set
1449 # # forth in the LICENSE file which can be found at the top level of
1450 # # the sendmail distribution.
1455 # # This is a generic configuration file for Ultrix 4.x.
1456 # # It has support for local and SMTP mail only. If you want to
1457 # # customize it, copy it to a name appropriate for your environment
1458 # # and do the modifications there.
1462 # VERSIONID(`$Id: generic-ultrix4.mc,v 8.11 1999/02/07 07:26:03 gshapiro Exp $')
1463 # OSTYPE(ultrix4)dnl
1464 # DOMAIN(generic)dnl