mailx(1) DG/UX R4.11MU05 mailx(1)
NAME
mailx - interactive message processing system
SYNOPSIS
mailx [ options ] [ name... ]
DESCRIPTION
The command 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 entered.
Many of the remote features of mailx work only if the Basic
Networking Utilities are installed on your system.
Incoming mail is stored in a standard file for each user, called the
mailbox for that user. When mailx is called to read messages, the
mailbox is the default place to find them. As messages are read,
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 normally
located in the user's HOME directory [see MBOX (Environment
Variables) for a description of this file]. Messages can be saved in
other secondary files named by the user. Messages remain in a
secondary file until forcibly removed.
The user can access a secondary file by using the -f option of the
mailx command. Messages in the secondary file can then be read or
otherwise processed using the same Commands as in the primary
mailbox. This gives rise within these pages to the notion of a
current mailbox.
Security Features
On a system running with mandatory access control (MAC), you can
receive mail only at the same level as the process that sent it.
Thus, if mail is sent to you at two distinct levels, you will have a
separate mailbox at each level. mailx reads the mail at your current
level and at all levels dominated by your current level. mailx's
ability to read mail in a multilevel directory means that you do not
have to log out of the current level and log back in at another level
in order to read mail at the dominated levels.
In addition, the mail (from all levels you dominate) is put into one
"inbox" and is sorted by date received; that way, you can view all
mail as though it were actually in one mailbox.
Mail read from any level other than the current level is marked with
an X (meaning "restricted") when its message header is displayed.
Any message marked with an X is read-only. You cannot save, write,
edit, touch, or reply to it from the current level. In addition, a
restricted message will not generate a return receipt, except when
read at its own level.
All files generated by mailx, including dead.letter files, will be
assigned the current MAC label.
Options
On the command line, options start with a minus (-); any other
arguments are taken to be destinations (recipients). If no
recipients are specified, mailx attempts to read messages from the
mailbox. Command-line options are:
-A author Search "From:" message header for author.
-B Unbuffer both input and output.
-C Disable the mailx commands sh and !.
-d Turn on debugging output.
-D date Search "From" message header for date. The date must
be in YYYY/MM/DD format, e.g., "1993/05/17".
-e Test for presence of mail. mailx prints nothing and
exits with a successful return code if there is mail to
read.
-E Query mailbox for new messages.
-f [filename] Read messages from filename instead of mailbox. If no
filename is specified, the mbox is used.
-F Record the message in a file named after the first
recipient. Overrides the record variable, if set (see
Environment Variables).
-G subject Search "Subject" message header for subject. The
subject must be in "/string" format (similar to mailx
message lists).
-h number The number of network ``hops'' made so far. This is
provided for network software to avoid infinite
delivery loops. This option and its argument are
passed to the delivery program.
-H Print header summary only.
-i Ignore interrupts. See also ignore (Environment
Variables).
-I Include the newsgroup and article-id header lines when
printing mail messages. This option requires the -f
option to be specified.
-n Do not initialize from the system default mailx.rc
file.
-N Do not print initial header summary.
-R Ask for a return receipt for the message being sent.
Note that receipts will be issued only by mail readers
that understand the return receipt header information.
-s subject Set the Subject header field to subject.
-S string Search mailbox for string; displays header for messages
in which a match is found.
-T file Message-id and article-id header lines are recorded in
file after the message is read. This option will also
set the -I option.
-t Read the To:, Cc: and Bcc: headers found on standard
input to determine the list of recipients.
-u user Read user's mailbox. This is effective only if user's
mailbox is not read protected.
-U Convert uucp style addresses to internet standards.
Overrides the conv environment variable.
-V Print the mailx version number and exit.
-~ Permits tilde escape commands no matter where the input
is coming from, including non-tty input.
Reading Mail
When reading mail, mailx is 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 Commands below). If a
message has "return receipt" (i.e., it was sent using -R or ~R), the
header summary includes an RQ string. When sending mail, mailx is in
input mode. If no subject is specified on the command line, a prompt
for the subject is printed. (A subject longer than 1024 characters
causes mailx to print the message mail: ERROR signal 10; the mail
will not be delivered.) As the message is typed, mailx reads the
message and stores it in a temporary file. Commands may 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.
At any time, the behavior of mailx is governed by a set of
environment variables. These are flags and valued parameters which
are set and cleared via the set and unset commands. See Environment
Variables (below) for a summary of these parameters.
Recipients listed on the command line may be of three types: login
names, shell commands, or alias groups. Login names may be any
network address, including mixed network addressing. If mail is
found to be undeliverable, an attempt is made to return it to the
sender's mailbox. If the recipient name begins with a pipe symbol
(|), the rest of the name is taken 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(1) for recording
outgoing mail on paper. Alias groups are set by the alias command
(see Commands 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, and
lines not treated as commands are taken as input for the message.
Each message is assigned a sequential number, and there is at any
time the notion of a current message, marked by a right angle bracket
(>) in the header summary. Many commands take an optional list of
messages (msglist) to operate on. The default for msglist is the
current message. A msglist is a list of message identifiers
separated by spaces, which may 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.
user All messages from user.
/string All messages with string in the subject line (case
ignored). Space or tab terminates string.
%date All messages received on date, in YYYY/MM/DD format.
:c All messages of type c, where c is one of:
d deleted messages
n new messages
o old messages
r read messages
s saved messages
u unread messages
Note that the context of the command determines
whether this type of message specification makes
sense.
Other arguments are usually arbitrary strings whose usage depends on
the command involved. Filenames, where expected, are expanded via
the normal shell conventions [see sh(1)]. Special characters are
recognized by certain commands and are documented with the commands
below.
At start-up time, mailx tries to execute commands from the optional
system-wide file (/etc/mail/mailx.rc) to initialize certain
parameters, then from a private start-up file ($HOME/.mailrc) for
personalized variables. With the exceptions noted below, regular
commands are legal inside start-up files. The most common use of a
start-up file is to set up initial display options and alias lists.
The following commands are not legal in the start-up file: !, Copy,
edit, followup, Followup, hold, mail, preserve, reply, Reply, shell,
and visual. An error in the start-up file causes the remaining lines
in the file to be ignored. The .mailrc file is optional and must be
constructed locally.
International Features
mailx enables the retrieval, editing, and processing of mail
messages, including characters from supplementary code sets.
Supplementary code set characters can be used in the subject line.
Commands
The following is a complete list of mailx commands:
!shell-command
Escape to the shell. See SHELL (Environment Variables).
# comment
Null command (comment). This may be useful in .mailrc files.
= Print the current message number.
? Print a summary of commands.
alias alias name ...
group alias name ...
Declare an alias for the given names. The names are
substituted when alias is used as a recipient. Useful in the
.mailrc file.
alternates name ...
Declare a list of alternate names for your login. When
responding to a message, these names are removed from the list
of recipients for the response. With no arguments, alternates
prints the current list of alternate names. See also allnet
(Environment Variables).
Bprint [msglist]
Equivalent to Print, except that non-text content may also be
printed.
bprint [msglist]
Equivalent to print, except that non-text content may also be
printed.
btop [msglist]
Equivalent to top, except that non-text content may also be
printed.
bedit [msglist]
Equivalent to edit, except that non-text content may also be
edited.
bvisual [msglist]
Equivalent to visual, except that non-text content may also be
edited.
cd [directory]
chdir [directory]
Change directory. If directory is not specified, $HOME is
used.
copy [filename]
copy [msglist] filename
Copy messages to the file without marking the messages as
saved. Otherwise equivalent to the save command.
Copy [msglist]
Save the specified messages in a file whose name is derived
from the author of the message to be saved, without marking
the messages as saved. Otherwise equivalent to the Save
command.
date date
Search mailbox for messages received on date (the date from
the "From" message header). date must be in "YYYY/MM/DD"
format. The ">" and "<" characters can be used to create
strings such as ">YYYY/MM/DD" or "<YYYY/MM/DD", indicating
dates greater than (inclusive) or less than (inclusive) the
current date, respectively. ">" and "<" can also be used
together to specify a range, e.g., ">1994/03/15 <1994/04/01".
delete [msglist]
Delete messages from the mailbox. If autoprint is set, the
next message after the last one deleted is printed (see
Environment Variables).
discard [header-field ...]
ignore [header-field ...]
Suppress printing of the specified header fields when
displaying messages on the screen. Examples of header fields
to ignore are status and cc. The fields are included when the
message is saved. The Print and Type commands override this
command. If no header is specified, the current list of
header fields being ignored will be printed. See also the
undiscard and unignore commands.
dp [msglist]
dt [msglist]
Delete the specified messages from the mailbox and print the
next message after the last one deleted. Roughly equivalent
to a delete command followed by a print command.
echo string ...
Echo the given strings [like echo(1)].
edit [msglist]
Edit the given messages. The messages are placed in a
temporary file and the EDITOR variable is used to get the name
of the editor (see Environment Variables). Default editor is
ed(1).
exit
xit Exit from mailx, without changing the mailbox. No messages
are saved in the mbox (see also quit).
file [filename]
folder [filename]
Quit from the current file of messages and read in the
specified file. Several special characters are recognized
when used as file names, with the following substitutions:
% the current mailbox.
%user the mailbox for user.
# the previous file.
& the current mbox.
Default file is the current mailbox.
folders
Print the names of the files in the directory set by the
folder variable (see Environment Variables).
followup [message]
Respond to a message, recording the response in a file whose
name is derived from the author of the message. Overrides the
record variable, if set. See also the Followup, Save, and
Copy commands and outfolder (Environment Variables).
Followup [msglist]
Followupall [msglist]
Respond to the first message in the msglist, sending the
message to the author of each message in the msglist. The
subject line is taken from the first message and the response
is recorded in a file whose name is derived from the author of
the first message. The Followupall command is not affected by
the flipf variable (see Environment Variables). See also the
followup, Save, and Copy commands and outfolder (Environment
Variables).
from [msglist]
Print the header summary for the specified messages.
group alias name ...
alias alias name ...
Declare an alias for the given names. The names are
substituted when alias is used as a recipient. Useful in the
.mailrc file.
headers [message]
Print the page of headers which includes the message
specified. The screen variable sets the number of headers per
page (see Environment Variables). See also the z command.
Headers [message]
Print the headers which would be printed by the headers
command, printing one line per header field. This command is
typically used by other programs, not a user.
help Prints a summary of commands.
hold [msglist]
preserve [msglist]
Hold the specified messages in the mailbox.
if s | r
mail-commands
else
mail-commands
endif Conditional execution, where s executes following mail-
commands, up to an else or endif, if the program is in send
mode, and r causes the mail-commands to be executed only in
receive mode. Useful in the .mailrc file.
ignore [header-field ...]
discard [header-field ...]
Note: ignore/discard has been superseded by retain; if both a
retained header list and an ignored header list exist, the
ignored header list will be ignored. Suppresses printing of
the specified header fields when displaying messages on the
screen. Examples of header fields to ignore are status and
cc. All fields are included when the message is saved. The
Print and Type commands override this command. If no header
is specified, the current list of header fields being ignored
will be printed. See also the undiscard and unignore
commands.
inc
newmail
Incorporate new mail messages that arrive while you are
reading the system mailbox. The new messages are added to the
message list in the current mail session. This command does
not commit changes made during the session, and prior messages
are not renumbered. If newmail (Environment Variables) is
specified, new mail will be looked for before each prompt.
label [msglist]
Display MAC levels of the given messages.
list Print all commands available. No explanation is given.
mail name ...
mailall name ...
Mail a message to the specified users. The mailall command is
not affected by the flipm variable (see Environment
Variables).
Mail name
Mailrecord name
Mail a message to the specified user and record a copy of it
in a file named after that user. The Mailrecord command is
not affected by the flipm variable (see Environment
Variables).
mbox [msglist]
Arrange for the given messages to end up in the standard mbox
save file when mailx terminates normally. See MBOX
(Environment Variables) for a description of this file. See
also the exit and quit commands.
New[msglist]
Unread [msglist]
unread [msglist]
Mark each message as not having been read. Each message in
msglist will be treated as if it had never been seen before.
newmail
inc Incorporate new mail messages that arrive while you are
reading the system mailbox. The new messages are added to the
message list in the current mail session. This command does
not commit changes made during the session, and prior messages
are not renumbered. If newmail (Environment Variables) is
specified, new mail will be looked for before each prompt.
next [message]
Go to next message matching message. A msglist may be
specified, but in this case the first valid message in the
list is the only one used. This is useful for jumping to the
next message from a specific user, since the name would be
taken as a command in the absence of a real command. See the
discussion of msglists (above) for a description of possible
message specifications.
Pipe [msglist] [shell-command]
Pipe the message through the given shell-command, suppressing
the fields specified by the ignore command. The message is
treated as if it were read. If no arguments are given, the
current message is piped through the command specified by the
value of the cmd variable. If the page variable is set, a
form feed character is inserted after each message (see
Environment Variables).
pipe [msglist] [shell-command]
| [msglist] [shell-command]
Pipe the message through the given shell-command. The message
is treated as if it were read. If no arguments are given, the
current message is piped through the command specified by the
value of the cmd variable. If the page variable is set, a
form feed character is inserted after each message (see
Environment Variables).
preserve [msglist]
hold [msglist]
Preserve the specified messages in the mailbox.
Print [msglist]
Type [msglist]
Print the specified messages on the screen, including all
header fields. Overrides suppression of fields by the ignore
command.
print [msglist]
type [msglist]
bprint [msglist]
Print the specified messages. If crt is set, the messages
longer than the number of lines specified by the crt variable
are paged through the command specified by the PAGER variable.
The default command is pg(1) (see Environment Variables).
Unless it is suppressed by the ignore command, the pseudo-
header field Message: is printed before each message. If the
mail message is in Multi-Purpose Internet Message Extensions
(MIME) format and contains something other than a text
message, or contains text in a character set other than that
associated with your current locale, the message will be piped
to the metamail program for parsing. (If the variable
$NOMETAMAIL is set, metamail will not be invoked. See
Environment Variables.) The character set associated with
your current locale may be overridden by using the variable
$MMCHARSET (see Environment Variables).
quit Exit from mailx, storing messages that were read in mbox and
unread messages in the mailbox. Messages that have been
explicitly saved in a file are deleted.
Reply [msglist]
Respond [msglist]
replysender [message]
Send a response to the author of each message in the msglist.
The subject line is taken from the first message. If record
is set to a filename, the response is saved at the end of that
file (see Environment Variables). The Replysender command is
not affected by the flipr variable (see Environment
Variables).
reply [message]
respond [message]
replyall [message]
respondall [message]
Reply to the specified message, including all other recipients
of the message. If record is set to a filename, the response
is saved at the end of that file (see Environment Variables).
The replyall/respondall command is not affected by the flipr
variable (see Environment Variables).
retain header-field . . .
Add the list of header fields named to the retained list.
Only the header fields in the retain list are shown on your
terminal when you print a message. All other header fields
are suppressed. Examples of header fields to retain are from,
to, cc, bcc, and subject. The Type and Print commands can be
used to print a message in its entirety. If retain is
executed with no arguments, it lists the current set of
retained fields. See also the unretain command.
Save [msglist]
Save the specified messages in a file whose name is derived
from the author of the first message. The name of the file is
taken to be the author's name with all network addressing
stripped off. See also the Copy, followup, and Followup
commands and outfolder (Environment Variables).
save [filename]
save [msglist] filename
Save the specified messages in the given file. The file is
created if it does not exist. The file defaults to mbox. The
message is deleted from the mailbox when mailx terminates
unless keepsave is set (see also Environment Variables and the
exit and quit commands).
search [msglist] "string"
Search given messages for text "string" (quotation marks are
required); displays the header of each message in which a
match occurs.
set
setname
setname=string
setname=number
Define a variable called name. The variable may be given a
null, string, or numeric value. By itself, set prints all
defined variables and their values.
See Environment Variables for detailed descriptions of the
mailx variables.
shell Invoke an interactive shell [see also SHELL (Environment
Variables)].
size [msglist]
Print the size, in characters, of the specified messages.
source filename
Read commands from the given file and return to command mode.
top [msglist]
Print the top few lines of the specified messages. If the
toplines variable is set, it is taken as the number of lines
to print (see Environment Variables). The default is 5.
touch [msglist]
Touch the specified messages. If any message in msglist is
not specifically saved in a file, it is placed in the mbox or
the file specified in the MBOX environment variable upon
normal termination. See exit and quit.
Type [msglist]
Print [msglist]
Print the specified messages on the screen, including all
header fields. Overrides suppression of fields by the ignore
command.
type [msglist]
print [msglist]
Print the specified messages. If crt is set, the messages
longer than the number of lines specified by the crt variable
are paged through the command specified by the PAGER variable.
The default command is pg(1) (see Environment Variables).
unalias alias . . .
Remove an alias for the given names (see alias). Takes a list
of names defined by alias commands and discards the remembered
groups of users. The group names no longer have any
significance.
undelete [msglist]
Restore the specified deleted messages. Will restore only
messages deleted in the current mail session. If autoprint is
set, the last message of those restored is printed (see
Environment Variables).
undiscard header-field ...
unignore header-field ...
Remove the specified header fields from the list being
ignored.
Unread [msglist]
unread [msglist]
New[msglist]
Mark each message as not having been read. Each message in
msglist will be treated as if it had never been seen before.
unretain header-field . . .
Remove the specified header fields from the list being
retained (see retain).
unset name ...
Cause the specified variables to be erased. If the variable
was imported from the execution environment (i.e., a shell
variable), it cannot be erased.
version
Print the current version.
visual [msglist]
Edit the given messages with a screen editor. The messages
are placed in a temporary file, and the VISUAL variable is
used to get the name of the editor (see Environment
Variables).
write [msglist] filename
Write the given messages on the specified file, minus the
header and trailing blank line. Otherwise equivalent to the
save command.
xit
exit Exit from mailx, without changing the mailbox. No messages
are saved in the mbox (see also quit).
z[+ | -]
Scroll the header display forward or backward one screen-full.
The number of headers displayed is set by the screen variable
(see Environment Variables).
Tilde Escapes
The following commands may be entered only from input mode, by
beginning a line with the tilde escape character (~). See escape
(Environment Variables) for changing this special character.
~! shell-command
Escape to the shell.
~. Simulate end of file (terminate message input).
~: mail-command
~ mail-command
Perform the command-level request. Valid only when sending a
message while reading mail.
~? Print a summary of tilde escapes.
~A Insert the autograph string Sign into the message (see
Environment Variables).
~a Insert the autograph string sign into the message (see
Environment Variables).
~b names ...
Add the names to the blind carbon copy (Bcc) list.
~c names ...
Add the names to the carbon copy (Cc) list.
~d Read in the dead.letter file. See DEAD (Environment
Variables) for a description of this file.
~e Invoke the editor on the partial message. See also EDITOR
(Environment Variables).
~f [msglist]
Forward the specified messages. The messages are inserted
into the message without alteration.
~F [msglist]
Equivalent to the ~f command, except that all headers are
included in the message, regardless of previous discard,
ignore, and retain commands. Valid only when sending a
message while reading mail.
~h Prompt for Subject line and To, Cc, and Bcc lists. If the
field is displayed with an initial value, it may be edited as
if you had just typed it.
~i string
Insert the value of the named variable into the text of the
message. For example, ~A is equivalent to ~iSign.
Environment variables set and exported in the shell are also
accessible by ~i.
~m [msglist]
Insert the specified messages into the letter, shifting the
new text to the right one tab stop. Valid only when sending a
message while reading mail.
~M [msglist]
Equivalent to the ~m command, except that all headers are
included in the message, regardless of previous discard,
ignore, and retain commands. Valid only when sending a
message while reading mail.
~p Print the message being entered.
~q
~Q Quit from input mode by simulating an interrupt. If the body
of the message is not null, the partial message is saved in
dead.letter. See DEAD (Environment Variables) for a
description of this file.
~R Generate a request for a return receipt for the message being
sent. If the recipient uses mailx to read the message, a
receipt (marked with RR in the subject line) will be returned
to the sender.
~r filename
~< filename
~< !shell-command
Read in the specified file. If the argument begins with an
exclamation point (!), the rest of the string is taken as an
arbitrary shell command and is executed, with the standard
output inserted into the message.
~s string ...
Set the subject line to string.
~t names ...
Add the given names to the To list.
~v Invoke a preferred screen editor on the partial message. See
also VISUAL (Environment Variables).
~w filename
Write the message into the given file, without the header.
~x Exit as with ~q except the message is not saved in
dead.letter.
~| shell-command
Pipe the body of the message through the given shell-command.
If the shell-command returns a successful exit status, the
output of the command replaces the message.
Environment Variables
The following are environment variables taken from the execution
environment and are not alterable within mailx.
HOME=directory
The user's base of operations.
MAILRC=filename
The name of the start-up file. Default is $HOME/.mailrc.
The following variables are internal mailx variables. They may be
imported from the execution environment or set via the set command at
any time. The unset command may be used to erase variables.
allnet All network names whose last component (login name) match are
treated as identical. This causes the msglist message
specifications to behave similarly. Default is noallnet. See
also the alternates command and the metoo variable.
append Upon termination, append messages to the end of the mbox file
instead of prepending them. Default is noappend.
askatend
If set, the prompts for Cc and Bcc lists will be performed
after the message has been entered instead of after the
Subject is entered. See also askcc and askbcc.
askcc Prompt for the Cc list after the Subject is entered. Default
is noaskcc.
askbcc Prompt for the Bcc list after the Subject is entered. Default
is noaskbcc.
asksub Prompt for subject if it is not specified on the command line
with the -s option. Enabled by default.
autoedit
Automatically edit a message, as in ~e, after prompting for
the subject, To list, Cc list and Bcc list. The variable
autoedit is looked for after the variable autovedit. Default
is noautoedit.
autoprint
Enable automatic printing of messages after delete and
undelete commands. Default is noautoprint.
autosign=string
The specified signature string is automatically appended to
the body of each message that is sent. The value is echoed to
the screen as it is appended. No default [see also ~i (TILDE
ESCAPES)].
autoSign=string
The specified signature string is automatically appended to
the body of each message that is sent. No default. The
variable inserted into the text of a message when the ~A
command is given. No default [see also ~i (TILDE ESCAPES)].
autovedit
Automatically edit a message, as in ~v, after prompting for
the subject, To list, Cc list and Bcc list. The variable
autovedit is looked for before the variable autoedit. Default
is noautovedit.
bang Enable the special-casing of exclamation points (!) in shell
escape command lines as in vi(1). Default is nobang.
cmd=shell-command
Set the default command for the pipe command. No default
value.
conv=conversion
Convert uucp addresses to the specified address style. The
only valid conversion now is internet, which uses domain-style
addressing. Conversion is disabled by default. See also the
-U command-line option.
crt=number
Pipe messages that have more than number lines through the
command specified by the value of the PAGER variable [pg(1) by
default]. Disabled by default.
DEAD=filename
The name of the file in which to save partial letters in case
of untimely interrupt. Default is $HOME/dead.letter.
debug Enable verbose diagnostics for debugging. Messages are not
delivered. Default is nodebug.
dot Take a period on a line by itself during input from a terminal
as end-of-file. Default is nodot.
editheaders
Include message headers in the text to be edited by the ~e and
~v commands. Enabled by default.
EDITOR=shell-command
The command to run when the edit or ~e command is used.
Default is ed(1).
escape=c
Substitute c for the ~ escape character. Takes effect with
next message sent.
flipf Swap the meanings of the Followup and followup commands.
flipm Swap the meanings of the Mail and mail commands.
flipr Swap the meanings of the Reply (Respond) and reply (respond)
commands.
folder=directory
The directory for saving standard mail files. User-specified
filenames beginning with a plus (+) are expanded by preceding
the filename with this directory name to obtain the real file
name. If directory does not start with a slash (/), $HOME is
prepended to it. In order to use the plus (+) construct on a
mailx command line, folder must be an exported sh environment
variable. There is no default for the folder variable. See
also outfolder below.
forwardbegin=string
Use the specified string above the text of forwarding
messages. See the forward and Forward commands. Default is
---- begin forwarded message ---- .
forwardbracket
Use the forwardbegin, forwardprefix, and forwardend strings
(or their defaults) with the ~f and ~F commands as well as the
forward and Forward commands.
forwardend=string
Use the specified string after the text of forwarded messages.
See the forward and Forward commands. Default is
---- end of forwarded message ---- .
forwardprefix=string
Use the specified string instead of the two characters ``> ''
when forwarding messages. See the forward and Forward
commands.
from A From: header is created on all outgoing messages, and the
Reply-To: or From: headers will be examined to determine the
return address when replying to a message. (These headers
will be treated as valid only if they contain a domain-style
address.) Enabled by default.
header Enable printing of the header summary when entering mailx.
Enabled by default.
hold Preserve all messages that are read in the mailbox instead of
putting them in the standard mbox save file. Default is
nohold.
ignore Ignore interrupts while entering messages. Handy for noisy
dial-up lines. Default is noignore.
ignoreeof
Ignore end-of-file during message input. Input must be
terminated by a period (.) on a line by itself or by the ~.
command. Default is noignoreeof. See also dot above.
indentprefix=string
Use the specified string instead of a single tab character
when inserting messages into a letter. See the ~m command.
iprompt=string
While in input mode, the specified string is displayed as a
prompt for each line of input.
keep When the mailbox is empty, truncate it to zero length instead
of removing it. Disabled by default.
keepsave
Keep messages that have been saved in other files in the
mailbox instead of deleting them. Default is nokeepsave.
LCMESSAGES=localename
Both the user messages and the legal strings for confirmation
prompts are determined by this variable. The LANG and LCALL
variables also have an effect, see LANG in environ(5) for
details.
LISTER=shell-command
The command (and options) to use when listing the contents of
the folder directory. The default is ls(1).
MAILXHEAD=string
The specified string is included at the beginning of the body
of each message that is sent.
MAILXTAIL=string
The specified string is included at the end of the body of
each message that is sent.
MBOX=filename
The name of the file in which to save messages that have been
read. The xit command overrides this function, as does saving
the message explicitly in another file. Default is
$HOME/mbox.
metoo If your login appears as a recipient, do not delete it from
the list. Default is nometoo.
mprefix=string
Use the specified string instead of a single tab character
when inserting messages into a letter. (Note: This variable
is being replaced by the indentprefix string.)
mustbang
All mail addresses are forced into bang format.
netprecedence
When mailx compares addresses for allnet and metoo processing,
as well as removing duplicates, the addresses are normalized
into an internal format before comparison. In order to do
this, the relative precedences of the various networking
characters must be taken into consideration. The
netprecedence variable consists of a list of networking
characters, each followed by the letter l or r, depending on
whether that networking character is left associative or right
associative, respectively. The default is ``@r!l%r''.
newmail
Look for new mail before each prompt. Enabled by default.
no When used as a prefix to a variable name, has the effect of
unsetting the variable, just like using the unset command.
NOMETAMAIL
If set, a Multi-Purpose Internet Message Extensions (MIME)
message will not be passed through the program metamail.
onehop When responding to a message that was originally sent to
several recipients, the other recipient addresses are normally
forced to be relative to the originating author's machine for
the response. This flag disables alteration of the
recipients' addresses, improving efficiency in a network where
all machines can send directly to all other machines (i.e.,
one hop away).
outfolder
Causes the files used to record outgoing messages to be
located in the directory specified by the folder variable
unless the pathname is absolute. Default is nooutfolder. See
folder, above, and the Save, Copy, followup, and Followup
commands.
page Used with the pipe command to insert a form feed after each
message sent through the pipe. Default is nopage.
PAGER=shell-command
The command to use as a filter for paginating output. This
can also be used to specify the options to be used. Default
is pg(1).
postmark=string
The specified string is included in the comment field of the
From: header of messages that you send. The string is usually
set to your name. See from and translate. If the string
includes an @, it will be used for the entire From: header.
prompt=string
Set the command mode prompt to string. Default is ``? ''.
quiet Refrain from printing the opening message and version when
entering mailx. Default is noquiet.
record=filename
Record all outgoing mail in filename. Disabled by default.
See also outfolder above. If you have the record and
outfolder variables set but the folder variable not set,
messages are saved in +filename instead of filename.
reversedp
When using the dt or dp commands, if the last undeleted
message is deleted, the next undeleted message from the end is
printed.
save Enable saving of messages in dead.letter on interrupt or
delivery error. See DEAD for a description of this file.
Enabled by default.
screen=number
Set the number of lines in a screen-full of headers for the
headers command. It must be a positive number.
sendmail=shell-command
Alternate command for delivering messages. Default is
/usr/bin/mail.
sendwait
Wait for background mailer to finish before returning.
Default is nosendwait.
SHELL=shell-command
The name of a preferred command interpreter. Default is
sh(1).
showto When displaying the header summary and the message is from
you, print the recipient's name instead of the author's name.
sign=string
The variable inserted into the text of a message when the ~a
(autograph) command is given. No default [see also ~i (Tilde
Escapes)].
Sign=string
The variable inserted into the text of a message when the ~A
command is given. No default [see also ~i (Tilde Escapes)].
toplines=number
The number of lines of header to print with the top command.
Default is 5.
translate=shell-command
The name of a command used to translate mail addresses. The
program will receive mail addresses as arguments. The program
should produce, on standard output, lines containing the
following data, in this order:
The postmark for the sender (see the postmark).
Translated mail addresses, one per line, corresponding to the
program's arguments. Each translated address will replace the
corresponding address in the mail message being sent.
A line containing only y or n . If the line contains y , the
user will be asked to confirm that the message should be sent.
The translate program will be invoked for each mail message
sent. If the program exists with a non-zero exit status, or
fails to produce enough output, the message will not be sent.
VISUAL=shell-command
The name of a preferred screen editor. Default is vi.
EXAMPLES
In the following example, the user is reading mail on a system with
DG/UX information security, running with MAC. This means that the
user's mailboxes are in a multi-level directory. Messages marked
with an X are restricted and can only be read. Note that mail from
the multiple levels is combined into one "inbox" and is sorted by
date received.
In this example, the user tries to invoke commands with a restricted
message (the current message, '3') and is prevented from doing so.
# mailx
mailx version 4.00 02/03/95 Type ? for help.
"/var/mail/proto": 5 messages 2 new 1 unread
X 1 Proto user Wed Feb 1 16:01 18/356 msg at ACR LO
X 2 Papa Bear Thu Feb 2 22:57 17/368 another test
>X 3 Wilbur Pig Thu Feb 2 23:56 11/336 what ho!
U 4 Mama Bear Fri Feb 3 00:10 17/367 huskers
X 5 Wilbur Pig Fri Feb 3 00:13 17/403 inside here
? save /tmp/foo
"/tmp/foo" UX:mailx: WARNING: Cannot save restricted msg 3
? r
UX:mailx: WARNING: Cannot reply to restricted msg 3
? vi
UX:mailx: WARNING: Cannot edit restricted msg 3
? touch
UX:mailx: WARNING: Cannot touch restricted msg 3
? label 1-5
X 1 Proto user Wed Feb 1 16:01 18/356 msg at ACR LO
ACCRED_LO
X 2 Papa Bear Thu Feb 2 22:57 17/368 another test
ACCRED_LO
>X 3 Wilbur Pig Thu Feb 2 23:56 11/336 what ho!
ACCRED_LO
U 4 Mama Bear Fri Feb 3 00:10 17/367 huskers
ACCRED_HI
X 5 Wilbur Pig Fri Feb 3 00:13 17/403 inside here
ACCRED_LO
In the next example, the date is queried from the DG/UX command line or the
mailx command line:
$ mailx -D "1994/03/15" -f ~/mbox
O 98 Rocky Rhode Tue Mar 15 09:44 45/1432 Build Proc
O 99 Rocky Rhode Tue Mar 15 11:47 27/870 Re: cmd
(and from inside mailx ...)
? date ">1994/03/15 < 1994/03/17"
O 98 Rocky Rhode Tue Mar 15 09:44 45/1432 Build Proc
O 99 Rocky Rhode Tue Mar 15 11:47 27/870 Re: cmd
O100 Rocky Rhode Wed Mar 16 08:53 24/677 out Thursday
In this example, searching for text is invoked through mailx
or from the mailx command line, like this:
$ mailx -S "howdy" -f ~/mbox
O 10 Alex Malex Thu Jan 6 13:52 32/853 Re: no bugs
O164 Alex Malex Thu May 5 15:15 96/3622 Re: code review
O428 Nathan Noodle Fri Feb 3 13:36 17/403 trying this
and
? search "howdy"
O 10 Alex Malex Thu Jan 6 13:52 32/853 Re: no bugs
O164 Alex Malex Thu May 5 15:15 96/3622 Re: code review
O428 Nathan Noodle Fri Feb 3 13:36 17/403 trying this
FILES
$HOME/.mailrc personal start-up file
$HOME/mbox secondary storage file
/var/mail/* post office directory
/usr/share/lib/mailx/mailx.help* help message files
/etc/mail/mailx.rc optional global start-up file
/tmp/R[emqsx]* temporary files
SEE ALSO
ls(1), mail(1), pg(1), sendmail(1M), vi(1).
Only if running with MAC: ckmail(1).
NOTES
The -h option can be used only if mailx is using a delivery program
other than /usr/bin/mail.
Where shell-command is shown as valid, arguments are not always
allowed. Experimentation is recommended.
Internal variables imported from the execution environment cannot be
unset.
The full internet addressing is not fully supported by mailx. The
new standards need some time to settle down.
Attempts to send a message that has a line consisting only of a ``.''
are treated as the end of the message by mail(1) (the standard mail
delivery program).
Mailx(1) relies on the message header to be in a specific format.
When editing a mail message, changing the contents of the fields of
the header is acceptable. However, modifying the format of the
message header, such as inserting or deleting lines, or adding spaces
can cause unpredictable results.
In some cases, text messages originating in one locale may be treated
as binary when received in another locale (see environ(5)). This can
occur when the locales use different character sets. To allow such
messages to be treated as text when received, the LCCTYPE or LANG
environment variable should be set to match the value used on the
sending system.
If a user's mail folder resides on a non-DG/UX system, or if the user
has saved a mail folder from a pre-5.4 DG/UX system, and these
folders contain messages that use 8-bit characters, there may be
difficulties in processing the messages with mailx. In such a case,
the difficulties should be eliminated if the locale is set so that
the ISO 8859-1 character set will be used.
Licensed material--property of copyright holder(s)