Attachment Conversion

While the goal of an e-mail MTA (message transfer agent) is to transfer mail without alteration to the message content, there are cases where altering the content may be beneficial.

One such case is where attachments have been produced with a word processing tool (such as MS-Word) which the recipient may not be able to read due to lack of an appropriate application.

The following outlines the establishment of attachment conversion facilities (in this case receiving an MS-Word attachment and converting it into plain text) on a VMS  system. The differences between the configuration items shown below and those for a Unix based system, are constrained to the converter invocation line in the Conversion Control file.

Note that if you are attempting to convert WPS+ attachments produced by All-in-1 on your system into ASCII text, please refer to the note specifically covering this issue.
Getting Started

First you have to know the path of the message through PMDF, so you can invoke conversion at the right time. An example may be that you want all messages coming from the Internet (e.g. tcp_local channel) and destined for A1 users (e.g. mr_local channel) to be eligible for conversion. If you don't know what a channel is, please see PMDF 101 and section 3.2.5 of the PMDF System Manager's Guide.

Secondly, since PMDF can only be told to convert a "part" of the message, not the entire message, you need to know the MIME content-type/subtype of the part you want to convert. An example MIME body part may be of the type APPLICATION/MSWORD, which you may want to convert to TEXT/PLAIN.

The conversion itself is done via the use of the conversion channel, which is invoked via a CONVERSIONS mapping in the PMDF mappings file. The specific conversion step is controlled by the "conversions" file. Each is briefly described below.

The Conversion Channel

Refer to Chapter 19 of the PMDF System Manager's Guide, section 19.2.2, to ensure that your installation of PMDF has been configured with a conversion channel. (If this is a post PMDF 5.0 generated configuration, you should already have it configured for you automatically.)

The CONVERSIONS Mapping Table

The CONVERSION mapping table is used to identify canidate messages which may require conversion actions. Thus mapping table must be supplied; it is placed in the PMDF mappings file. For example, to select messages arriving via the tcp_local channel for delivery to PMDF Mail users via the l channel, the following mapping would be used:

CONVERSIONS
      in-chan=tcp_local;out-chan=l;convert    Yes
Messages matching this path will be checked against the conversions file to see if any conversion is to be done.

Conversion actions

Messages identified as canidates by the CONVERSION mapping table are then parsed. Of particular interest is the MIME Content-type: header lines within a canidate message. If a conversion action specified in the conversions file matches any of the message's parts, then the specified action is applied to the matching part. Message parts not matching any conversion action are passed through unchanged.

The following indicates how a conversion on an OpenVMS  system using the KEYpak converter, to reduce a MS-Word document to text, might be achieved:

out-chan=l; in-type=application; in-subtype=msword;
    out-type=text; out-subtype=plain; out-mode=text;
    command="$KW MWW/S='INPUT_FILE' AF/T='OUTPUT_FILE'"
      
About KEYpak

KEYpak is available for Solaris SPARC, Solaris Intel, OpenVMS and DEC Unix.

Files involved

  • Mappings file
    • on Unix /pmdf/table/mappings
    • on VMS PMDF_TABLE:MAPPINGS.
  • Conversions file
    • on Unix /pmdf/table/conversions
    • on VMS PMDF_TABLE:CONVERSIONS.
Further reading



Search: