Re: Points about yarn

From: Lulu of the Lotus-Eaters (quilty@ibm.net)
Date: Mon, 01 Nov 1999 23:23:06 -0500

Howard Schwartz <theo@ncal.verio.com> wrote:
|to which Lulu replied:
|> The problem with this is that Yarn hides the From: editor from the
|> editor (and attaches it only during post-processing. I never liked this
|> one element of Yarn's behavior.

|The problem is not a problem: When you reply the address in the
|From: line becomes the address in the To: line, which Yarn Does include
|in your editor. So the name of the recipiant of your mail is available.

You are quite correct. I made a 'thinko' with this. In the past I have
wanted to process my own outgoing address (to change it depending on the
context, and have been frustrated by the inability to control the From:
within my editor). I played with Yarf and Yep to fix this issue, but it
is kludgey. But this thread is about a different issue.

One thing one could do to automate things further is to use a "custom
editor" that includes preprocessing. I do this along with Yep, but you
don't need to. My "editor" is a batch file, called YARNEDIT.CMD. In
this, I do a little preprocessing:

::--- First change the Content-Type
sed "s/ISO-8859-8/US-ASCII/" %1 > %1.1

::-- Next, clean commas from To:
sed "s/\(^To:[ ]*([^,]*\),\([^,]*)\)/\1 -\2/" %1.1 > %1.2

::-- Restore the last modified file to original name
copy %1.2 %1

::-- Delete intermediate files
delete %1.1
delete %1.2
delete %1.3

::-- Now actually edit the template
d:\boxer\b2.exe %1 %2

This isn't great, and I may improve it later... but you can see the
idea. In terms of the second 'sed' -- for those who cannot immediately
grok regex's (which includes me) -- the purpose was to deal with a class
of probably RFC822 invalid addresses I was receiving. I was getting
messages from a sender like:

From: (John Doe, Acme Enterprises) jdoe@acme.com

If I replied without noticing the address, SOUPER would interpret the
To: field as consisting of two addresses, with the one '(John Doe' not
matching anything, of course[*]. My sed command eliminates the commas
from fullnames surrounded by parentheses. Of course, it is imperfect,
since it will only fix the first such problem address on the To: line,
not subsequent ones. If anyone has a better regex, I'd be curious.

Yours, Lulu...

[*] I am not sure, but I think VSOUP might be smarter about handling the
above address than SOUPER was. I wrote the sed command before I
switched to VSOUP.

--
quilty    _/_/_/_/_/_/_/ THIS MESSAGE WAS BROUGHT TO YOU BY:_/_/_/_/ v i
@ibm.   _/_/                    Postmodern Enterprises         _/_/  s r
net    _/_/  MAKERS OF CHAOS....                              _/_/   i u
      _/_/_/_/_/ LOOK FOR IT IN A NEIGHBORHOOD NEAR YOU_/_/_/_/_/    g s