Information technology evolves rapidly. While some of the information on these pages may still be valid, some of it is also outdated and will not be revised. For assistance with a computing problem, please contact the Computing Help Desk

Athena Mail/MIME FAQ

* What is MIME?
* What Athena mail programs (a.k.a. Mail User Agents or MUAs) support MIME attachments?
* How does MIME support work on Athena?
* Can I customize or disable the MIME display behavior?
* How do I send a MIME attachment?
* I set up my account previously to use the mime locker, should I change anything?

What is MIME?

MIME stands for Multipurpose Internet Mail Extensions. MIME is an encoding method designed for exchanging binary files over the internet (particularly via email messages) in a standardized, platform-independent form using a coding scheme called base64. A MIME-encoded message can contain several parts, each of which can be a different type of file: ASCII text, pictures, video, sound, or any other type of binary data.

What mail programs (a.k.a. Mail User Agents or MUAs) on Athena support MIME attachments?

For general information about Athena supported mail handlers see: Electronic Mail on Athena (AC-31)

How does MIME support work on the standard Athena mail system?

Beginning with the summer 1999 release of Athena 8.3, the standard Athena mail system (inc, show, etc.) is configured to handle MIME attachments automatically. (The MH suite has been upgraded to nmh or "new MH" which continues to use the same basic commands such as inc, show, etc.; major differences in behavior are explained in the Athena 8.3 Release Notes.)

When you show a message with a MIME attachment, you will usually see something like this:

  Hi Fred, here's the latest revision to Chapter 6.

  part 2     application/octet-stream  149K
  Press return to view PDF document, Type Control-C to cancel 
If you press the Return key, the attachment will be opened in an appropriate viewing application (in this case, the Adobe Acrobat reader). If you type Control-C, the attachment will be skipped, and the rest of the message will be shown.

Note: Earlier Athena releases included MIME support for MH, but some user configuration was required to open attachments automatically. If you previously set up your account to use the scripts in the mime locker, you should now revert those changes to make sure you're getting all of the current defaults.

Default MIME handling

The show command is now configured to handle MIME attachments as follows:

Dealing with attachments manually

If the file type of the attachment is not recognized or nmh is not configured to display it automatically, you can save the file as explained below and try to find an application with which to view it (either on Athena or on a Mac or PC). Before putting too much effort into this, it's a good idea to ask the sender what type of file it is (including the version number of the application used to create it), and whether the sender can make it available in another format if you don't have access to an application that can open the original.

Step 1: Extract the attachment

When you try to show the file, you will see something like this:
  Here it is...make sure the speakers are ON but
  the volume is very, very low

  part 2     application/zip           557K

  Unknown content type application/zip 
  Use mhstore to store this data to disk. 

If you just type mhstore, it will save each part of the current message, with a filename of the form message#.part#.ext (by default, to the current directory). The message text is usually the first part, and each attachment is an additional part. For example:
  athena% mhstore
  storing message 3 part 1 as file 3.1.txt
  storing message 3 part 2 as file
To save only the attachment, you must specify its part number:
  athena% mhstore -part 2
  storing message 3 part 2 as file
If you don't have the part number handy from the earlier show command, you can see a list of all the parts by using the mhlist command:
  athena% mhlist
   msg part  type/subtype              size description                        
     3       multipart/mixed           753K
       1     text/plain                 141
       2     application/zip           557K
Notes on using mhstore:

Step 2: Identify the file type

If the file type isn't clear, you can use the file command to try and identify it:
     athena% file filename
or the SIPB version, which may recognize other file formats:
    athena% add sipb
    athena% /mit/sipb/bin/file filename
If this doesn't tell you anything useful, look carefully at the show prompt again for hints. For example:
     athena% show
     part 1     application/octet-stream   13K

     Unknown content type application/ 
     Use mhstore to store this data to disk. 

