HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)

m
mailx(1) mailx(1)
NAME
mailx - interactive mail message processing system
SYNOPSIS
Send mode
mailx [-FUm][-s
subject][-r address][-h number] address ...
Receive mode
mailx -e
mailx
[-UHLiNn][-u
user]
mailx -f [-UHLiNn][filename]
Obsolescent
mailx [-f filename][
-UHLiNn]
DESCRIPTION
mailx provides a comfortable, flexible environment for sending and receiving messages electronically.
When reading mail, mailx provides commands to facilitate saving, deleting, and responding to messages.
When sending mail, mailx allows editing, reviewing and other modification of the message as it is created.
Incoming mail for each user is stored in a standard file called the system mailbox for that user. When
using
mailx to read messages, the system mailbox is used unless an alternate mailbox file is specified by
using the -f option with or without a specific filename. As incoming messages are read from the system
mailbox, they are marked to be moved to a secondary file for storage (unless specific action is taken) so that
the messages need not be seen again. This secondary file is called the mbox and is usually located in the
user’s
HOME directory (see MBOX in the Environment Variables subsection for a description of this file and
other environment variables used by
mailx). Messages remain in this file until specifically removed.
Command-line options start with a hyphen (-), and any other arguments are assumed to be destinations
(recipients).
Arguments containing multiple words must be enclosed in quotes.
If no recipients are specified, mailx attempts to read messages from the system mailbox.
Recipient addresses specified on the command line must total less than 1024 characters in length. You may
declare an alias or group (see the COMMANDS section) to specify a recipient address or list of
addresses of up to 8191 characters, and use that alias or group name (though each address in the list must
still be less than 1024 characters). If you wish to specify a list of recipient addresses of greater length than
this, have your system administrator declare an alias or group in the system alias file
/etc/mail/aliases
and use that alias name instead.
Options
mailx recognizes the following command-line options:
-e Test for presence of mail. mailx prints nothing and exits with a successful return
code if there is mail to read. Sometimes used in login scripts such as
$HOME/.profile to check for mail during login.
-f filename Read messages from filename instead of from the user’s system mailbox. If filename is
not specified, the secondary mbox is used.
Note: When using the -f filename option in mailx, do not specify a system mailbox
(for example, /var/mail/user) as the filename. According to the mailx stan-
dards, the -f option cannot be used to read the system mailbox messages. The
behavior of mailx in this circumstance is undefined.
The behavior of mailx is also undefined in these circumstances:
When the -f and -u options are used together in the command line.
When the -f or -u option is used multiple times in the command line.
-F Record the message in a file named after the first recipient. Overrides the record
environment variable, if set.
-h number The number of network "hops" made so far. This is provided for network software to
prevent infinite delivery loops.
HP-UX 11i Version 3: February 2007 1 Hewlett-Packard Company 625