Sending ASCII and non-ASCII files as attachments

It is incorrect to send raw non-ASCII-text files in e-mail messages (e.g. executable files, word processor documents, graphics image files, compressed Unix files, tar files, etc.). These files contain extra long ``lines'' that could be truncated and special characters that may be mangled in transmission, so it is very likely your recipient will not be able to read or use the file. The correct way to send such files intact is to encode them as ASCII-text and have your recipient decode them. This procedure works with ASCII attachments as well. Encoding and decoding is done automatically by the attachment feature in the pine and Netscape mailers. The Unix utilities that accomplish the same result are the paired Carnegie Mellon University mpack and munpack commands. The mpack utility even sends the file.

For example, to encode the image file Sunflower.jpg and send it as a MIME-encoded attachment to , use

   mpack Sunflower.jpg
The standard graphics filename extension, .jpg is recognized by mpack and the attachment is labeled as such. If your friend is using the Netscape or other MIME-capable mail reader, he/she should be able to view the image file upon opening it.

To decode a message sent in this way, open the message with mail and write it to a file using the w <tempfilename> command. Then run

  munpack <tempfilename>
to decode the document. If the message contained the above example attachment, a file called Sunflower.jpg should then appear in the same directory, ready to view with xv.

SECURITY CAUTION: A Trojan horse is malicious executable code disguised as an innocent attachment and received and executed by an unsuspecting recipient. Computer viruses are spread this way. Do not run an executable file (binary executable, shell script, word processor and spreadsheet documents containing executable macros, etc) sent as an attachment, unless you are sure it will do no harm.