[comp.soft-sys.andrew] @ Automagically adding headers to outgoing mail?

nsb@THUMPER.BELLCORE.COM (Nathaniel Borenstein) (05/08/91)

Fred Hansen seems to have located the problem, which is kind of amusing
from an archaeological perspective:

Excerpts from activemsgs: 8-May-91 Re: @ Automagically adding .. Fred
Hansen@andrew.cmu.e (835+0)

> Perhaps the problem arises from this code in WriteOneFile() in sendmsg.c:

>         d = sendmessage->HeadText;
>         SeeingAt = FALSE;
>         for (i=0, lim = text_GetLength(d); i<lim; ++i) {
>         c = text_GetChar(d, i);
>         if (c == '@') {
>             if (SeeingAt) continue;
>             SeeingAt = TRUE;
>         } else {
>             SeeingAt = FALSE;
>         }
>         putc(c, fp);
>         }

Uh, yeah, that looks like the relevant part of the code all right.  An
interesting question is, what is that code supposed to do?  Too bad the
clown who wrote it didn't deign to document it with a few comments...[An
Andrew ToolKit view (a raster image) was included here, but could not be
displayed.][An Andrew ToolKit view (a footnote) was included here, but
could not be displayed.]

I think I remember, now, what the problem was:  Back in the days of the
old Scribe-format BE1 data stream, People used to cut & paste addresses
from the message-reading window into the message-sending window.  The
way the old code (ReadMail and ReadNews, at least) worked, even if you
were cutting "plain text" (no fonts),  what got put into the cut buffer
had all "@" signs quoted.  That is, if you cut something like
"nsb@thumper.bellcore.com" from the mail-reading window and pasted it
into the mail sending window, it got turned into
"nsb@@thumper.bellcore.com".    (In fact, if I recall correctly, this
problem turned out to be so deep-rooted in the way cut & paste was done
in BE1 that it had a signifcant effect on the way cut & paste is now
done in ATK, but I could be wrong.)  Anyway, the problem essentially
couldn't be fixed in BE1, and it was a nasty bug because people never
noticed the duplicate "@" until they tried to deliver the mail.  This
pre-dated address validation too, so the only symptom they ever saw of
this bug was that their message was rejected by the delivery system!  In
order to work around it, I added the code that is now responsible for
breaking the "X-Face" headers.  Time marches on.

At any rate, I think that the right fix is simply to GET RID of all the
code related to "SeeingAt".  Note that the code is DUPLICATED, more or
less, later in the same file, in the ValidateHeader routine.  More
archaeology there.  I suspect the code can simply be eliminated in both
places, since BE1 has long since gone to that happy magtape archive in
the sky....