(although the part description "application/octet-stream" doesn't help, from the next line it appears that the filetype is Excel).

Finally, you can run mhstore -auto to try and save the attachment with its original filename to see if the name or extension tells you anything:

     athena% mhstore -auto
     storing message 14 part 1 as file nonsense.xls

Step 3: Find an application for viewing the file

Once you've determined the file type, you can try and find an application on Athena able to open it. Some common cases:

MSOffice files:

uuencoded files:

If the message includes test which begins something like this:

  begin 666 Letter_to_depts_re_renewal.doc
  M````10``````````$ ``2 ````$```#^____`````$8```#_____________
it is uuencoded. You can decode it as follows:
     athena% show | uudecode
(The file will be decoded to its original name in the current directory.)

BinHex files:

If the attachment is a BinHex file (an encoding type often used on Mac files), you can decode it as follows:

     athena% add consult
     athena% xbin filename
This will silently unravel the BinHex file and leave three additional files. The file with the extension .data is the file with the MIME content, the others can be discarded.
     athena% /mit/sipb/bin/file testfile.*
will return the following: Microsoft Word 6.0 Document
     testfile.doc:  BinHex binary text, version 4.0 data
     testfile.rsrc: data


exmh is graphical interface to MH which is configured to handle MIME messages. (Note: this program is maintained by the SIPB, not IS. It is based on MH, and there are no general problems going back and forth between the two. There is a known problem handling mail from exmh when an account goes over quota.)

To run exmh from an Athena workstation:
     athena% add sipb
     athena% exmh &
The non-text parts of a MIME message are labelled separately; pressing the right mouse button over each label brings up a menu of options for saving or otherwise handling that part.

Documentation on exmh

athena% man exmh
online help within exmh
Manual and extensive FAQ.


Netscape mail

Netscape mail is designed to handle MIME mail in much the same way it handles HTML files: selecting a component will either bring up an appropriate helper application or present you with the option of saving the file. However, Netscape stores mail in a format that is incompatible with MH-based inbox; once read in Netscape, a mail message will not be visible from the other readers.

For information on configuring your Athena account to use Netscape mail, see Athena Consulting's stock answer on how to use Netscape Mail.


Can I customize or disable the MIME display behavior?

There are several customizations you can make with environment variables:

variable customization
MU_HTML html display HTML mail in a web browser
MU_MSWORD frame display Word documents in FrameMaker (rather than as text)
MU_MSWORD html display Word Documents as HTML in a web browser (it will fall back to Frame in the case of Word 6 or Word 7 files, which can't currently display as html)
MU_EXCEL frame display Excel documents in FrameMaker rather than Xess (depending on the version of the file, one application may be more successful than the other)
MU_AUDIO no prevent any playing of audio attachments
NOMHNPROC disable automatic display of MIME attachments (if you set this, you can still manually invoke MIME display by using mhshow instead of show)

To make one of these changes the behavior, use the setenv command with the corresponding variable above. For example:

     athena% setenv MU_MSWORD frame
would cause Word docs to be opened in FrameMaker, while
     athena% setenv NOMHNPROC   
will disable automatic MIME display.

If you want to make a customization permanent, add the setenv line to your ~/.environment file and it will take effect at your next login. (For general information about environment variables and customizing your Athena account, see the IS Publication Working with Configuration Files ("Dotfiles") .)


How do I Send Mail with MIME Attachments?

Exmh handles attachment sending automatically, but if you don't want to switch from MH you can still send MIME attachments manually.

First, use a text editor to write a message to accompany the encoded file. Then at the Athena prompt do:

     athena% add graphics
     athena% mpack -m 0 -d messagefile file-to-encode recipient-address
(Setting the "-m" option to zero means that there is no limit to size of the generated message). You will be prompted only for the Subject before the mail is sent. For example:
     athena% mpack -m 0 -d /tmp/msg /tmp/ ajfox
     Subject: Claus test
Note: the -m flag can be used to split the file into several separate messages of a specified maximum size. See the man page for more details.


I set up my account previously to use the mime locker, should I change anything?

If you previously set up your account to use the scripts in the mime locker, you should now remove those lines from your ~/.environment files:
     add mime
     source /mit/mime/share/setup.csh
or if you are a bash user, remove from your ~/.profile:
     add mime
     . /mit/mime/share/


MIT | Academic Computing | Contact us
Last modified: Tue Jun 5 12:36:09 2001