PMDF User's Guide
OpenVMS Edition


Previous Next Contents Index

8.3.5 Mailcap Files

With a mailcap file you can specify how PMDF MAIL should display different types of application, audio, image, text, and video messages or message parts. The format of a mailcap file is described by RFC 1524, "A User Agent Configuration Mechanism For Multimedia Mail Format Information". A copy of this RFC can be found in the PMDF_ROOT:[DOC.RFC] directory. Mailcap files cannot be used by captive users.

Mailcap files have the name MAILCAP. with no extension (i.e., file type). You should place your mailcap file in your login directory. If you want to keep it elsewhere then redefine the PMDF_INIT logical to point to where you want to keep that file and other PMDF MAIL files such as your header trimming file.1

Each entry from the mailcap file describes how to display a message type/subtype pair, (e.g., image/gif, video/mpeg, etc.). At present, PMDF MAIL only uses entries for the message types application, audio, image, text, and video. Entries for the types message and multipart as well as entries for unknown type are ignored.

PMDF MAIL presently uses mailcap files for viewing purposes only. Thus, only the /subtype, view-command, test, and nametemplate fields are used from mailcap entries:


type/subtype; view-command; [test=test-command;] 
  [nametemplate=%s.file-type;] [x-needsXterminal;] [x-wait;] 
PMDF MAIL also supports two private fields: x-needsXterminal and x-wait. x-needsXterminal specifies that the mailcap entry should be skipped if the user is not using an X Windows display; x-wait specifies that PMDF MAIL should pause execution until the subprocess has exited.

Entries in a mailcap file take precedence over PMDF MAIL's built-in message viewing rules. Thus, you can override PMDF MAIL's viewing rules with a mailcap file. However, any viewing command procedure set with a SET command (e.g., SET AUDIO_COMMAND) will override both mailcap entries and built-in rules for the same message type.

If a test field is specified, then a subprocess will be spawned to execute the specified test-command. If that command returns either a successful status code (an odd value) or zero, then the test will be considered successful; treating a status code of zero as a success is for compatibility with UNIX-style return codes.

For the fields test, view-command, and nametemplate, the patterns %s, %h, and %t will be replaced, respectively, with the name of the file containing the message part to process, a title to associate with the message part (e.g., NEWMAIL 12.2), and the content type/subtype for the message part.

A viewing command, if selected, will be executed from a spawned subprocess. Unless x-wait is specified, it is the responsibility of that subprocess to delete the message part file after viewing the message part.

Sample mailcap file entries are shown in Example 8-1.

Example 8-1 Example Mailcap Entries

# PostScript files 
application/postscript; VIEW/INTERFACE=DECWINDOWS %s/FORMAT=PS; \
  x-needsXterminal; x-wait 
image/postscript; VIEW/INTERFACE=DECWINDOWS %s/FORMAT=PS; x-needsXterminal; \
  x-wait; 
# Images 
image/*; XV -wname %h %s; x-needsXterminal; x-wait; 
# Audio 
audio/*; AUDIO %s; test = AUDIO_TEST; 

Note

1 Mailcap files are pointed at by the PMDF_MAILCAP_DIR logical. By default, that logical translates to PMDF_INIT: and PMDF_TABLE:. PMDF_INIT, in turn, translates to SYS$LOGIN. All mailcap files located via the PMDF_MAILCAP_DIR logical search list will be processed. The list is read from left to right; entries from earlier files (files to the left) have precedences over later files (files to the right).


Previous Next Contents Index