[comp.mail.sendmail] sendmail: how come I have two headers ??

sgs@rand.mel.cocam.oz.au (Stuart Szabo) (04/18/91)

Some of my mail actually contains two (2) headers.....
Also, because the subject field is in the second (the correct) header,
when I read the mail there is no subject field.

Enclosed is my sendmail.cf and an example of the duplicate headers.

Any ideas?


=========================================================================
Example of dual headers
=========================================================================

From blarson%dianne.usc.edu%usc.edu@munnari.cs.mu Wed Apr 17 00:08:34 1991
Return-Path: <blarson%dianne.usc.edu%usc.edu@munnari.cs.mu>
Date: Tue, 16 Apr 91 23:39:45 est
From: blarson%dianne.usc.edu%usc.edu@munnari.cs.mu
Subject: lpr for sys V (Request)
Received-Date: Wed, 17 Apr 91 00:08:33 est
Apparently-To: sgs
Status: RO

>From blarson%dianne.usc.edu%usc.edu@munnari.oz Tue Apr 16 23:39:52 1991
Received: from manta.mel.dit.CSIRO.AU by munnari.oz.au with SMTP (5.64+1.3.1+0.50)
	id AA12336; Tue, 16 Apr 1991 23:39:52 +1000 (from blarson%dianne.usc.edu@usc.edu)
Received: from usc.edu by manta.mel.dit.csiro.au with SMTP id AA02541
  (5.65b/IDA-1.4.3/DIT-1.2 for sgs@rand.mel.cocam.oz.au); Tue, 16 Apr 91 20:10:55 +1000
Received: from dianne.usc.edu by usc.edu (5.64+/SMI-3.0DEV3) id AA26719; 
                Tue, 16 Apr 91 03:10:01 PDT
Received: by dianne.usc.edu (4.1/SMI-3.0DEV3) id AA10114; 
                Tue, 16 Apr 91 03:10:31 PDT
