Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 6/7/83; site hao.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!zehntel!hplabs!hao!pag
From: pag@hao.UUCP (Peter Gross)
Newsgroups: net.mail
Subject: Re: Path problem -- From: vs. Return-Path: data
Message-ID: <1163@hao.UUCP>
Date: Fri, 21-Sep-84 20:42:40 EDT
Article-I.D.: hao.1163
Posted: Fri Sep 21 20:42:40 1984
Date-Received: Wed, 26-Sep-84 02:18:42 EDT
References: <4512@brl-tgr.ARPA>
Organization: High Altitude Obs./NCAR, Boulder CO
Lines: 233

The problem everyone has been complaining about -- "From: " lines
out of sync with "From " lines and resulting dropped sites from
paths -- is NOT (repeat, NOT) due to a sendmail problem.  I previously
posted a fix for this.  It is a mal-design in Berkeley 4.2 Mail.
The problem is that when mail passes through a 4.2 mail system
it always uses the From: " line if present.  But System V systems
ignore it and add their own sitename only to the "From " line.
Then when a 4.2-er does an "r[eply]" in Mail it constructs the return path
from the "From: " line which may be missing some of the sites.
The fix is simple -- force Mail to use the "From " line in preference
to the "From: " line.  This works fine for uucp-only (ie non-ARPA) sites.
I haven't thought about implications for Internet sites.  It may still
work fine there too.

--peter gross
hao!pag

The changes:
1.  Add "-DIGNOREFROM" to the OPTIONS line in the Makefile
2.  changes to cmd3.c and aux.c (in src/ucb/Mail):
*** /tmp/,RCSt1007362	Fri Sep 21 18:29:19 1984
--- cmd3.c	Sat Jun 23 15:42:49 1984
***************
*** 1,5
  #ifndef lint
! static char *sccsid = "@(#)cmd3.c	2.14 (Berkeley) 8/11/83";
  #endif
  
  #include "rcv.h"

--- 1,5 -----
  #ifndef lint
! static char *rcsid = "$Header: cmd3.c,v 2.15 84/06/23 15:41:47 pag Exp $";
  #endif
  
  #include "rcv.h"
