[net.mail] Do you rewrite "From:" lines?

jeff@fluke.UUCP (Jeff Stearns) (09/26/86)

Now that I've installed smail, a nasty question comes up.  Should our sendmail
modify "From:" lines?

Background:
    We're a uucp site with a dozen or so neighbors.  We're running Berkeley
    UNIX with sendmail.  We just installed smail.

    Our standard sendmail rewrites "From" and "From:" lines.  Specifically,
    it prepends our sitename to the address.  This is standard practice here
    in uucp-land.  All of our uucp neighbors do it, too.

	An example.  Say we receive this message and relay it to site bletch.
	The message comes in through rmail, passes through sendmail, and exits
	via uux.  It arrives like this:

	    From foo!bar!joeuser  Thu Sep 25 13:29:06 1986
	    Date: Thu Sep 25 13:29:06 1986
	    From: foo!bar!joeuser (Joseph User)
	    To: fluke!bletch!recipient
	    ...

	And sendmail emits it like this:

	    From fluke!foo!bar!joeuser  Thu Sep 25 13:29:06 1986
	    Date: Thu Sep 25 13:29:06 1986
	    From: fluke!foo!bar!joeuser (Joseph User)
	    To: bletch!recipient
	    ...

    So we tacked on our sitename onto "From" and "From:" as the message passed
    through us. 

The problem:
    I've just installed smail.  We're getting domain-ized.  We're trying to
    make a separation between domain addresses and uucp routes.

    What to do with the "From:" line?

    I believe that the theoretically correct answer is this:
	Don't touch the "From:" line at all.  Do your playing with the
	"From" line, so that "From" can indicate a valid UUCP path,
	leaving the sender's domain address in "From:".
	(That last part is a quote from the smail manual page.)

	And this is what smail does.

But all of our neighbors tack their sitename onto the "From:" line as well!
There's gonna be lots of unreplyable(?) mail if we start playing by The Right
Rules while everybody else is Doing What The Majority Does.  (Recall that
4.2BSD /usr/ucb/mail sends replies to the "From:" address, not the "From"
address.)

What's a mother to do?
-- 
	Jeff Stearns       (206) 356-5064
	John Fluke Mfg. Co.
	P.O. Box C9090  Everett WA  98043  
	{uw-beaver,decvax!microsof,ucbvax!lbl-csam,allegra,ssc-vax}!fluke!jeff

mark@cbosgd.ATT.COM (Mark Horton) (09/28/86)

In article <358@tc-jeff.fluke.UUCP> jeff@fluke.UUCP (Jeff Stearns) writes:
>Now that I've installed smail, a nasty question comes up.  Should our sendmail
>modify "From:" lines?

If you have a legal 822 domain From: line, and you modify it by sticking
your host name on the front, you violate RFC976 and 822, and your mailer
is badly broken.  Unfortunately, this applies to most 4.2BSD hosts, and
I think the bug is still in 4.3.  I think the problem is related to the
fact that the From_ and From: lines are tied together by sendmail, and
it's very hard to prepend to one without breaking the other.  One solution
is to install smail, which won't involve sendmail in ordinary pass-through
mail.

If you have a From: line written with bangs, then there are no standards
that apply, and you can just about do what you please with it.

But note that it's pointless to stick your host name on the front of a
bang path in a From: line to help out a reply command.  This doesn't
work unless EVERY HOP along the way sticks its name in, and since
System III and V don't modify the From: line, the message need go only
through one System V hop to render the From: line meaningless.  Berkeley
long ago gave up on expecting this to work - domains are a much better
solution to the reply problem.

>But all of our neighbors tack their sitename onto the "From:" line as well!
>There's gonna be lots of unreplyable(?) mail if we start playing by The Right
>Rules while everybody else is Doing What The Majority Does.  (Recall that
>4.2BSD /usr/ucb/mail sends replies to the "From:" address, not the "From"
>address.)
>
>What's a mother to do?

That mail is generally unreplyable anyway, so you really aren't breaking
anything by stopping an unsavory practice.

	Mark

lyndon@ncc.UUCP (09/30/86)

In article <358@tc-jeff.fluke.UUCP>, jeff@fluke.UUCP (Jeff Stearns) writes:
> Now that I've installed smail, a nasty question comes up.  Should our sendmail
> modify "From:" lines?
> 
> Background:
>     We're a uucp site with a dozen or so neighbors.  We're running Berkeley
>     UNIX with sendmail.  We just installed smail.
> 
>     Our standard sendmail rewrites "From" and "From:" lines.  Specifically,
>     it prepends our sitename to the address.  This is standard practice here
>     in uucp-land.  All of our uucp neighbors do it, too.
> 

