Oracle eMail Server Administrator's Guide Release 5.2 A86653-01 |
| Library | Service | Index

# 8
Managing MIME Attachment Types

To exchange multimedia messages with MIME-compliant systems, you can configure your gateway to make sure messages and attachments are mapped to the correct types. In addition, if you will be exchanging messages and message attachments with a non-MIME-compliant system, you can set up a gateway that performs special encoding and decoding.

In most cases, the default MIME configuration will be sufficient for your needs. If you need to customize your MIME configuration, use the following tasks discussed in this chapter:

- Creating an Attachment Type

- Creating a MIME Attachment Map

- Updating a MIME Attachment Map

- Mapping MIME Attachment Types Using Converters

  See Also: Chapter 23, "MIME Text Encoding and Decoding", to learn more about encoding and decoding

## Creating an Attachment Type

eMail Server uses information about attachment types to start the program that created the file when the user downloads the attachment. eMail Server provides some predefined attachment types. In addition, you can define new attachment types. When you add an attachment type, you must first add a generic type, then an attachment type of the same name that is platform-specific.

### Steps for Creating an Attachment Type

This task can be performed through either the Administration Tool GUI, or the OOMGR command-line interface.

#### In the Administration Tool GUI

1. Start the Administration Tool GUI.

2. In the navigation tree, select Messaging System > Domains > Attachment Types.

3. In the toolbar, click (Create).

4. Complete the Add a New Attachment Type dialog box.

   See Also: "Parameters for Creating an Attachment Type" for more information about the parameters in this dialog box

5. Click OK.

#### In OOMGR

1. Start OOMGR.

2. Enter the following command at the OOMGR prompt:

       IOFCMGR>insert attachtype
       2>name=<attachment_name>
       3>type=<attachment_type>
       4>platform=<user_platform>
       5>binary=[Y | N]
       6>description="<description>"
       7>command="<launch_command>";

   See Also: "Parameters for Creating an Attachment Type" for more information about the parameters available with this command

### Parameters for Creating an Attachment Type

Parameter | Description
--- | ---
`binary` | Indicates whether the attachment data is binary.
`command` | Command required to launch the appropriate application and open the attachment. The maximum length is 255 characters. The launch command consists of three parts: The command to start the application. For example, "word" for Microsoft Word. A symbol (`%` or `%f`) representing the name of the temporary file that is opened to display the attachment. This file is deleted when the user closes the attachment. A symbol (`%o`) representing the name of the operating system on which the original message was created. For example, if you use a text editor named "EDIT" that takes a filename as its first parameter, the launch command for attachments using this editor would be `EDIT %f`.
`description` (Optional) | Description of the attachment type. Although this is not a mandatory attribute, you should include a description because eMail Server displays this text when listing the available attachment types for your users. The maximum length is 255 characters.
`name` | Name of the attachment type. The maximum length is 30 characters.
`oisinfo` (Optional) | Information used to write the attachment to a file for a given operating system. For example, on Windows NT, this might be the file extension. The maximum length is 255 characters.
`platform` | Platform on which your users will be viewing their messages. This parameter lets you set up different attachment types for each platform being used. For example, opening a text file requires one command on an MS-Windows machine and a different command on a Macintosh machine. Valid values are Block Mode, MS-Windows, Charmode, Open Look, GENERIC, Presentation Manager, Macintosh, X-UNIX, Motif, X-VMS, and MS-DOS.
`type` | A unique numeric identifier that you assign to the attachment type. Valid values are numbers between 10000 and 32000. (Numbers between 1 and 9999 are reserved.)

## Creating a MIME Attachment Map

The MIME standard has established conventions and names for many common attachment types, such as GIFs, PostScript documents, or formatted spreadsheets. When you install eMail Server, many of these standard MIME types are automatically mapped to their corresponding types in eMail Server so that the attachment types can pass through the SMTP/MIME gateway immediately. You can change these existing MIME-type mappings or create new ones.

### Prerequisites to Creating a MIME Attachment Map

Before creating a MIME attachment type, review the default attachment types to be sure one does not exist.

See Also: "Default MIME Attachment Type Mappings" for more information

### Steps for Creating a MIME Attachment Map

This task can be performed through either the Administration Tool GUI, or the OOMGR command-line interface.

#### In the Administration Tool GUI

1. Start the Administration Tool GUI.

2. In the navigation tree, select Messaging System > Domains > Attachment Maps.

3. In the toolbar, click (Create).

4. Complete the Add a New Attachment Map dialog box.

   See Also: "Parameters for Creating an Attachment Type" for more information about the parameters in this dialog box

5. Click OK.

#### In OOMGR

1. Start OOMGR on the DCN of the domain to which you want to subscribe the node.

2. Enter the following command at the OOMGR prompt:

       IOFCMGR>insert attachmap gateway=<gateway_type>
       2>foreigntype=<foreign_attachment>
       3>localtype=<defined_type>
       4>description='<description>';

### Default MIME Attachment Type Mappings

The following table lists the standard MIME attachment types that are automatically mapped to eMail Server attachment types during installation. Some of these types may only be available on certain platforms.

