2 # Copyright (c) 1998-2004, 2009 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@wiz.smi.sendmail.com on Tue Dec 22 20:49:08 PST 2009
20 ##### in /extra/home/ca/sm-8.14.4/OpenSource/sendmail-8.14.4/cf/cf
21 ##### using ../ as configuration include directory
23 ######################################################################
25 ##### DO NOT EDIT THIS FILE! Only edit the source .mc file.
27 ######################################################################
28 ######################################################################
30 ##### $Id: cfhead.m4,v 8.120 2009/01/23 22:39:21 ca Exp $ #####
31 ##### $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $ #####
32 ##### $Id: generic-nextstep3.3.mc,v 8.10 1999/02/07 07:26:02 gshapiro Exp $ #####
34 ##### $Id: nextstep.m4,v 8.21 1999/10/21 00:31:40 gshapiro Exp $ #####
36 ##### $Id: generic.m4,v 8.15 1999/04/04 00:51:09 ca Exp $ #####
38 ##### $Id: redirect.m4,v 8.15 1999/08/06 01:47:36 gshapiro Exp $ #####
40 ##### $Id: use_cw_file.m4,v 8.11 2001/08/26 20:58:57 gshapiro Exp $ #####
44 ##### $Id: proto.m4,v 8.741 2009/12/11 00:04:53 ca Exp $ #####
46 # level 10 config file format
49 # override file safeties - setting this option compromises system security,
50 # addressing the actual file configuration problem is preferred
51 # need to set this before any file actions are encountered in the cf file
52 #O DontBlameSendmail=safe
54 # default LDAP map specification
55 # need to set this now before any LDAP maps are defined
56 #O LDAPDefaultSpec=-h localhost
63 # need to set this before any LDAP lookups are done (including classes)
64 #D{sendmailMTACluster}$m
67 # file containing names of hosts for which we receive email
68 Fw/etc/mail/local-host-names
70 # my official domain name
71 # ... define this only if sendmail cannot automatically determine your domain
74 # host/domain names ending with a token in class P are canonical
77 # "Smart" relay host (may be null)
81 # operators that cannot be in local usernames (i.e., network indicators)
84 # a class with just dot (for identifying canonical names)
87 # a class with just a left bracket (for identifying domain literals)
91 # Resolve map (to check if a host exists in check_mail)
92 Kresolve host -a<OKR> -T<TEMP>
96 # Hosts for which relaying is permitted ($=R)
97 FR-o /etc/mail/relay-domains
109 # class E: names that should be exposed as from this host, even if we masquerade
110 # class L: names that should be delivered locally, even if we have a relay
111 # class M: domains that should be converted to $M
112 # class N: domains that should not be converted to $M
118 # my name for error messages
124 # Configuration version number
132 # strip message body to 7 bits on input?
133 O SevenBitInput=False
135 # 8-bit data handling
136 #O EightBitMode=pass8
138 # wait for alias file rebuild (default units: minutes)
141 # location of alias file
142 O AliasFile=/etc/mail/aliases
144 # minimum number of free blocks on filesystem
147 # maximum message size
150 # substitution for space (blank) characters
153 # avoid connecting to "expensive" mailers on initial submission?
154 O HoldExpensive=False
156 # checkpoint queue runs after every N successful deliveries
157 #O CheckpointInterval=10
159 # default delivery mode
160 O DeliveryMode=background
162 # error message header/file
163 #O ErrorHeader=/etc/mail/error-header
168 # save Unix-style "From_" lines at top of header?
169 #O SaveFromLine=False
171 # queue file mode (qf files)
172 #O QueueFileMode=0600
174 # temporary file mode
177 # match recipients against GECOS field?
183 # location of help file
184 O HelpFile=/etc/mail/helpfile
186 # ignore dots as terminators in incoming messages?
189 # name resolver options
190 #O ResolverOptions=+AAONLY
192 # deliver MIME-encapsulated error messages?
193 O SendMimeErrors=True
195 # Forward file search path
196 O ForwardPath=$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward
198 # open connection cache size
199 O ConnectionCacheSize=2
201 # open connection cache timeout
202 O ConnectionCacheTimeout=5m
204 # persistent host status directory
205 #O HostStatusDirectory=.hoststat
207 # single thread deliveries (requires HostStatusDirectory)?
208 #O SingleThreadDelivery=False
210 # use Errors-To: header?
216 # send to me too, even in an alias expansion?
219 # verify RHS in newaliases?
222 # default messages to old style headers if no special punctuation?
223 O OldStyleHeaders=True
225 # SMTP daemon options
226 O DaemonPortOptions=Name=MTA
227 O DaemonPortOptions=Port=587, Name=MSA, M=E
229 # SMTP client options
230 #O ClientPortOptions=Family=inet, Address=0.0.0.0
232 # Modifiers to define {daemon_flags} for direct submissions
233 #O DirectSubmissionModifiers
235 # Use as mail submission program? See sendmail/SECURITY
239 O PrivacyOptions=authwarnings
241 # who (if anyone) should get extra copies of error messages
242 #O PostmasterCopy=Postmaster
244 # slope of queue-only function
245 #O QueueFactor=600000
247 # limit on number of concurrent queue runners
250 # maximum number of queue-runners per queue-grouping with multiple queues
251 #O MaxRunnersPerQueue=1
253 # priority of queue runners (nice(3))
256 # shall we sort the queue by hostname first?
257 #O QueueSortOrder=priority
259 # minimum time in queue before retry
262 # how many jobs can you process in the queue?
265 # perform initial split of envelope without checking MX records
269 O QueueDirectory=/usr/spool/mqueue
271 # key for shared memory; 0 to turn off, -1 to auto-select
274 # file to store auto-selected key for shared memory (SharedMemoryKey = -1)
275 #O SharedMemoryKeyFile
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
285 #O Timeout.datainit=5m
286 #O Timeout.datablock=1h
287 #O Timeout.datafinal=1h
291 #O Timeout.command=1h
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
314 #O Timeout.starttls=1h
316 # time for DeliverBy; extension disabled if less than 0
319 # should we not prune routes in route-addr syntax addresses?
320 #O DontPruneRoutes=False
322 # queue up everything before forking?
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
334 # default UID (can be username or userid:groupid)
335 #O DefaultUser=mailnull
337 # list of locations of user database file (null means no lookup)
338 #O UserDatabaseSpec=/etc/mail/userdb
341 #O FallbackMXhost=fall.back.host.net
343 # fallback smart host
344 #O FallbackSmartHost=fall.back.host.net
346 # if we are the best MX host for a site, try it directly instead of config err
347 #O TryNullMXList=False
349 # load average at which we just queue messages
352 # load average at which we refuse connections
355 # log interval when refusing connections for this long
356 #O RejectLogInterval=3h
358 # load average at which we delay connections; 0 means no limit
361 # maximum number of children we allow at one time
362 #O MaxDaemonChildren=0
364 # maximum number of new connections per second
365 #O ConnectionRateThrottle=0
367 # Width of the window
368 #O ConnectionRateWindowSize=60s
370 # work recipient factor
371 #O RecipientFactor=30000
373 # deliver each queued job in a separate process?
382 # default character set
383 #O DefaultCharSet=unknown-8bit
385 # service switch file (name hardwired on Solaris, Ultrix, OSF/1, others)
386 #O ServiceSwitchFile=/etc/mail/service.switch
388 # hosts file (normally /etc/hosts)
389 #O HostsFile=/etc/hosts
391 # dialup line delay on connection failure
394 # action to take if there are no recipients in the message
395 #O NoRecipientAction=none
397 # chrooted environment for writing to files
398 #O SafeFileEnvironment
400 # are colons OK in addresses?
401 #O ColonOkInAddr=True
403 # shall I avoid expanding CNAMEs (violates protocols)?
404 #O DontExpandCnames=False
406 # SMTP initial login message (old $e macro)
407 O SmtpGreetingMessage=$j Sendmail $v/$Z; $b
409 # UNIX initial From header format (old $l macro)
410 O UnixFromLine=From $g $d
412 # From: lines that have embedded newlines are unwrapped onto one line
413 #O SingleLineFromHeader=False
415 # Allow HELO SMTP command that does not include a host name
416 #O AllowBogusHELO=False
418 # Characters to be quoted in a full name phrase (@,;:\()[] are automatic)
421 # delimiter (operator) characters (old $o macro)
422 O OperatorChars=.:%@!^/[]+
424 # shall I avoid calling initgroups(3) because of high NIS costs?
425 #O DontInitGroups=False
427 # are group-writable :include: and .forward files (un)trustworthy?
428 # True (the default) means they are not trustworthy.
429 #O UnsafeGroupWrites=True
432 # where do errors that occur when sending errors get sent?
433 #O DoubleBounceAddress=postmaster
435 # issue temporary errors (4xy) instead of permanent errors (5xy)?
438 # where to save bounces if all else fails
439 #O DeadLetterDrop=/var/tmp/dead.letter
441 # what user id do we assume for the majority of the processing?
442 #O RunAsUser=sendmail
444 # maximum number of recipients per SMTP envelope
445 #O MaxRecipientsPerMessage=0
447 # limit the rate recipients per SMTP envelope are accepted
448 # 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
529 # File containing certificate revocation lists
531 # DHParameters (only required if DSA/DH is used)
533 # Random data source (required for systems without /dev/urandom under OpenSSL)
536 # Maximum number of "useless" commands before slowing down
537 #O MaxNOOPCommands=20
539 # Name to use for EHLO (defaults to $j)
542 ############################
543 # QUEUE GROUP DEFINITIONS #
544 ############################
547 ###########################
548 # Message precedences #
549 ###########################
552 Pspecial-delivery=100
557 #####################
559 #####################
561 # this is equivalent to setting class "t"
562 #Ft/etc/mail/trusted-users
567 #########################
568 # Format of headers #
569 #########################
571 H?P?Return-Path: <$g>
572 HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
573 $.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.)
574 $.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}
575 (version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u
580 H?F?Resent-From: $?x$x <$g>$|$g$.
581 H?F?From: $?x$x <$g>$|$g$.
584 # H?l?Received-Date: $b
585 H?M?Resent-Message-Id: <$t.$i@$j>
586 H?M?Message-Id: <$t.$i@$j>
589 ######################################################################
590 ######################################################################
592 ##### REWRITING RULES
594 ######################################################################
595 ######################################################################
597 ############################################
598 ### Ruleset 3 -- Name Canonicalization ###
599 ############################################
602 # handle null input (translate to <@> special case)
605 # strip group: syntax (not inside angle brackets!) and trailing semicolon
606 R$* $: $1 <@> mark addresses
607 R$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr>
608 R@ $* <@> $: @ $1 unmark @host:...
609 R$* [ IPv6 : $+ ] <@> $: $1 [ IPv6 : $2 ] unmark IPv6 addr
610 R$* :: $* <@> $: $1 :: $2 unmark node::addr
611 R:include: $* <@> $: :include: $1 unmark :include:...
612 R$* : $* [ $* ] $: $1 : $2 [ $3 ] <@> remark if leading colon
613 R$* : $* <@> $: $2 strip colon if marked
615 R$* ; $1 strip trailing semi
616 R$* < $+ :; > $* $@ $2 :; <@> catch <list:;>
617 R$* < $* ; > $1 < $2 > bogus bracketed semi
619 # null input now results from list:; syntax
622 # strip angle brackets -- note RFC733 heuristic to get innermost item
623 R$* $: < $1 > housekeeping <>
624 R$+ < $* > < $2 > strip excess on left
625 R< $* > $+ < $1 > strip excess on right
626 R<> $@ < @ > MAIL FROM:<> case
627 R< $+ > $: $1 remove housekeeping <>
629 # strip route address <@a,@b,@c:user@d> -> <user@d>
634 # find focus for list syntax
635 R $+ : $* ; @ $+ $@ $>Canonify2 $1 : $2 ; < @ $3 > list syntax
636 R $+ : $* ; $@ $1 : $2; list syntax
638 # find focus for @ syntax addresses
639 R$+ @ $+ $: $1 < @ $2 > focus on domain
640 R$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right
641 R$+ < @ $+ > $@ $>Canonify2 $1 < @ $2 > already canonical
644 # convert old-style addresses to a domain-based address
645 R$- ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > resolve uucp names
646 R$+ . $- ! $+ $@ $>Canonify2 $3 < @ $1 . $2 > domain uucps
647 R$+ ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > uucp subdomains
649 # if we have % signs, take the rightmost one
650 R$* % $* $1 @ $2 First make them all @s.
651 R$* @ $* @ $* $1 % $2 @ $3 Undo all but the last.
652 R$* @ $* $@ $>Canonify2 $1 < @ $2 > Insert < > and finish
654 # else we must be a local name
655 R$* $@ $>Canonify2 $1
658 ################################################
659 ### Ruleset 96 -- bottom half of ruleset 3 ###
660 ################################################
664 # handle special cases for local names
665 R$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all
666 R$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain
667 R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain
669 # check for IPv4/IPv6 domain literal
670 R$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [addr]
671 R$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal
672 R$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr
678 # if really UUCP, handle it immediately
680 # try UUCP traffic as a local address
681 R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3
682 R$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3
684 # hostnames ending in class P are always canonical
685 R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4
686 R$* < @ $* $~P > $* $: $&{daemon_flags} $| $1 < @ $2 $3 > $4
687 R$* CC $* $| $* < @ $+.$+ > $* $: $3 < @ $4.$5 . > $6
688 R$* CC $* $| $* $: $3
689 # pass to name server to make hostname canonical
690 R$* $| $* < @ $* > $* $: $2 < @ $[ $3 $] > $4
693 # local host aliases and pseudo-domains are always canonical
694 R$* < @ $=w > $* $: $1 < @ $2 . > $3
695 R$* < @ $=M > $* $: $1 < @ $2 . > $3
696 R$* < @ $* . . > $* $1 < @ $2 . > $3
699 ##################################################
700 ### Ruleset 4 -- Final Output Post-rewriting ###
701 ##################################################
704 R$+ :; <@> $@ $1 : handle <list:;>
705 R$* <@> $@ handle <> and list:;
707 # strip trailing dot off possibly canonical name
708 R$* < @ $+ . > $* $1 < @ $2 > $3
710 # eliminate internal code
711 R$* < @ *LOCAL* > $* $1 < @ $j > $2
713 # externalize local domain info
714 R$* < $+ > $* $1 $2 $3 defocus
715 R@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical
716 R@ $* $@ @ $1 ... and exit
718 # UUCP must always be presented in old form
719 R$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u
721 # delete duplicate local names
722 R$+ % $=w @ $=w $1 @ $2 u%host@host => u@host
726 ##############################################################
727 ### Ruleset 97 -- recanonicalize and call ruleset zero ###
728 ### (used for recursive calls) ###
729 ##############################################################
736 ######################################
737 ### Ruleset 0 -- Parse Address ###
738 ######################################
742 R$* $: $>Parse0 $1 initial parsing
743 R<@> $#local $: <@> special case error msgs
744 R$* $: $>ParseLocal $1 handle local hacks
745 R$* $: $>Parse1 $1 final parsing
748 # Parse0 -- do initial syntax checking and eliminate local addresses.
749 # This should either return with the (possibly modified) input
750 # or return with a #error mailer. It should not return with a
751 # #mailer other than the #error mailer.
755 R<@> $@ <@> special case error msgs
756 R$* : $* ; <@> $#error $@ 5.1.3 $: "553 List:; syntax illegal for recipient addresses"
757 R@ <@ $* > < @ $1 > catch "@@host" bogosity
758 R<@ $+> $#error $@ 5.1.3 $: "553 User address required"
759 R$+ <@> $#error $@ 5.1.3 $: "553 Hostname required"
761 R<> $* < @ [ $* ] : $+ > $* $1 < @ [ $2 ] : $3 > $4
762 R<> $* < @ [ $* ] , $+ > $* $1 < @ [ $2 ] , $3 > $4
763 R<> $* < @ [ $* ] $+ > $* $#error $@ 5.1.2 $: "553 Invalid address"
764 R<> $* < @ [ $+ ] > $* $1 < @ [ $2 ] > $3
765 R<> $* <$* : $* > $* $#error $@ 5.1.3 $: "553 Colon illegal in host name part"
767 R$* < @ . $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
768 R$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
769 R$* < @ $* @ > $* $#error $@ 5.1.2 $: "553 Invalid route address"
770 R$* @ $* < @ $* > $* $#error $@ 5.1.3 $: "553 Invalid route address"
771 R$* , $~O $* $#error $@ 5.1.3 $: "553 Invalid route address"
774 # now delete the local info -- note $=O to find characters that cause forwarding
775 R$* < @ > $* $@ $>Parse0 $>canonify $1 user@ => user
776 R< @ $=w . > : $* $@ $>Parse0 $>canonify $2 @here:... -> ...
777 R$- < @ $=w . > $: $(dequote $1 $) < @ $2 . > dequote "foo"@here
778 R< @ $+ > $#error $@ 5.1.3 $: "553 User address required"
779 R$* $=O $* < @ $=w . > $@ $>Parse0 $>canonify $1 $2 $3 ...@here -> ...
780 R$- $: $(dequote $1 $) < @ *LOCAL* > dequote "foo"
781 R< @ *LOCAL* > $#error $@ 5.1.3 $: "553 User address required"
782 R$* $=O $* < @ *LOCAL* >
783 $@ $>Parse0 $>canonify $1 $2 $3 ...@*LOCAL* -> ...
784 R$* < @ *LOCAL* > $: $1
787 # Parse1 -- the bottom half of ruleset 0.
792 # handle numeric address spec
793 R$* < @ [ $+ ] > $* $: $>ParseLocal $1 < @ [ $2 ] > $3 numeric internet spec
794 R$* < @ [ $+ ] > $* $: $1 < @ [ $2 ] : $S > $3 Add smart host to path
795 R$* < @ [ $+ ] : > $* $#esmtp $@ [$2] $: $1 < @ [$2] > $3 no smarthost: send
796 R$* < @ [ $+ ] : $- : $*> $* $#$3 $@ $4 $: $1 < @ [$2] > $5 smarthost with mailer
797 R$* < @ [ $+ ] : $+ > $* $#esmtp $@ $3 $: $1 < @ [$2] > $4 smarthost without mailer
800 # short circuit local delivery so forwarded email works
803 R$=L < @ $=w . > $#local $: @ $1 special local names
804 R$+ < @ $=w . > $#local $: $1 regular local name
807 # resolve remotely connected UUCP links (if any)
809 # resolve fake top level domains by forwarding to other hosts
813 # pass names that still have a host to a smarthost (if defined)
814 R$* < @ $* > $* $: $>MailerToTriple < $S > $1 < @ $2 > $3 glue on smarthost name
816 # deal with other remote names
817 R$* < @$* > $* $#esmtp $@ $2 $: $1 < @ $2 > $3 user@host.domain
819 # handle locally delivered names
820 R$=L $#local $: @ $1 special local names
821 R$+ $#local $: $1 regular local names
823 ###########################################################################
824 ### Ruleset 5 -- special rewriting after aliases have been expanded ###
825 ###########################################################################
829 R$+ $: $1 $| $>"Local_localaddr" $1
830 R$+ $| $#ok $@ $1 no change
837 # deal with plussed users so aliases work nicely
838 R$+ + * $#local $@ $&h $: $1
839 R$+ + $* $#local $@ + $2 $: $1 + *
841 # prepend an empty "forward host" on the front
846 R< > $+ $: < > < $1 <> $&h > nope, restore +detail
848 R< > < $+ <> + $* > $: < > < $1 + $2 > check whether +detail
849 R< > < $+ <> $* > $: < > < $1 > else discard
850 R< > < $+ + $* > $* < > < $1 > + $2 $3 find the user part
851 R< > < $+ > + $* $#local $@ $2 $: @ $1 strip the extra +
852 R< > < $+ > $@ $1 no +detail
853 R$+ $: $1 <> $&h add +detail back in
855 R$+ <> + $* $: $1 + $2 check whether +detail
856 R$+ <> $* $: $1 else discard
857 R< local : $* > $* $: $>MailerToTriple < local : $1 > $2 no host extension
858 R< error : $* > $* $: $>MailerToTriple < error : $1 > $2 no host extension
860 R< $~[ : $+ > $+ $: $>MailerToTriple < $1 : $2 > $3 < @ $2 >
862 R< $+ > $+ $@ $>MailerToTriple < $1 > $2 < @ $1 >
865 ###################################################################
866 ### Ruleset 95 -- canonify mailer:[user@]host syntax to triple ###
867 ###################################################################
870 R< > $* $@ $1 strip off null relay
871 R< error : $-.$-.$- : $+ > $* $#error $@ $1.$2.$3 $: $4
872 R< error : $- : $+ > $* $#error $@ $(dequote $1 $) $: $2
873 R< error : $+ > $* $#error $: $1
874 R< local : $* > $* $>CanonLocal < $1 > $2
875 R< $~[ : $+ @ $+ > $*<$*>$* $# $1 $@ $3 $: $2<@$3> use literal user
876 R< $~[ : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
877 R< $=w > $* $@ $2 delete local host
878 R< $+ > $* $#relay $@ $1 $: $2 use unqualified mailer
880 ###################################################################
881 ### Ruleset CanonLocal -- canonify local: syntax ###
882 ###################################################################
885 # strip local host from routed addresses
886 R< $* > < @ $+ > : $+ $@ $>Recurse $3
887 R< $* > $+ $=O $+ < @ $+ > $@ $>Recurse $2 $3 $4
889 # strip trailing dot from any host name that may appear
890 R< $* > $* < @ $* . > $: < $1 > $2 < @ $3 >
892 # handle local: syntax -- use old user, either with or without host
893 R< > $* < @ $* > $* $#local $@ $1@$2 $: $1
894 R< > $+ $#local $@ $1 $: $1
896 # handle local:user@host syntax -- ignore host part
897 R< $+ @ $+ > $* < @ $* > $: < $1 > $3 < @ $4 >
899 # handle local:user syntax
900 R< $+ > $* <@ $* > $* $#local $@ $2@$3 $: $1
901 R< $+ > $* $#local $@ $2 $: $1
903 ###################################################################
904 ### Ruleset 93 -- convert header names to masqueraded form ###
905 ###################################################################
910 # do not masquerade anything in class N
911 R$* < @ $* $=N . > $@ $1 < @ $2 $3 . >
913 R$* < @ *LOCAL* > $@ $1 < @ $j . >
915 ###################################################################
916 ### Ruleset 94 -- convert envelope names to masqueraded form ###
917 ###################################################################
920 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
922 ###################################################################
923 ### Ruleset 98 -- local part of ruleset zero (can be null) ###
924 ###################################################################
928 # addresses sent to foo@host.REDIRECT will give a 551 error code
929 R$* < @ $+ .REDIRECT. > $: $1 < @ $2 . REDIRECT . > < ${opMode} >
930 R$* < @ $+ .REDIRECT. > <i> $: $1 < @ $2 . REDIRECT. >
931 R$* < @ $+ .REDIRECT. > < $- > $#error $@ 5.1.1 $: "551 User has moved; please try " <$1@$2>
937 ######################################################################
938 ### CanonAddr -- Convert an address into a standard form for
939 ### relay checking. Route address syntax is
940 ### crudely converted into a %-hack address.
943 ### $1 -- full recipient address
946 ### parsed address, not in source route form
947 ######################################################################
950 R$* $: $>Parse0 $>canonify $1 make domain canonical
953 ######################################################################
954 ### ParseRecipient -- Strip off hosts in $=R as well as possibly
955 ### $* $=m or the access database.
956 ### Check user portion for host separators.
959 ### $1 -- full recipient address
962 ### parsed, non-local-relaying address
963 ######################################################################
966 R$* $: <?> $>CanonAddr $1
967 R<?> $* < @ $* . > <?> $1 < @ $2 > strip trailing dots
968 R<?> $- < @ $* > $: <?> $(dequote $1 $) < @ $2 > dequote local part
970 # if no $=O character, no host in the user portion, we are done
971 R<?> $* $=O $* < @ $* > $: <NO> $1 $2 $3 < @ $4>
975 R<NO> $* < @ $* $=R > $: <RELAY> $1 < @ $2 $3 >
979 R<RELAY> $* < @ $* > $@ $>ParseRecipient $1
983 ######################################################################
984 ### check_relay -- check hostname/address on SMTP startup
985 ######################################################################
991 R$* $: $1 $| $>"Local_check_relay" $1
992 R$* $| $* $| $#$* $#$3
993 R$* $| $* $| $* $@ $>"Basic_check_relay" $1 $| $2
996 # check for deferred delivery mode
997 R$* $: < $&{deliveryMode} > $1
998 R< d > $* $@ deferred
1004 ######################################################################
1005 ### check_mail -- check SMTP `MAIL FROM:' command argument
1006 ######################################################################
1010 R$* $: $1 $| $>"Local_check_mail" $1
1012 R$* $| $* $@ $>"Basic_check_mail" $1
1015 # check for deferred delivery mode
1016 R$* $: < $&{deliveryMode} > $1
1017 R< d > $* $@ deferred
1021 R$* $: $1 $| $>"tls_client" $&{verify} $| MAIL
1025 R<> $@ <OK> we MUST accept <> (RFC 1123)
1027 R<?><$+> $: <@> <$1>
1029 R$* $: $&{daemon_flags} $| $1
1030 R$* f $* $| <@> < $* @ $- > $: < ? $&{client_name} > < $3 @ $4 >
1031 R$* u $* $| <@> < $* > $: <?> < $3 >
1033 # handle case of @localhost on address
1034 R<@> < $* @ localhost > $: < ? $&{client_name} > < $1 @ localhost >
1035 R<@> < $* @ [127.0.0.1] >
1036 $: < ? $&{client_name} > < $1 @ [127.0.0.1] >
1037 R<@> < $* @ localhost.$m >
1038 $: < ? $&{client_name} > < $1 @ localhost.$m >
1039 R<@> < $* @ localhost.UUCP >
1040 $: < ? $&{client_name} > < $1 @ localhost.UUCP >
1041 R<@> $* $: $1 no localhost as domain
1042 R<? $=w> $* $: $2 local client: ok
1043 R<? $+> <$+> $#error $@ 5.5.4 $: "553 Real domain name required for sender address"
1045 R$* $: <?> $>CanonAddr $1 canonify sender address and mark it
1046 R<?> $* < @ $+ . > <?> $1 < @ $2 > strip trailing dots
1047 # handle non-DNS hostnames (*.bitnet, *.decnet, *.uucp, etc)
1048 R<?> $* < @ $* $=P > $: <OKR> $1 < @ $2 $3 >
1049 R<?> $* < @ $j > $: <OKR> $1 < @ $j >
1050 R<?> $* < @ $+ > $: <? $(resolve $2 $: $2 <PERM> $) > $1 < @ $2 >
1051 R<? $* <$->> $* < @ $+ >
1055 # handle case of no @domain on address
1056 R<?> $* $: $&{daemon_flags} $| <?> $1
1057 R$* u $* $| <?> $* $: <OKR> $3
1059 R<?> $* $: < ? $&{client_addr} > $1
1060 R<?> $* $@ <OKR> ...local unqualed ok
1061 R<? $+> $* $#error $@ 5.5.4 $: "553 Domain name required for sender address " $&f
1064 R<?> $* $: @ $1 mark address: nothing known about it
1065 R<$={ResOk}> $* $: @ $2 domain ok
1066 R<TEMP> $* $#error $@ 4.1.8 $: "451 Domain of sender address " $&f " does not resolve"
1067 R<PERM> $* $#error $@ 5.1.8 $: "553 Domain of sender address " $&f " does not exist"
1071 ######################################################################
1072 ### check_rcpt -- check SMTP `RCPT TO:' command argument
1073 ######################################################################
1077 R$* $: $1 $| $>"Local_check_rcpt" $1
1079 R$* $| $* $@ $>"Basic_check_rcpt" $1
1083 R<> $#error $@ nouser $: "553 User address required"
1084 R$@ $#error $@ nouser $: "553 User address required"
1085 # check for deferred delivery mode
1086 R$* $: < $&{deliveryMode} > $1
1087 R< d > $* $@ deferred
1091 ######################################################################
1092 R$* $: $1 $| @ $>"Rcpt_ok" $1
1093 R$* $| @ $#TEMP $+ $: $1 $| T $2
1095 R$* $| @ RELAY $@ RELAY
1096 R$* $| @ $* $: O $| $>"Relay_ok" $1
1097 R$* $| T $+ $: T $2 $| $>"Relay_ok" $1
1098 R$* $| $#TEMP $+ $#error $2
1100 R$* $| RELAY $@ RELAY
1101 R T $+ $| $* $#error $1
1102 # anything else is bogus
1103 R$* $#error $@ 5.7.1 $: "550 Relaying denied"
1106 ######################################################################
1107 ### Rcpt_ok: is the recipient ok?
1108 ######################################################################
1110 R$* $: $>ParseRecipient $1 strip relayable hosts
1115 # authenticated via TLS?
1116 R$* $: $1 $| $>RelayTLS client authenticated?
1117 R$* $| $# $+ $# $2 error/ok?
1120 R$* $: $1 $| $>"Local_Relay_Auth" $&{auth_type}
1123 R$* $| $* $: $1 $| $&{auth_type}
1125 R$* $| $={TrustAuthMech} $# RELAY
1127 # anything terminating locally is ok
1128 R$+ < @ $=w > $@ RELAY
1129 R$+ < @ $* $=R > $@ RELAY
1134 # check for local user (i.e. unqualified address)
1136 R<?> $* < @ $+ > $: <REMOTE> $1 < @ $2 >
1141 ######################################################################
1142 ### Relay_ok: is the relay/sender ok?
1143 ######################################################################
1145 # anything originating locally is ok
1147 R$* $: $&{client_addr}
1148 R$@ $@ RELAY originated locally
1149 R0 $@ RELAY originated locally
1150 R127.0.0.1 $@ RELAY originated locally
1151 RIPv6:::1 $@ RELAY originated locally
1152 R$=R $* $@ RELAY relayable IP address
1153 R$* $: [ $1 ] put brackets around it...
1154 R$=w $@ RELAY ... and see if it is local
1157 # check client name: first: did it resolve?
1158 R$* $: < $&{client_resolve} >
1159 R<TEMP> $#TEMP $@ 4.4.0 $: "450 Relaying temporarily denied. Cannot resolve PTR record for " $&{client_addr}
1160 R<FORGED> $#error $@ 5.7.1 $: "550 Relaying denied. IP name possibly forged " $&{client_name}
1161 R<FAIL> $#error $@ 5.7.1 $: "550 Relaying denied. IP name lookup failed " $&{client_name}
1162 R$* $: <@> $&{client_name}
1163 # pass to name server to make hostname canonical
1164 R<@> $* $=P $:<?> $1 $2
1165 R<@> $+ $:<?> $[ $1 $]
1166 R$* . $1 strip trailing dots
1168 R<?> $* $=R $@ RELAY
1174 ######################################################################
1175 ### trust_auth: is user trusted to authenticate as someone else?
1178 ### $1: AUTH= parameter from MAIL command
1179 ######################################################################
1183 R$* $: $&{auth_type} $| $1
1184 # required by RFC 2554 section 4.
1185 R$@ $| $* $#error $@ 5.7.1 $: "550 not authenticated"
1186 R$* $| $&{auth_authen} $@ identical
1187 R$* $| <$&{auth_authen}> $@ identical
1188 R$* $| $* $: $1 $| $>"Local_trust_auth" $2
1190 R$* $#error $@ 5.7.1 $: "550 " $&{auth_authen} " not allowed to act as " $&{auth_author}
1192 ######################################################################
1193 ### Relay_Auth: allow relaying based on authentication?
1196 ### $1: ${auth_type}
1197 ######################################################################
1200 ######################################################################
1201 ### srv_features: which features to offer to a client?
1202 ### (done in server)
1203 ######################################################################
1207 ######################################################################
1208 ### try_tls: try to use STARTTLS?
1209 ### (done in client)
1210 ######################################################################
1214 ######################################################################
1215 ### tls_rcpt: is connection with server "good" enough?
1216 ### (done in client, per recipient)
1220 ######################################################################
1224 ######################################################################
1225 ### tls_client: is connection with client "good" enough?
1226 ### (done in server)
1229 ### ${verify} $| (MAIL|STARTTLS)
1230 ######################################################################
1232 R$* $| $* $@ $>"TLS_connection" $1
1234 ######################################################################
1235 ### tls_server: is connection with server "good" enough?
1236 ### (done in client)
1240 ######################################################################
1242 R$* $@ $>"TLS_connection" $1
1244 ######################################################################
1245 ### TLS_connection: is TLS connection "good" enough?
1249 ### Requirement: RHS from access map, may be ? for none.
1250 ######################################################################
1252 RSOFTWARE $#error $@ 4.7.0 $: "403 TLS handshake."
1255 ######################################################################
1256 ### RelayTLS: allow relaying based on TLS authentication
1260 ######################################################################
1264 ######################################################################
1265 ### authinfo: lookup authinfo in the access map
1268 ### $1: {server_name}
1269 ### $2: {server_addr}
1270 ######################################################################
1278 ######################################################################
1279 ######################################################################
1281 ##### MAIL FILTER DEFINITIONS
1283 ######################################################################
1284 ######################################################################
1287 ######################################################################
1288 ######################################################################
1290 ##### MAILER DEFINITIONS
1292 ######################################################################
1293 ######################################################################
1296 ##################################################
1297 ### Local and Program Mailer specification ###
1298 ##################################################
1300 ##### $Id: local.m4,v 8.59 2004/11/23 00:37:25 ca Exp $ #####
1303 # Envelope sender rewriting
1306 R<@> $n errors to mailer-daemon
1307 R@ <@ $*> $n temporarily bypass Sun bogosity
1308 R$+ $: $>AddDomain $1 add local domain if needed
1309 R$* $: $>MasqEnv $1 do masquerading
1312 # Envelope recipient rewriting
1315 R$+ < @ $* > $: $1 strip host part
1316 R$+ + $* $: < $&{addr_type} > $1 + $2 mark with addr type
1317 R<e s> $+ + $* $: $1 remove +detail for sender
1318 R< $* > $+ $: $2 else remove mark
1321 # Header sender rewriting
1324 R<@> $n errors to mailer-daemon
1325 R@ <@ $*> $n temporarily bypass Sun bogosity
1326 R$+ $: $>AddDomain $1 add local domain if needed
1327 R$* $: $>MasqHdr $1 do masquerading
1330 # Header recipient rewriting
1333 R$+ $: $>AddDomain $1 add local domain if needed
1334 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1337 # Common code to add local domain name (only if always-add-domain)
1341 Mlocal, P=/bin/mail, F=lsDFMAw5:/|@qPrmn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
1342 T=DNS/RFC822/X-Unix,
1344 Mprog, P=/bin/sh, F=lsDFMoqeuP, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
1345 T=X-Unix/X-Unix/X-Unix,
1348 #####################################
1349 ### SMTP Mailer specification ###
1350 #####################################
1352 ##### $Id: smtp.m4,v 8.65 2006/07/12 21:08:10 ca Exp $ #####
1355 # common sender and masquerading recipient rewriting
1358 R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
1359 R$+ $@ $1 < @ *LOCAL* > add local qualification
1362 # convert pseudo-domain addresses to real domain addresses
1366 # pass <route-addr>s through
1367 R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr>
1369 # output fake domains as user%fake@relay
1371 # do UUCP heuristics; note that these are shared with UUCP mailers
1372 R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form
1373 R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form
1375 # leave these in .UUCP form to avoid further tampering
1376 R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. >
1377 R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 >
1378 R< $&h ! > $+ $@ $1 < @ $&h .UUCP. >
1379 R< $+ ! > $+ $: $1 ! $2 < @ $Y > use UUCP_RELAY
1380 R$+ < @ $~[ $* : $+ > $@ $1 < @ $4 > strip mailer: part
1381 R$+ < @ > $: $1 < @ *LOCAL* > if no UUCP_RELAY
1385 # envelope sender rewriting
1388 R$+ $: $>PseudoToReal $1 sender/recipient common
1389 R$* :; <@> $@ list:; special case
1390 R$* $: $>MasqSMTP $1 qualify unqual'ed names
1391 R$+ $: $>MasqEnv $1 do masquerading
1395 # envelope recipient rewriting --
1396 # also header recipient if not masquerading recipients
1399 R$+ $: $>PseudoToReal $1 sender/recipient common
1400 R$+ $: $>MasqSMTP $1 qualify unqual'ed names
1401 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1404 # header sender and masquerading header recipient rewriting
1407 R$+ $: $>PseudoToReal $1 sender/recipient common
1408 R:; <@> $@ list:; special case
1410 # do special header rewriting
1411 R$* <@> $* $@ $1 <@> $2 pass null host through
1412 R< @ $* > $* $@ < @ $1 > $2 pass route-addr through
1413 R$* $: $>MasqSMTP $1 qualify unqual'ed names
1414 R$+ $: $>MasqHdr $1 do masquerading
1418 # relay mailer header masquerading recipient rewriting
1421 R$+ $: $>MasqSMTP $1
1424 Msmtp, P=[IPC], F=mDFMuX, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1427 Mesmtp, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1430 Msmtp8, P=[IPC], F=mDFMuX8, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1433 Mdsmtp, P=[IPC], F=mDFMuXa%, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1436 Mrelay, P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,
1440 ### generic-nextstep3.3.mc ###
1443 # # Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
1444 # # All rights reserved.
1445 # # Copyright (c) 1983 Eric P. Allman. All rights reserved.
1446 # # Copyright (c) 1988, 1993
1447 # # The Regents of the University of California. All rights reserved.
1449 # # By using this file, you agree to the terms and conditions set
1450 # # forth in the LICENSE file which can be found at the top level of
1451 # # the sendmail distribution.
1456 # # This is a generic configuration file for NEXTSTEP 3.3 systems.
1457 # # It has support for local and SMTP mail only. If you want to
1458 # # customize it, copy it to a name appropriate for your environment
1459 # # and do the modifications there.
1463 # VERSIONID(`$Id: generic-nextstep3.3.mc,v 8.10 1999/02/07 07:26:02 gshapiro Exp $')
1464 # OSTYPE(nextstep)dnl
1465 # DOMAIN(generic)dnl