Fran Rizzardi and Newton Akiyama
It is quite common for people to send files via e-mail. The easy way to do this using Pine and Eudora, two popular and easy-to-use mail agents, is to include files as "attachments." (In Pine this is done by giving the file name in the Attchmnt: header or after typing ^J, i.e., Control-J.) Be warned, however, that both Pine and Eudora attachments are sent encoded in MIME format. Be sure that your recipient has some way to read MIME files before doing this. Pine, Eudora, and Elm can all interpret MIME files. MIME files that originated as ASCII text are displayed correctly on any type of terminal.
Below we will discuss various ways to read MIME files, as well as alternatives for people without MIME capability.
MIME stands for "Multipurpose Internet Mail Extensions." It is the de facto standard for sending multipart, multimedia, and binary data using e-mail. A MIME file, regardless of the original file's type, is an ASCII text file with 60 characters per line. This avoids any line truncation that may be done by non-UNIX mail handlers. MIME also allows for labeling message parts so that a recipient (or mail agent) may determine what to do with them.
All mail agents on Garnet and Violet have a way of invoking a text editor on your message, and all text editors on Garnet and Violet have a way to insert a file into your edited message. For example, with Pico, the default editor used by Pine, the ^R ("Read File") command prompts you for the name of a file to read in. When your cursor is in the "Message Text" section of your message, you are using Pico automatically. A file read into Pine in this manner will not be MIME-encoded. Whichever editor and user mail agent you use, this is the recommended way of sending files to people who can't read MIME files.
Garnet or Violet users who use the standard mail command (sometimes called ucbmail) can use mmencode (mimencode) with the -u option to decode any MIME files they receive. Mmencode must be read only on the MIME-encoded text; if you include any regular text or even the MIME message boundaries (lines that begin with --), the results will be unreadable. An easy way to run mmencode on a mail message if you don't mind seeing ^M's at the ends of lines (and a bit of line-wrapping that the ^M's may cause) while in mail is to type the internal mail command v, mark the beginning and end of the MIME-encoded text, and use vi's "bottom line" | command to invoke mmencode on those lines of text. For example, suppose the message you received looks like this:
To: Fran RizzardiMessage-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-885409262-805152566:#21166" Status: R This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-885409262-805152566:#21166 Content-Type: TEXT/PLAIN; charset=US-ASCII --0-885409262-805152566:#21166 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=motd Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: VUxUUklYIFY0LjNBIChSZXYuIDE0NikgU3lzdGVtICM2OiBUaHUgSnVuIDMw IDE1OjM3OjIzIFBEVCAxOTk0DQpVV1MgVjQuM0EgKFJldi4gMjUpDQpTY2hl ZHVsZWQgRG93biBUaW1lOiBGaXJzdCBTdW5kYXkgb2YgdGhlIG1vbnRoIGZy b20gMDM6MDAtMTA6MzAgYS5tLg0KDQoNCiAxIEp1bjogIFN1bW1lciBzaG9y dCBjb3Vyc2Ugc2NoZWR1bGUgYXZhaWxhYmxlLiAgVHlwZSAiZ29waGVyIGlz dHB1YiA0MDAxIiBhbmQNCiAgICAgICAgIHNlbGVjdCAiSVNUIENvbXB1dGVy IENvdXJzZSBTY2hlZHVsZSwgU3VtbWVyIDE5OTUiIGZvciBpbmZvcm1hdGlv bi4NCg0KIDUgTWF5OiAgMjQwMCBCYXVkIE1vZGVtIFNlcnZpY2UgY2hhbmdp bmcgb24gTWF5IDIyLiAgU2VlIG5ld3MuDQoNCiAzIEZlYjogIFBPUlQgU0VM RUNUT1IgU0VSVklDRSBHT0lORyBBV0FZIDcvMS85NS4gIEZvciBtb3JlIGlu Zm9ybWF0aW9uLCBzZWUNCiAgICAgICAgIHRoZSBhcnRpY2xlICJQb3J0IFNl bGVjdG9yIEZpbmFsbHkgR29pbmcgQXdheSwgRm9yIFJlYWwiIHVuZGVyDQog ICAgICAgICAiQ29tcHV0aW5nIGFuZCBDb21tdW5pY2F0aW9ucyIgdXNpbmcg Z29waGVyIG9yIHVuZGVyICJDb21wdXRpbmcNCiAgICAgICAgIFJlc291cmNl cyIgdXNpbmcgbHlueC4NCg0KIDQgTm92OiBUd28tc2lkZWQgcHJpbnRpbmcg b24gdGhlIEhQMSBwcmludGVyIG5vdyBhdmFpbGFibGUuICBTZWUgIm5ld3Mi Lg0KDQo= --0-885409262-805152566:#21166--
If you marked the first line of the encoded text (beginning with VUxUUk) with the command ma and marked the last line of the encoded text (beginning with Lg0KDQo=) with mb, then the command
will show the decoded text. See man mimencode for more details of this command.
For PC and Macintosh users, there are a number of standalone programs that can interpret a MIME message. One such program available for both platforms (in addition to UNIX) is munpack. Munpack was developed at Carnegie Mellon University and is available via anonymous FTP from ftp.andrew.cmu.edu in the directory pub/mpack/.