From owner-freebsd-bugs Fri Dec 29 22:00:05 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id WAA01524 for bugs-outgoing; Fri, 29 Dec 1995 22:00:05 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id WAA01497 Fri, 29 Dec 1995 22:00:02 -0800 (PST) Resent-Date: Fri, 29 Dec 1995 22:00:02 -0800 (PST) Resent-Message-Id: <199512300600.WAA01497@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, gil@limbic.ssdl.com Received: from limbic.ssdl.com (limbic.ssdl.com [206.109.78.34]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id VAA01427 for ; Fri, 29 Dec 1995 21:59:01 -0800 (PST) Received: (from gil@localhost) by limbic.ssdl.com (8.7.2/8.7.2) id XAA22783; Fri, 29 Dec 1995 23:58:56 -0600 (CST) Message-Id: <199512300558.XAA22783@limbic.ssdl.com> Date: Fri, 29 Dec 1995 23:58:56 -0600 (CST) From: "Gil Kloepfer Jr." Reply-To: gil@limbic.ssdl.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: misc/922: Bad From line handling in mail.local Sender: owner-bugs@freebsd.org Precedence: bulk >Number: 922 >Category: misc >Synopsis: From line handling incorrect in mail.local >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Dec 29 22:00:01 PST 1995 >Last-Modified: >Originator: Gil Kloepfer Jr. >Organization: SSDL >Release: FreeBSD 2.0-BUILT-19950603 i386 >Environment: Any FreeBSD environment using sendmail with mailers such as elm >Description: If a "From " line is in the text of a message, a ">" is not consistently prepended to the word "From ", causing mailers such as elm to erroneously think that a new message has started. The problem occurs specifically when a "From " line occurs in the text of a message without a blank line before it. The problem has manifested itself more recently because I think the old local mailer in sendmail had the F=E option, and I know it doesn't now. mail.local is the correct place to do the substitution, not sendmail. >How-To-Repeat: Forward a message to yourself using elm, or remotely using any mail user agent that will not automatically prepend ">" to "From " lines. The mail.local program will not do the proper prepending. >Fix: The logic for the original mail.local for handling "From " lines makes little sense. I have interpreted it as attempting to leave existing "From " lines in the header alone, although I'm pretty sure that these are supposed to have a prepended ">" also if there is a duplicate. I will leave it up to the sendmail people to interpret what the code should have done, and what it should do now. The bug is also in the current mail.local in the latest version of sendmail. I have not checked the 2.1.0-RELEASE of FreeBSD to see if it exists there. *** mail.local.c Fri Dec 29 23:45:34 1995 --- mail.local.c.orig Fri Dec 29 23:46:45 1995 *************** *** 158,171 **** (void)fprintf(fp, "From %s %s", from, ctime(&tval)); line[0] = '\0'; ! for (eline = 0; fgets(line, sizeof(line), stdin);) { if (line[0] == '\n') eline = 1; ! else if (eline && line[0] == 'F' && !memcmp(line, "From ", 5)) (void)putc('>', fp); ! (void)fprintf(fp, "%s", line); if (ferror(fp)) { e_to_sys(errno); --- 158,172 ---- (void)fprintf(fp, "From %s %s", from, ctime(&tval)); line[0] = '\0'; ! for (eline = 1; fgets(line, sizeof(line), stdin);) { if (line[0] == '\n') eline = 1; ! else { if (eline && line[0] == 'F' && !memcmp(line, "From ", 5)) (void)putc('>', fp); ! eline = 0; ! } (void)fprintf(fp, "%s", line); if (ferror(fp)) { e_to_sys(errno); >Audit-Trail: >Unformatted: