[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

XYENC and E-mail



Wally:

I figured out why my XYENCode posting was getting corrupted in
transit. It's because it contained lines beginning with a period
(Ascii-46d), which has special significance in SMTP messages.

SMTP uses the sequence "." to signify the end of an
e-mail transmission. Since the message body itself may contain this
sequence, SMTP checks the first character of each line before
sending it; if the line starts with a period, the server "escapes"
it by inserting an additional period at the beginning of the line.
The receiving server is supposed to do the reverse to incoming
messages. If an incoming line consists of a lone ".", the
tranmission terminates, but if a line starting with "." contains
additional characters, the initial period is deleted, or should be,
on the assumption that the sender added "." to that line. (See RFC
821, Simple Mail Transfer Protocol, Section 4.5.2.1.) But sometimes,
for whatever reason, the extra period is not deleted, it slips
through. That's what was corrupting my XYENCode block.

We encountered this problem years ago with U2's frame ENCODE, and
solved it by having ENCODE expand any period at the beginning of a
line to its Ascii decimal token, "{046}". XYENC.COM could -- and, I
think, should -- do something similar: Expand any period at the
beginning of a line to "{tilde}046" (which XYDEC.COM recognizes and
decodes properly). I think this expansion should occur whenever the
user supplies a line-width value for encoded output, on the
assumption that the main, if not the only, rationale for specifying
line width is to accommodate encoding for e-mail. (Alternatively,
you could add a new option that would force an expansion to
"{tilde}ddd" of any Ascii char that would otherwise be passed as is.
But this would be overkill in relation to the immediate problem, and
would require the user to remember to use the option when encoding
for e-mail. So an automatic expansion of just the initial period
seems preferable.)

There's another potential issue with encoding for mail transmission.
Some servers (perversely) delete blanks and tabs at the end of a
line. This doesn't affect XYENC, however, because blanks and tabs
are already encoded to "safe" characters.

--
Carl Distefano
cld@xxxxxxxx