Extra commas in To: field

From: Lulu of the Lotus-Eaters (quilty@ibm.net)
Date: Tue, 18 May 1999 23:06:35 -0400

I have used Yarn for a bunch of years, but only in the last few days
found both this list and some web pages devoted to enhancements and
add-ons to Yarn. So I hope my first post is of some help to someone.

One small glitch I have found in Yarn has always bugged me. After
downloading Yep, which does a lot of nice stuff, I nonetheless concluded
that Yep would not fix the specific problem I am about to mention... at
least not so far as I can see. That is, when responding to a letter
from someone who has a comma in their name, Yarn (or Souper, really)
chokes on trying to send the letter. At least in my experience (YMMV).

For example, if I receive a letter with:

From: johndoe@morgue.com (John Doe, Body)

when I press 'R', this same line gets copied to the To: in my outgoing
message. When I try to send this message with Souper, I get an error
message about 'address <Body> not valid', or something to that effect.
I know I can change the To: in my editor, but I often forget to.

The solution I have come to is to use as my editor a script called
YarnEdit.cmd. The last instruction in my script is to call my actual
editor (Boxer/2 in my case). But before I do that, I do some massaging
of the headers. One such massage is:

sed "s/\(^To:.*(.*\),\(.*)\)/\1 -\2/" %1.1 > %1.2

In the above case, I would wind up with the line:

To: johndoe@morgue.com (John Doe - Body)

in the respond message. I know the semantics of the dash might not be
exactly the same as what the sender meant by the comma... but it should
be close enough, and not choke on sending the reply.

Sed is a widely available tool for pretty much every platform (including
OS/2, which I use). The particular deal I do with %1.? is peculiar, and
is part of creating and copying around temporary versions of my massaged
file. That could probably be improved. Maybe the Regex could be
improved also (I can think of some perverse cases that would do the
wrong thing... but to account for them I would need an even worse
looking Regex). But this might work for someone else.

Yours, Lulu...

--
    _/_/_/ THIS MESSAGE WAS BROUGHT TO YOU BY: Postmodern Enterprises _/_/_/
   _/_/    ~~~~~~~~~~~~~~~~~~~~~[quilty@ibm.net]~~~~~~~~~~~~~~~~~~~~~  _/_/
  _/_/  The opinions expressed here must be those of my employer...   _/_/
 _/_/_/_/_/_/_/_/_/_/ Surely you don't think that *I* believe them!  _/_/