NOT true! (see comments later)

> The problem:
>     I've just installed smail.  We're getting domain-ized.  We're trying to
>     make a separation between domain addresses and uucp routes.
> 
>     What to do with the "From:" line?
> 
>     I believe that the theoretically correct answer is this:
> 	Don't touch the "From:" line at all.  Do your playing with the
> 	"From" line, so that "From" can indicate a valid UUCP path,
> 	leaving the sender's domain address in "From:".
> 	(That last part is a quote from the smail manual page.)
> 
> 	And this is what smail does.
> 
> But all of our neighbors tack their sitename onto the "From:" line as well!
> There's gonna be lots of unreplyable(?) mail if we start playing by The Right
> Rules while everybody else is Doing What The Majority Does.  (Recall that
> 4.2BSD /usr/ucb/mail sends replies to the "From:" address, not the "From"
> address.)
> 
> What's a mother to do?
> -- 
> 	Jeff Stearns       (206) 356-5064
> 	John Fluke Mfg. Co.
> 	P.O. Box C9090  Everett WA  98043  
> 	{uw-beaver,decvax!microsof,ucbvax!lbl-csam,allegra,ssc-vax}!fluke!jeff

Our configuration is a Convergent MiniFrame running SYS_V with NO sendmail
(yes people, there are a *lot* of machines that don't have the foggiest
idea about sendmail :-).

None of our mailers understands RFC822. All interaction takes place on the
"From " headers; The "From:" lines are passed untouched. Strange things
begin to happen when I receive mail from site 'a' (4.2BSD) destined for
site 'b' (also 4.2BSD). When 'b' receives the mail, the "From " line
contains a path of "ncc!a!...", but the "From:" line has "a!...".
When b!user tries to reply to the message, it generates a return address
from the "From:" line of "a!..." which is obviously incorrect as the mail
has to go through "ncc" to get to "a".

What to do? There are two options that come to mind. First, "b" can ignore
"From:" info, and construct return paths from "From " lines. This maintains
compatibility with the dumb *dumb* DUMB Sys_V mailers. It also allows me to
continue acting as a mail gateway between 4.2BSD systems. The second option
is to use smail/pathalias. When "b" tries to reply directly to "a", the
pathalias database will be invoked to find a path to "a". Unfortunately,
the default configuration only forces a lookup if the address is of the
form "a!b". If the reply was really destined for "a!c!d", the lookup is
bypassed. To start messing with the compile time options in smail *will* fix
this problem, but strange things start happening as nearly everything
gets re-routed.

I have thought about building RFC822 into smail (and aliases, and intelligent
network gateways, ...). It's about time Sys_V caught up with the rest of
the world with respect to mailers. The only problem here is that I keep
hearing that "it's coming in the next release on **IX". Arrgh!

I would like to hear from other SA's who have run into this problem. The
*must* be a reasonable method for dealing with this...
-- 

Lyndon Nerenberg (VE6BBM) 	  {ihnp4,ubc-vision,watmath}!alberta!ncc!lyndon
Systems Group - A Div. of Nexus Computing Corp.  		Envoy_100: Unix

asgard@cpro.UUCP (J.R. Stoner) (10/04/86)

In article <736@ncc.UUCP>, lyndon@ncc.UUCP writes:
> 
> I have thought about building RFC822 into smail (and aliases, and intelligent
> network gateways, ...). It's about time Sys_V caught up with the rest of
> the world with respect to mailers. The only problem here is that I keep
> hearing that "it's coming in the next release on **IX". Arrgh!

I have tried to install smail in my SVID validated SYS5r2 system twice.
Both times the usual result is some failure to work in the rmail
replacement.  It would be nice if people who claim to have such a neat
interface prepare to write a version that works as advertised on SVID
systems as well as the machines used by their elitist friends on VAXen.

> 
> I would like to hear from other SA's who have run into this problem. The
> *must* be a reasonable method for dealing with this...
> 
> Lyndon Nerenberg (VE6BBM) 	  {ihnp4,ubc-vision,watmath}!alberta!ncc!lyndon
> Systems Group - A Div. of Nexus Computing Corp.  		Envoy_100: Unix

You have heard the word, and the word is BONGA!

diamant@hpfclp.HP.COM (John Diamant) (10/05/86)

In article <358@tc-jeff.fluke.UUCP>, jeff@fluke.UUCP (Jeff Stearns) writes:
> Now that I've installed smail, a nasty question comes up.  Should our sendmail
> modify "From:" lines?
> 
> Background:
>     We're a uucp site with a dozen or so neighbors.  We're running Berkeley
>     UNIX with sendmail.  We just installed smail.
> 
>     Our standard sendmail rewrites "From" and "From:" lines.  Specifically,
>     it prepends our sitename to the address.  This is standard practice here
>     in uucp-land.  All of our uucp neighbors do it, too.
> 

