Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > R


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


readmail — read mail from a mail folder or incoming mailbox


readmail [-ahnp] [-f folder] [number-list|pattern]


The readmail program displays messages from your incoming mailbox or a specified mail folder.

Within the elm mail system (see elm(1) with no operands and optionally the -h or -n option, readmail displays the appropriate headers and the body of the current message.

With the number-list operand and no options, readmail displays the corresponding messages and a summary of the headers from your incoming mailbox.

With the pattern operand and no options, readmail displays the first message that matches the pattern and a summary of the headers from your incoming mailbox.


readmail supports the following options.


Print all messages that match pattern. If no pattern was specified, this option is ignored.

-f folder

Use file folder for the operations instead of the incoming mailbox.


Include the entire header of the matched message or messages when displaying their text. The default is to display the From:, Date:, and Subject: lines only.


Exclude all headers.


Put form feeds (Ctrl-L) between message headers. This is useful when printing sets of messages.


readmail supports the following operands.


A blank-separated list of the ordinal locations of messages in the mail file (i.e., their "message numbers"), up to 25 at a time. The character $ means the last message in the mail file. Similarly, * represents every message in the file (i.e., 1 2 3 ... $)

The message numbers are sorted into ascending order. Thus, 1 3 2 produces the same output as 1 2 3.


A string that is present in one of the messages. This pattern can be typed in directly (no quotes) if the words are separated by a single space in the actual message. The pattern matching is case sensitive, so Hello and hello are not equivalent. Leading digits (on the first word) are not permitted; however, you can precede them with a space and quote the entire string, if the space occurs in the message, as in " 1st item of business" .


If you are using vi to reply to a message from within the elm mail system, you can insert the text of the current message with the command:

:r !readmail

If you define an alias similar to:

alias rd='readmail $ | page' (Korn or POSIX shell) alias rd 'readmail $ | page' (C shell)

you can use it with a program such newmail to peruse mail as it arrives, without needing to start a mail system (see newmail(1)).


readmail was developed by HP.



Incoming mailbox


Temporary file for elm

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.