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

m
mailx(1) mailx(1)
-H Print header summary only.
-L Print complete header information only.
-i Ignore interrupts. Also see the description of the
ignore environment below.
-n Do not initialize from the system default
mailx.rc file.
-m Do not add MIME header lines Mime Version, Content Type & Content Encoding to
the header information while sending mails.
-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 messages
is displayed, followed by a prompt indicating that mailx can accept regular commands (see the COM-
MANDS section). 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 char-
acter followed by a single command letter and optional arguments. See the TILDE ESCAPES section 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 the Environment
Variables subsection 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 the
COMMANDS section) and are lists of recipients of any type.
Note: To send a message to an
alias name that is prefixed with a plus (+) symbol, the
alias name with
the plus (+) symbol must be placed within double quotes ("), as specified below:
mailx [-s subject] \"+alias\"
If the double quotes are not used, mailx considers the alias name as a user-specified file name begin-
ning with a plus symbol, similar to the folder=directory option under EXTERNAL INFLUENCES.
Regular
mailx 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.
626 Hewlett-Packard Company 2 HP-UX 11i Version 3: February 2007