🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.vm.bug
Article #8749

vm-su-do-author

#8749
From: Kevin Rodgers
Date: Thu, 24 Jun 1993 19:39
44 lines
2481 bytes
There appear to be a couple bugs in vm-su-do-author, which is
responsible for determining the 'from' and 'full-name' message
attributes.  When a "From:" header header is present, vm-su-do-author
uses regexps to parse the address and person's name; in particular, it
looks for these formats

	full-name <address>		e.g. First Last <user@host.domain>
	address (full-name)		e.g. user@host.domain (First Last)

by matching these regexps, respectively

	"^\\([^< \t\n]+\\([ \t\n]+[^< \t\n]+\\)*\\)?[ \t\n]*\\(<\\([^>]+\\)>\\)"
	"[\000-\177]*(\\([^)]+\\))[\000-\177]*"

The problems I've found are that:

1. Nested parentheses in second format aren't handled correctly.  For
   instance, "user@host.domain (First Last (position))" gets parsed as
   full-name = "position" and from = "user@host.domain (First Last )".

2. Only two white-space separated words are allowed in the full-name
   part of the first format.  For example, "First Middle Last
   <user@host.domain>" isn't recognized.

I can fix vm-su-do-author and post the patch, but I have a couple
questions about the way it's implemented that I'd like to have answered
before I proceed:

1. Why not use rfc822-addresses, like vm-su-do-recipients, to extract
   the 'from' attribute?

2. Since the two formats are analogous in that they consist of two parts
   separated by whitespace, one of which is enclosed by matching
   delimiters, why aren't they parsed by analogous regexps?

   In particular, why is the regexp for "full-name <address>" anchored
   at the beginning but not at the end, and why isn't the regexp for
   "address (full-name)" anchored at all?
-- 
Kevin Rodgers				kevin@traffic.den.mmc.com
Martin Marietta MS DC5695		(303) 971-2396
P.O. Box 179
Denver CO 80201 USA			GO BUFFS!
Technical Details
Message-ID: <1993Jun24.193940.5265@den.mmc.com>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!ux1.cso.uiuc.edu!sdd.hp.com!col.hp.com!csn!news.den.mmc.com!traffic!kevin

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6829,5d57888019b47500,start
X-Google-Attributes: gidf6829,public
X-Google-ArrivalTime: 1993-06-24 13:03:47 PST
Newsgroups: gnu.emacs.vm.bug
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!ux1.cso.uiuc.edu!sdd.hp.com!col.hp.com!csn!news.den.mmc.com!traffic!kevin
From: kevin@traffic.den.mmc.com (Kevin Rodgers)
Subject: vm-su-do-author
Message-ID: <1993Jun24.193940.5265@den.mmc.com>
Sender: news@den.mmc.com (News)
Nntp-Posting-Host: traffic.den.mmc.com
Reply-To: kevin@traffic.den.mmc.com
Organization: Martin Marietta Information Systems, Western Internal Systems
Date: Thu, 24 Jun 1993 19:39:40 GMT
Lines: 44