Date: Tue, 16 Apr 91 03:10:31 PDT
From: blarson@dianne.usc.edu (Bob Larson)
Message-Id: <9104161010.AA10114@dianne.usc.edu>
To: sgs@rand.mel.cocam.oz.au[
Subject: lpr for sys V
Organization: USC software systems, home of TOADS

===========================================================================
sendmail.cf that causes the headers
===========================================================================

#####
#####   SENDMAIL CONFIGURATION FILE FOR MHSnet MACHINES
#####

#  Official hostname ($j).
#Dj$w.$D.$A.$C
Dj$w

# major relay mailer
DMMHS

# local domain names
#
# These can now be set from the domainname system call.
# Otherwise, edit them to be your mail domain name.
#DDorg
#CDorg mhs au
DDcocam
CDmel cocam oz au

# domain-spec for local domain within universe (eg, what domains are above?)
#DAmhs
#CAmhs au
DAoz
CAoz au

# country name
DCau
CCau

#  Define relay host ($R) - where we send mail that we can't handle.
#  Define relay class - drop this from addresses on incoming local mail
#                if we would use $R to send mail to that address anyway.
#  Define known domain class ($K) - domains we can send to via relay.

DRmunnari.cs.mu.oz.au
CRmunnari.cs.mu.oz.au
CKcsnet bitnet dec mailnet uk gov edu
CKcom mil net us org arpa nl kr aus cdn uninett
CKcern chunet irl dfn iris sunet osiride surfnet hasler dunet
CKjunet jp jpn uucp

#  UUCP name ($U), and list of hosts we connect directly to.

DU$w
#FU/usr/lib/uucp/L.sys %s

# If you want to pre-load the "mailhosts" then use a line like
# FS /usr/lib/mailhosts
# and then change all the occurences of $%y to be $=S instead.
# Otherwise, the default is to use the hosts.byname map if YP
# is running (or else the /etc/hosts file if no YP).
# known hosts in this domain are obtained from gethostbyname() call
FS/etc/hosts

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

#       @(#)version.m4  4.7             8/31/83
#
#  Define version ($V).

DVSMI-3.2

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

# my name
DnMAILER-DAEMON

# UNIX header format
DlFrom $g $d

# delimiter (operator) characters
Do.:%@!^=/[]

# format of a total name
Dq$g$?x ($x)$.

# SMTP login message
De$j Sendmail $v/$V ready at $b

#  Forwarding host ($F) - redefine this if you can't talk to the relay directly.
DF$R

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

# location of alias file
#OA/usr/lib/aliases
OA/usr/lib/mail/aliases

# wait up to ten minutes for alias file rebuild
Oa10

# default delivery mode (deliver in background)
Odbackground

# (don't) connect to "expensive" mailers
#Oc

# rebuild the alias file automagically
OD

# temporary file mode -- 0600 for secure mail, 0644 for permissive
OF0600

# default GID
Og10

# location of help file
OH/usr/lib/sendmail.hf

# log level
OL9

# default messages to old style
Oo

# Cc my postmaster on error replies I generate
OPPostmaster

# queue directory
OQ/usr/spool/mqueue

# read timeout -- violates protocols
Or30m

# status file
OS/usr/lib/sendmail.st

# queue up everything before starting transmission, for safety
Os

# default timeout interval
OT3d

# default UID
Ou1

# wizard's password
OW*

# load average at which we just queue messages
Ox8

# load average at which we refuse connections
OX12

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

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

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

Troot
Tdaemon
Tuucp
Tnetwork

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

H?P?Return-Path: <$g>
H?R?Received: $?sfrom $s $.$?Lvia $L $.by $j $?rwith $r $.($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:
# 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   ###
###########################


################################
#  Sender Field Pre-rewriting  #
################################
S1
# None needed.

###################################
#  Recipient Field Pre-rewriting  #
###################################
S2
# None needed.

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

S4
R$+<@$+.uucp>		$2!$1			u@h.uucp => h!u
R$+			$: $>9 $1		Clean up addr
R$*<$+>$*		$1$2$3			defocus


################################################
#  Clean up an address for passing to a mailer #
#  (but leave it focused)                      #
################################################

S9
# externalize internal forms which don't meet external specs
R@			$@$n			handle <> error addr
R$*<$*.local>$*		$1<$2>$3		change local info
R$*<@local>$*		$1$2			strip spurious local
R<@$+>$*:$+:$+		<@$1>$2,$3:$4		<route-addr> canonical

###########################
#  Name Canonicalization  #
###########################

# Internal format of addresses within the rewriting rules is:
#       anything<@host.domain.domain...>anything
# We try to get every kind of address into this format, except for local
# addresses, which have no host part.  The reason for the "<>" stuff is
# that the relevant host name could be on the front of the address (for
# source routing), or on the back (normal form).  We enclose the one that
# we want to route on in the <>'s to make it easy to find.
#

S3

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

# basic textual canonicalization
R$*<$+>$*		$2			basic RFC821/822 parsing 

# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
R@$+,$+:$+		@$1:$2:$3		change all "," to ":"

#  Localize and dispose of domain-based addresses.
R@$+:$+			$@$>6<@$1>:$2		handle <route-addr>

#  More miscellaneous cleanup.
R$+			$:$>8$1			host dependent cleanup
R$+:$*;@$+		$@$1:$2;@$3		list syntax
R$+@$+			$:$1<@$2>		focus on domain
R$+<$+@$+>		$1$2<@$3>		move gaze right
R$+<@$+>		$@$>6$1<@$2>		already canonical

#  Convert old-style addresses to a domain-based address.

R$-:$+			$@$>3$1@$2		user:host
R$-^$+			$1!$2			convert ^ to !
R$-!$+			$@$>6$2<@$1.uucp>	resolve uucp names
R$-.$+!$+		$@$>6$3<@$1.$2>		host.domain!user
R$+%$+			$@$>3$1@$2		user%host

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

S6
R$*<@$w>$*		$1<@local>$2		convert local host
R$*<@$j>$*		$1<@local>$2		convert local host.doms
R$*<@$+$=D>$*		$1<@$2local>$4		convert local domain
R$*<@$+$=D.$=A>$*	$1<@$2local>$5		or full domain name
R$*<@$+$=D.$=A.$=C>$*	$1<@$2local>$6		or full domain name + country
R$*<@$*$=D.local>$*	$1<@$2local>$4		hash known domains

##### special local conversions

S8
#  strip dense attempts to uucp to relay host.
R$=R!$*@$*		$2@$3
R$=R!$*!$*		$2!$3

############################################################
############################################################
#####
#####           Local and Program Mailer specification
#####
############################################################
############################################################

Mlocal, P=/usr/lib/mail/mail.local, F=UnFDxPlm, S=10, R=20, A=mail.local -r $g $u
Mprog,  P=/bin/sh,   F=lsDFeu,  S=10, R=20, A=sh -c $u

S10
#  Relay name in mail arriving via a mail relay is boring, delete it.
R$*!$*<@$=R$*>		$1!$2
R$*@$*$=K<@$=R$*>	$1@$2$3

S20
R$*<@$=w$*>		$1		Rip off our hostname

############################################################
############################################################
#####
#####           Ethernet Mailer specification
#####
#####   Messages processed by this configuration are assumed to remain
#####   in the same domain.  Hence, they may not necessarily correspond
#####   to RFC822 in all details.
#####
#####           (This should really be called the TCP mailer, since
#####            nothing here is particular to Ethernet)
#####
############################################################
############################################################

MTCP, P=[IPC], F=msDFRuXn, S=11, R=21, A=IPC $h
S11
R$*<@$+>$*		$@$1<@$2>$3		already ok
R$+			$@$1<@$j>		tack on our hostname

S21

############################################################
############################################################
#####
#####           MHSnet Mailer specification
#####
############################################################
############################################################

MMHS,  P=/usr/spool/MHSnet/_bin/netfile, F=CDFMRhmnsu, S=14, R=24,
	Argv=netfile -Amailer -N$i -Q$u
#	Argv=netfile -Amailer -N$i -R$f -Q$u	# needs F=S and network SU for sendmail

S14
R$*<@$=S>		$1			change local info
R$*<@$+>$*		$:$1<@$2>$3		already ok
R$+			$:$1<@$j>		tack on our hostname

S24

############################################################
############################################################
#####
#####           UUCP Mailer specification
#####
############################################################
############################################################

Muucp,	P=/usr/bin/uux, F=DFRMhuU, S=13, R=23, M=100000,
	A=uux - -r -z -a$f -gC $h!rmail ($u)

S13
R$=w!$+			$2			strip local name
R$*<@$=S>$*		$1<@$2.$D>$3		resolve abbreviations
R$+<@$+>		$2!$1			uucpize (no @'s in addr)
R$+			$:$U!$1			stick on our host name

S23
R$*<@$=S>$*		$1<@$2.$D>$3		resolve abbreviations
R$*<@$=w>$*		$1<@$2.$D>$3		resolve abbreviations

############################################################
############################################################
#####
#####           RULESET ZERO
#####
############################################################
############################################################

# Ruleset 7 just calls rulesets 3 then 0.
S7
R$*			$: $>3 $1		First canonicalize
R$*			$@ $>0 $1		Then rerun ruleset 0

S0
# On entry, the address has been canonicalized and focused by ruleset 3.
# Handle special cases.....

R@			$#local $:$n		handle <> form

# For numeric spec, you can't pass spec on to receiver, since rcvr's
# are not smart enough to know that [x.y.z.a] is their own name.
R<@[$+]>:$*		$:$>9 <@[$1]>:$2	Clean it up, then...
R<@[$+]>:$*		$#TCP $@[$1] $:$2	numeric internet spec
R<@[$+]>,$*		$#TCP $@[$1] $:$2	numeric internet spec
R$*<@[$+]>		$#TCP $@[$2] $:$1	numeric internet spec

# now delete redundant local info
R$*<$*$=w.local>$*	$1<$2>$4		thishost.local
R$*<$*$=w.uucp>$*	$1<$2>$4		thishost.uucp
R$*<$*$=w.$D>$*		$1<$2>$4		thishost.mydomain
R$*<$*$=w.$D.$A>$*	$1<$2>$4		thishost.mydomain.hierarchy
R$*<$*$=w.$D.$A.$C>$*	$1<$2>$4		thishost.mydomain.hierarchy.co
R$*<$*$=w>$*		$1<$2>$4		thishost
R$*<$*.>$*		$1<$2>$3		drop trailing dot
R<@>:$*			$@$>7$1			retry after route strip
R$*<@>			$@$>7$1			strip null trash & retry


################################################
###  Machine dependent part of ruleset zero  ###
################################################

# deliver to known TCP hosts explicitly specified in our domain
R$*<@$*$=S>$*		$#TCP $@$3 $:$1<@$2$3>$4	user@tcphost.here

#  local uucp mail - just change pattern, so it doesn't match!.

R<@$=U.uucp>:$+		$1!$2			to old format
R$+<@$=U.uucp>		$2!$1			to old format

#  route mail to domains reachable from a friendly relay via them.

R<@$*.$=K>:$+		$2@$1.$3<@$R>		arpanet mail, etc
R$+<@$*.$=K>		$1@$2.$3<@$R>		arpanet mail, etc

# Clean up addresses for external use -- kills LOCAL, route-addr ,=>: and etc.
R$*			$:$>9 $1		Then continue...

# Give user@host style addresses to ACSnet
R$*<@$*>$*		$#$M $@anyhost $:$1@$2		user@anything

# and host!user style to uucp
R$-!$+			$#uucp$@$1$:$2		host!user => local uucp

# everything else is a local name
R$+			$#local $:$1		local names


			

			Thanks,


-- 
===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-===-
Snail:	   Co-Cam Computer Services              |  sgs@rand.mel.cocam.oz.au 
           Abbotsford, VIC 3067                  |  +61 3 412-3411 (voice)      
	   Melbourne,  Australia                 |  +61 3 417-7857 (fax)