Wanted: reply fix for 4.2 mailer

Peter Gross pag at hao.UUCP
Sun Jun 24 08:05:54 AEST 1984


imsvax!rcc:

> We're running the distribution 4.2 mail system.  The reply command has
> a number of bugs, the most aggravating of which is that the reply
> command, when given on a message with more than one From line in the
> header, figures out the path to be used from the wrong From line.
> This results in reply being worse than useless for replying to any
> message that originates more than one machine or so away.

This problem is due to mail passing from 4.2 sendmail sites through
non-sendmail sites.  Sendmail either adds a "From: " (note colon) header
or prepends the sitename to an existing one.  Unfortunately this scheme
causes problems when the mail passes through non-sendmail sites;
they ignore the "From: " header, adding their site name only to the
"From " line.  Berkeley Mail always uses the "From: " header in preference
to the "From " one.  Thus you end up with incorrect reply paths.

The real problem is that sendmail is conforming to RFC 822 (right number?)
when most of the rest of the Unix world is not.  What we really need is
a public domain mailer that all uucp sites can run which conforms to
RFC822.  The approach I took was to add a defined constant IGNOREFROM
which uucp-only sites can use to cure the problem.  Here are those
changes:

1.  In Mail/Makefile add "-DIGNOREFROM" to the options line.

2.  diffs for Mail/aux.c:
*** /tmp/,RCSt1013078	Sat Jun 23 15:43:47 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)

3.  diffs for cmd3.c:
*** /tmp/,RCSt1013089	Sat Jun 23 15:44:51 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++ = ' ';
*********************************************************************
--peter gross
hao!pag



More information about the Comp.unix.wizards mailing list