Type ID | eMail Server Type | Binary | MIME Type
--- | --- | --- | ---
0 | TEXT | N | text/plain
1 | BIN | Y | application/octet-stream
2 | HTML | N | text/html
5 | EXEC | Y | unmapped
25 | ORABROWSE | Y | unmapped
26 | ORABOOK | Y | unmapped
50 | AUDIO | Y | audio/basic
53 | WINSOUND | Y | audio/x-wav
61 | TIFF | Y | image/tiff
62 | GIF | Y | image/gif
63 | PCX | Y | unmapped
64 | G3FAX | Y | image/g3fax
65 | PICT | Y | application/x-macpict application/x-pict
66 | JFIF | Y | image/jpeg
67 | XBM | Y | image/x-xbitmap image/x-xbm
68 | BMP | Y | unmapped
70 | POSTSCRIPT | N | application/postscript
71 | ENCPS | N | unmapped
80 | BITMAP | Y | unmapped
90 | ZIP | Y | application/zip
91 | QUICKTIME | Y | video/quicktime
92 | MPEG | Y | video/mpeg
104 | AMIPRO | Y | unmapped
105 | WP | Y | application/wordperfect5.1
110 | MWORD | Y | application/msword
111 | EXCEL | Y | unmapped
120 | 123 | Y | unmapped
130 | EZ | Y | unmapped
131 | DBASE | Y | unmapped
132 | ACROBAT | Y | application/pdf
145 | POWERPOINT | Y | unmapped

## Updating a MIME Attachment Map

You can update a MIME attachment map if any of the information, such as the gateway type or foreign attachment type, changes.

### Steps for Updating a MIME Attachment Map

This task can be only be performed through the OOMGR command-line interface.

#### In OOMGR

1. Start OOMGR.

2. Enter the following command at the OOMGR prompt:

       IOFCMGR>update attachmap gateway=<gateway_type>
       2>foreigntype=<foreign_attachment>
       3>localtype=<defined_type>
       4>description='<description>';

## Mapping MIME Attachment Types Using Converters

Some MIME attachment types may not have corresponding eMail Server attachment types. In this case, you can use a converter to map a MIME attachment type to an eMail Server attachment type. A converter is a program that converts and maps a MIME attachment type to an eMail Server attachment type, and vice versa.

If you can map a MIME attachment type either with or without a converter, then you should select the method that does not use a converter.

For example, eMail Server attachment type 67 (XBM) maps to MIME types image/x-xbitmap and image/x-xbm. If the mapping for eMail Server attachment type XBM to MIME type image/x-xbm is created first (on the DCN), an attachment of type XBM will be transmitted as an image/x-xbm MIME part with no type conversion.

A format converter should perform bidirectional data conversion. In other words, if you select a specific converter to map a MIME type to an eMail Server type, use the same converter to map the eMail Server type to the MIME type.

Converter programs cannot be used for multipart/<multipart-subtype> MIME types. The gateway ignores these attachment type mappings.

If you use an external converter, it must:

- Accept input from stdin.

- Write output to stdout.

- Write errors to stderr.

In addition, the following must hold true:

- The first argument supplied by the gateway to the converter, can be either -D or -E. Other arguments can be configured and they will appear after this argument. When the first argument is -D, the converter performs MIME-to-eMail Server conversion or decoding. When this argument is -E, the converter performs eMail Server-to-MIME conversion or encoding.

- The output of a format converter in the eMail Server-to-MIME direction is 7-bit ASCII.

To define the full pathname to the format converter, use the Converter parameter. If a relative pathname is specified, then the gateway assumes the path is relative to $ORACLE_HOME/bin.

To configure the external attachment format converters, use the `insert attachmap` command.

#### Example: Mapping Mac-binhex40 to eMail Server Type 7

The following is an example using a converter for inbound messages. The example defines a mapping between MIME-type application/mac-binhex40 and eMail Server type 7. When the gateway receives an application/mac-binhex40 body part in an inbound MIME message, it sends the data through the /oracle/bin/ofc_bh40.sh -D filter. The filter output is inserted into eMail Server as attachment of type 7.

    IOFCMGR>insert attachmap gateway=smtp
    2>foreigntype=application/mac-binhex40 localtype=7
    3>converter=/oracle/bin/ofc_bh40.sh
    4>description='converter for macbin <-> mac-binhex40';

When an external converter exits or terminates inbound messages with an error, the original MIME body part is inserted as the attachment type defined in the `default_type` process parameter. Data that cannot be converted is prepared with an X-Orcl-Comments header, indicating that the gateway has failed to convert the data. The comment is followed by the original Content-type and Content-Transfer-Encoding headers and the data.

#### Example: Mapping X-uuencode to eMail Server Type 1

The following is an example using a converter for outbound messages. The example defines a mapping between MIME type application/x-uuencode and eMail Server type 1.

    IOFCMGR>insert attachmap gateway=unix
    2>foreigntype=application/x-uuencode localtype=1
    3>converter=/oracle/bin/ofc_uu.sh
    4>description='converter for uuencode/decode';

The gateway sends the contents of a type 1 attachment in an outbound message through the /oracle/bin/ofc_uu.sh -E filter. The filter output becomes the data of an application/x-uuencode MIME body part in the outbound message.

The SMTP/MIME gateway assumes the output of an external type converter is 7-bit ASCII, which does not require further transfer encoding. In the outbound MIME message, the 7-bit content transfer encoding is used.

When an attachment type conversion program fails, the attachment is sent as an application/octet-stream MIME part, and the base64 content transfer encoding is used.

| Copyright © 2001 Oracle Corporation. All Rights Reserved. |
| Library | Service | Index