***************
*** 9,14
   * Mail -- a mail program
   *
   * Still more user commands.
   */
  
  /*

--- 9,20 -----
   * Mail -- a mail program
   *
   * Still more user commands.
+  *
+  * $Log:	cmd3.c,v $
+  * Revision 2.15  84/06/23  15:41:47  pag
+  * Added IGNOREFROM conditional code to keep responses from using a
+  * possibly incomplete "From:" header
+  * 
   */
  
  /*
***************
*** 205,210
  	cp = skin(nameof(mp, 1));
  	if (cp != NOSTR)
  	    rcv = cp;
  	cp = skin(hfield("from", mp));
  	if (cp != NOSTR)
  	    rcv = cp;

--- 211,217 -----
  	cp = skin(nameof(mp, 1));
  	if (cp != NOSTR)
  	    rcv = cp;
+ #ifndef IGNOREFROM
  	cp = skin(hfield("from", mp));
  	if (cp != NOSTR)
  	    rcv = cp;
***************
*** 208,213
  	cp = skin(hfield("from", mp));
  	if (cp != NOSTR)
  	    rcv = cp;
  	replyto = skin(hfield("reply-to", mp));
  	strcpy(buf, "");
  	if (replyto != NOSTR)

--- 215,221 -----
  	cp = skin(hfield("from", mp));
  	if (cp != NOSTR)
  	    rcv = cp;
+ #endif IGNOREFROM
  	replyto = skin(hfield("reply-to", mp));
  	strcpy(buf, "");
  	if (replyto != NOSTR)
***************
*** 673,678
  	for (s = 0, ap = msgvec; *ap != 0; ap++) {
  		mp = &message[*ap - 1];
  		dot = mp;
  		if ((cp = skin(hfield("from", mp))) != NOSTR)
  		    s+= strlen(cp) + 1;
  		else

--- 681,687 -----
  	for (s = 0, ap = msgvec; *ap != 0; ap++) {
  		mp = &message[*ap - 1];
  		dot = mp;
+ #ifndef IGNOREFROM
  		if ((cp = skin(hfield("from", mp))) != NOSTR)
  		    s+= strlen(cp) + 1;
  		else
***************
*** 676,681
  		if ((cp = skin(hfield("from", mp))) != NOSTR)
  		    s+= strlen(cp) + 1;
  		else
  		    s += strlen(skin(nameof(mp, 2))) + 1;
  	}
  	if (s == 0)

--- 685,691 -----
  		if ((cp = skin(hfield("from", mp))) != NOSTR)
  		    s+= strlen(cp) + 1;
  		else
+ #endif IGNOREFROM
  		    s += strlen(skin(nameof(mp, 2))) + 1;
  	}
  	if (s == 0)
***************
*** 684,689
  	head.h_to = cp;
  	for (ap = msgvec; *ap != 0; ap++) {
  		mp = &message[*ap - 1];
  		if ((cp2 = skin(hfield("from", mp))) == NOSTR)
  		    cp2 = skin(nameof(mp, 2));
  		cp = copy(cp2, cp);

--- 694,700 -----
  	head.h_to = cp;
  	for (ap = msgvec; *ap != 0; ap++) {
  		mp = &message[*ap - 1];
+ #ifndef IGNOREFROM
  		if ((cp2 = skin(hfield("from", mp))) == NOSTR)
  #endif IGNOREFROM
  		    cp2 = skin(nameof(mp, 2));
***************
*** 685,690
  	for (ap = msgvec; *ap != 0; ap++) {
  		mp = &message[*ap - 1];
  		if ((cp2 = skin(hfield("from", mp))) == NOSTR)
  		    cp2 = skin(nameof(mp, 2));
  		cp = copy(cp2, cp);
  		*cp++ = ' ';

--- 696,702 -----
  		mp = &message[*ap - 1];
  #ifndef IGNOREFROM
  		if ((cp2 = skin(hfield("from", mp))) == NOSTR)
+ #endif IGNOREFROM
  		    cp2 = skin(nameof(mp, 2));
  		cp = copy(cp2, cp);
  		*cp++ = ' ';
-----------------------
*** /tmp/,RCSt1007356	Fri Sep 21 18:28:38 1984
--- aux.c	Sat Jun 23 15:41:13 1984
***************
*** 1,5
  #ifndef lint
! static char *sccsid = "@(#)aux.c	2.11 (Berkeley) 8/11/83";
  #endif
  
  #include "rcv.h"

--- 1,5 -----
  #ifndef lint
! static char *rcsid = "$Header: aux.c,v 2.12 84/06/23 15:39:54 pag Exp $";
  #endif
  
  #include "rcv.h"
***************
*** 10,15
   * Mail -- a mail program
   *
   * Auxiliary functions.
   */
  
  /*

--- 10,21 -----
   * Mail -- a mail program
   *
   * Auxiliary functions.
+  *
+  * $Log:	aux.c,v $
+  * Revision 2.12  84/06/23  15:39:54  pag
+  * Added IGNOREFROM conditional code to keep responses from using the
+  * incomplete "From:" header
+  * 
   */
  
  /*
***************
*** 616,621
  	register FILE *ibuf;
  	int first = 1;
  
  	if ((cp = hfield("from", mp)) != NOSTR)
  		return(cp);
  	if (reptype == 0 && (cp = hfield("sender", mp)) != NOSTR)

--- 622,628 -----
  	register FILE *ibuf;
  	int first = 1;
  
+ #ifndef IGNOREFROM
  	if ((cp = hfield("from", mp)) != NOSTR)
  		return(cp);
  	if (reptype == 0 && (cp = hfield("sender", mp)) != NOSTR)
***************
*** 620,625
  		return(cp);
  	if (reptype == 0 && (cp = hfield("sender", mp)) != NOSTR)
  		return(cp);
  	ibuf = setinput(mp);
  	copy("", namebuf);
  	if (readline(ibuf, linebuf) <= 0)

--- 627,633 -----
  		return(cp);
  	if (reptype == 0 && (cp = hfield("sender", mp)) != NOSTR)
  		return(cp);
+ #endif IGNOREFROM
  	ibuf = setinput(mp);
  	copy("", namebuf);
  	if (readline(ibuf, linebuf) <= 0)