2 # Copyright (c) 1998-2004, 2009, 2010 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 Sat May 14 21:31:13 PDT 2011
20 ##### in /extra/home/ca/sm-8.14.5/OpenSource/sendmail-8.14.5/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.121 2010/01/07 18:20:19 ca Exp $ #####
31 ##### $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $ #####
32 ##### $Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $ #####
34 ##### $Id: linux.m4,v 8.13 2000/09/17 17:30:00 gshapiro Exp $ #####
38 ##### $Id: local_procmail.m4,v 8.22 2002/11/17 04:24:19 ca Exp $ #####
41 ##### $Id: generic.m4,v 8.15 1999/04/04 00:51:09 ca Exp $ #####
43 ##### $Id: redirect.m4,v 8.15 1999/08/06 01:47:36 gshapiro Exp $ #####
45 ##### $Id: use_cw_file.m4,v 8.11 2001/08/26 20:58:57 gshapiro Exp $ #####
49 ##### $Id: proto.m4,v 8.744 2010/11/23 20:29:47 guenther Exp $ #####
51 # level 10 config file format
54 # override file safeties - setting this option compromises system security,
55 # addressing the actual file configuration problem is preferred
56 # need to set this before any file actions are encountered in the cf file
57 #O DontBlameSendmail=safe
59 # default LDAP map specification
60 # need to set this now before any LDAP maps are defined
61 #O LDAPDefaultSpec=-h localhost
68 # need to set this before any LDAP lookups are done (including classes)
69 #D{sendmailMTACluster}$m
72 # file containing names of hosts for which we receive email
73 Fw/etc/mail/local-host-names
75 # my official domain name
76 # ... define this only if sendmail cannot automatically determine your domain
79 # host/domain names ending with a token in class P are canonical
82 # "Smart" relay host (may be null)
86 # operators that cannot be in local usernames (i.e., network indicators)
89 # a class with just dot (for identifying canonical names)
92 # a class with just a left bracket (for identifying domain literals)
96 # Resolve map (to check if a host exists in check_mail)
97 Kresolve host -a<OKR> -T<TEMP>
101 # Hosts for which relaying is permitted ($=R)
102 FR-o /etc/mail/relay-domains
114 # class E: names that should be exposed as from this host, even if we masquerade
115 # class L: names that should be delivered locally, even if we have a relay
116 # class M: domains that should be converted to $M
117 # class N: domains that should not be converted to $M
123 # my name for error messages
129 # Configuration version number
137 # strip message body to 7 bits on input?
138 O SevenBitInput=False
140 # 8-bit data handling
141 #O EightBitMode=pass8
143 # wait for alias file rebuild (default units: minutes)
146 # location of alias file
147 O AliasFile=/etc/mail/aliases
149 # minimum number of free blocks on filesystem
152 # maximum message size
155 # substitution for space (blank) characters
158 # avoid connecting to "expensive" mailers on initial submission?
159 O HoldExpensive=False
161 # checkpoint queue runs after every N successful deliveries
162 #O CheckpointInterval=10
164 # default delivery mode
165 O DeliveryMode=background
167 # error message header/file
168 #O ErrorHeader=/etc/mail/error-header
173 # save Unix-style "From_" lines at top of header?
174 #O SaveFromLine=False
176 # queue file mode (qf files)
177 #O QueueFileMode=0600
179 # temporary file mode
182 # match recipients against GECOS field?
188 # location of help file
189 O HelpFile=/etc/mail/helpfile
191 # ignore dots as terminators in incoming messages?
194 # name resolver options
195 #O ResolverOptions=+AAONLY
197 # deliver MIME-encapsulated error messages?
198 O SendMimeErrors=True
200 # Forward file search path
201 O ForwardPath=$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward
203 # open connection cache size
204 O ConnectionCacheSize=2
206 # open connection cache timeout
207 O ConnectionCacheTimeout=5m
209 # persistent host status directory
210 #O HostStatusDirectory=.hoststat
212 # single thread deliveries (requires HostStatusDirectory)?
213 #O SingleThreadDelivery=False
215 # use Errors-To: header?
221 # send to me too, even in an alias expansion?
224 # verify RHS in newaliases?
227 # default messages to old style headers if no special punctuation?
228 O OldStyleHeaders=True
230 # SMTP daemon options
231 O DaemonPortOptions=Name=MTA
232 O DaemonPortOptions=Port=587, Name=MSA, M=E
234 # SMTP client options
235 #O ClientPortOptions=Family=inet, Address=0.0.0.0
237 # Modifiers to define {daemon_flags} for direct submissions
238 #O DirectSubmissionModifiers
240 # Use as mail submission program? See sendmail/SECURITY
244 O PrivacyOptions=authwarnings
246 # who (if anyone) should get extra copies of error messages
247 #O PostmasterCopy=Postmaster
249 # slope of queue-only function
250 #O QueueFactor=600000
252 # limit on number of concurrent queue runners
255 # maximum number of queue-runners per queue-grouping with multiple queues
256 #O MaxRunnersPerQueue=1
258 # priority of queue runners (nice(3))
261 # shall we sort the queue by hostname first?
262 #O QueueSortOrder=priority
264 # minimum time in queue before retry
267 # how many jobs can you process in the queue?
270 # perform initial split of envelope without checking MX records
274 O QueueDirectory=/var/spool/mqueue
276 # key for shared memory; 0 to turn off, -1 to auto-select
279 # file to store auto-selected key for shared memory (SharedMemoryKey = -1)
280 #O SharedMemoryKeyFile
282 # timeouts (many of these)
283 #O Timeout.initial=5m
284 #O Timeout.connect=5m
285 #O Timeout.aconnect=0s
286 #O Timeout.iconnect=5m
290 #O Timeout.datainit=5m
291 #O Timeout.datablock=1h
292 #O Timeout.datafinal=1h
296 #O Timeout.command=1h
298 #O Timeout.fileopen=60s
299 #O Timeout.control=2m
300 O Timeout.queuereturn=5d
301 #O Timeout.queuereturn.normal=5d
302 #O Timeout.queuereturn.urgent=2d
303 #O Timeout.queuereturn.non-urgent=7d
304 #O Timeout.queuereturn.dsn=5d
305 O Timeout.queuewarn=4h
306 #O Timeout.queuewarn.normal=4h
307 #O Timeout.queuewarn.urgent=1h
308 #O Timeout.queuewarn.non-urgent=12h
309 #O Timeout.queuewarn.dsn=4h
310 #O Timeout.hoststatus=30m
311 #O Timeout.resolver.retrans=5s
312 #O Timeout.resolver.retrans.first=5s
313 #O Timeout.resolver.retrans.normal=5s
314 #O Timeout.resolver.retry=4
315 #O Timeout.resolver.retry.first=4
316 #O Timeout.resolver.retry.normal=4
319 #O Timeout.starttls=1h
321 # time for DeliverBy; extension disabled if less than 0
324 # should we not prune routes in route-addr syntax addresses?
325 #O DontPruneRoutes=False
327 # queue up everything before forking?
333 # time zone handling:
334 # if undefined, use system default
335 # if defined but null, use TZ envariable passed in
336 # if defined and non-null, use that info
339 # default UID (can be username or userid:groupid)
340 #O DefaultUser=mailnull
342 # list of locations of user database file (null means no lookup)
343 #O UserDatabaseSpec=/etc/mail/userdb
346 #O FallbackMXhost=fall.back.host.net
348 # fallback smart host
349 #O FallbackSmartHost=fall.back.host.net
351 # if we are the best MX host for a site, try it directly instead of config err
352 #O TryNullMXList=False
354 # load average at which we just queue messages
357 # load average at which we refuse connections
360 # log interval when refusing connections for this long
361 #O RejectLogInterval=3h
363 # load average at which we delay connections; 0 means no limit
366 # maximum number of children we allow at one time
367 #O MaxDaemonChildren=0
369 # maximum number of new connections per second
370 #O ConnectionRateThrottle=0
372 # Width of the window
373 #O ConnectionRateWindowSize=60s
375 # work recipient factor
376 #O RecipientFactor=30000
378 # deliver each queued job in a separate process?
387 # default character set
388 #O DefaultCharSet=unknown-8bit
390 # service switch file (name hardwired on Solaris, Ultrix, OSF/1, others)
391 #O ServiceSwitchFile=/etc/mail/service.switch
393 # hosts file (normally /etc/hosts)
394 #O HostsFile=/etc/hosts
396 # dialup line delay on connection failure
399 # action to take if there are no recipients in the message
400 #O NoRecipientAction=none
402 # chrooted environment for writing to files
403 #O SafeFileEnvironment
405 # are colons OK in addresses?
406 #O ColonOkInAddr=True
408 # shall I avoid expanding CNAMEs (violates protocols)?
409 #O DontExpandCnames=False
411 # SMTP initial login message (old $e macro)
412 O SmtpGreetingMessage=$j Sendmail $v/$Z; $b
414 # UNIX initial From header format (old $l macro)
415 O UnixFromLine=From $g $d
417 # From: lines that have embedded newlines are unwrapped onto one line
418 #O SingleLineFromHeader=False
420 # Allow HELO SMTP command that does not include a host name
421 #O AllowBogusHELO=False
423 # Characters to be quoted in a full name phrase (@,;:\()[] are automatic)
426 # delimiter (operator) characters (old $o macro)
427 O OperatorChars=.:%@!^/[]+
429 # shall I avoid calling initgroups(3) because of high NIS costs?
430 #O DontInitGroups=False
432 # are group-writable :include: and .forward files (un)trustworthy?
433 # True (the default) means they are not trustworthy.
434 #O UnsafeGroupWrites=True
437 # where do errors that occur when sending errors get sent?
438 #O DoubleBounceAddress=postmaster
440 # issue temporary errors (4xy) instead of permanent errors (5xy)?
443 # where to save bounces if all else fails
444 #O DeadLetterDrop=/var/tmp/dead.letter
446 # what user id do we assume for the majority of the processing?
447 #O RunAsUser=sendmail
449 # maximum number of recipients per SMTP envelope
450 #O MaxRecipientsPerMessage=0
452 # limit the rate recipients per SMTP envelope are accepted
453 # once the threshold number of recipients have been rejected
457 # shall we get local names from our installed interfaces?
458 #O DontProbeInterfaces=False
460 # Return-Receipt-To: header implies DSN request
461 #O RrtImpliesDsn=False
463 # override connection address (for testing)
464 #O ConnectOnlyTo=0.0.0.0
466 # Trusted user for file ownership and starting the daemon
469 # Control socket for daemon management
470 #O ControlSocketName=/var/spool/mqueue/.control
472 # Maximum MIME header length to protect MUAs
473 #O MaxMimeHeaderLength=0/0
475 # Maximum length of the sum of all headers
476 O MaxHeadersLength=32768
478 # Maximum depth of alias recursion
479 #O MaxAliasRecursion=10
481 # location of pid file
482 #O PidFile=/var/run/sendmail.pid
484 # Prefix string for the process title shown on 'ps' listings
485 #O ProcessTitlePrefix=prefix
487 # Data file (df) memory-buffer file maximum size
488 #O DataFileBufferSize=4096
490 # Transcript file (xf) memory-buffer file maximum size
491 #O XscriptFileBufferSize=4096
493 # lookup type to find information about local mailboxes
494 #O MailboxDatabase=pw
496 # override compile time flag REQUIRES_DIR_FSYNC
497 #O RequiresDirfsync=true
499 # list of authentication mechanisms
500 #O AuthMechanisms=EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5
502 # Authentication realm
505 # default authentication information for outgoing connections
506 #O DefaultAuthInfo=/etc/mail/default-auth-info
511 # SMTP AUTH maximum encryption strength
514 # SMTP STARTTLS server options
534 # File containing certificate revocation lists
536 # DHParameters (only required if DSA/DH is used)
538 # Random data source (required for systems without /dev/urandom under OpenSSL)
541 # Maximum number of "useless" commands before slowing down
542 #O MaxNOOPCommands=20
544 # Name to use for EHLO (defaults to $j)
547 ############################
548 # QUEUE GROUP DEFINITIONS #
549 ############################
552 ###########################
553 # Message precedences #
554 ###########################
557 Pspecial-delivery=100
562 #####################
564 #####################
566 # this is equivalent to setting class "t"
567 #Ft/etc/mail/trusted-users
572 #########################
573 # Format of headers #
574 #########################
576 H?P?Return-Path: <$g>
577 HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
578 $.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.)
579 $.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}
580 (version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u
585 H?F?Resent-From: $?x$x <$g>$|$g$.
586 H?F?From: $?x$x <$g>$|$g$.
589 # H?l?Received-Date: $b
590 H?M?Resent-Message-Id: <$t.$i@$j>
591 H?M?Message-Id: <$t.$i@$j>
594 ######################################################################
595 ######################################################################
597 ##### REWRITING RULES
599 ######################################################################
600 ######################################################################
602 ############################################
603 ### Ruleset 3 -- Name Canonicalization ###
604 ############################################
607 # handle null input (translate to <@> special case)
610 # strip group: syntax (not inside angle brackets!) and trailing semicolon
611 R$* $: $1 <@> mark addresses
612 R$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr>
613 R@ $* <@> $: @ $1 unmark @host:...
614 R$* [ IPv6 : $+ ] <@> $: $1 [ IPv6 : $2 ] unmark IPv6 addr
615 R$* :: $* <@> $: $1 :: $2 unmark node::addr
616 R:include: $* <@> $: :include: $1 unmark :include:...
617 R$* : $* [ $* ] $: $1 : $2 [ $3 ] <@> remark if leading colon
618 R$* : $* <@> $: $2 strip colon if marked
620 R$* ; $1 strip trailing semi
621 R$* < $+ :; > $* $@ $2 :; <@> catch <list:;>
622 R$* < $* ; > $1 < $2 > bogus bracketed semi
624 # null input now results from list:; syntax
627 # strip angle brackets -- note RFC733 heuristic to get innermost item
628 R$* $: < $1 > housekeeping <>
629 R$+ < $* > < $2 > strip excess on left
630 R< $* > $+ < $1 > strip excess on right
631 R<> $@ < @ > MAIL FROM:<> case
632 R< $+ > $: $1 remove housekeeping <>
634 # strip route address <@a,@b,@c:user@d> -> <user@d>
639 # find focus for list syntax
640 R $+ : $* ; @ $+ $@ $>Canonify2 $1 : $2 ; < @ $3 > list syntax
641 R $+ : $* ; $@ $1 : $2; list syntax
643 # find focus for @ syntax addresses
644 R$+ @ $+ $: $1 < @ $2 > focus on domain
645 R$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right
646 R$+ < @ $+ > $@ $>Canonify2 $1 < @ $2 > already canonical
649 # convert old-style addresses to a domain-based address
650 R$- ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > resolve uucp names
651 R$+ . $- ! $+ $@ $>Canonify2 $3 < @ $1 . $2 > domain uucps
652 R$+ ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > uucp subdomains
654 # if we have % signs, take the rightmost one
655 R$* % $* $1 @ $2 First make them all @s.
656 R$* @ $* @ $* $1 % $2 @ $3 Undo all but the last.
657 R$* @ $* $@ $>Canonify2 $1 < @ $2 > Insert < > and finish
659 # else we must be a local name
660 R$* $@ $>Canonify2 $1
663 ################################################
664 ### Ruleset 96 -- bottom half of ruleset 3 ###
665 ################################################
669 # handle special cases for local names
670 R$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all
671 R$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain
672 R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain
674 # check for IPv4/IPv6 domain literal
675 R$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [addr]
676 R$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal
677 R$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr
683 # if really UUCP, handle it immediately
685 # try UUCP traffic as a local address
686 R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3
687 R$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3
689 # hostnames ending in class P are always canonical
690 R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4
691 R$* < @ $* $~P > $* $: $&{daemon_flags} $| $1 < @ $2 $3 > $4
692 R$* CC $* $| $* < @ $+.$+ > $* $: $3 < @ $4.$5 . > $6
693 R$* CC $* $| $* $: $3
694 # pass to name server to make hostname canonical
695 R$* $| $* < @ $* > $* $: $2 < @ $[ $3 $] > $4
698 # local host aliases and pseudo-domains are always canonical
699 R$* < @ $=w > $* $: $1 < @ $2 . > $3
700 R$* < @ $=M > $* $: $1 < @ $2 . > $3
701 R$* < @ $* . . > $* $1 < @ $2 . > $3
704 ##################################################
705 ### Ruleset 4 -- Final Output Post-rewriting ###
706 ##################################################
709 R$+ :; <@> $@ $1 : handle <list:;>
710 R$* <@> $@ handle <> and list:;
712 # strip trailing dot off possibly canonical name
713 R$* < @ $+ . > $* $1 < @ $2 > $3
715 # eliminate internal code
716 R$* < @ *LOCAL* > $* $1 < @ $j > $2
718 # externalize local domain info
719 R$* < $+ > $* $1 $2 $3 defocus
720 R@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical
721 R@ $* $@ @ $1 ... and exit
723 # UUCP must always be presented in old form
724 R$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u
726 # delete duplicate local names
727 R$+ % $=w @ $=w $1 @ $2 u%host@host => u@host
731 ##############################################################
732 ### Ruleset 97 -- recanonicalize and call ruleset zero ###
733 ### (used for recursive calls) ###
734 ##############################################################
741 ######################################
742 ### Ruleset 0 -- Parse Address ###
743 ######################################
747 R$* $: $>Parse0 $1 initial parsing
748 R<@> $#local $: <@> special case error msgs
749 R$* $: $>ParseLocal $1 handle local hacks
750 R$* $: $>Parse1 $1 final parsing
753 # Parse0 -- do initial syntax checking and eliminate local addresses.
754 # This should either return with the (possibly modified) input
755 # or return with a #error mailer. It should not return with a
756 # #mailer other than the #error mailer.
760 R<@> $@ <@> special case error msgs
761 R$* : $* ; <@> $#error $@ 5.1.3 $: "553 List:; syntax illegal for recipient addresses"
762 R@ <@ $* > < @ $1 > catch "@@host" bogosity
763 R<@ $+> $#error $@ 5.1.3 $: "553 User address required"
764 R$+ <@> $#error $@ 5.1.3 $: "553 Hostname required"
766 R<> $* < @ [ $* ] : $+ > $* $1 < @ [ $2 ] : $3 > $4
767 R<> $* < @ [ $* ] , $+ > $* $1 < @ [ $2 ] , $3 > $4
768 R<> $* < @ [ $* ] $+ > $* $#error $@ 5.1.2 $: "553 Invalid address"
769 R<> $* < @ [ $+ ] > $* $1 < @ [ $2 ] > $3
770 R<> $* <$* : $* > $* $#error $@ 5.1.3 $: "553 Colon illegal in host name part"
772 R$* < @ . $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
773 R$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
774 R$* < @ $* @ > $* $#error $@ 5.1.2 $: "553 Invalid route address"
775 R$* @ $* < @ $* > $* $#error $@ 5.1.3 $: "553 Invalid route address"
776 R$* , $~O $* $#error $@ 5.1.3 $: "553 Invalid route address"
779 # now delete the local info -- note $=O to find characters that cause forwarding
780 R$* < @ > $* $@ $>Parse0 $>canonify $1 user@ => user
781 R< @ $=w . > : $* $@ $>Parse0 $>canonify $2 @here:... -> ...
782 R$- < @ $=w . > $: $(dequote $1 $) < @ $2 . > dequote "foo"@here
783 R< @ $+ > $#error $@ 5.1.3 $: "553 User address required"
784 R$* $=O $* < @ $=w . > $@ $>Parse0 $>canonify $1 $2 $3 ...@here -> ...
785 R$- $: $(dequote $1 $) < @ *LOCAL* > dequote "foo"
786 R< @ *LOCAL* > $#error $@ 5.1.3 $: "553 User address required"
787 R$* $=O $* < @ *LOCAL* >
788 $@ $>Parse0 $>canonify $1 $2 $3 ...@*LOCAL* -> ...
789 R$* < @ *LOCAL* > $: $1
792 # Parse1 -- the bottom half of ruleset 0.
797 # handle numeric address spec
798 R$* < @ [ $+ ] > $* $: $>ParseLocal $1 < @ [ $2 ] > $3 numeric internet spec
799 R$* < @ [ $+ ] > $* $: $1 < @ [ $2 ] : $S > $3 Add smart host to path
800 R$* < @ [ $+ ] : > $* $#esmtp $@ [$2] $: $1 < @ [$2] > $3 no smarthost: send
801 R$* < @ [ $+ ] : $- : $*> $* $#$3 $@ $4 $: $1 < @ [$2] > $5 smarthost with mailer
802 R$* < @ [ $+ ] : $+ > $* $#esmtp $@ $3 $: $1 < @ [$2] > $4 smarthost without mailer
805 # short circuit local delivery so forwarded email works
808 R$=L < @ $=w . > $#local $: @ $1 special local names
809 R$+ < @ $=w . > $#local $: $1 regular local name
812 # resolve remotely connected UUCP links (if any)
814 # resolve fake top level domains by forwarding to other hosts
818 # pass names that still have a host to a smarthost (if defined)
819 R$* < @ $* > $* $: $>MailerToTriple < $S > $1 < @ $2 > $3 glue on smarthost name
821 # deal with other remote names
822 R$* < @$* > $* $#esmtp $@ $2 $: $1 < @ $2 > $3 user@host.domain
824 # handle locally delivered names
825 R$=L $#local $: @ $1 special local names
826 R$+ $#local $: $1 regular local names
828 ###########################################################################
829 ### Ruleset 5 -- special rewriting after aliases have been expanded ###
830 ###########################################################################
834 R$+ $: $1 $| $>"Local_localaddr" $1
835 R$+ $| $#ok $@ $1 no change
842 # deal with plussed users so aliases work nicely
843 R$+ + * $#local $@ $&h $: $1
844 R$+ + $* $#local $@ + $2 $: $1 + *
846 # prepend an empty "forward host" on the front
851 R< > $+ $: < > < $1 <> $&h > nope, restore +detail
853 R< > < $+ <> + $* > $: < > < $1 + $2 > check whether +detail
854 R< > < $+ <> $* > $: < > < $1 > else discard
855 R< > < $+ + $* > $* < > < $1 > + $2 $3 find the user part
856 R< > < $+ > + $* $#local $@ $2 $: @ $1 strip the extra +
857 R< > < $+ > $@ $1 no +detail
858 R$+ $: $1 <> $&h add +detail back in
860 R$+ <> + $* $: $1 + $2 check whether +detail
861 R$+ <> $* $: $1 else discard
862 R< local : $* > $* $: $>MailerToTriple < local : $1 > $2 no host extension
863 R< error : $* > $* $: $>MailerToTriple < error : $1 > $2 no host extension
865 R< $~[ : $+ > $+ $: $>MailerToTriple < $1 : $2 > $3 < @ $2 >
867 R< $+ > $+ $@ $>MailerToTriple < $1 > $2 < @ $1 >
870 ###################################################################
871 ### Ruleset 95 -- canonify mailer:[user@]host syntax to triple ###
872 ###################################################################
875 R< > $* $@ $1 strip off null relay
876 R< error : $-.$-.$- : $+ > $* $#error $@ $1.$2.$3 $: $4
877 R< error : $- : $+ > $* $#error $@ $(dequote $1 $) $: $2
878 R< error : $+ > $* $#error $: $1
879 R< local : $* > $* $>CanonLocal < $1 > $2
880 R< $~[ : $+ @ $+ > $*<$*>$* $# $1 $@ $3 $: $2<@$3> use literal user
881 R< $~[ : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
882 R< $=w > $* $@ $2 delete local host
883 R< $+ > $* $#relay $@ $1 $: $2 use unqualified mailer
885 ###################################################################
886 ### Ruleset CanonLocal -- canonify local: syntax ###
887 ###################################################################
890 # strip local host from routed addresses
891 R< $* > < @ $+ > : $+ $@ $>Recurse $3
892 R< $* > $+ $=O $+ < @ $+ > $@ $>Recurse $2 $3 $4
894 # strip trailing dot from any host name that may appear
895 R< $* > $* < @ $* . > $: < $1 > $2 < @ $3 >
897 # handle local: syntax -- use old user, either with or without host
898 R< > $* < @ $* > $* $#local $@ $1@$2 $: $1
899 R< > $+ $#local $@ $1 $: $1
901 # handle local:user@host syntax -- ignore host part
902 R< $+ @ $+ > $* < @ $* > $: < $1 > $3 < @ $4 >
904 # handle local:user syntax
905 R< $+ > $* <@ $* > $* $#local $@ $2@$3 $: $1
906 R< $+ > $* $#local $@ $2 $: $1
908 ###################################################################
909 ### Ruleset 93 -- convert header names to masqueraded form ###
910 ###################################################################
915 # do not masquerade anything in class N
916 R$* < @ $* $=N . > $@ $1 < @ $2 $3 . >
918 R$* < @ *LOCAL* > $@ $1 < @ $j . >
920 ###################################################################
921 ### Ruleset 94 -- convert envelope names to masqueraded form ###
922 ###################################################################
925 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
927 ###################################################################
928 ### Ruleset 98 -- local part of ruleset zero (can be null) ###
929 ###################################################################
933 # addresses sent to foo@host.REDIRECT will give a 551 error code
934 R$* < @ $+ .REDIRECT. > $: $1 < @ $2 . REDIRECT . > < ${opMode} >
935 R$* < @ $+ .REDIRECT. > <i> $: $1 < @ $2 . REDIRECT. >
936 R$* < @ $+ .REDIRECT. > < $- > $#error $@ 5.1.1 $: "551 User has moved; please try " <$1@$2>
942 ######################################################################
943 ### CanonAddr -- Convert an address into a standard form for
944 ### relay checking. Route address syntax is
945 ### crudely converted into a %-hack address.
948 ### $1 -- full recipient address
951 ### parsed address, not in source route form
952 ######################################################################
955 R$* $: $>Parse0 $>canonify $1 make domain canonical
958 ######################################################################
959 ### ParseRecipient -- Strip off hosts in $=R as well as possibly
960 ### $* $=m or the access database.
961 ### Check user portion for host separators.
964 ### $1 -- full recipient address
967 ### parsed, non-local-relaying address
968 ######################################################################
971 R$* $: <?> $>CanonAddr $1
972 R<?> $* < @ $* . > <?> $1 < @ $2 > strip trailing dots
973 R<?> $- < @ $* > $: <?> $(dequote $1 $) < @ $2 > dequote local part
975 # if no $=O character, no host in the user portion, we are done
976 R<?> $* $=O $* < @ $* > $: <NO> $1 $2 $3 < @ $4>
980 R<NO> $* < @ $* $=R > $: <RELAY> $1 < @ $2 $3 >
984 R<RELAY> $* < @ $* > $@ $>ParseRecipient $1
988 ######################################################################
989 ### check_relay -- check hostname/address on SMTP startup
990 ######################################################################
996 R$* $: $1 $| $>"Local_check_relay" $1
997 R$* $| $* $| $#$* $#$3
998 R$* $| $* $| $* $@ $>"Basic_check_relay" $1 $| $2
1001 # check for deferred delivery mode
1002 R$* $: < $&{deliveryMode} > $1
1003 R< d > $* $@ deferred
1008 ######################################################################
1009 ### check_mail -- check SMTP `MAIL FROM:' command argument
1010 ######################################################################
1014 R$* $: $1 $| $>"Local_check_mail" $1
1016 R$* $| $* $@ $>"Basic_check_mail" $1
1019 # check for deferred delivery mode
1020 R$* $: < $&{deliveryMode} > $1
1021 R< d > $* $@ deferred
1025 R$* $: $1 $| $>"tls_client" $&{verify} $| MAIL
1029 R<> $@ <OK> we MUST accept <> (RFC 1123)
1031 R<?><$+> $: <@> <$1>
1033 R$* $: $&{daemon_flags} $| $1
1034 R$* f $* $| <@> < $* @ $- > $: < ? $&{client_name} > < $3 @ $4 >
1035 R$* u $* $| <@> < $* > $: <?> < $3 >
1037 # handle case of @localhost on address
1038 R<@> < $* @ localhost > $: < ? $&{client_name} > < $1 @ localhost >
1039 R<@> < $* @ [127.0.0.1] >
1040 $: < ? $&{client_name} > < $1 @ [127.0.0.1] >
1041 R<@> < $* @ localhost.$m >
1042 $: < ? $&{client_name} > < $1 @ localhost.$m >
1043 R<@> < $* @ localhost.UUCP >
1044 $: < ? $&{client_name} > < $1 @ localhost.UUCP >
1045 R<@> $* $: $1 no localhost as domain
1046 R<? $=w> $* $: $2 local client: ok
1047 R<? $+> <$+> $#error $@ 5.5.4 $: "553 Real domain name required for sender address"
1049 R$* $: <?> $>CanonAddr $1 canonify sender address and mark it
1050 R<?> $* < @ $+ . > <?> $1 < @ $2 > strip trailing dots
1051 # handle non-DNS hostnames (*.bitnet, *.decnet, *.uucp, etc)
1052 R<?> $* < @ $* $=P > $: <OKR> $1 < @ $2 $3 >
1053 R<?> $* < @ $j > $: <OKR> $1 < @ $j >
1054 R<?> $* < @ $+ > $: <? $(resolve $2 $: $2 <PERM> $) > $1 < @ $2 >
1055 R<? $* <$->> $* < @ $+ >
1059 # handle case of no @domain on address
1060 R<?> $* $: $&{daemon_flags} $| <?> $1
1061 R$* u $* $| <?> $* $: <OKR> $3
1063 R<?> $* $: < ? $&{client_addr} > $1
1064 R<?> $* $@ <OKR> ...local unqualed ok
1065 R<? $+> $* $#error $@ 5.5.4 $: "553 Domain name required for sender address " $&f
1068 R<?> $* $: @ $1 mark address: nothing known about it
1069 R<$={ResOk}> $* $: @ $2 domain ok
1070 R<TEMP> $* $#error $@ 4.1.8 $: "451 Domain of sender address " $&f " does not resolve"
1071 R<PERM> $* $#error $@ 5.1.8 $: "553 Domain of sender address " $&f " does not exist"
1075 ######################################################################
1076 ### check_rcpt -- check SMTP `RCPT TO:' command argument
1077 ######################################################################
1081 R$* $: $1 $| $>"Local_check_rcpt" $1
1083 R$* $| $* $@ $>"Basic_check_rcpt" $1
1087 R<> $#error $@ nouser $: "553 User address required"
1088 R$@ $#error $@ nouser $: "553 User address required"
1089 # check for deferred delivery mode
1090 R$* $: < $&{deliveryMode} > $1
1091 R< d > $* $@ deferred
1095 ######################################################################
1096 R$* $: $1 $| @ $>"Rcpt_ok" $1
1097 R$* $| @ $#TEMP $+ $: $1 $| T $2
1099 R$* $| @ RELAY $@ RELAY
1100 R$* $| @ $* $: O $| $>"Relay_ok" $1
1101 R$* $| T $+ $: T $2 $| $>"Relay_ok" $1
1102 R$* $| $#TEMP $+ $#error $2
1104 R$* $| RELAY $@ RELAY
1105 R T $+ $| $* $#error $1
1106 # anything else is bogus
1107 R$* $#error $@ 5.7.1 $: "550 Relaying denied"
1110 ######################################################################
1111 ### Rcpt_ok: is the recipient ok?
1112 ######################################################################
1114 R$* $: $>ParseRecipient $1 strip relayable hosts
1119 # authenticated via TLS?
1120 R$* $: $1 $| $>RelayTLS client authenticated?
1121 R$* $| $# $+ $# $2 error/ok?
1124 R$* $: $1 $| $>"Local_Relay_Auth" $&{auth_type}
1127 R$* $| $* $: $1 $| $&{auth_type}
1129 R$* $| $={TrustAuthMech} $# RELAY
1131 # anything terminating locally is ok
1132 R$+ < @ $=w > $@ RELAY
1133 R$+ < @ $* $=R > $@ RELAY
1138 # check for local user (i.e. unqualified address)
1140 R<?> $* < @ $+ > $: <REMOTE> $1 < @ $2 >
1145 ######################################################################
1146 ### Relay_ok: is the relay/sender ok?
1147 ######################################################################
1149 # anything originating locally is ok
1151 R$* $: $&{client_addr}
1152 R$@ $@ RELAY originated locally
1153 R0 $@ RELAY originated locally
1154 R127.0.0.1 $@ RELAY originated locally
1155 RIPv6:::1 $@ RELAY originated locally
1156 R$=R $* $@ RELAY relayable IP address
1157 R$* $: [ $1 ] put brackets around it...
1158 R$=w $@ RELAY ... and see if it is local
1161 # check client name: first: did it resolve?
1162 R$* $: < $&{client_resolve} >
1163 R<TEMP> $#TEMP $@ 4.4.0 $: "450 Relaying temporarily denied. Cannot resolve PTR record for " $&{client_addr}
1164 R<FORGED> $#error $@ 5.7.1 $: "550 Relaying denied. IP name possibly forged " $&{client_name}
1165 R<FAIL> $#error $@ 5.7.1 $: "550 Relaying denied. IP name lookup failed " $&{client_name}
1166 R$* $: <@> $&{client_name}
1167 # pass to name server to make hostname canonical
1168 R<@> $* $=P $:<?> $1 $2
1169 R<@> $+ $:<?> $[ $1 $]
1170 R$* . $1 strip trailing dots
1172 R<?> $* $=R $@ RELAY
1178 ######################################################################
1179 ### trust_auth: is user trusted to authenticate as someone else?
1182 ### $1: AUTH= parameter from MAIL command
1183 ######################################################################
1187 R$* $: $&{auth_type} $| $1
1188 # required by RFC 2554 section 4.
1189 R$@ $| $* $#error $@ 5.7.1 $: "550 not authenticated"
1190 R$* $| $&{auth_authen} $@ identical
1191 R$* $| <$&{auth_authen}> $@ identical
1192 R$* $| $* $: $1 $| $>"Local_trust_auth" $2
1194 R$* $#error $@ 5.7.1 $: "550 " $&{auth_authen} " not allowed to act as " $&{auth_author}
1196 ######################################################################
1197 ### Relay_Auth: allow relaying based on authentication?
1200 ### $1: ${auth_type}
1201 ######################################################################
1204 ######################################################################
1205 ### srv_features: which features to offer to a client?
1206 ### (done in server)
1207 ######################################################################
1211 ######################################################################
1212 ### try_tls: try to use STARTTLS?
1213 ### (done in client)
1214 ######################################################################
1218 ######################################################################
1219 ### tls_rcpt: is connection with server "good" enough?
1220 ### (done in client, per recipient)
1224 ######################################################################
1228 ######################################################################
1229 ### tls_client: is connection with client "good" enough?
1230 ### (done in server)
1233 ### ${verify} $| (MAIL|STARTTLS)
1234 ######################################################################
1236 R$* $| $* $@ $>"TLS_connection" $1
1238 ######################################################################
1239 ### tls_server: is connection with server "good" enough?
1240 ### (done in client)
1244 ######################################################################
1246 R$* $@ $>"TLS_connection" $1
1248 ######################################################################
1249 ### TLS_connection: is TLS connection "good" enough?
1253 ### Requirement: RHS from access map, may be ? for none.
1254 ######################################################################
1256 RSOFTWARE $#error $@ 4.7.0 $: "403 TLS handshake."
1259 ######################################################################
1260 ### RelayTLS: allow relaying based on TLS authentication
1264 ######################################################################
1268 ######################################################################
1269 ### authinfo: lookup authinfo in the access map
1272 ### $1: {server_name}
1273 ### $2: {server_addr}
1274 ######################################################################
1282 ######################################################################
1283 ######################################################################
1285 ##### MAIL FILTER DEFINITIONS
1287 ######################################################################
1288 ######################################################################
1291 ######################################################################
1292 ######################################################################
1294 ##### MAILER DEFINITIONS
1296 ######################################################################
1297 ######################################################################
1300 ##################################################
1301 ### Local and Program Mailer specification ###
1302 ##################################################
1304 ##### $Id: local.m4,v 8.59 2004/11/23 00:37:25 ca Exp $ #####
1307 # Envelope sender rewriting
1310 R<@> $n errors to mailer-daemon
1311 R@ <@ $*> $n temporarily bypass Sun bogosity
1312 R$+ $: $>AddDomain $1 add local domain if needed
1313 R$* $: $>MasqEnv $1 do masquerading
1316 # Envelope recipient rewriting
1319 R$+ < @ $* > $: $1 strip host part
1320 R$+ + $* $: < $&{addr_type} > $1 + $2 mark with addr type
1321 R<e s> $+ + $* $: $1 remove +detail for sender
1322 R< $* > $+ $: $2 else remove mark
1325 # Header sender rewriting
1328 R<@> $n errors to mailer-daemon
1329 R@ <@ $*> $n temporarily bypass Sun bogosity
1330 R$+ $: $>AddDomain $1 add local domain if needed
1331 R$* $: $>MasqHdr $1 do masquerading
1334 # Header recipient rewriting
1337 R$+ $: $>AddDomain $1 add local domain if needed
1338 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1341 # Common code to add local domain name (only if always-add-domain)
1345 Mlocal, P=/usr/bin/procmail, F=lsDFMAw5:/|@qSPfhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
1346 T=DNS/RFC822/X-Unix,
1347 A=procmail -Y -a $h -d $u
1348 Mprog, P=/bin/sh, F=lsDFMoqeu9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
1349 T=X-Unix/X-Unix/X-Unix,
1352 #####################################
1353 ### SMTP Mailer specification ###
1354 #####################################
1356 ##### $Id: smtp.m4,v 8.65 2006/07/12 21:08:10 ca Exp $ #####
1359 # common sender and masquerading recipient rewriting
1362 R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
1363 R$+ $@ $1 < @ *LOCAL* > add local qualification
1366 # convert pseudo-domain addresses to real domain addresses
1370 # pass <route-addr>s through
1371 R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr>
1373 # output fake domains as user%fake@relay
1375 # do UUCP heuristics; note that these are shared with UUCP mailers
1376 R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form
1377 R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form
1379 # leave these in .UUCP form to avoid further tampering
1380 R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. >
1381 R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 >
1382 R< $&h ! > $+ $@ $1 < @ $&h .UUCP. >
1383 R< $+ ! > $+ $: $1 ! $2 < @ $Y > use UUCP_RELAY
1384 R$+ < @ $~[ $* : $+ > $@ $1 < @ $4 > strip mailer: part
1385 R$+ < @ > $: $1 < @ *LOCAL* > if no UUCP_RELAY
1389 # envelope sender rewriting
1392 R$+ $: $>PseudoToReal $1 sender/recipient common
1393 R$* :; <@> $@ list:; special case
1394 R$* $: $>MasqSMTP $1 qualify unqual'ed names
1395 R$+ $: $>MasqEnv $1 do masquerading
1399 # envelope recipient rewriting --
1400 # also header recipient if not masquerading recipients
1403 R$+ $: $>PseudoToReal $1 sender/recipient common
1404 R$+ $: $>MasqSMTP $1 qualify unqual'ed names
1405 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1408 # header sender and masquerading header recipient rewriting
1411 R$+ $: $>PseudoToReal $1 sender/recipient common
1412 R:; <@> $@ list:; special case
1414 # do special header rewriting
1415 R$* <@> $* $@ $1 <@> $2 pass null host through
1416 R< @ $* > $* $@ < @ $1 > $2 pass route-addr through
1417 R$* $: $>MasqSMTP $1 qualify unqual'ed names
1418 R$+ $: $>MasqHdr $1 do masquerading
1422 # relay mailer header masquerading recipient rewriting
1425 R$+ $: $>MasqSMTP $1
1428 Msmtp, P=[IPC], F=mDFMuX, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1431 Mesmtp, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1434 Msmtp8, P=[IPC], F=mDFMuX8, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1437 Mdsmtp, P=[IPC], F=mDFMuXa%, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1440 Mrelay, P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,
1444 ### generic-linux.mc ###
1447 # # Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
1448 # # All rights reserved.
1449 # # Copyright (c) 1983 Eric P. Allman. All rights reserved.
1450 # # Copyright (c) 1988, 1993
1451 # # The Regents of the University of California. All rights reserved.
1453 # # By using this file, you agree to the terms and conditions set
1454 # # forth in the LICENSE file which can be found at the top level of
1455 # # the sendmail distribution.
1460 # # This is a generic configuration file for Linux.
1461 # # It has support for local and SMTP mail only. If you want to
1462 # # customize it, copy it to a name appropriate for your environment
1463 # # and do the modifications there.
1467 # VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
1469 # DOMAIN(generic)dnl