Help for Pine - MIME
You are in Home > Miscellaneous > MIME


This section talks about handling of attachments in Pine. We describe here how you can set variables so that opening attachments in Pine (and sending them) will be smooth for you and the recipients of your messages.

The most important point that you must understand is that what is described here only works if all involved parties in the handling of the message decide to cooperate. It is enough that at least one of the parties misconfigures his/her system to make it fail for you (and vice versa). Therefore it's important that you configure your system correctly.

What is MiMe?

MIME stands for Multipurpose Internet Mail Extensions. It is intended to be a way to safely transport all type of information through a mail system. Any two mime-conformant clients can exchange any message in an encoding that will not corrupt the information.

There are two main issues when transporting a message. That is transporting its text and attached files. First we will discuss the case of attachments, leaving the case of handling of text in the e-mail for later in this document.

Configuration Variables Related to Mime

In order to view attachments in Pine, a few configuration options will help you to deal with them. Here's a list of them
  1. enable-msg-view-attachments This features allows you to open an attachment by selecting it from the message, without having to press "V" to view the list of attachments. All you need to do is to put the cursor over the attachment and press RETURN to open it.
  2. prefer-plain-text When you receive an html message, normally it is also sent an attachment containing the same message but in plain text. If you enable this feature, you will see the plain text attachment and not the html attachment.
  3. quell-content-id This configuration is set in case you send an attachment to a user using Outlook, and this one can not see the attachment. Setting this option, will make those users of Outlook see the attachment.
  4. show-plain-text-internally Instead of passing plain text to an external viewer, setting this option will make Pine display it for you.
  5. mimetype-search-path This variable contains either the path to your mime-type file or a colon delimited sequence of full paths to mime-type files in you're system. Typical entries here include:
    mimetype-search-path = /home/id/.mime-types
    mimetype-search-path = /etc/mime-types:/home/id/.mime-types
  6. mailcap-search-path Same as with mimetype-search-path, but this configuration option contains the value for the mailcap file. Additionally to the consideration for mime-types, the MAILCAPS environment variable can be used to determine the search-path. Notice that if the files are separated by a plus sign (+), then the files must be combined, and if they are separated by a semi colon (;), then the first file found should be used.

The .mime-types File


Every file that you create or open has associated a type. For example, the file that you are reading now is a HTML file, therefore this file should be labeled TEXT/HTML. The idea of associating a type to a file is to associate a program that will be able to handle the file. For example, a TEXT/HTML is handled by a web browser, like the one you are using right now. A web browser knows what to do with this type of files, but it may not know what to do with an audio file (you need a media player for handling that file). Therefore there are two parts to this process, one is the type of the file, and the other is the program used to open that file. In this part we will see how to associate a file with its type.


Normally when a file is created, in order to distinguish a file from another people use extensions that indicate what the type of the file is. For example lisa.gif is probably a picture of Lisa. You recognize this, not by the name "lisa", but by the extension ".gif".

The same method is applied to create the .mime-types file. All the information that this file contains is just associations of extensions of files and their corresponding mime-type, in the format

file/type	extension1 extension2 extension3
For example, the following are possible entries in a .mime-types file
video/mpeg                     mpeg mpg mpe
text/html                      html htm
image/gif                      gif
image/jpeg                     jpeg jpg jpe
application/msword             doc
application/VND.MS-EXEL        xls
application/pdf		       pdf
application/postscript	       ps
A cautionary note is that Pine does not recognize the mime-types file generated by Netscape. The format used by Pine is exactly as shown above, and any other format will result in Pine not making the right association of file and type.

In particular, the above table implies that the file thesis.doc is a word document of type application/msword. This information is used in two ways by Pine. If you were to attach the file thesis.doc, then Pine would attach that file as application/msword, and in that form will be received by the user. On the other hand when you have received a file of type application/msword, if you have configured your mailcap file correctly you may be able to open it from Pine, without any need to save it first.

Here you can find a list of recognized file types. Note in particular the type Application/octet-stream. This type is used to identify files that do not conform to any specified type, and therefore, you should not associate it to any extension type.

The .mailcap File

This file contains the information on how to open a file of an specified type. Its format is as follows
file/type; command %s;[test]; extra_parameter 
Here is a sample entry .mailcap file:
application/pdf;acroread3 -geometry 700x800 -tempFile %s ; ;  test=test -n "$DISPLAY"
application/postscript; gv  %s ; ; test=test -n "$DISPLAY"
text/html;/usr/local/bin/lynx -use_mouse -force_html %s;needsterminal
image/gif;xv  %s ; ;  test=test -n "$DISPLAY"
video/mpeg; mpeg_play %s  ; ;  test=test -n "$DISPLAY"
As a cautionary note. You should never add to this list programs that may have bad effect on your system. For example adding an entry for application/x-sh (for a shell script) is a bad idea, as that could perfectly be a virus, and you certainly don't need to get infected by one. For the same reason, you should not associate a program to the file type application/octet-stream.
You are in Home > Miscellaneous > MIME