Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!caip!im4u!esc-bb!brad From: brad@esc-bb.UUCP (Brad Benton) Newsgroups: net.news.adm Subject: Re: Minor fix for recmail Message-ID: <143@esc-bb.UUCP> Date: Fri, 21-Feb-86 01:03:25 EST Article-I.D.: esc-bb.143 Posted: Fri Feb 21 01:03:25 1986 Date-Received: Mon, 24-Feb-86 05:45:11 EST References: <158@moncol.UUCP> Reply-To: brad@esc-bb.UUCP (Brad Benton) Organization: Eclipse Systems Corporation ; Austin, Texas Lines: 49 Keywords: 2.10.3 4.3 bsd beta, cc:, recmail, dead.letter In article <158@moncol.UUCP> john@moncol.UUCP (John Ruschmeyer) writes: >Program: recmail.c (2.10.3 4.3 bsd beta) > >Problem: The program incorrectly handles a line containing a cc: with no > destinations in that it attemps to send a copy of the mail to > noone. Needless to say, this fails, leaving the user a copy of > his mail in dead.letter and a note from recmail. > Further explication of the Problem: In addrecips (the routine that parses the To: and Cc: lines) it is possible to come up with a zero-length name by having trailing garbage (blanks, commas, etc.) in the line. But addrecips doesn't notice this and goes ahead and collects a zero-length name for the mailer, which then is confronted with the user "" (in addition to all of the names validly parsed). Action: Also consider the following context diff. The advantage of the following code is that with it, recmail will correctly handle all cases in which a zero-length recipient is parsed on any line that is passed to addrecips (both To: and Cc: lines). *** recmail.c.orig Thu Feb 20 08:33:07 1986 --- recmail.c Thu Feb 20 22:43:40 1986 *************** *** 145,150 for (front=line; front < tail; ) { while (!isok(*front) && front < tail) front++; for (back=front; isok(*back); back++) ; *back=0; --- 145,152 ----- for (front=line; front < tail; ) { while (!isok(*front) && front < tail) front++; + if (front >= tail) + break; /* skip end-of-line garbage */ for (back=front; isok(*back); back++) ; *back=0; -- --brad benton ..!{gatech,seismo,ihnp4}!ut-sally!im4u!esc-bb!brad