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

# MIMEDECODERS

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

## Syntax

Envariable

  N/A

Element

  `<MIMEDECODERS>`
  decoder-specification
  ...
  `</MIMEDECODERS>`

Command-line Option

  N/A

## Description

The MIMEDECODERS resource specifies Perl routines to call for decoding MIME encoded data. For message bodies, the encoding is specified by the `Content-Transfer-Encoding` header field. Data encoding can also occur for non-ASCII data in message headers.

The MIMEDECODERS resource can only be defined via the resource file. Each line of the element specifies a encoding, the Perl decoding routine, and the Perl source file containing the routine.

Example:

    <MIMEDecoders>
    base64;           base64::b64decode;            base64.pl
    </MIMEDecoders>

The first field is the encoding method. The second field is the routine name (which should contain a package qualifier). The third field is the source file the routine is defined. The source file is optional if the routine is known to be defined in an already listed source file.

There are some special decoder routines values. They are as follows:

as-is

  Leave the data "as-is".

Each decoder function is invoked as follows:

        $decoded_data = &function($data);

## Default Setting

    <MIMEDecoders>
    7bit;             as-is;
    8bit;             as-is;
    binary;           as-is;
    base64;           base64::b64decode;            base64.pl
    quoted-printable; quoted_printable::qprdecode;  qprint.pl
    x-uuencode;       base64::uudecode;             base64.pl
    xuue;             base64::uudecode;             base64.pl
    uuencode;         base64::uudecode;             base64.pl
    </MIMEDecoders>

## Resource Variables

N/A

## Examples

The following example changes the base64 decoder to use the MIME::Base64 module (available from CPAN):

    <MIMEDecoders>
    base64; MIME::Base64::decode_base64; MIME/Base64.pm
    </MIMEDecoders>

## Version

2.4.4

## See Also

CHARSETCONVERTERS, MIMEFILTERS, PERLINC

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