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:09 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: submit.mc,v 8.14 2006/04/05 05:54:41 ca Exp $ #####
33 ##### $Id: msp.m4,v 1.33 2004/02/09 22:32:38 ca Exp $ #####
35 ##### $Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $ #####
38 ##### $Id: proto.m4,v 8.741 2009/12/11 00:04:53 ca Exp $ #####
40 # level 10 config file format
43 # override file safeties - setting this option compromises system security,
44 # addressing the actual file configuration problem is preferred
45 # need to set this before any file actions are encountered in the cf file
46 #O DontBlameSendmail=safe
48 # default LDAP map specification
49 # need to set this now before any LDAP maps are defined
50 #O LDAPDefaultSpec=-h localhost
57 # need to set this before any LDAP lookups are done (including classes)
58 #D{sendmailMTACluster}$m
62 # my official domain name
63 # ... define this only if sendmail cannot automatically determine your domain
66 # host/domain names ending with a token in class P are canonical
69 # "Smart" relay host (may be null)
73 # operators that cannot be in local usernames (i.e., network indicators)
76 # a class with just dot (for identifying canonical names)
79 # a class with just a left bracket (for identifying domain literals)
83 # Resolve map (to check if a host exists in check_mail)
84 Kresolve host -a<OKR> -T<TEMP>
88 # Hosts for which relaying is permitted ($=R)
89 FR-o /etc/mail/relay-domains
101 # class E: names that should be exposed as from this host, even if we masquerade
102 # class L: names that should be delivered locally, even if we have a relay
103 # class M: domains that should be converted to $M
104 # class N: domains that should not be converted to $M
109 # my name for error messages
113 D{MTAHost}[127.0.0.1]
116 # Configuration version number
124 # strip message body to 7 bits on input?
125 O SevenBitInput=False
127 # 8-bit data handling
128 #O EightBitMode=pass8
130 # wait for alias file rebuild (default units: minutes)
133 # location of alias file
134 #O AliasFile=/etc/mail/aliases
136 # minimum number of free blocks on filesystem
139 # maximum message size
142 # substitution for space (blank) characters
145 # avoid connecting to "expensive" mailers on initial submission?
146 O HoldExpensive=False
148 # checkpoint queue runs after every N successful deliveries
149 #O CheckpointInterval=10
151 # default delivery mode
154 # error message header/file
155 #O ErrorHeader=/etc/mail/error-header
160 # save Unix-style "From_" lines at top of header?
161 #O SaveFromLine=False
163 # queue file mode (qf files)
166 # temporary file mode
169 # match recipients against GECOS field?
175 # location of help file
176 O HelpFile=/etc/mail/helpfile
178 # ignore dots as terminators in incoming messages?
181 # name resolver options
182 #O ResolverOptions=+AAONLY
184 # deliver MIME-encapsulated error messages?
185 O SendMimeErrors=True
187 # Forward file search path
190 # open connection cache size
191 O ConnectionCacheSize=2
193 # open connection cache timeout
194 O ConnectionCacheTimeout=5m
196 # persistent host status directory
197 #O HostStatusDirectory=.hoststat
199 # single thread deliveries (requires HostStatusDirectory)?
200 #O SingleThreadDelivery=False
202 # use Errors-To: header?
208 # send to me too, even in an alias expansion?
211 # verify RHS in newaliases?
214 # default messages to old style headers if no special punctuation?
215 O OldStyleHeaders=True
217 # SMTP daemon options
219 O DaemonPortOptions=Name=NoMTA, Addr=127.0.0.1, M=E
221 # SMTP client options
222 #O ClientPortOptions=Family=inet, Address=0.0.0.0
224 # Modifiers to define {daemon_flags} for direct submissions
225 #O DirectSubmissionModifiers
227 # Use as mail submission program? See sendmail/SECURITY
231 O PrivacyOptions=goaway,noetrn,restrictqrun
233 # who (if anyone) should get extra copies of error messages
234 #O PostmasterCopy=Postmaster
236 # slope of queue-only function
237 #O QueueFactor=600000
239 # limit on number of concurrent queue runners
242 # maximum number of queue-runners per queue-grouping with multiple queues
243 #O MaxRunnersPerQueue=1
245 # priority of queue runners (nice(3))
248 # shall we sort the queue by hostname first?
249 #O QueueSortOrder=priority
251 # minimum time in queue before retry
254 # how many jobs can you process in the queue?
257 # perform initial split of envelope without checking MX records
261 O QueueDirectory=/var/spool/clientmqueue
263 # key for shared memory; 0 to turn off, -1 to auto-select
266 # file to store auto-selected key for shared memory (SharedMemoryKey = -1)
267 #O SharedMemoryKeyFile
269 # timeouts (many of these)
270 #O Timeout.initial=5m
271 #O Timeout.connect=5m
272 #O Timeout.aconnect=0s
273 #O Timeout.iconnect=5m
277 #O Timeout.datainit=5m
278 #O Timeout.datablock=1h
279 #O Timeout.datafinal=1h
283 #O Timeout.command=1h
285 #O Timeout.fileopen=60s
286 #O Timeout.control=2m
287 O Timeout.queuereturn=5d
288 #O Timeout.queuereturn.normal=5d
289 #O Timeout.queuereturn.urgent=2d
290 #O Timeout.queuereturn.non-urgent=7d
291 #O Timeout.queuereturn.dsn=5d
292 O Timeout.queuewarn=4h
293 #O Timeout.queuewarn.normal=4h
294 #O Timeout.queuewarn.urgent=1h
295 #O Timeout.queuewarn.non-urgent=12h
296 #O Timeout.queuewarn.dsn=4h
297 #O Timeout.hoststatus=30m
298 #O Timeout.resolver.retrans=5s
299 #O Timeout.resolver.retrans.first=5s
300 #O Timeout.resolver.retrans.normal=5s
301 #O Timeout.resolver.retry=4
302 #O Timeout.resolver.retry.first=4
303 #O Timeout.resolver.retry.normal=4
306 #O Timeout.starttls=1h
308 # time for DeliverBy; extension disabled if less than 0
311 # should we not prune routes in route-addr syntax addresses?
312 #O DontPruneRoutes=False
314 # queue up everything before forking?
318 O StatusFile=/var/spool/clientmqueue/sm-client.st
320 # time zone handling:
321 # if undefined, use system default
322 # if defined but null, use TZ envariable passed in
323 # if defined and non-null, use that info
326 # default UID (can be username or userid:groupid)
327 #O DefaultUser=mailnull
329 # list of locations of user database file (null means no lookup)
330 #O UserDatabaseSpec=/etc/mail/userdb
333 #O FallbackMXhost=fall.back.host.net
335 # fallback smart host
336 #O FallbackSmartHost=fall.back.host.net
338 # if we are the best MX host for a site, try it directly instead of config err
339 #O TryNullMXList=False
341 # load average at which we just queue messages
344 # load average at which we refuse connections
347 # log interval when refusing connections for this long
348 #O RejectLogInterval=3h
350 # load average at which we delay connections; 0 means no limit
353 # maximum number of children we allow at one time
354 #O MaxDaemonChildren=0
356 # maximum number of new connections per second
357 #O ConnectionRateThrottle=0
359 # Width of the window
360 #O ConnectionRateWindowSize=60s
362 # work recipient factor
363 #O RecipientFactor=30000
365 # deliver each queued job in a separate process?
374 # default character set
375 #O DefaultCharSet=unknown-8bit
377 # service switch file (name hardwired on Solaris, Ultrix, OSF/1, others)
378 #O ServiceSwitchFile=/etc/mail/service.switch
380 # hosts file (normally /etc/hosts)
381 #O HostsFile=/etc/hosts
383 # dialup line delay on connection failure
386 # action to take if there are no recipients in the message
387 #O NoRecipientAction=none
389 # chrooted environment for writing to files
390 #O SafeFileEnvironment
392 # are colons OK in addresses?
393 #O ColonOkInAddr=True
395 # shall I avoid expanding CNAMEs (violates protocols)?
396 #O DontExpandCnames=False
398 # SMTP initial login message (old $e macro)
399 O SmtpGreetingMessage=$j Sendmail $v/$Z; $b
401 # UNIX initial From header format (old $l macro)
402 O UnixFromLine=From $g $d
404 # From: lines that have embedded newlines are unwrapped onto one line
405 #O SingleLineFromHeader=False
407 # Allow HELO SMTP command that does not include a host name
408 #O AllowBogusHELO=False
410 # Characters to be quoted in a full name phrase (@,;:\()[] are automatic)
413 # delimiter (operator) characters (old $o macro)
414 O OperatorChars=.:%@!^/[]+
416 # shall I avoid calling initgroups(3) because of high NIS costs?
417 O DontInitGroups=True
419 # are group-writable :include: and .forward files (un)trustworthy?
420 # True (the default) means they are not trustworthy.
421 #O UnsafeGroupWrites=True
424 # where do errors that occur when sending errors get sent?
425 #O DoubleBounceAddress=postmaster
427 # issue temporary errors (4xy) instead of permanent errors (5xy)?
430 # where to save bounces if all else fails
431 #O DeadLetterDrop=/var/tmp/dead.letter
433 # what user id do we assume for the majority of the processing?
436 # maximum number of recipients per SMTP envelope
437 #O MaxRecipientsPerMessage=0
439 # limit the rate recipients per SMTP envelope are accepted
440 # once the threshold number of recipients have been rejected
444 # shall we get local names from our installed interfaces?
445 O DontProbeInterfaces=True
447 # Return-Receipt-To: header implies DSN request
448 #O RrtImpliesDsn=False
450 # override connection address (for testing)
451 #O ConnectOnlyTo=0.0.0.0
453 # Trusted user for file ownership and starting the daemon
456 # Control socket for daemon management
457 #O ControlSocketName=/var/spool/mqueue/.control
459 # Maximum MIME header length to protect MUAs
460 #O MaxMimeHeaderLength=0/0
462 # Maximum length of the sum of all headers
463 #O MaxHeadersLength=32768
465 # Maximum depth of alias recursion
466 #O MaxAliasRecursion=10
468 # location of pid file
469 O PidFile=/var/spool/clientmqueue/sm-client.pid
471 # Prefix string for the process title shown on 'ps' listings
472 #O ProcessTitlePrefix=prefix
474 # Data file (df) memory-buffer file maximum size
475 #O DataFileBufferSize=4096
477 # Transcript file (xf) memory-buffer file maximum size
478 #O XscriptFileBufferSize=4096
480 # lookup type to find information about local mailboxes
481 #O MailboxDatabase=pw
483 # override compile time flag REQUIRES_DIR_FSYNC
484 #O RequiresDirfsync=true
486 # list of authentication mechanisms
487 #O AuthMechanisms=EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5
489 # Authentication realm
492 # default authentication information for outgoing connections
493 #O DefaultAuthInfo=/etc/mail/default-auth-info
498 # SMTP AUTH maximum encryption strength
501 # SMTP STARTTLS server options
521 # File containing certificate revocation lists
523 # DHParameters (only required if DSA/DH is used)
525 # Random data source (required for systems without /dev/urandom under OpenSSL)
528 # Maximum number of "useless" commands before slowing down
529 #O MaxNOOPCommands=20
531 # Name to use for EHLO (defaults to $j)
534 ############################
535 # QUEUE GROUP DEFINITIONS #
536 ############################
539 ###########################
540 # Message precedences #
541 ###########################
544 Pspecial-delivery=100
549 #####################
551 #####################
553 # this is equivalent to setting class "t"
554 #Ft/etc/mail/trusted-users
559 #########################
560 # Format of headers #
561 #########################
563 H?P?Return-Path: <$g>
564 HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
565 $.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.)
566 $.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}
567 (version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u
572 H?F?Resent-From: $?x$x <$g>$|$g$.
573 H?F?From: $?x$x <$g>$|$g$.
576 # H?l?Received-Date: $b
577 H?M?Resent-Message-Id: <$t.$i@$j>
578 H?M?Message-Id: <$t.$i@$j>
581 ######################################################################
582 ######################################################################
584 ##### REWRITING RULES
586 ######################################################################
587 ######################################################################
589 ############################################
590 ### Ruleset 3 -- Name Canonicalization ###
591 ############################################
594 # handle null input (translate to <@> special case)
597 # strip group: syntax (not inside angle brackets!) and trailing semicolon
598 R$* $: $1 <@> mark addresses
599 R$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr>
600 R@ $* <@> $: @ $1 unmark @host:...
601 R$* [ IPv6 : $+ ] <@> $: $1 [ IPv6 : $2 ] unmark IPv6 addr
602 R$* :: $* <@> $: $1 :: $2 unmark node::addr
603 R:include: $* <@> $: :include: $1 unmark :include:...
604 R$* : $* [ $* ] $: $1 : $2 [ $3 ] <@> remark if leading colon
605 R$* : $* <@> $: $2 strip colon if marked
607 R$* ; $1 strip trailing semi
608 R$* < $+ :; > $* $@ $2 :; <@> catch <list:;>
609 R$* < $* ; > $1 < $2 > bogus bracketed semi
611 # null input now results from list:; syntax
614 # strip angle brackets -- note RFC733 heuristic to get innermost item
615 R$* $: < $1 > housekeeping <>
616 R$+ < $* > < $2 > strip excess on left
617 R< $* > $+ < $1 > strip excess on right
618 R<> $@ < @ > MAIL FROM:<> case
619 R< $+ > $: $1 remove housekeeping <>
621 # strip route address <@a,@b,@c:user@d> -> <user@d>
626 # find focus for list syntax
627 R $+ : $* ; @ $+ $@ $>Canonify2 $1 : $2 ; < @ $3 > list syntax
628 R $+ : $* ; $@ $1 : $2; list syntax
630 # find focus for @ syntax addresses
631 R$+ @ $+ $: $1 < @ $2 > focus on domain
632 R$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right
633 R$+ < @ $+ > $@ $>Canonify2 $1 < @ $2 > already canonical
636 # convert old-style addresses to a domain-based address
637 R$- ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > resolve uucp names
638 R$+ . $- ! $+ $@ $>Canonify2 $3 < @ $1 . $2 > domain uucps
639 R$+ ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > uucp subdomains
641 # convert node::user addresses into a domain-based address
642 R$- :: $+ $@ $>Canonify2 $2 < @ $1 .DECNET > resolve DECnet names
643 R$- . $- :: $+ $@ $>Canonify2 $3 < @ $1.$2 .DECNET > numeric DECnet addr
645 # if we have % signs, take the rightmost one
646 R$* % $* $1 @ $2 First make them all @s.
647 R$* @ $* @ $* $1 % $2 @ $3 Undo all but the last.
648 R$* @ $* $@ $>Canonify2 $1 < @ $2 > Insert < > and finish
650 # else we must be a local name
651 R$* $@ $>Canonify2 $1
654 ################################################
655 ### Ruleset 96 -- bottom half of ruleset 3 ###
656 ################################################
660 # handle special cases for local names
661 R$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all
662 R$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain
663 R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain
665 # check for IPv4/IPv6 domain literal
666 R$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [addr]
667 R$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal
668 R$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr
674 # if really UUCP, handle it immediately
676 # try UUCP traffic as a local address
677 R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3
678 R$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3
680 # hostnames ending in class P are always canonical
681 R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4
682 R$* < @ $* $~P > $* $: $&{daemon_flags} $| $1 < @ $2 $3 > $4
683 R$* CC $* $| $* < @ $+.$+ > $* $: $3 < @ $4.$5 . > $6
684 R$* CC $* $| $* $: $3
685 # pass to name server to make hostname canonical
686 R$* $| $* < @ $* > $* $: $2 < @ $[ $3 $] > $4
689 # local host aliases and pseudo-domains are always canonical
690 R$* < @ $=w > $* $: $1 < @ $2 . > $3
691 R$* < @ $=M > $* $: $1 < @ $2 . > $3
692 R$* < @ $* . . > $* $1 < @ $2 . > $3
695 ##################################################
696 ### Ruleset 4 -- Final Output Post-rewriting ###
697 ##################################################
700 R$+ :; <@> $@ $1 : handle <list:;>
701 R$* <@> $@ handle <> and list:;
703 # strip trailing dot off possibly canonical name
704 R$* < @ $+ . > $* $1 < @ $2 > $3
706 # eliminate internal code
707 R$* < @ *LOCAL* > $* $1 < @ $j > $2
709 # externalize local domain info
710 R$* < $+ > $* $1 $2 $3 defocus
711 R@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical
712 R@ $* $@ @ $1 ... and exit
714 # UUCP must always be presented in old form
715 R$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u
717 # put DECnet back in :: form
718 R$+ @ $+ . DECNET $2 :: $1 u@h.DECNET => h::u
719 # delete duplicate local names
720 R$+ % $=w @ $=w $1 @ $2 u%host@host => u@host
724 ##############################################################
725 ### Ruleset 97 -- recanonicalize and call ruleset zero ###
726 ### (used for recursive calls) ###
727 ##############################################################
734 ######################################
735 ### Ruleset 0 -- Parse Address ###
736 ######################################
740 R$* $: $>Parse0 $1 initial parsing
741 R<@> $#local $: <@> special case error msgs
742 R$* $: $>ParseLocal $1 handle local hacks
743 R$* $: $>Parse1 $1 final parsing
746 # Parse0 -- do initial syntax checking and eliminate local addresses.
747 # This should either return with the (possibly modified) input
748 # or return with a #error mailer. It should not return with a
749 # #mailer other than the #error mailer.
753 R<@> $@ <@> special case error msgs
754 R$* : $* ; <@> $#error $@ 5.1.3 $: "553 List:; syntax illegal for recipient addresses"
755 R@ <@ $* > < @ $1 > catch "@@host" bogosity
756 R<@ $+> $#error $@ 5.1.3 $: "553 User address required"
757 R$+ <@> $#error $@ 5.1.3 $: "553 Hostname required"
759 R<> $* < @ [ $* ] : $+ > $* $1 < @ [ $2 ] : $3 > $4
760 R<> $* < @ [ $* ] , $+ > $* $1 < @ [ $2 ] , $3 > $4
761 R<> $* < @ [ $* ] $+ > $* $#error $@ 5.1.2 $: "553 Invalid address"
762 R<> $* < @ [ $+ ] > $* $1 < @ [ $2 ] > $3
763 R<> $* <$* : $* > $* $#error $@ 5.1.3 $: "553 Colon illegal in host name part"
765 R$* < @ . $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
766 R$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
767 R$* < @ $* @ > $* $#error $@ 5.1.2 $: "553 Invalid route address"
768 R$* @ $* < @ $* > $* $#error $@ 5.1.3 $: "553 Invalid route address"
769 R$* , $~O $* $#error $@ 5.1.3 $: "553 Invalid route address"
772 # now delete the local info -- note $=O to find characters that cause forwarding
773 R$* < @ > $* $@ $>Parse0 $>canonify $1 user@ => user
774 R< @ $=w . > : $* $@ $>Parse0 $>canonify $2 @here:... -> ...
775 R$- < @ $=w . > $: $(dequote $1 $) < @ $2 . > dequote "foo"@here
776 R< @ $+ > $#error $@ 5.1.3 $: "553 User address required"
777 R$* $=O $* < @ $=w . > $@ $>Parse0 $>canonify $1 $2 $3 ...@here -> ...
778 R$- $: $(dequote $1 $) < @ *LOCAL* > dequote "foo"
779 R< @ *LOCAL* > $#error $@ 5.1.3 $: "553 User address required"
780 R$* $=O $* < @ *LOCAL* >
781 $@ $>Parse0 $>canonify $1 $2 $3 ...@*LOCAL* -> ...
782 R$* < @ *LOCAL* > $: $1
785 # Parse1 -- the bottom half of ruleset 0.
790 # handle numeric address spec
791 R$* < @ [ $+ ] > $* $: $>ParseLocal $1 < @ [ $2 ] > $3 numeric internet spec
792 R$* < @ [ $+ ] > $* $: $1 < @ [ $2 ] : $S > $3 Add smart host to path
793 R$* < @ [ $+ ] : > $* $#esmtp $@ [$2] $: $1 < @ [$2] > $3 no smarthost: send
794 R$* < @ [ $+ ] : $- : $*> $* $#$3 $@ $4 $: $1 < @ [$2] > $5 smarthost with mailer
795 R$* < @ [ $+ ] : $+ > $* $#esmtp $@ $3 $: $1 < @ [$2] > $4 smarthost without mailer
798 # short circuit local delivery so forwarded email works
801 R$=L < @ $=w . > $#local $: @ $1 special local names
802 R$+ < @ $=w . > $#local $: $1 regular local name
805 # resolve remotely connected UUCP links (if any)
807 # resolve fake top level domains by forwarding to other hosts
811 # pass names that still have a host to a smarthost (if defined)
812 R$* < @ $* > $* $: $>MailerToTriple < $S > $1 < @ $2 > $3 glue on smarthost name
814 # deal with other remote names
815 R$* < @$* > $* $#esmtp $@ $2 $: $1 < @ $2 > $3 user@host.domain
817 # handle locally delivered names
818 R$=L $#local $: @ $1 special local names
819 R$+ $#local $: $1 regular local names
821 ###########################################################################
822 ### Ruleset 5 -- special rewriting after aliases have been expanded ###
823 ###########################################################################
827 R$+ $: $1 $| $>"Local_localaddr" $1
828 R$+ $| $#ok $@ $1 no change
835 # deal with plussed users so aliases work nicely
836 R$+ + * $#local $@ $&h $: $1
837 R$+ + $* $#local $@ + $2 $: $1 + *
839 # prepend an empty "forward host" on the front
844 R< > $+ $: < > < $1 <> $&h > nope, restore +detail
846 R< > < $+ <> + $* > $: < > < $1 + $2 > check whether +detail
847 R< > < $+ <> $* > $: < > < $1 > else discard
848 R< > < $+ + $* > $* < > < $1 > + $2 $3 find the user part
849 R< > < $+ > + $* $#local $@ $2 $: @ $1 strip the extra +
850 R< > < $+ > $@ $1 no +detail
851 R$+ $: $1 <> $&h add +detail back in
853 R$+ <> + $* $: $1 + $2 check whether +detail
854 R$+ <> $* $: $1 else discard
855 R< local : $* > $* $: $>MailerToTriple < local : $1 > $2 no host extension
856 R< error : $* > $* $: $>MailerToTriple < error : $1 > $2 no host extension
858 R< $~[ : $+ > $+ $: $>MailerToTriple < $1 : $2 > $3 < @ $2 >
860 R< $+ > $+ $@ $>MailerToTriple < $1 > $2 < @ $1 >
863 ###################################################################
864 ### Ruleset 95 -- canonify mailer:[user@]host syntax to triple ###
865 ###################################################################
868 R< > $* $@ $1 strip off null relay
869 R< error : $-.$-.$- : $+ > $* $#error $@ $1.$2.$3 $: $4
870 R< error : $- : $+ > $* $#error $@ $(dequote $1 $) $: $2
871 R< error : $+ > $* $#error $: $1
872 R< local : $* > $* $>CanonLocal < $1 > $2
873 R< $~[ : $+ @ $+ > $*<$*>$* $# $1 $@ $3 $: $2<@$3> use literal user
874 R< $~[ : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
875 R< $=w > $* $@ $2 delete local host
876 R< $+ > $* $#relay $@ $1 $: $2 use unqualified mailer
878 ###################################################################
879 ### Ruleset CanonLocal -- canonify local: syntax ###
880 ###################################################################
883 # strip local host from routed addresses
884 R< $* > < @ $+ > : $+ $@ $>Recurse $3
885 R< $* > $+ $=O $+ < @ $+ > $@ $>Recurse $2 $3 $4
887 # strip trailing dot from any host name that may appear
888 R< $* > $* < @ $* . > $: < $1 > $2 < @ $3 >
890 # handle local: syntax -- use old user, either with or without host
891 R< > $* < @ $* > $* $#local $@ $1@$2 $: $1
892 R< > $+ $#local $@ $1 $: $1
894 # handle local:user@host syntax -- ignore host part
895 R< $+ @ $+ > $* < @ $* > $: < $1 > $3 < @ $4 >
897 # handle local:user syntax
898 R< $+ > $* <@ $* > $* $#local $@ $2@$3 $: $1
899 R< $+ > $* $#local $@ $2 $: $1
901 ###################################################################
902 ### Ruleset 93 -- convert header names to masqueraded form ###
903 ###################################################################
908 # do not masquerade anything in class N
909 R$* < @ $* $=N . > $@ $1 < @ $2 $3 . >
911 R$* < @ *LOCAL* > $@ $1 < @ $j . >
913 ###################################################################
914 ### Ruleset 94 -- convert envelope names to masqueraded form ###
915 ###################################################################
918 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
920 ###################################################################
921 ### Ruleset 98 -- local part of ruleset zero (can be null) ###
922 ###################################################################
929 ######################################################################
930 ### CanonAddr -- Convert an address into a standard form for
931 ### relay checking. Route address syntax is
932 ### crudely converted into a %-hack address.
935 ### $1 -- full recipient address
938 ### parsed address, not in source route form
939 ######################################################################
942 R$* $: $>Parse0 $>canonify $1 make domain canonical
945 ######################################################################
946 ### ParseRecipient -- Strip off hosts in $=R as well as possibly
947 ### $* $=m or the access database.
948 ### Check user portion for host separators.
951 ### $1 -- full recipient address
954 ### parsed, non-local-relaying address
955 ######################################################################
958 R$* $: <?> $>CanonAddr $1
959 R<?> $* < @ $* . > <?> $1 < @ $2 > strip trailing dots
960 R<?> $- < @ $* > $: <?> $(dequote $1 $) < @ $2 > dequote local part
962 # if no $=O character, no host in the user portion, we are done
963 R<?> $* $=O $* < @ $* > $: <NO> $1 $2 $3 < @ $4>
967 R<NO> $* < @ $* $=R > $: <RELAY> $1 < @ $2 $3 >
971 R<RELAY> $* < @ $* > $@ $>ParseRecipient $1
975 ######################################################################
976 ### check_relay -- check hostname/address on SMTP startup
977 ######################################################################
983 R$* $: $1 $| $>"Local_check_relay" $1
984 R$* $| $* $| $#$* $#$3
985 R$* $| $* $| $* $@ $>"Basic_check_relay" $1 $| $2
988 # check for deferred delivery mode
989 R$* $: < $&{deliveryMode} > $1
990 R< d > $* $@ deferred
996 ######################################################################
997 ### check_mail -- check SMTP `MAIL FROM:' command argument
998 ######################################################################
1002 R$* $: $1 $| $>"Local_check_mail" $1
1004 R$* $| $* $@ $>"Basic_check_mail" $1
1007 # check for deferred delivery mode
1008 R$* $: < $&{deliveryMode} > $1
1009 R< d > $* $@ deferred
1013 R$* $: $1 $| $>"tls_client" $&{verify} $| MAIL
1017 R<> $@ <OK> we MUST accept <> (RFC 1123)
1019 R<?><$+> $: <@> <$1>
1021 R$* $: $&{daemon_flags} $| $1
1022 R$* f $* $| <@> < $* @ $- > $: < ? $&{client_name} > < $3 @ $4 >
1023 R$* u $* $| <@> < $* > $: <?> < $3 >
1025 # handle case of @localhost on address
1026 R<@> < $* @ localhost > $: < ? $&{client_name} > < $1 @ localhost >
1027 R<@> < $* @ [127.0.0.1] >
1028 $: < ? $&{client_name} > < $1 @ [127.0.0.1] >
1029 R<@> < $* @ localhost.$m >
1030 $: < ? $&{client_name} > < $1 @ localhost.$m >
1031 R<@> < $* @ localhost.UUCP >
1032 $: < ? $&{client_name} > < $1 @ localhost.UUCP >
1033 R<@> $* $: $1 no localhost as domain
1034 R<? $=w> $* $: $2 local client: ok
1035 R<? $+> <$+> $#error $@ 5.5.4 $: "553 Real domain name required for sender address"
1037 R$* $: <?> $>CanonAddr $1 canonify sender address and mark it
1038 R<?> $* < @ $+ . > <?> $1 < @ $2 > strip trailing dots
1039 # handle non-DNS hostnames (*.bitnet, *.decnet, *.uucp, etc)
1040 R<?> $* < @ $* $=P > $: <OKR> $1 < @ $2 $3 >
1041 R<?> $* < @ $j > $: <OKR> $1 < @ $j >
1042 R<?> $* < @ $+ > $: <? $(resolve $2 $: $2 <PERM> $) > $1 < @ $2 >
1043 R<? $* <$->> $* < @ $+ >
1047 # handle case of no @domain on address
1048 R<?> $* $: $&{daemon_flags} $| <?> $1
1049 R$* u $* $| <?> $* $: <OKR> $3
1051 R<?> $* $: < ? $&{client_addr} > $1
1052 R<?> $* $@ <OKR> ...local unqualed ok
1053 R<? $+> $* $#error $@ 5.5.4 $: "553 Domain name required for sender address " $&f
1056 R<?> $* $: @ $1 mark address: nothing known about it
1057 R<$={ResOk}> $* $: @ $2 domain ok
1058 R<TEMP> $* $#error $@ 4.1.8 $: "451 Domain of sender address " $&f " does not resolve"
1059 R<PERM> $* $#error $@ 5.1.8 $: "553 Domain of sender address " $&f " does not exist"
1063 ######################################################################
1064 ### check_rcpt -- check SMTP `RCPT TO:' command argument
1065 ######################################################################
1069 R$* $: $1 $| $>"Local_check_rcpt" $1
1071 R$* $| $* $@ $>"Basic_check_rcpt" $1
1075 R<> $#error $@ nouser $: "553 User address required"
1076 R$@ $#error $@ nouser $: "553 User address required"
1077 # check for deferred delivery mode
1078 R$* $: < $&{deliveryMode} > $1
1079 R< d > $* $@ deferred
1083 ######################################################################
1084 R$* $: $1 $| @ $>"Rcpt_ok" $1
1085 R$* $| @ $#TEMP $+ $: $1 $| T $2
1087 R$* $| @ RELAY $@ RELAY
1088 R$* $| @ $* $: O $| $>"Relay_ok" $1
1089 R$* $| T $+ $: T $2 $| $>"Relay_ok" $1
1090 R$* $| $#TEMP $+ $#error $2
1092 R$* $| RELAY $@ RELAY
1093 R T $+ $| $* $#error $1
1094 # anything else is bogus
1095 R$* $#error $@ 5.7.1 $: "550 Relaying denied"
1098 ######################################################################
1099 ### Rcpt_ok: is the recipient ok?
1100 ######################################################################
1102 R$* $: $>ParseRecipient $1 strip relayable hosts
1107 # authenticated via TLS?
1108 R$* $: $1 $| $>RelayTLS client authenticated?
1109 R$* $| $# $+ $# $2 error/ok?
1112 R$* $: $1 $| $>"Local_Relay_Auth" $&{auth_type}
1115 R$* $| $* $: $1 $| $&{auth_type}
1117 R$* $| $={TrustAuthMech} $# RELAY
1119 # anything terminating locally is ok
1120 R$+ < @ $=w > $@ RELAY
1121 R$+ < @ $* $=R > $@ RELAY
1126 # check for local user (i.e. unqualified address)
1128 R<?> $* < @ $+ > $: <REMOTE> $1 < @ $2 >
1133 ######################################################################
1134 ### Relay_ok: is the relay/sender ok?
1135 ######################################################################
1137 # anything originating locally is ok
1139 R$* $: $&{client_addr}
1140 R$@ $@ RELAY originated locally
1141 R0 $@ RELAY originated locally
1142 R127.0.0.1 $@ RELAY originated locally
1143 RIPv6:::1 $@ RELAY originated locally
1144 R$=R $* $@ RELAY relayable IP address
1145 R$* $: [ $1 ] put brackets around it...
1146 R$=w $@ RELAY ... and see if it is local
1149 # check client name: first: did it resolve?
1150 R$* $: < $&{client_resolve} >
1151 R<TEMP> $#TEMP $@ 4.4.0 $: "450 Relaying temporarily denied. Cannot resolve PTR record for " $&{client_addr}
1152 R<FORGED> $#error $@ 5.7.1 $: "550 Relaying denied. IP name possibly forged " $&{client_name}
1153 R<FAIL> $#error $@ 5.7.1 $: "550 Relaying denied. IP name lookup failed " $&{client_name}
1154 R$* $: <@> $&{client_name}
1155 # pass to name server to make hostname canonical
1156 R<@> $* $=P $:<?> $1 $2
1157 R<@> $+ $:<?> $[ $1 $]
1158 R$* . $1 strip trailing dots
1160 R<?> $* $=R $@ RELAY
1166 ######################################################################
1167 ### trust_auth: is user trusted to authenticate as someone else?
1170 ### $1: AUTH= parameter from MAIL command
1171 ######################################################################
1175 R$* $: $&{auth_type} $| $1
1176 # required by RFC 2554 section 4.
1177 R$@ $| $* $#error $@ 5.7.1 $: "550 not authenticated"
1178 R$* $| $&{auth_authen} $@ identical
1179 R$* $| <$&{auth_authen}> $@ identical
1180 R$* $| $* $: $1 $| $>"Local_trust_auth" $2
1182 R$* $#error $@ 5.7.1 $: "550 " $&{auth_authen} " not allowed to act as " $&{auth_author}
1184 ######################################################################
1185 ### Relay_Auth: allow relaying based on authentication?
1188 ### $1: ${auth_type}
1189 ######################################################################
1192 ######################################################################
1193 ### srv_features: which features to offer to a client?
1194 ### (done in server)
1195 ######################################################################
1199 ######################################################################
1200 ### try_tls: try to use STARTTLS?
1201 ### (done in client)
1202 ######################################################################
1206 ######################################################################
1207 ### tls_rcpt: is connection with server "good" enough?
1208 ### (done in client, per recipient)
1212 ######################################################################
1216 ######################################################################
1217 ### tls_client: is connection with client "good" enough?
1218 ### (done in server)
1221 ### ${verify} $| (MAIL|STARTTLS)
1222 ######################################################################
1224 R$* $| $* $@ $>"TLS_connection" $1
1226 ######################################################################
1227 ### tls_server: is connection with server "good" enough?
1228 ### (done in client)
1232 ######################################################################
1234 R$* $@ $>"TLS_connection" $1
1236 ######################################################################
1237 ### TLS_connection: is TLS connection "good" enough?
1241 ### Requirement: RHS from access map, may be ? for none.
1242 ######################################################################
1244 RSOFTWARE $#error $@ 4.7.0 $: "403 TLS handshake."
1247 ######################################################################
1248 ### RelayTLS: allow relaying based on TLS authentication
1252 ######################################################################
1256 ######################################################################
1257 ### authinfo: lookup authinfo in the access map
1260 ### $1: {server_name}
1261 ### $2: {server_addr}
1262 ######################################################################
1273 R$+ $: $>ParseRecipient $1
1274 R$* < @ $+ > $* $#relay $@ ${MTAHost} $: $1 < @ $2 > $3
1276 R$+ :: $+ $#relay $@ ${MTAHost} $: $1 :: $2
1277 R$* $#relay $@ ${MTAHost} $: $1 < @ $j >
1279 ######################################################################
1280 ######################################################################
1282 ##### MAIL FILTER DEFINITIONS
1284 ######################################################################
1285 ######################################################################
1288 ######################################################################
1289 ######################################################################
1291 ##### MAILER DEFINITIONS
1293 ######################################################################
1294 ######################################################################
1297 ##################################################
1298 ### Local and Program Mailer specification ###
1299 ##################################################
1301 ##### $Id: local.m4,v 8.59 2004/11/23 00:37:25 ca Exp $ #####
1304 # Envelope sender rewriting
1307 R<@> $n errors to mailer-daemon
1308 R@ <@ $*> $n temporarily bypass Sun bogosity
1309 R$+ $: $>AddDomain $1 add local domain if needed
1310 R$* $: $>MasqEnv $1 do masquerading
1313 # Envelope recipient rewriting
1316 R$+ < @ $* > $: $1 strip host part
1317 R$+ + $* $: < $&{addr_type} > $1 + $2 mark with addr type
1318 R<e s> $+ + $* $: $1 remove +detail for sender
1319 R< $* > $+ $: $2 else remove mark
1322 # Header sender rewriting
1325 R<@> $n errors to mailer-daemon
1326 R@ <@ $*> $n temporarily bypass Sun bogosity
1327 R$+ $: $>AddDomain $1 add local domain if needed
1328 R$* $: $>MasqHdr $1 do masquerading
1331 # Header recipient rewriting
1334 R$+ $: $>AddDomain $1 add local domain if needed
1335 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1338 # Common code to add local domain name (only if always-add-domain)
1342 Mlocal, P=[IPC], F=lmDFMuXkw5, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
1345 Mprog, P=[IPC], F=lmDFMuXk5, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
1346 T=X-Unix/X-Unix/X-Unix,
1349 #####################################
1350 ### SMTP Mailer specification ###
1351 #####################################
1353 ##### $Id: smtp.m4,v 8.65 2006/07/12 21:08:10 ca Exp $ #####
1356 # common sender and masquerading recipient rewriting
1359 R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
1360 R$+ $@ $1 < @ *LOCAL* > add local qualification
1363 # convert pseudo-domain addresses to real domain addresses
1367 # pass <route-addr>s through
1368 R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr>
1370 # output fake domains as user%fake@relay
1372 # do UUCP heuristics; note that these are shared with UUCP mailers
1373 R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form
1374 R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form
1376 # leave these in .UUCP form to avoid further tampering
1377 R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. >
1378 R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 >
1379 R< $&h ! > $+ $@ $1 < @ $&h .UUCP. >
1380 R< $+ ! > $+ $: $1 ! $2 < @ $Y > use UUCP_RELAY
1381 R$+ < @ $~[ $* : $+ > $@ $1 < @ $4 > strip mailer: part
1382 R$+ < @ > $: $1 < @ *LOCAL* > if no UUCP_RELAY
1386 # envelope sender rewriting
1389 R$+ $: $>PseudoToReal $1 sender/recipient common
1390 R$* :; <@> $@ list:; special case
1391 R$* $: $>MasqSMTP $1 qualify unqual'ed names
1392 R$+ $: $>MasqEnv $1 do masquerading
1396 # envelope recipient rewriting --
1397 # also header recipient if not masquerading recipients
1400 R$+ $: $>PseudoToReal $1 sender/recipient common
1401 R$+ $: $>MasqSMTP $1 qualify unqual'ed names
1402 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1405 # header sender and masquerading header recipient rewriting
1408 R$+ $: $>PseudoToReal $1 sender/recipient common
1409 R:; <@> $@ list:; special case
1411 # do special header rewriting
1412 R$* <@> $* $@ $1 <@> $2 pass null host through
1413 R< @ $* > $* $@ < @ $1 > $2 pass route-addr through
1414 R$* $: $>MasqSMTP $1 qualify unqual'ed names
1415 R$+ $: $>MasqHdr $1 do masquerading
1419 # relay mailer header masquerading recipient rewriting
1422 R$+ $: $>MasqSMTP $1
1425 Msmtp, P=[IPC], F=mDFMuXk5, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1428 Mesmtp, P=[IPC], F=mDFMuXak5, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1431 Msmtp8, P=[IPC], F=mDFMuX8k5, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1434 Mdsmtp, P=[IPC], F=mDFMuXa%k5, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1437 Mrelay, P=[IPC], F=mDFMuXa8k, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,
1444 # # Copyright (c) 2001-2003 Sendmail, Inc. and its suppliers.
1445 # # All rights reserved.
1447 # # By using this file, you agree to the terms and conditions set
1448 # # forth in the LICENSE file which can be found at the top level of
1449 # # the sendmail distribution.
1454 # # This is the prototype file for a set-group-ID sm-msp sendmail that
1455 # # acts as a initial mail submission program.
1459 # VERSIONID(`$Id: submit.mc,v 8.14 2006/04/05 05:54:41 ca Exp $')
1460 # define(`confCF_VERSION', `Submit')dnl
1461 # define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining
1462 # define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
1463 # define(`confTIME_ZONE', `USE_TZ')dnl
1464 # define(`confDONT_INIT_GROUPS', `True')dnl
1466 # dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1]
1467 # FEATURE(`msp', `[127.0.0.1]')dnl