Uue decoding utility

Class which decodes UUE encoded files.

UUE format description:

Internet e-mail and Usenet news posts were designed for plain text messages.
As such, many systems expect the messages to only contain printable characters
from the 7-bit (first bit of the 8-bit byte is always zero) ASCII character set.

This poses a problem for sending files, which can contain any combination of 8-bit binary data.

The way around this limitation is to encode the binary data (attachment)
into ASCII characters before sending

Uuencode (Unix-to-Unix Encode), as its name implies, comes from the Unix world.
It was commonly used to encode files transmitted from one Unix computer to another.

Most mail systems will pass Uuencode without problems.

Uuencode is more common in news than mail. MIME is making inroads in mail faster than news.

Uuencode results in a transmitted message about 42% larger than the original file.
This is typical of the encoding penalty.

Below shows how the image would look like if Uuencoded.

The encoded file follows. Most lines begin with an "M" 0x4D (representing the line length before encoding+32) and 60 characters of data. Every three octets(bytes) of data, are spitted into four sextets and offsetting each sextet by 32 decimal.

The last data line is usually shorter, and therefore starts with a different character.
The end of the encoding has "`" on a line by itself and then the word "end" on a line by itself.

begin 644 a.gif
M1TE&.#EA)0`H`+,``.P`2QBQ`/__________________________________
M_____________________RP`````)0`H```$5S#(2:N]..O-N_]@*(YD:9YH
MB@(LH%ZM^U;Q3,6L+>6MW@>_5VXW%,J`Q500>5PUF:HE\4F20ITX'#:K-5FG
;WB3MZR&#J^(QM9RVF'7PN'Q.K]OO^+Q^!``[
`
end

Example:

ArrayList list=Uue.GetAllFiles(s);    //s - any string which may contain uuencoded files.

foreach(UueFile uueFile in list)
{
    FileStream stream=File.Create("c:\\"+uueFile.FileName);
    stream.Write(uueFile.Data,0,uueFile.Data.Length);
    stream.Close();
}

Download and parse your emails with Mail.dll component for .NET.

Products > Mail.dll - mail component for .NET 2.0 > Mail.dll help > Uue decoding utility