PMDF User's Guide
OpenVMS Edition


Previous Contents Index


EXTRACT

Extract a mail message to an external file.

Syntax

EXTRACT file-spec[,...]

Qualifiers Defaults
/ALL /NOALL
/APPEND /NOAPPEND
/CONFIRM /NOCONFIRM
/ENTIRE /PART
/DIGEST /DIGEST
/HEADER /HEADER
/LOG /LOG
/MARKED None
/MBOX /NOMBOX
/MESSAGE /PART
/PART /PART
/READ None
/REPLIED None
/TRIM_HEADER /NOTRIM_HEADER

Parameters

file-spec[,...]

Required parameter specifying one or more files to extract the message to. Multiple files should be specified when a multipart message with non-text attachments is extracted.

Description

The EXTRACT command extracts one or more messages or message parts to a file. Unless /ALL is specified, only the currently selected message is extracted. If it is a multipart message, then only the last read part of that message is extracted. The /MESSAGE and /ENTIRE qualifiers modify this behavior.

When /ALL is used, all of the currently selected messages are extracted to a single message digest file. Similarly, /MARKED and /NOMARKED can be used to extract, respectively, all marked or unmarked messages to a single digest file. Specify /NODIGEST to obtain a form-feed delimited file rather than a message digest.


Qualifiers

/ALL

/NOALL (default)

Extract all currently selected messages. Messages will be extracted into a file formatted as a message digest. Cannot be used in conjunction with /MARKED, /NOMARKED, /READ, /NOREAD, /REPLIED, or /NOREPLIED.

/APPEND

/NOAPPEND (default)

If the output file already exists, then append the message to it without creating a new file.

/CONFIRM

/NOCONFIRM (default)

When you specify /CONFIRM, you must approve the extraction of each message. That is, for each message to be extracted, you will be prompted. If you reply to the prompt in the affirmative, then the message will be extracted; otherwise, it will be skipped.

/ENTIRE

/MESSAGE

/PART (default)

By default, when you extract a multipart or nested message, only the current part is extracted. This behavior is explicitly requested with the /PART qualifier. To extract the entire message, specify /ENTIRE; to only extract the current part identifiable as a message, specify /MESSAGE. When extracting a single-part message which is not nested, the /ENTIRE, /PART, and /MESSAGE qualifiers are identical and have no effect. /ENTIRE is assumed when /ALL is specified; /MESSAGE and /PART have no effect in that case.

/DIGEST (default)

/NODIGEST

When /NODIGEST is specified, multiple messages output to a file will be separated by form feeds. When /DIGEST is specified, a MIME message/digest format will be used.

/HEADER (default)

/NOHEADER

By default, when the message is extracted its header is included. Specify /NOHEADER to omit the message header.

/LOG (default)

/NOLOG

For each output file created, output to the terminal a status message. To suppress this information, use the /NOLOG qualifier.

/MARKED

/NOMARKED

Extract all messages that have been marked, /MARKED, or are unmarked, /NOMARKED. Cannot be used in conjunction with /ALL.

/MBOX

/NOMBOX (default)

The /MBOX qualifier causes the extracted message(s) to be stored in UNIX Berkeley mailbox format; this can be useful if you want to physically move your mailbox to a UNIX system. /NOMBOX is the default.

/READ

/NOREAD

Extract all messages that have been read, /READ, or are unread, /NOREAD. Cannot be used in conjunction with /ALL.

/REPLIED

/NOREPLIED

Extract all messages that have been replied to, /REPLIED, or have not been replied to, /NOREPLIED. Cannot be used in conjunction with /ALL.

/TRIM_HEADER

/NOTRIM_HEADER (default)

By default, the full message header appears in each extracted message. Use the /TRIM_HEADER qualifier to apply header trimming to each message prior to extracting it.

Examples

#1

EMAIL> READ
 
Message MAIL 1                                      2-FEB-2012 12:13:18.01
 
Date: Tue, 2 Feb 2012 12:13:18 PDT
From: bob@example.com
To: staff@example.com
Subject: Vacation schedule
   .
   .
   .
EMAIL> EXTRACT SCHEDULE.TXT
%EMAIL-S-CREATED, D1:[SUE]SCHEDULE.TXT created
EMAIL> EXIT
$ TYPE SCHEDULE.TXT
Return-path: <bob@example.com>
Received: from EXAMPLE.COM by EXAMPLE.COM (PMDF V6.5#5674)
 id <01GV52QDNTPS8WW845@EXAMPLE.COM>; Tue, 2 Feb 2012 12:13:44 PDT
Date: Tue, 2 Feb 2012 12:13:18 -0700 (PDT)
From: bob@example.com
To: staff@example.com
Subject: Vacation schedule
Message-id: <01GV52QDNTPU8WW845@EXAMPLE.COM>
MIME-version: 1.0
Content-type: TEXT/PLAIN; CHARSET=US-ASCII
Content-transfer-encoding: 7BIT
   .
   .
   .
$
      

In this example a message is extracted to the file SCHEDULE.TXT. Note that the entire message header, which was suppressed when the message was displayed with the READ command, appears in the extracted file.

#2

EMAIL> READ/NEW
Message NEWMAIL 1.0.0                              25-FEB-2012 15:50:14.77
 
Date: Thu, 25 Feb 2012 15:50:01 -0700 (PDT)
From: bob@example.com
Subject: A picture
To: sue@example.com
 
Message contains multiple parts.  Press return to read the next part...
 
EMAIL> [RETURN]
 
Message NEWMAIL 1.1.1                              25-FEB-2012 15:50:14.77
 
Content-type: image/gif
 
[Viewing GIF image data with XV.  Type Q in image window to close window.]
 
EMAIL> EXTRACT [SUE.PICTURES]BOAT.GIF
%EMAIL-S-CREATED, D1:[SUE.PICTURES]BOAT.GIF;1 created
EMAIL>
      

In this example, a multipart message containing a GIF image is displayed. After, displaying the image, it is extracted to the file BOAT.GIF with the EXTRACT command. Only the current message part is extracted since /MESSAGE or /ENTIRE was not specified. The extracted file contains the GIF image data and can be viewed at a later time with a GIF viewer such as XV.


Previous Next Contents Index