> The problem:
>     I've just installed smail.  We're getting domain-ized.  We're trying to
>     make a separation between domain addresses and uucp routes.
> 
>     What to do with the "From:" line?
> 
>     I believe that the theoretically correct answer is this:
> 	Don't touch the "From:" line at all.  Do your playing with the
> 	"From" line, so that "From" can indicate a valid UUCP path,
> 	leaving the sender's domain address in "From:".
> 	(That last part is a quote from the smail manual page.)
> 
> 	And this is what smail does.
> 
> But all of our neighbors tack their sitename onto the "From:" line as well!
> There's gonna be lots of unreplyable(?) mail if we start playing by The Right
> Rules while everybody else is Doing What The Majority Does.  (Recall that
> 4.2BSD /usr/ucb/mail sends replies to the "From:" address, not the "From"
> address.)
> 
> What's a mother to do?
> -- 
> 	Jeff Stearns       (206) 356-5064
> 	John Fluke Mfg. Co.
> 	P.O. Box C9090  Everett WA  98043  
> 	{uw-beaver,decvax!microsof,ucbvax!lbl-csam,allegra,ssc-vax}!fluke!jeff

Smail is telling you exactly the right thing to do.  4.2BSD Mail does the
right thing by using the From: lines since it has sendmail available to it,
it is expected to be able to handle 822 style addresses.  If it reads an
822 header ("From:") and doesn't understand such a header, it is just plain
wrong!  SYS V mailers, on the other hand, look at "From " lines, because
they don't understand 822 style addresses.

"From:" lines will only be generated by sites that understand 822 (or they
are wrong).  Given that this is the case, if a "From:" line exists, you should
assume it is correct.

The only time you have to do something funny is if you get are gatewaying a
piece of mail from a non-822 site, you will have to add a "From:" line
since it doesn't already have one.  Here is an example:  say your neighbor
runs standard SYS V (non-822) and is called "dumbsite", and you are called
"gateway.com", and that the user called "user" is sending a message through
you.  You cannot generate a From: line of user@dumbsite because nobody 
understands that except dumbsites neighbors.  You have a choice of:
user%dumbsite@gateway.com or dumbsite!user@getway.com.  I have discussed
this with Mark Horton (by mail) and he claimed that the second address is
O.K. because anyone looking at the From: line must have "@" precedence.  While
he is technically correct, this is very dangerous, because as you say, there
are many sites out there that don't follow rules.  The first one should work
fine, as long as you make sure your site can translate the address back
into UUCP style before transmitting it.

You are correct about it being a large problem that people are modifying the
From: lines.  However, anybody who succeeds in replying to such mail also
must have a broken mailer.  An "@" is required in a From: line and must take
precedence over any other address token (like "!").  So, in fact, tacking
on a "!" at the beginning is wrong and is unreplyable by a mailer that conforms
to standards.  The only thing I can suggest is that the more people who
conform to standards, the more likely everyone else will be to conform (because
it will hurt them not too).  As far as how many people already conform,
consider that the entire ARPA Internet  does, which means all those From:
lines are already not replyable via gateways into the Internet.  I encourage
you to not modify From: lines and convince your neighbors not to also.  The
faster we get people to start doing the right thing, the smaller the problem
will be -- the real problem is getting a critical mass of people to conform.


John Diamant
Systems Software Operation	UUCP:  {hplabs,hpfcla}!hpfclp!diamant
Hewlett Packard Co.		ARPA/CSNET: diamant%hpfclp@hplabs.HP.COM
Fort Collins, CO

ahby@meccts.UUCP (Shane P. McCarron) (10/06/86)

In article <112@cpro.UUCP> asgard@cpro.UUCP (J.R. Stoner) writes:
>I have tried to install smail in my SVID validated SYS5r2 system twice.
>Both times the usual result is some failure to work in the rmail
>replacement.  It would be nice if people who claim to have such a neat
>interface prepare to write a version that works as advertised on SVID
>systems as well as the machines used by their elitist friends on VAXen.

I have installed smail on several machines, all of which are running
Sys Vr2, and had no trouble at all.  A number of local sites have also
installed it on everything from Sys III to BSD 4.3, and had no
trouble.  Could you please send along a little more information about
exactly how it is failing?  The smail/rmail program is just about too
stupid not to work.
-- 
Shane P. McCarron			UUCP	ihnp4!meccts!ahby
MECC Technical Services			ATT	(612) 481-3589

"They're only monkey boys;  We can still crush them here on earth!"

henry@utzoo.UUCP (Henry Spencer) (10/06/86)

Clearly, the way this mess *should* have been handled in the first place
was to recognize that the old (I mean OLD) Unix header, which was a pile
of lines looking, say, like this:

	From uucp 22:22 Sept 16
	From uucp 22:20 Sept 16 remote from decvax
	From uucp 21:11 Sept 16 remote from ucbvax
	From joey 09:13 Sept 15 remote from foobar

is in fact a different way of writing:

	From: decvax!ucbvax!foobar!joey
	Received: here at 22:22 Sept 16
	Received: by decvax at 22:20 Sept 16
	Received: by ucbvax at 21:11 Sept 16
	Received: by foobar at 09:13 Sept 15

or something along those lines.  A message which contains "From " lines
should not contain a "From:" line, and vice-versa.  Software that talks
between places that speak "From:" (Arpanet; high-level user interfaces)
and places that speak "From " (low-level UUCPNet mail transmission) should
convert.  This would eliminate or reduce many, many problems.

Unfortunately, it's far too late for that.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,decvax,pyramid}!utzoo!henry

hokey@plus5.UUCP (Hokey) (10/07/86)

Many sendmail sites *incorrectly* prepend their site name to the From: line.
This especially bothersome when the line is in @ format, as the resulting
address is *definitely* wrong (user@site becomes relay!user@site, which *must*
be parsed as (relay!user)@site by an RFC822-compliant mailer).

To a great extent, abolition of this problem would solve the "dumb neighbor"
problem mentioned in some of the referenced articles.

I won't rehash my belief that *all* RFC822 mail transported in the UUCP domain
should be in ! format.

Don't forget that even dumb V7 mailers use the To: line if there are multiple
recipients.

Why not run sendmail on your SysV box?  There are versions available which
even include nameserver lookup code.

-- 
Hokey

henry@utzoo.UUCP (Henry Spencer) (10/10/86)

> Don't forget that even dumb V7 mailers use the To: line if there are multiple
> recipients.

Um, not correct:  dumb V7 mailers have no concept of mail headers at all,
much less any specific notions about the "To:" line.  Believe me; we run
one.  (And as a result we're the only major network hub in this part of
the world whose mailer is 100% predictable and 100% reliable.)
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,decvax,pyramid}!utzoo!henry

dan@rna.UUCP (Dan Ts'o) (10/11/86)

In article <7212@utzoo.UUCP> henry@utzoo.UUCP (Henry Spencer) writes:
>> Don't forget that even dumb V7 mailers use the To: line if there are multiple
>> recipients.
>
>Um, not correct:  dumb V7 mailers have no concept of mail headers at all,
>much less any specific notions about the "To:" line.  Believe me; we run
>one.  (And as a result we're the only major network hub in this part of
>the world whose mailer is 100% predictable and 100% reliable.)
>-- 
>				Henry Spencer @ U of Toronto Zoology
>				{allegra,ihnp4,decvax,pyramid}!utzoo!henry

	What happens when you get mail that is misaddressed (wrong host, unknown
login name) ? Do you predictably and reliably drop it on the floor ? How can
it be 100% when its based on uucp as its transport ?
	A crashed machine is 100% predictable and reliable, too.

henry@utzoo.UUCP (Henry Spencer) (10/20/86)

> >Um, not correct:  dumb V7 mailers have no concept of mail headers at all,
> >much less any specific notions about the "To:" line.  Believe me; we run
> >one.  (And as a result we're the only major network hub in this part of
> >the world whose mailer is 100% predictable and 100% reliable.)
> 
> What happens when you get mail that is misaddressed (wrong host, unknown
> login name) ? Do you predictably and reliably drop it on the floor ?

No, we predictably and reliably [we fixed the locking system] forward it
to the postmaster [me] for appropriate action.  There is no completely
satisfactory way of dealing with it automatically.  Believe me, there isn't.
Even returning it to the sender is an arbitrarily difficult job, because
it implies determining the return address from the headers.  I think I can
safely say that I am smarter than any automated header parser, and *I*
sometimes have considerable trouble sorting out the correct return address
(no points for getting it wrong, guys, or believing headers that are lying).
Sometimes, whether it goes on to its destination or back to its sender
is a matter of whose address is easier to determine!

> How can it be 100% when its based on uucp as its transport ?

The mailer is not based on uucp.  The mail system as a whole is.  The
unreliability of one part of the system (uucp) is not an excuse for
unreliability of other parts.

>	A crashed machine is 100% predictable and reliable, too.

Then it's a considerable improvement on sendmail!
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,decvax,pyramid}!utzoo!henry