[comp.mail.elm] Elm 2.1 PL1 strange frm/newmail addresses

jac@petsd.UUCP (Jim Clausing) (01/13/89)

The other day, I noticed that newmail (and later I discovered the same behavior
from frm) was sometimes giving me a strange address for the sender.  I was
mailing things from one machine to another and on the receiving machine, the
senders address that newmail gave me was "from!jac", so I went poking around
in newmail.  I discovered that the >From lines on this machine have 11 fields
not the 10 or 9 checked for in forwarded.  My simple patch first checks for
11, then 10 and then 9 so I think should be safe for everyone even if you
weren't affected by the problem.  My patch follows.  Your line numbers may
differ.


*** newmail.c.orig	Tue Jan 10 14:09:10 1989
--- newmail.c	Thu Jan 12 15:46:33 1989
***************
*** 446,451
  	char machine[80], buff[80];
  
  	machine[0] = '\0';
  	sscanf(buffer, "%*s %s %*s %*s %*s %*s %*s %*s %*s %s",
  	            who, machine);
  

--- 446,455 -----
  	char machine[80], buff[80];
  
  	machine[0] = '\0';
+ 	sscanf(buffer, "%*s %s %*s %*s %*s %*s %*s %*s %*s %*s %s",
+ 	            who, machine);
+ 
+ 	if (machine[0] == '\0') 
  	sscanf(buffer, "%*s %s %*s %*s %*s %*s %*s %*s %*s %s",
  	            who, machine);
  
-- 
Jim Clausing			CI$:   74726, 2015
Parallel Processing Tools Grp.	GEnie: J.CLAUSING
Concurrent Computer Corp.	Pseudo-domain: jac@petsd.ccur.com
Tinton Falls, NJ  07724		UUCP:  {rutgers, princeton}!petsd!jac

jac@petsd.UUCP (Jim Clausing) (01/13/89)

In my previous message, I guess I didn't necessarily make it clear that the
same patch can (and probably should) be applied to from.c as well as to
newmail.c.
-- 
Jim Clausing			CI$:   74726, 2015
Parallel Processing Tools Grp.	GEnie: J.CLAUSING
Concurrent Computer Corp.	Pseudo-domain: jac@petsd.ccur.com
Tinton Falls, NJ  07724		UUCP:  {rutgers, princeton}!petsd!jac