From br@smilla.rueskamp.com  Tue Nov  3 05:22:08 1998
Received: from smilla.rueskamp.com (smilla.rueskamp.com [194.97.69.109])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA06668
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 3 Nov 1998 05:22:06 -0800 (PST)
          (envelope-from br@smilla.rueskamp.com)
Received: (from br@localhost)
	by smilla.rueskamp.com (8.8.8/8.8.8) id OAA26460;
	Tue, 3 Nov 1998 14:21:55 +0100 (CET)
	(envelope-from br)
Message-Id: <199811031321.OAA26460@smilla.rueskamp.com>
Date: Tue, 3 Nov 1998 14:21:55 +0100 (CET)
From: Bodo Rueskamp <br@rueskamp.com>
Reply-To: br@rueskamp.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: /usr/libexec/mail.local doesn't handle ">From " lines transparently
X-Send-Pr-Version: 3.2

>Number:         8553
>Category:       bin
>Synopsis:       /usr/libexec/mail.local doesn't handle ">From " lines transparently
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gshapiro
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov  3 05:30:00 PST 1998
>Closed-Date:    Wed Aug 14 21:50:54 PDT 2002
>Last-Modified:  Wed Aug 14 21:50:54 PDT 2002
>Originator:     Bodo Rueskamp
>Release:        FreeBSD 2.2.6-RELEASE i386
>Organization:
>Environment:

FreeBSD smilla.rueskamp.com 2.2.6-RELEASE FreeBSD 2.2.6-RELEASE #21: Thu Oct 15 16:26:53 CEST 1998     roof@smilla.rueskamp.com:/u1/src/sys/compile/SMILLA  i386

>Description:

mail.local inserts a ">" before "From " lines
but doesn't insert ">" before ">From " lines.
Because of this a mail frontend (like ELM) cannot convert
the message back into its original form.

>How-To-Repeat:

(XXX inserted to preserve 'From ' lines)

XXX mail root <<EOF
XXX
XXX From - Thu Jan  1 09:36:29 1998
XXX
XXX >From - Thu Jan  1 09:36:29 1998
XXX
XXX EOF

>Fix:

*** mail.local.c.orig	Fri Feb 20 18:32:27 1998
--- mail.local.c	Tue Nov  3 13:43:37 1998
***************
*** 143,148 ****
--- 143,158 ----
  	exit(eval);
  }
  
+ static
+ int
+ fromcmp(line)
+ 	char *line;
+ {
+ 	while (*line == '>')
+ 		++line;
+ 	return(memcmp(line, "From ", 5));
+ }
+ 
  int
  store(from)
  	char *from;
***************
*** 168,175 ****
  		if (line[0] == '\n')
  			eline = 1;
  		else {
! 			if (eline && line[0] == 'F' &&
! 			    !memcmp(line, "From ", 5))
  				(void)putc('>', fp);
  			eline = 0;
  		}
--- 178,185 ----
  		if (line[0] == '\n')
  			eline = 1;
  		else {
! 			if (eline && ((line[0] == 'F') || (line[0] == '>')) &&
! 			    !fromcmp(line))
  				(void)putc('>', fp);
  			eline = 0;
  		}


>Release-Note:
>Audit-Trail:

From: Wolfram Schneider <wosch@panke.de.freebsd.org>
To: br@rueskamp.com, FreeBSD-gnats-submit@FreeBSD.ORG
Cc:  Subject: Re: bin/8553: /usr/libexec/mail.local doesn't handle ">From " lines transparently
Date: Tue, 3 Nov 1998 21:55:53 +0100

 > >Description:
 > mail.local inserts a ">" before "From " lines
 > but doesn't insert ">" before ">From " lines.
 > Because of this a mail frontend (like ELM) cannot convert
 > the message back into its original form.
 
 I would like if we insert a space or a tab instead the ">"
 before a "From " line.
 
 A space is a harmless character in most computer or
 human languages. The ">" is not, for example in LaTeX it will
 create strange output. See The UNIX-HATERS Handbook
 
 Wolfram

From: Bodo Rueskamp <br@rueskamp.com>
To: wosch@panke.de.freebsd.org (Wolfram Schneider)
Cc: br@rueskamp.com, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/8553: /usr/libexec/mail.local doesn't handle ">From " lines transparently
Date: Wed, 4 Nov 1998 00:32:18 +0100 (CET)

 Wolfram:
 > Bodo:
 > > mail.local inserts a ">" before "From " lines
 > > but doesn't insert ">" before ">From " lines.
 > > Because of this a mail frontend (like ELM) cannot convert
 > > the message back into its original form.
 >
 > I would like if we insert a space or a tab instead the ">"
 > before a "From " line.
 > 
 > A space is a harmless character in most computer or
 > human languages. The ">" is not, for example in LaTeX it will
 > create strange output. See The UNIX-HATERS Handbook
 
 The '>' char is UNIX standard since 20 years (or more).
 We shouldn't change that.
 
 We just have to do the escape algorithm right.
 (and do the right unescape algorithm in /usr/bin/mail et al)
 
 ; Bodo
 
 -- 
 Bodo Rskamp, br@rueskamp.com, 5155' N 741' E
 A Unix a day keeps Linux away.
 .
 f y cnnt rd ths y mst b sng a brkn mlr
Responsible-Changed-From-To: freebsd-bugs->gshapiro 
Responsible-Changed-By: gshapiro 
Responsible-Changed-When: Mon Jun 17 14:07:56 PDT 2002 
Responsible-Changed-Why:  
Over to sendmail maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=8553 
State-Changed-From-To: open->feedback 
State-Changed-By: gshapiro 
State-Changed-When: Mon Jun 17 14:08:07 PDT 2002 
State-Changed-Why:  
The From escaping done by mail.local is the traditional way it is done 
and I don't think it should be changed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=8553 
State-Changed-From-To: feedback->closed 
State-Changed-By: gshapiro 
State-Changed-When: Wed Aug 14 21:50:32 PDT 2002 
State-Changed-Why:  
No further feedback received. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=8553 
>Unformatted:
