# # Copyright (c) 1983, 1995 Eric P. Allman # Copyright (c) 1988, 1993 # The Regents of the University of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by the University of # California, Berkeley and its contributors. # 4. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # @(#)proto.v7 3.91 (motonori/WIDE) 30 Nov 1997 # @(#)version.v7 3.6 (motonori/WIDE) 27 Apr 1997 # @(#)ostype 3.4 (motonori/WIDE) 26 Feb 1994 # @(#)bsd4.4 3.4 (motonori/WIDE) 25 Jan 1994 # @(#)general 3.14 (motonori/WIDE) 21 Apr 1997 # @(#)address 3.13 (motonori/WIDE) 08 Jul 1997 # @(#)canon 3.15 (motonori/WIDE) 08 Jun 1996 # @(#)acceptaddr 3.22 (motonori/WIDE) 02 Feb 1997 # @(#)mailer.v7 3.21 (motonori/WIDE) 29 Jun 1997 # @(#)another_addr 3.9 (motonori/WIDE) 10 Jun 1997 # @(#)numeric 3.7 (motonori/WIDE) 20 Sep 1994 # @(#)indirect 3.21 (motonori/WIDE) 24 Jun 1997 # @(#)error 3.16 (motonori/WIDE) 17 Sep 1996 # @(#)option.v7 3.49 (motonori/WIDE) 10 Nov 1997 ############################################################################ ############################################################################ ##### ##### SENDMAIL CONFIGURATION FILE ##### for sendmail 8.7 or later ##### ##### built by eto on saba.home ##### in /usr/local/src/CF-3.6W ##### with saba.def ##### at Mon Aug 17 23:14:12 JST 1998 ##### ############################################################################ ############################################################################ # class/macro characters allocation information # macro X: MX sendmail flag (define "." if true) [allocchar] # class X: fake domain list and special terminators [allocchar] # macro Z: CF version [version.v7] # pair S: from address/local users [address] # class Z: accepting address [acceptaddr] # macro Y: another address [another_addr] # pair R: default gateway/domain for direct delivery [indirect] # level 7 config file format V7/Berkeley ######################### # Local Information # ######################### # local domain name (defined automatically) #Dmmy.domain.name # local host name without domain (defined automatically) #Dwmyname # my official SMTP hostname (defined automatically) #Dj$w.$m # my internet aliases #Fw/etc/sendmail.cw #Cw myaliasnames Cw localhost local # address which should be accepted #FZ/etc/sendmail.aa CZ home # users who require host.domain CS root daemon news usenet postmaster MAILER-DAEMON # default from-address (can be $j, $m or another generic address) DS$j # special another address for specific destination DYmwa.biglobe.ne.jp # default relay host DRsmtp2:mwa.biglobe.ne.jp # domains for direct delivery CR .home # operators that cannot be in local usernames (i.e., network indicators) C@ @ % ! # dequoting map Kdequote dequote ############################# ### Setup Information ### ############################# ###################### # General Macros # ###################### # need trailing dot for MX lookup DX. ############### # Classes # ############### # Internal ("fake") domains that we use in rewriting CX UUCP # and special terminators CX ] . ###################### # Version Number # ###################### DZ3.6W ###################### # Special macros # ###################### # my name DnMAILER-DAEMON # format of a total name Dq$?x$x <$g>$|$g$. ############### # Options # ############### # strip message body to 7 bits on input? O SevenBitInput=False # 8-bit data handling O EightBitMode=pass8 # location of alias file O AliasFile=/etc/aliases # wait for alias file rebuild (default units: minutes) O AliasWait=10 # maximum message size #O MaxMessageSize=1000000 # substitution for space (blank) characters O BlankSub=. # minimum number of free blocks on filesystem O MinFreeBlocks=100 # checkpoint queue runs after every N successful deliveries O CheckpointInterval=10 # avoid connecting to "expensive" mailers on initial submission? O HoldExpensive=False # automatically rebuild the alias database? O AutoRebuildAliases=False # default delivery mode O DeliveryMode=background # error message header/file #O ErrorHeader=/etc/sendmail.oE # error mode #O ErrorMode=print # temporary file mode O TempFileMode=0600 # save Unix-style "From_" lines at top of header? O SaveFromLine=False # match recipients against GCOS field? O MatchGECOS=False # location of help file O HelpFile=/usr/share/misc/sendmail.hf # maximum hop count O MaxHopCount=25 # name resolver options O ResolverOptions= # ignore dots as terminators in incoming messages? O IgnoreDots=False # Forward file search path #O ForwardPath=/var/forward/$u:$z/.forward.$w:$z/.forward # deliver MIME-encapsulated error messages? O SendMimeErrors=True # open connection cache timeout O ConnectionCacheTimeout=5m # open connection cache size O ConnectionCacheSize=1 # log level O LogLevel=9 # use Errors-To: header? O UseErrorsTo=False # send to me too, even in an alias expansion? O MeToo=True # verify RHS in newaliases? O CheckAliases=True # SMTP daemon options #O DaemonPortOptions=Port=esmtp # default messages to old style headers if no special punctuation? O OldStyleHeaders=True # who (if anyone) should get extra copies of error messages #O PostMasterCopy=postmaster # privacy flags O PrivacyOptions=authwarnings # queue directory O QueueDirectory=/var/spool/mqueue # slope of queue-only function #O QueueFactor=600000 # should we not prune routes in route-addr syntax addresses? #O DontPruneRoutes=False # timeouts (many of these) #O Timeout.initial=5m #O Timeout.helo=5m #O Timeout.mail=10m #O Timeout.rcpt=1h #O Timeout.datainit=5m #O Timeout.datablock=1h #O Timeout.datafinal=1h #O Timeout.connect=5m #O Timeout.iconnect=5m #O Timeout.rset=5m #O Timeout.quit=2m #O Timeout.misc=2m #O Timeout.command=1h #O Timeout.ident=30s #O Timeout.fileopen=60s O Timeout.queuereturn=5d #O Timeout.queuereturn.normal=5d #O Timeout.queuereturn.urgent=2d #O Timeout.queuereturn.non-urgent=7d #O Timeout.queuewarn=4h #O Timeout.queuewarn.normal=4h #O Timeout.queuewarn.urgent=1h #O Timeout.queuewarn.non-urgent=12h #O Timeout.hoststatus=12h # status file O StatusFile=/var/log/sendmail.st # queue up everything before forking? O SuperSafe=True # time zone handling: # if undefined, use system default # if defined but null, use TZ envariable passed in # if defined and non-null, use that info #O TimeZoneSpec= # list of locations of user database file (null means no lookup) O UserDatabaseSpec= # default UID (can be username or userid:groupid) O DefaultUser=1:1 # fallback MX host #O FallbackMXhost=fall.back.host.net # if we are the best MX host for a site, try it directly instead of config err O TryNullMXList=False # load average at which we refuse connections O RefuseLA=12 # load average at which we just queue messages O QueueLA=8 # deliver each queued job in a separate process? O ForkEachJob=False # work recipient factor #O RecipientFactor=30000 # work time factor #O RetryFactor=90000 # work class factor #O ClassFactor=1800 # shall we sort the queue by hostname first? #O QueueSortOrder=priority # minimum time in queue before retry #O MinQueueAge=30m # default character set #O DefaultCharSet=iso-8859-1 # service switch file (ignored on Solaris, Ultrix, OSF/1, others) #O ServiceSwitchFile=/etc/service.switch # hosts file (normally /etc/hosts) #O HostsFile=/etc/hosts # dialup line delay on connection failure #O DialDelay=10s # action to take if there are no recipients in the message #O NoRecipientAction=10s # chrooted environment for writing to files #O SafeFileEnvironment=/arch # are colons OK in addresses? O ColonOkInAddr=False # how many jobs can you process in the queue? #O MaxQueueRunSize=10000 # shall I avoid expanding CNAMEs (violates protocols)? O DontExpandCnames=False # SMTP initial login message (old $e macro) O SmtpGreetingMessage=$j Sendmail $v/$Z; $b # UNIX initial From header format (old $l macro) O UnixFromLine=From $g $d # delimiter (operator) characters (old $o macro) O OperatorChars=.:%@!^=/[]|+ # shall I avoid calling initgroups(3) because of high NIS costs? O DontInitGroups=False # make sure from fits on one line #O SingleLineFromHeader=False # allow HELO commands with syntax errors #O AllowBogusHELO=False # connection rate throttle #O ConnectionRateThrottle=3 # group writable files are unsafe #O UnsafeGroupWrites=False # address to which to send double bounces #O DoubleBounceAddress=postmaster # persistent host status directory #O HostStatusDirectory=.hoststat # single thread deliveries (requires hsdir) #O SingleThreadDelivery=False # run bulk of code as this user #O RunAsUser=postmaster ########################### # Message precedences # ########################### Pfirst-class=0 Pspecial-delivery=100 Plist=-30 Pbulk=-60 Pjunk=-100 ##################### # Trusted users # ##################### # this is equivalent to setting class "t" T root daemon uucp #Ft /etc/sendmail.ct ######################### # Format of headers # ######################### H?P?Return-Path: <$g> #HReceived: $?sfrom $s $.$?_($?s$|from $.$_) # $.by $j ($v/$Z)$?r with $r$. id $i$?u # for $u; $|; # $.$b H?D?Resent-Date: $a H?D?Date: $a H?F?Resent-From: $q H?F?From: $q # H?x?Full-Name: $x HSubject: # HPosted-Date: $a # H?l?Received-Date: $b H?M?Resent-Message-Id: <$t.$i@$j> H?M?Message-Id: <$t.$i@$j> ###################################################################### ###################################################################### ##### ##### REWRITING RULES ##### ###################################################################### ###################################################################### ################################################ ### Rulset 1 -- Sender Field Pre-rewriting ### ################################################ S1 ################################################### ### Rulset 2 -- Recipient Field Pre-rewriting ### ################################################### S2 ########################################### ### Rulset 3 -- Name Canonicalization ### ########################################### S3 # handle null input and list syntax (translate to <@> special case) R$@ $@<@> # strip group: syntax (not inside angle brackets!) and trailing semicolon R$* $:$1<@> mark addresses R$*<$*>$*<@> $:$1<$2>$3 unmark R:include:$*<@> $::include:$1 unmark :include: R$*[$*:$*]<@> $:$1[$2:$3] unmark IPv6 addrs R$*::$*<@> $:$1::$2 unmark host::addr #R$*:;<@> $:$1:; unmark list:; R$*:;<@> $@ list:; special case R$*:<@> $:$1: unmark something: (bad) R$*:$*;<@> $:$2 strip group:; if marked R@$*:$*<@> $:@$1:$2 unmark @route:addr R$*:$*<@> $:$2 strip group: if marked R$*;<@> $:$1 strip semi if marked R$*<@> $:$1 unmark # basic textual canonicalization -- note RFC733 heuristic here R$*<$*>$*<$*>$* $2$3<$4>$5 strip multiple <> <> R$*<$*<$*<$+>$*>$*>$* $4 3-level <> nesting R$*<$*<$+>$*>$* $3 2-level <> nesting R$*<>$* $@<@> MAIL FROM: <> case R$*<$+>$* $2 basic RFC821/822 parsing # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later R@$+,$+ @$1:$2 change all "," to ":" # localize and dispose of route-based addresses R@$+:$+ $@$>96 <@$1>:$2 handle # find focus for list syntax R$+:$*;@$+ $@$1:$2;<@$3> list syntax R$+:$*; $@$1:$2;<@> list syntax # find focus for @ syntax addresses R$+@$+ $:$1<@$2> focus on domain R$+<$+@$+> $1$2<@$3> move gaze right R$+<@$+> $@$>96 $1<@$2> already canonical # convert old-style addresses to a domain-based address R$-!$+ $@$>96 $2<@$1.UUCP> resolve uucp names R$+.$-!$+ $@$>96 $3<@$1.$2> domain uucps R$+.!$+ $@$>96 $2<@$1> extended domain uucps R$*!$* $@$>96 $2<@$1.UUCP> uucp subdomains # if we have % signs, take the rightmost one R$+%$+ $1@$2 First make them all @s. R$+@$+@$+ $1%$2@$3 Undo all but the last. R$+@$+ $@$>96 $1<@$2> Insert < > and finish # trap invalid address R@$* $@<@$1> ################################################ ### Ruleset 96 -- bottom half of ruleset 3 ### ################################################ # At this point, everything should be in a "local_part<@domain>extra" format. S96 # strip trailing dot off R$*<@$+.>$* $1<@$2>$3 # resolve numeric addresses to name if possible R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 R$*<@$+.>$* $1<@$2>$3 strip trailing dot off R$*<@$=w.UUCP>$* $:$1<@$j>$3 R$*<@$=w.$m>$* $:$1<@$j>$3 R$*<@$=w>$* $:$1<@$j>$3 # exit immidiately, if fake domains or numeric address spec R$*<@$*.$=X>$* $@$1<@$2.$3>$4 # acceptable domains are OK R$*<@$=Z>$* $@$1<@$2>$3 # official name is OK R$*<@$j>$* $@$1<@$j>$2 # more than one token is OK R$*<@$-.$+>$* $@$1<@$2.$3>$4 # canonicalize with nameserver lookup R$*<@$*>$* $:$1<@$[$2$]>$3 # strip trailing dot off possibly canonical name R$*<@$+.>$* $1<@$2>$3 ################################################## ### Ruleset 4 -- Final Output Post-rewriting ### ################################################## S4 R<> $@<> handle <> for uucp R<@> $@<> catch invalid address R$*<@> $@$1 handle <> and list:; # strip trailing dot off possibly canonical name R$*<@$+.>$* $1<@$2>$3 # externalize local domain info R$*<$+>$* $1$2$3 defocus R@$+:@$+:$+ @$1,@$2:$3 canonical R@$* $@@$1 ... and exit # UUCP must always be presented in old form R$+@$+.UUCP $2!$1 u@h.UUCP => h!u # delete duplicate local names R$+%$=w@$j $1@$j u%host@host => u@host R$+%$=w@$=Z $1@$j u%host@dom => u@host R$+%$=Z@$j $1@$2 u%dom@host => u@dom R$+%$=Z@$=Z $1@$2 u%dom@dom => u@dom ############################################################ ### Ruleset 97 -- recanonicalize and call ruleset zero ### ### (used for recursive calls) ### ############################################################ S97 R$*<$-.$+>$* $:$1$2.$3$4 defocus R$* $:$>3 $1 canonicalize R$* $:$>0 $1 and try again #################################### ### Ruleset 0 -- Parse Address ### #################################### S0 R$*:;<@> $#error$@5.1.3$: List:; syntax illegal for recipient addresses R$*<@> $#local$:<@> special case error msgs R<@$+> $#error$@5.1.1$: User address required R$*<$*:$*>$* $#error$@5.1.1$: Colon illegal in host name part R$*<@.$*>$* $#error$@5.1.2$: Illegal address spec R$*<@$*..$*>$* $#error$@5.1.2$: Illegal address spec R$*<@$*[$*>$* $:<[]>$1<@$2[$3>$4 mark if with [ R<[]>$*<@$*[$*]$*>$* $:$1<@$2[$3]$4>$5 unmark if with [ ] R$*<@$*]$*>$* $:<[]>$1<@$2]$3>$4 mark if with ] R<[]>$*<@$*[$*]$*>$* $:$1<@$2[$3]$4>$5 unmark if with [ ] R<[]>$*<@$*>$* $#error$@4.1.2$: Unballanced [ ] # handle numeric address spec R$*<@[$+]>$* $:$>88 .$1<@[$2]>$3 numeric internet spec # now delete the local info R$*<@>$* $@$>97 $1 user@ => user R<@$j>:$* $@$>97 $1 @here:... -> ... R$*<@$j> $@$>97 $1 ...@here -> ... R<@$=Z>:$* $@$>97 $2 @here:... -> ... R$*<@$=Z> $@$>97 $1 ...@here -> ... # resolve SMTP traffic R$*<@$*$=R>$* $:$>88 .$1<@$2$3>$4 R$*<@$*>$* $:$>88 <$R>.$1<@$2>$3 # if this is quoted, strip the quotes and try again R$+ $:$(dequote $1 $) strip quotes R$+$=@$+ $@$>97 $1$2$3 try again # remaining names must be local R$* $#local$:$1 regular names ######################################################################### ### Ruleset 5 -- special rewriting after aliases have been expanded ### ######################################################################### S5 ############################################## ### Ruleset 88 -- dispatching to mailers ### ############################################## S88 R<>.$* $@$1 strip off null relay R<$-:>.$* $@$2 strip off null relay R.$*<@$*>$* $#error$@5.1.1$: can not deliver to $2 R.$*<@$-.$*>$* $#error$@5.1.2$: never heard of $2 in domain $3 R.$* $#error$@$1.$2.$3$: $4 R.$* $#error$@5.1.0$: $1 R.<@$*>:$* $@$>97 $2 local address, retry R.$*<@$*> $@$>97 $1 local address, retry R.$* $@$>97 $1 special case local R<$=w>.$*<$*>$* $@$>97 $2$3$4 delete local host R<$-:$=w>.$*<$*>$* $@$>97 $3$4$5 delete local host R<$-:$=w>.$* $#local$:@$3 local R<$=Z>.$*<$*>$* $@$>97 $2$3$4 delete local host R<$-:$=Z>.$*<$*>$* $@$>97 $3$4$5 delete local host R.$*<@$*>$* $:.$1<@$2>$3 deliver w/o MX lookup R<$-:ignmx>.$*<@$*>$* $:<$1:[$3]>.$2<@$3>$4 deliver w/o MX lookup R.$* $:.$2 deliver w/o MX lookup R<$-:ignmx:$*>.$* $:<$1:[$2]>.$3 deliver w/o MX lookup R.$*<@$*>$* $:.$1<@$2>$3 deliver with MX lookup R<$-:mx>.$*<@$*>$* $:<$1:$3$X>.$2<@$3>$4 deliver with MX lookup R.$*<@$*>$* $:.$2<@$3>$4 deliver with MX, static R<$-:mx:$*>.$*<@$*>$* $:<$1:$4$X:$2>.$3<@$4>$5 deliver with MX, static R<$-:$+@$+>.$* $:<$1:$3>.$2<@$3> special case deliver R.$* $#relay$@$1$2$X$:$3 send to relay R.$* $#smtp$@$1$2$X$:$3 send to destination R.$* $#esmtp$@$1$2$X$:$3 send to destination R.$* $#smtp8$@$1$2$X$:$3 send to destination R<$-:$+>.$* $#$1$@$2$:$3 with specific mailer R<$*$~X>.$* $#smtp$@$1$2$X$:$3 multi-token: smtp R<$+>.$* $#smtp$@$1$:$2 multi-token: smtp ###################################################################### ###################################################################### ##### ##### MAILER DEFINITIONS ##### ###################################################################### ###################################################################### Mlocal, P=/usr/libexec/mail.local, F=lsDFMAw5:/|@qrmn, S=10, R=20/0, T=DNS/RFC822/X-Unix, A=mail -d $u Mprog, P=/bin/sh, F=lsDFMoqeuP, S=10, R=20/0, T=X-Unix, D=$z:/, A=sh -c $u Msmtp, P=[IPC], F=mDFuX, S=11, R=21, T=DNS/RFC822/SMTP, E=\r\n, L=990, A=IPC $h Msmtp2, P=[IPC], F=mDFuX, S=16, R=26, T=DNS/RFC822/SMTP, A=IPC $h, E=\r\n, L=990 Mesmtp, P=[IPC], F=mDFMuXa, S=11, R=21, T=DNS/RFC822/SMTP, E=\r\n, L=990, A=IPC $h Msmtp8, P=[IPC], F=mDFMuX8, S=11, R=21, T=DNS/RFC822/SMTP, E=\r\n, L=990, A=IPC $h Mrelay, P=[IPC], F=mDFMuX8, S=11, R=29, T=DNS/RFC822/SMTP, E=\r\n, L=2040, A=IPC $h ############################## # Sender field rewriting # ############################## S10 R<@> $n errors to mailer-daemon S11 R$*<@$*>$* $@$1<@$2>$3 already qualified # output local host as user@host.domain R$=S $@$1<@$j> show exposed names R$+ $@$1<@$S> user w/o host S16 R$+<@$=w> $@$1<@$Y> my name R$+<@$=Z> $@$1<@$Y> accept addrs R$*<@$*>$* $@$>11 $1<@$2>$3 already qualified R$+ $@$1<@$Y> user w/o host ################################## # Receipient field rewriting # ################################## S20 R$+<@$*> $:$1 strip host part S21 R$+<@$+.UUCP> $@$2!$1 user@host.UUCP R$*<@$*>$* $@$1<@$2>$3 already qualified # output local host as user@host.domain R$=S $@$1<@$j> show exposed names R$+ $@$1<@$j> user w/o host S26 R$+<@$=w> $@$1<@$Y> my name R$+<@$=Z> $@$1<@$Y> accept addrs R$*<@$*>$* $@$>21 $1<@$2>$3 already qualified R$+ $@$1<@$Y> user w/o host Scheck_compat R$+ $| $+ $: $2 $| $>3 $1 R$+ $| $+ $: $2 $| $>3 $1 Rhnakamur $| $* $@ OK Rhnakamur<@$+> $| $* $@ OK Rnobody $| $* $@ OK Rnobody<@$+> $| $* $@ OK R$* $| $*<@$+>$* $# error $: no permission R$* $| $* $@ OK