MHonArc Resources: MIMEALTPREFS

[Prev: MHPATTERN] | [Resources][TOC] | [Next: MIMEARGS]

# MIMEALTPREFS

- Syntax
- Description
- Default Setting
- Resource Variables
- Examples
- Version
- See Also

## Syntax

Envariable

  N/A

Element

  `<MIMEALTPREFS>`
  content-type
  content-type
  ...
  `</MIMEALTPREFS>`

Command-line Option

  N/A

## Description

MIMEALTPREFS allows you to specify media-type preferences for `multipart/alternative` data, overriding the default preferences as specified in mail messages.

When a `multipart/alternative` entity is processed, the last filterable media-type is normally used. However, it is sometimes desirable to override this behavior for certain media-types. For example, it has become common for many MUAs to generate the following message structures:

      multipart/alternative
        text/plain
        text/html

A message with HTML and a plain text equivalent for receiving MUAs who cannot render HTML. When MHonArc processes such a message, MHonArc will use the `text/html` part since it is filterable and comes after `text/plain`.

There are many who would like to have nothing to do with HTML in email, like for security reasons. With MIMEALTPREFS, you can tell MHonArc to use the `text/plain` entity (if it exists) over the `text/html` part with the following setting:

    <MIMEAltPrefs>
    text/plain
    text/html
    </MIMEAltPrefs>

Media-types listed in MIMEALTPREFS are from most prefered to least prefered.

Note, MIMEALTPREFS augments the normal processing of `multipart/alternative` entities. For example, say the following message entity structure exists,

      multipart/alternative
        text/plain
        text/enriched
        text/html

and we are using the MIMEALTPREFS setting,

    <MIMEAltPrefs>
    text/plain
    text/html
    </MIMEAltPrefs>

So which entity will MHonArc actually use? In this case, the `text/enriched` part will be used. The reason is that the `text/html` will be excluded since a `text/plain` alternative entity exists. However, MHonArc still tries to use the last filterable alternative part, which is `text/enriched` in this case.

In order to have `text/plain` chosen, the following MIMEALTPREFS setting would be needed,

    <MIMEAltPrefs>
    text/plain
    text/enriched
    text/html
    </MIMEAltPrefs>

This says that `text/enriched` is preferred over `text/html`. And `text/plain` is preferred over `text/enriched` and `text/html`.

NOTE | Each time `<MIMEALTPREFS>` occurs in a resource file, the last encountered setting will override any previous values. Therefore, specifying the `override` attribute is redundant.

## Default Setting

Nil

## Resource Variables

N/A

## Examples

None.

## Version

2.5.8

## See Also

MIMEEXCS

[Prev: MHPATTERN] | [Resources][TOC] | [Next: MIMEARGS]