SUMMARY: Mail problems

From: Usuario novato <osf_at_xosfulsa.ulsa.mx>
Date: Fri, 9 Aug 1996 09:36:44 -0600 (CST)

I had some problems with my mails. Every time we sent one, it was
returned back to my home directory, with the message "rewrite: map _at_ not
found", and when trying to fix it, we had another problem about the
domain name. But right now it` working ok.

   THANKS A LOT TO DAVE SINNOTT !!! (dave_at_persimmon.com)

Here it is the correct version of sendmail.cf (the one that is working ok).

***************************************************************************

############################################################
############################################################
#####
##### SENDMAIL CONFIGURATION FILE
#####
#
# *****************************************************************
# * *
# * Copyright (c) Digital Equipment Corporation, 1991, 1995 *
# * *
# * All Rights Reserved. Unpublished rights reserved under *
# * the copyright laws of the United States. *
# * *
# * The software contained on this media is proprietary to *
# * and embodies the confidential technology of Digital *
# * Equipment Corporation. Possession, use, duplication or *
# * dissemination of the software and media is authorized only *
# * pursuant to a valid written license from Digital Equipment *
# * Corporation. *
# * *
# * RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
# * by the U.S. Government is subject to restrictions as set *
# * forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
# * or in FAR 52.227-19, as applicable. *
# * *
# *****************************************************************
#
##### generic configuration
#####
#####
############################################################
############################################################
#
# NOTE: This is a generic sendmail.cf file. Please use mailsetup to
# change configuration.
#
# EDIT-- IMPORTANT!! enter your unqualified host name here if your hostname
# EDIT-- for your machine is qualified. For example, if your hostname was
# EDIT-- foo.dec.com then the enter DAfoo and comment DA$w.
DAxosfulsa
#
# EDIT-- this is added in answer to a question "What is your domain? "
# EDIT-- this is used for all hosts.
# EDIT-- **IMPORTANT** when setting this macro make sure you set the
# EDIT-- $A macro (above) is the unqualified host name!!!!
DDulsa.mx

## predefined
# $y decnet node name (if known) (if running a recent binary)
# $w fully-qualified hostname
# $j same as $w (except IDA, which is all-lower-case, strip-at-first-dot)
##

############################################################ _at_Ltag(LocalInfo)
### local info
############################################################
# EDIT-- Top Level or parent domain - the reason for this is if
# EDIT-- you can directly reach hosts in this domain via IP but not
# EDIT-- outside -- through the gateways. It is also used for
# EDIT-- address encapsulation.
DP$D

# my domain
DN$D

# name exported on external internet mail
DW$w

# my official hostname
Dj$w

# EDIT-- this is added in answer to a question basically asked
# EDIT-- to determine what to do whenyou dont know how to deliver.
# EDIT-- Who gets the mail? Can be empty...
# EDIT-- if for Tcpip host should be fully qualified name
#DRgeneralpurposerelay

Dy$A
# $=J[.$P] is gatewayed through $J or sent via DECNET/MAIL11
# $=K[.$P] is gatewayed through $K or sent via DECNET/UMC
# if $J ($K) is undefined; will just use MX records (i.e. $#smtp)
# if set to $j will cause mail to be sent via mail11 from this host
#
# Easynet/Mail11
#
# (DNET is hardcoded here because DEC's mail11d generates it; $=J should not
# include $E or $F since these are likely to be multi-token which only IDA
# can handle in class matches. UTK Mail11D generates .DNET or .ENET (depending
# on your compile-time configuration). $=J must include whatever your Mail11D
# is generating which in the case of UTK with .ENET would make you want to
# set your ENET to ENET.)
#
CJDNET ENET
DJ$j
DEENET
DI$j
DFD5NET

# Phase V namespace
# EDIT-- enter your Phase V namespace here.
DXNAMESPACE
#
# MessageRouter/UMC
#
CKmts mr umc
# EDIT-- enter your UMC relay here.
#DKmr_relay
DMMTS
#
# UUCP
#
# EDIT-- enter your UUCP name here.
DU$A

#
# aliases at the $P level -- we think we are authoritative for these
#
Cddnet enet uucp

#
# usernames which will be _at_host qualified on outbound localdom mail
#
CNdaemon mailer-daemon news nobody pop postmaster rdist root uucp

#
# trash top-level domains -- don't use $[...$] on names ending with these
#
CTUUCP USENET UMC DNET ENET

############################################################
#
# General configuration information
#
############################################################

# Version Number
DV1.1.3.6

##########################
### Special macros ###
##########################

# my name
DnMAILER-DAEMON
# UNIX header format
DlFrom $g $d
# delimiter (operator) characters
Do.:%_at_!^=/[]
# format of a total name
Dq$?x$x $.<$g>
# SMTP login message
De$j Sendmail $v ($V) $b

###################
### Options ###
###################

# wait 5 minutes for newaliases to complete
Oa
# location of alias file
OA/var/adm/sendmail/aliases
# default delivery mode (deliver in background)
Odbackground
# temporary file mode
OF0600
# default UID
Ou1
# default GID
Og1
# location of help file
OH/usr/share/lib/sendmail.hf
# log level
OL9
# include sender if she's on an alias to which she's sending
Om
# queue directory
OQ/var/spool/mqueue
# read timeout -- violates protocols
Or1h
# status file
OS/var/adm/sendmail/sendmail.st
# queue up everything before starting transmission
Os
# use separate envelope/header rewriting rulesets (IDA)
O/
# default timeout interval
OT3d
# load average for forcing "Odq" behaviour
Ox20
# load average for refusing connections
#OX12
OX99

###############################
### Message precedences ###
###############################

Pfirst-class=0
Pspecial-delivery=100
Pjunk=-100

#########################
### Trusted users ###
#########################

Troot daemon uucp news

#############################
### Format of headers ###
#############################

H?P?Return-Path: <$g>
HReceived: by $j; id $i; $b
#HReceived: $?sfrom $s $.by $j; ($v/$V)
# id $i; $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:
H?M?Resent-Message-Id: <$t.$i_at_$j>
H?M?Message-Id: <$t.$i_at_$j>

###########################
### Rewriting rules ###
###########################

##
## S1/S2 (and S5/S6 in IDA) are called before the per-mailer S= and R= rwsets.
## for any address types which we export in native format (e.g., uucp !-form)
## rather than pseudodomain format (e.g., mail11 _at_node.decnet form), we need
## to undo the effects of S3/S7 here, so that the per-mailer rwsets will see
## them as "unqualified" and add the appropriate qualification to them. note
## that this is a deeply divisive issue; these so-called "mixed-mode" addresses
## (e.g., vixie!paul_at_decwrl.dec.com) have different interpretations depending
## on who you ask. since you're running our config file, you're getting our
## particular leanings. if you want it done some other way, do it yourself.
## (vix)

################################
# Sender Field Pre-rewriting #
################################
S1
R$+<_at_$-.UUCP> $2!$1 decapsulate UUCP
R$-_at_$+ $_at_$1_at_$N
R$- $_at_$1_at_$N

###################################
# Recipient Field Pre-rewriting #
###################################
S2
R$+<_at_$-.UUCP> $2!$1 decapsulate UUCP

###########################
# Name Canonicalization #
###########################
S3

# handle "from:<>" special case
R<> $_at__at_ turn into magic token

# route-addr's look canonical but aren't
R<_at_$+:$+>$* _at_$1:$2 unfocus <route-addr>

# already canonical?
R$*<_at_$+>$* $_at_$>7$1<_at_$2>$3 idempotency is good

# basic textual canonicalization -- note lack of RFC733 heuristic here
R$*<$+>$* $2 basic RFC822 parsing

# make sure <_at_a,_at_b,_at_c:user_at_d> syntax is easy to parse -- undone later
R_at_$+,$+ _at_$1:$2 change all "," to ":"
R_at_$+:$+ $_at_$>7<_at_$1>:$2 handle <route-addr>

# more miscellaneous cleanup
R$+:$*;$* $_at_$1:$2;$3 list syntax
R$+_at_$+ $:$1<_at_$2> focus on domain
R$+<$+_at_$+> $1$2<_at_$3> move gaze right
R$+_at_$+<_at_$+> $1%$2<_at_$3> a_at_b_at_c_at_d ->a%b%c_at_d

#
# DECNet. First turn all these addresses into :: form then back to _at_-form
# with a .pseudodomain approporiate to the protocol (phaseIV/phaseV/MR)
#

# (phase IV)
R$+<_at_$+.$E> $_at_$>7$1<_at_$2.$E> already encapsulated IV
R$+<_at_$-.$-.$=J> $:$2.$3::$1 u_at_aa.nnn.DNET
R$+<_at_$-.$=J> $:$2::$1 u_at_node.DNET

R$+<_at_$+.$=J> $1<_at_$2> not IV; try as a V

# (phase V)
R$+<_at_.$-.$+> $:.$2.$3::$1 u_at_.root.path
R$+<_at_$-:.$-.$+> $:$2:.$3.$4::$1 u_at_ns:.root.path
R$+<_at_%$-> $:%$2::$1 u_at_%nsap
# (all decnet addresses
# are now in ::-format,
# including the ones
# that came in that way;
# and the .DNET is gone.)

# things that are still in _at_-form are ready to eat
R$+<_at_$+> $_at_$>7$1<_at_$2> now canonical

# (phase IV conversions)
R$-.$-::$+ $_at_$>7$3<_at_$1.$2.$E> numeric decnet addr
R$-::$+ $_at_$>7$2<_at_$1.$E> h::u -> u_at_h.pseudodom

# (phase V conversions)
R%$-::$+ $_at_$>7$2<_at_$1.$F> %nsap::user
R.$-.$+::$+ $:$X:.$1.$2::$3 add default namespace
# (anything with a :: at
# this point is a NS-
# qualified phase V addr;
# there are NO _at_-signs)
R$-:.$-.$+::$+ $:$4_at_$3<_at_$2.$1> ns:.root.path
R$+_at_$-.$+<_at_$*> $1_at_$3<_at_$2.$4> shuffle tokens to end
R$+_at_$-<_at_$+> $_at_$>7$1<_at_$2.$3.$F> last token; remove dot

# UUCP conversions
R$-.$+!$+ $_at_$>7$3<_at_$1.$2> host.domain!user
R$-!$+ $_at_$>7$2<_at_$1.UUCP> resolve uucp names

# convert rightmost % to _at_ (ruleset 7 has the rest of the magic for this)
R$+%$+ $_at_$>7$1<_at_$2> user%host

# (ruleset 3 ends here. we don't exit through
# $>7 here as with the other exits from ruleset 3
# since we only exit through S7 when we make a
# change.)

##### special local conversions (exit path from S3)
S7
R$*<_at_$+%$+>$* $1%$2<_at_$3>$4 move _at_ right after %
R$*<_at_$+.$E>$* $_at_$1<_at_$2.$E.$P>$3 hide .$E under $P
R$*<_at_$+.$F>$* $_at_$1<_at_$2.$F.$P>$3 hide .$F under $P
R$*<_at_$+.$=K>$* $_at_$1<_at_$2.$M.$P>$4 .$=K -> $M.$P
R$+<_at_POP>$* $_at_$1<_at_POP>$2 POP already OK
R$*<_at_$->$* $_at_$1<_at_$2.$N>$3 qualify hostnames

#################################
# Final Output Post-rewriting #
#################################
S4

R_at_ $_at_ handle <> error addr
R$*<$+>$* $1$2$3 defocus
R_at_$+:$+:$+ _at_$1,$2:$3 <route-addr> canonical
R_at_$+:$+ $_at_<_at_$1:$2> route-addr needs <>

#################################
# (IDA) header senders #
#################################
S5
R$+ $_at_$>1$1 same as envelope

#################################
# (IDA) header recipients #
#################################
S6
R$+ $_at_$>2$1 same as envelope

#################################
# Utility: strip local domain #
#################################

# this is neccessarily tricky. S0 needs to strip off the local host(s) and
# it may take several passes to do that (consider $-%$j%$j%$j or $U!$-_at_$j).
# this requires iterate-until-no-change, which is a semantic not directly
# provided by sendmail. sendmail does permit recursion, though, which we
# use. S0 calls S8, which calls itself whenever it makes a change, else falls
# out the bottom when it has nothing left to strip.
#


# S8 starts by calling S3 since on the subsequent recursive calls, a change
# will have been made and the canonicalizion will have been lost. we would
# like to use $>8$>3 but that doesn't work the way you'd expect. the cost
# here is that S3 gets called once at the top even though S3 was called before
# S0 so there's nothing for it to do. this is why S3 must be idempotent and
# also why S3's "no change needed" condition is so close to its top.

S8

R$+ $:$>3$1 needed for recursions

R$*<_at_$j>$* $:$1<_at_>$2 _at_myfqdm
R$*<_at_$=w>$* $:$1<_at_>$3 _at_my alias
R$*<_at_$=w.$N>$* $:$1<_at_>$3 _at_my alias


R$*<_at_$y.$E.$P>$* $:$1<_at_>$2 myname:: (IV)
R$*<_at_$y.$F.$P>$* $:$1<_at_>$2 myname:: (V)

R$*<_at_$U.UUCP>$* $:$1<_at_>$2 myuucpname!

# here's where we recurse if a change was made
R<_at_>:$* $_at_$>8$1 localhost/route-addr
R$*<_at_>$* $_at_$>8$1$2 localhost

########################################
# Utility: canonicalize local domain #
########################################

S9

# (next four lines are only generated if $N isn't LOCAL)
R$*<_at_$->$* $:$1<_at_$2.$N>$3 qualify
R$*<_at_$+.$=T>$* $_at_$1<_at_$2.$3>$4 trash pseudodom, lv aln
R$*<_at_$+.$=T.$P>$* $_at_$1<_at_$2.$3.$P>$4 qualified trash, lv aln
R$*<_at_$+>$* $:$1<_at_$[$2$]>$3 canon'ize complex names

############################################################
############################################################
#####
##### RULESET 0
#####
############################################################
############################################################

S0

# special cases
#
R_at_ $#local $:$n handle <> form
R$*<_at_[$+]>$* $#smtp $_at_[$2] $:$1<_at_[$2]>$3 numeric internet spec

# localize if possible (rip off _at_DOMAINs for which we are authoritative)
#
R$*<_at_$+>$* $:$>8$1<_at_$2>$3

# DECNet/Mail11
#
# (phase IV)
R$+<_at_$+.$E.$P> $:$2_at__at_$1<_at_$2.$E.$P> dup nodename; add _at__at_
R$+_at__at_$+<_at_$+> $:$?J$1_at__at_$2??$3<_at_$J>$|$1_at__at_$2<_at_$3>$. mk _at_relay or lv alone
R$+_at__at_$+??$+<_at_$j> $#mail11 $_at_$1 $:$2 them is us; use mail11
R$+_at__at_$+??$+<_at_$J> $#smtp $_at_$J $:$2<_at_$3> undo damage; send now
R$+_at__at_$+??$+<_at_$+> $:$2<_at_$3> undo $?J damage
R$+_at__at_$+<_at_$+> $:$2<_at_$3> undo !$?J damage
# (phase V)
R$+<_at_$+.$F.$P> $:_at__at_$2_at__at_$1<_at_$2.$F.$P> dup nodename; add _at__at_ _at__at_
R$*_at__at_$-.$+_at__at_$+ $2.$1_at__at_$3_at__at_$4 slide tokens to left_at__at_
R$+._at__at_$-_at__at_$+ $2:.$1_at__at_$3 rm 1_at__at_; final reformat
R_at__at_$-_at__at_$+ %$1_at__at_$2 rm 1_at__at_; final reformat
R$+_at__at_$+<_at_$+> $:$?I$1_at__at_$2??$3<_at_$I>$|$1_at__at_$2<_at_$3>$. mk _at_relay or lv alone
R$+_at__at_$+??$+<_at_$j> $#mail11 $_at_$1 $:$2 them is us; use mail11
R$+_at__at_$+??$+<_at_$I> $#smtp $_at_$I $:$2<_at_$3> undo damage; send now
R$+_at__at_$+??$+<_at_$+> $:$2<_at_$3> undo $?I damage
R$+_at__at_$+<_at_$+> $:$2<_at_$3> undo !$?I damage
# (MessageRouter)
R$+<_at_$+.$=K.$P> $:$?K$1??$2.$M.$P<_at_$K>$|$1<_at_$2.$M.$P>$.
R$+??$+.$M.$P<_at_$j> $#umc $_at_$2 $:$1<_at_$2> them is us; use mail11
R$+??$+.$M.$P<_at_$K> $#smtp $_at_$K $:$1<_at_$2.$M.$P> undo damage; send now

# UUCP
#
R$*<_at_$-.UUCP> $#uucp $_at_$2 $:$2!$1 use our own uucp

# Fake hosts in my domain
#
R$+<_at_POP> $#pop $_at_$j $:$1 username_at_POP

# Real hosts in my domain
#
R$*<_at_$*$N>$* $#smtpl $_at_$2$N $:$1<_at_$2$N>$3 our domain; no gw

# Parent domain
#
R$*<_at_$*$P>$* $#smtp $_at_$2$P $:$1<_at_$2$P>$3 our domain; no gw

# Nonlocal mail
#
R$*<_at_$+>$* $#smtp $_at_$?R$R$|$2$. $:$1<_at_$2>$3

# Local mail
#

R$+ $#local $:$1 must be local

############################################################
############################################################
#####
##### Local, POP and Program mailers
#####
############################################################
############################################################

Mlocal, P=/bin/mail, F=rlsDFMmn, S=10, R=20, A=mail -r $f -d $u
Mprog, P=/bin/sh, F=lsDFM, S=10, R=20, A=sh -c $u
Mpop, P=/usr/lib/mh/spop, F=nsmFDM, S=10, R=20, A=pop $u

S10
R_at_ $n errors to mailer-daemon

S20

############################################################
############################################################
#####
##### SMTP to hosts inside the local domain
#####
############################################################
############################################################

Msmtpl, P=[IPC], F=mDFMuX, S=11, R=21, A=IPC $h, E=\r\n

# (we pull off the local hostname in all cases, and then selectively add it
# back on. we would add it back if the aliases aren't shared across all
# hosts in this domain, or if the user is root or one of the others that
# we want to know the hostname for.)
#
S11
R$*<_at_$j>$* $>3$1$2 strip local host name
R$*<_at_$+>$* $:$>9$1<_at_$2>$3 canonicalize domain
# (next two lines are only present if aliases aren't shared across localdom)
R$*<_at_$+>$* $_at_$1<_at_$2>$3 already has an _at_domain
R$+ $_at_$1 add our hostname

# (by running S11 on recipients, we get the above behaviour on To: and Cc:
# headers, as well as for the envelope recipient. this is good since we
# always call $#smtpl with hostname attached, which means that we won't be
# down here at all if $j is in the address (that would have been stripped
# in S0), and we will therefore qualify any domain-less addresses with our
# own hostname before sending them to other hosts in our domain. this is
# all ugly but it's what you have to do if your aliases aren't shared. --vix)
#
S21
R$+ $_at_$>11$1 nothing special here

############################################################
############################################################
#####
##### SMTP to hosts outside the local domain
#####
############################################################
############################################################

Msmtp, P=[IPC], F=mDFMuXL, S=12, R=22, A=IPC $h, E=\r\n

S12
R<_at_$+>$* $_at_<_at_$1>$2 <route-addr> syntax
R$*<_at_[$+]>$* $_at_$1<_at_[$2]>$3 numeric, lv alone
R$*<_at_$+>$* $_at_$>9$1<_at_$2>$3 canonicalize domain
R$=N $_at_$1 Add $j to local
R$- $:$1??$(_at_ $1 $: $) Look up aliases
R$-??$+ $_at_$1 Found it - reformat
R$-?? $:$1 undo dammage
R$+ $_at_$1 fix up return addr

S22
R$+ $_at_$>12$1 nothing special here

############################################################
############################################################
#####
##### SMTP to relay host
#####
############################################################
############################################################

Msmtpr, P=[IPC], F=mDFMuX, S=13, R=23, A=IPC $h, E=\r\n

# (we pull off the local hostname in all cases, and then selectively add it
# back on. we would add it back if the user is root or one of the others
# for which we want to know the hostname. Otherwise we want to look like we
# are a local user on the relay machine. This is to allow for "cleaner"
# addresses when crossing mail domains. --FMA)
#
S13
R$*<_at_$j>$* $>3$1$2 strip local host name
R$*<_at_$+>$* $:$>9$1<_at_$2>$3 canonicalize domain
R$=N $_at_$1<_at_$j> qualify nonhidden users
R$- $:$1??$(_at_ $1 $: $) Look up aliases
R$-??$+ $_at_$1<_at_$j> Found it - reformat
R$-?? $:$1 undo dammage

S23
R$+ $_at_$>13$1 nothing special here

############################################################
############################################################
#####
##### DECNET/MAIL11
#####
############################################################
############################################################

# (note that you will need an ultrix or osf1 sendmail binary to use this)
Mmail11, P=/usr/sbin/mail11v3, F=mnSXxH, S=14, R=24/29,
        A=mail11 $f $x $h

# (mail11 senders)
S14
R$+ $:$>3$1 Make canonical to convert last % to _at_
# (phase IV)
R$+<_at_$+.$E.$P> $_at_$2::$1 phaseIV back to :: form
# (phase V)
R$+<_at_$-.$F.$P> $_at_$1_at_%$2 % form
R$+<_at_$+.$F.$P> $:_at__at_$2_at__at_$1 dup nodename; add _at__at_ _at__at_
R$*_at__at_$-.$+_at__at_$+ $2.$1_at__at_$3_at__at_$4 slide tokens to left_at__at_
R$+._at__at_$-_at__at_$+ $_at_$3_at_$2:.$1 rm 1_at__at_; final reformat

# (mail11 recip env)
S24
R$+ $_at_$>14$1 nothing special here

# (mail11 recip hdr)
S29
# next line is for CC: headers which most mail11 receivers won't qualify
R$- $_at_$1_at_$y tack on our nodename
R$+ $_at_$>14$1 nothing special here

############################################################
############################################################
#####
##### UMC mailer
#####
############################################################
############################################################

Mumc, P=/usr/lib/umc/mr_mailer, F=mnDFMS, R=0, S=0,
        A=mr_mailer -send -hop $c -from $f -to $u


############################################################
############################################################
#####
##### UUCP mailers
#####
############################################################
############################################################
#
Muucp, P=/usr/bin/uux, F=sDFhuU, S=15, R=25, M=100000,
        A=uux - $h!rmail ($u)

##
## a more robust implementation of uucp would provide for route-addrs and
## MX neighbors; as well as pathalias; pulling $P off of pseudodomains;
## and RFC822-vs-not neighbors.
##
## UUCP is an odd case since the overwhelming majority of UUCP nodes can
## handle u_at_dom form addresses now. We want to pass those through without
## change. If something comes here in !-form; we likewise leave it alone
## if the first uucpnode in the path is a single token; if it contains
## multiple dot-separated tokens we assume that it's a domain and we change
## it into _at_-notation.
##
## note that we do not remove $U from the recipients. the envelope recipient
## has this done to it at S0 time; and the header recipients should be left
## alone.
##

S15
R$*<_at_$+>$* $_at_$1<_at_$2>$3 domain form is ok
R$+ $:$>25$1 do unto sender as to recipient
R$U!$+ $_at_$U!$1 already has our node name
R$+ $_at_$U!$1 tack on our hostname.

S25
R$*<_at_$+>$* $_at_$1<_at_$2>$3 domain form is ok
R$-!$+ $_at_$1!$2 !-form is ok; done
R$+!$+ $_at_$>3$2<_at_$1> looks like domain; chg to u_at_dom

**************************************************************************


                                                   osf
Received on Fri Aug 09 1996 - 17:32:07 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT