From owner-freebsd-bugs Sun Jul 7 13:40:13 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B14837B400 for ; Sun, 7 Jul 2002 13:40:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C35843E52 for ; Sun, 7 Jul 2002 13:40:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g67Ke2JU030002 for ; Sun, 7 Jul 2002 13:40:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g67Ke2pH030001; Sun, 7 Jul 2002 13:40:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3A4F37B400 for ; Sun, 7 Jul 2002 13:36:57 -0700 (PDT) Received: from smtp.noos.fr (camus.noos.net [212.198.2.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBC9843E9C for ; Sun, 7 Jul 2002 13:36:52 -0700 (PDT) (envelope-from root@gits.dyndns.org) Received: (qmail 37927277 invoked by uid 0); 7 Jul 2002 20:36:50 -0000 Received: from unknown (HELO gits.gits.dyndns.org) ([212.198.229.153]) (envelope-sender ) by 212.198.2.70 (qmail-ldap-1.03) with SMTP for ; 7 Jul 2002 20:36:50 -0000 Received: from gits.gits.dyndns.org (ptwqw61vdquelokb@localhost [127.0.0.1]) by gits.gits.dyndns.org (8.12.5/8.12.4) with ESMTP id g67Kanr6080317 for ; Sun, 7 Jul 2002 22:36:50 +0200 (CEST) (envelope-from root@gits.dyndns.org) Received: (from root@localhost) by gits.gits.dyndns.org (8.12.5/8.12.4/Submit) id g67KancY080316; Sun, 7 Jul 2002 22:36:49 +0200 (CEST) (envelope-from root) Message-Id: <200207072036.g67KancY080316@gits.gits.dyndns.org> Date: Sun, 7 Jul 2002 22:36:49 +0200 (CEST) From: Cyrille Lefevre Reply-To: Cyrille Lefevre To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/40314: mail is unable to parse From line w/o email address Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 40314 >Category: bin >Synopsis: mail is unable to parse From line w/o email address >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jul 07 13:40:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Cyrille Lefevre >Release: FreeBSD 4.6-STABLE i386 >Organization: ACME >Environment: System: FreeBSD gits 4.6-STABLE FreeBSD 4.6-STABLE #15: Sun Jun 23 06:31:23 CEST 2002 root@gits:/disk2/freebsd/src/sys/compile/CUSTOM i386 >Description: mail don't display messages w/ a badly formatted From line such as : From Sun Jul 7 21:55:25 2002 ^ no email address the following patch try to parse the email address as a valid date before the decide that's really an email address. >How-To-Repeat: cat << EOF > test.mbox From Sun Jul 7 21:55:25 2002 From: root@gits.dyndns.org Date: Sun, 07 Jul 2002 21:55:24 +0200 (CEST) To: test@gits.dyndns.org Precedence: bulk wrong body EOF mail -f test.mbox Mail version 8.1 6/6/93. Type ? for help. "test.mbox": 0 messages & q # oops! cat << EOF >> test.mbox From root@gits.dyndns.org Sun Jul 7 21:55:25 2002 From: root@gits.dyndns.org Subject: right message Date: Sun, 07 Jul 2002 21:55:24 +0200 (CEST) To: test@gits.dyndns.org Precedence: bulk right body EOF mail -f test.mbox "test.mbox": 1 message 1 unread >Fix: Index: head.c =================================================================== RCS file: /home/ncvs/src/usr.bin/mail/head.c,v retrieving revision 1.1.1.1.14.3 diff -u -r1.1.1.1.14.3 head.c --- head.c 15 Mar 2002 19:46:31 -0000 1.1.1.1.14.3 +++ head.c 7 Jul 2002 20:20:30 -0000 @@ -113,12 +113,19 @@ * Skip over "From" first. */ cp = nextword(cp, word); - cp = nextword(cp, word); - if (*word != '\0') - hl->l_from = copyin(word, &sp); - if (cp != NULL && cp[0] == 't' && cp[1] == 't' && cp[2] == 'y') { + /* + * Illegal empty address. + */ + if (isdate(cp)) + hl->l_from = copyin("nobody", &sp); + else { cp = nextword(cp, word); - hl->l_tty = copyin(word, &sp); + if (*word != '\0') + hl->l_from = copyin(word, &sp); + if (cp != NULL && cp[0] == 't' && cp[1] == 't' && cp[2] == 'y') { + cp = nextword(cp, word); + hl->l_tty = copyin(word, &sp); + } } if (cp != NULL) hl->l_date = copyin(cp, &sp); >Release-Note: >Audit-Trail: >Unformatted: 1 root@gits.dyndns.org Sun Jul 7 21:55 10/211 "right message" & d1 & q "test.mbox" removed # oops! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message