HP-UX Reference (11i v2 03/08) - 1 User Commands A-M (vol 1)

m
mailx(1) mailx(1)
NAME
mailx - interactive 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 mes-
sages. 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 sys-
tem 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.
The files and folders created by
mailx, using commands such as copy, save
, and Followup, and the
secondary file, mbox, are given read and write permissions for owner and zero permission for group and
other. (For more detail about these commands, see the COMMANDS section.) The file created with the
-F command-line option is given read and write permissions for owner and read-only permission for
group and other.
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 Read messages from filename instead of the user’s system mailbox. If filename is
not specified, the secondary mbox is used.
-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.
Section 1508 Hewlett-Packard Company 1 HP-UX 11i Version 2: August 2003