HP-UX Reference (11i v1 05/09) - 1 User Commands A-M (vol 1)

m
mailx(1) mailx(1)
-N Do not print initial header summary.
-r address Pass address to network delivery software. All tilde commands are disabled.
-s subject Set the Subject header field to subject.
-u user Read user’s mailbox. Can be used only if read access to user’s mailbox is not read pro-
tected.
-U Convert UUCP-style addresses to Internet standards. Overrides the
conv environ-
ment variable.
-d Turn on debugging output. Neither particularly interesting nor recommended.
When reading mail, mailx operates in command mode. A header summary of the first several mes-
sages is displayed, followed by a prompt indicating that
mailx can accept regular commands (see COM-
MANDS
below). When sending mail, mailx operates in input mode. If no subject is specified on the
command line, a prompt for the subject is printed. As the message is typed,
mailx reads the message
and stores it in a temporary file. Commands can be entered by beginning a line with the tilde (
˜)escape
character followed by a single command letter and optional arguments. See
TILDE ESCAPES for a summary
of these commands.
The behavior of
mailx at any given time is governed by a set of environment variables; flags and
valued parameters that are set and cleared by using the
set and unset commands. See
ENVIRONMENT
VARIABLES
below for a summary of these parameters.
Recipients listed on the command line can be of three types: login names, shell commands, or alias groups.
Login names can be any network address, including mixed network addressing. If the recipient name
begins with a pipe symbol (|), the rest of the name is assumed to be a shell command to pipe the message
through. This provides an automatic interface with any program that reads the standard input, such as
lp (see lp(1)) for recording outgoing mail on paper. Alias groups are set by the
alias command (see COM-
MANDS
below) and are lists of recipients of any type.
Regular commands are of the form
[command ][msglist ][arguments ]
If no command is specified in command mode, print is assumed. In input mode, commands are recognized
by the escape character (tilde unless redefined by the escape environment variable), and lines not
treated as commands are treated as input for the message.
Each message is assigned a sequential number, and there is always the notion of a current message,
marked by a
> in the header summary. Many commands take an optional list of messages (msglist)to
operate on, which defaults to the current message. A msglist is a list of message specifications separated
by spaces. The message list can include:
n Message number n.
. The current message.
^ The first undeleted message.
$ The last message.
* All messages.
n-m An inclusive range of message numbers, n through m, where n is less than m.
user All messages from user.
/string All messages with string in the subject line (uppercase-lowercase differences are ignored).
:c All messages of type c, where c is one of:
d deleted messages
n new messages
o old messages
r read messages
u unread messages
Note that the context of the command determines whether this type of message
specification makes sense.
HP-UX 11i Version 1: September 2005 2 Hewlett-Packard Company Section 1519