Chapter 8. Mailcap Files

In this chapter:

  • Mailcap File Format

  • Implementation Under Unix Operating Systems

  • Implementation Under Other Operating Systems

Modem mail user agents are required to handle files of many different types. Other applications on the same machine, such as World Wide Web browsers or news readers, may also have a requirement to display data based on the data’s advertised MIME type.

The MIME Content-type header gives an MUA or web browser enough information to choose a proper viewer for incoming files if the MUA understands both the list of all possible MIME types and the list of all possible viewers available on the local system. But it is difficult for MUAs to keep up with system changes as applications are added and removed. Also, MIME types may be registered, or used by a given vendor without registration, after the MUA is distributed. How then can MUAs keep up?

Some existing mail and web applications have taken a monolithic approach to this problem. Each program is created with as many native data handlers as possible. Others, like Netscape Navigator, allow MIME types to be associated with “helper apps,” but it has its own custom configuration file that lists them.

It would be better to have a single, system-wide listing of MIME content handlers that programs could share.

One solution to this problem is a “mailcap” file. Mailcap files are defined in RFC 1524, “A User Agent Configuration Mechanism for Multimedia Mail Format Information.” This solution is not an Internet ...

Get Programming Internet Email now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.