PMDF User's Guide
UNIX Edition


Previous Contents Index


encode

Encodes a binary file into a printable format for transmission as an e-mail message. Encoded files may be decoded with the pmdf decode utility. Both the standard MIME encodings as well as a few additional encodings (e.g., UUENCODE) are supported.

restrictions

None.

Syntax

pmdf encode input-file-spec encoded-file-spec

Qualifiers Defaults
-encoding=type -encoding=BASE64
-filename -nofilename
-header -noheader
-line_length -line_length=64

prompts

Input file: input-file-spec
Output file: encoded-file-spec

Parameters

input-file-spec

Specifies the name of an input file. The input file may be any binary file. Only a single input file may be specified; wildcards are not allowed.

encoded-file-spec The name of the file to produce as output. The file output by pmdf encode will contain all of the information necessary to reconstruct the original input file. The format of the output file is described in the Description section below.

Description

pmdf decode and pmdf encode have been, for the most part, made obsolete by MIME-aware user agent such as pine. If you use pine, then files which you send with the Send command will be encoded automatically, if necessary. Encoded messages which you receive will be decoded automatically, if necessary, and may simply be extracted to a file with the Save command. If, however, you do not use a MIME aware user agent such as pine, then read on.

The pmdf encode and pmdf decode utilities are provided with PMDF as a means of transmitting binary files via e-mail. With pmdf encode, a file may be encoded in a format which uses short records containing only printable characters. Such files can then be transmitted through most any mail system without being altered (e.g., lines wrapped, characters removed or replaced, etc.). pmdf encode preserves all file contents and all file attributes when encoding a file. The contents and attributes are properly restored when decoded with pmdf decode. Absolutely any type of file can be transmitted with these two utilities.

Encoded files have two parts. The first part is a conventional RFC 822 message header. Header lines are used to describe the file format; this information includes a description of the encoding used to convert the file into a printable form for transfer. pmdf encode creates this header; pmdf decode reads it and uses the information it contains to reconstruct the file.

Note

Many encoded messages received with PMDF are decoded automatically for you, thus obviating the need to use pmdf decode at all. This is especially true when you use pine whose Save command will extract any MIME-encoded message or message body part. If you use a non-MIME aware user agent, however, you may occasionally receive an encoded message which PMDF could not deliver in its decoded form to mail owing to limitations of mail itself.

Qualifiers

-encoding=type

This qualifier controls the type of encoding used to encode the input file. The possible values for this qualifier are BASE32, BASE64, CBASE64 gzip compressed BASE64, BASE85, BINHEX (encoding only, not the file format), BTOA, HEXADECIMAL, QUOTED_PRINTABLE, UUENCODE, CUUENCODE (gzip compressed UUENCODE). BASE64 encoding is the default; this is also the default decoding type used by pmdf decode.

-filename

-nofilename (default)

When used in conjunction with the -header qualifier, this qualifier specifies that the filename should be included in the MIME headers generated. Only the name and extension portion of the input file specification will be used; any node, device, directory, and version number information will be discarded. By default, no filename parameter is specified in the Content-type: or Content-disposition: header lines. Or if used with -encoding=uuencode, the -filename qualifier causes the filename to be included on the begin 600 line.

-header

-noheader (default)

This qualifier controls whether or not a MIME-compliant header is placed at the beginning of the output. -header is the default. -noheader is used to produce output suitable for use in non-MIME messaging applications. Note that all structural information about the file is lost when -noheader is used.

-line_length=length

The encoded data is written with fixed length records. The length of these records (i.e., line length) is controlled with the -line_length qualifier. By default, the line length is 64 characters. Specifying a line length in excess of 80 characters is not recommended as many mailers will wrap lines longer than 80 characters.

EXAMPLES

See the example provided for the pmdf decode command. In that example, the use of pmdf encode is also demonstrated.


Previous Next Contents Index