[comp.bugs.4bsd] /usr/ucb/mail doesn't handle rfc822 well

hubert@blake.acs.washington.edu (Steve Hubert) (10/14/89)

Index: ucb 4.3BSD-tahoe

Description:
Using 4.3-tahoe /usr/ucb/mail and replying with little "r" to the
following message illustrates a couple problems.

From someone Fri Oct 13 11:19:42 1989
From: Joe Someone <someone@sub.domain>
To: Fred Flintstone <fred@sub.domain>
Cc: cathy@other.domain, Ken Jones <ken>
Status: RO

Body of message.


Repeat-By:
Script started on Fri Oct 13 11:23:15 1989
% mail -f mail.bug
Mail version 5.3 2/18/88.  Type ? for help.
"mail.bug": 1 message
>   1 someone@sub.domain    Fri Oct 13 11:19   8/185 
& 1
Message 1:
From someone Fri Oct 13 11:19:42 1989
From: Joe Someone <someone@sub.domain>
To: Fred Flintstone <fred@sub.domain>
Cc: cathy@other.domain, Ken Jones <ken>

Body of message.

& r
To: fred@sub.domain someone@sub.domain
Cc: sub.ken@domain
Subject: 
^C
(Interrupt -- one more to kill letter)
^CInterrupt
& x
% ^D 
script done on Fri Oct 13 11:23:41 1989

Fix:
There are two problems.  The first problem is that cathy didn't
make it into the list at all.  The second is that the ken address
is messed up.  It tried to add the sender's domain since ken didn't
have a domain but it did it incorrectly.  Instead of ken@sub.domain
it came out as sub.ken@domain.

The first problem is a problem with the skin() code in aux.c.  There seems 
to be an implicit assumption there that all of the addresses will be rfc 822
style if any of them are.  When it runs into the "<" it throws out everything
before that, including cathy@other.domain which should have been saved since
it came before the ",".  I haven't coded a fix but one can imagine how to do
it fairly easily.

The second problem comes from some strange mucking about in optim.c, in the
arpafix() routine.  I don't pretend to understand what is supposed to be
happening there.

Steve Hubert
Networks and Distributed Computing, Univ. of Wash., Seattle
hubert@cac.washington.edu