diff options
Diffstat (limited to 'man1p/mailx.1p')
-rw-r--r-- | man1p/mailx.1p | 2208 |
1 files changed, 2208 insertions, 0 deletions
diff --git a/man1p/mailx.1p b/man1p/mailx.1p new file mode 100644 index 000000000..2a5aacc23 --- /dev/null +++ b/man1p/mailx.1p @@ -0,0 +1,2208 @@ +.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved +.TH "MAILX" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual" +.\" mailx +.SH NAME +mailx \- process messages +.SH SYNOPSIS +.SS Send Mode +.sp +.RS +.nf + +\fBmailx\fP \fB[\fP\fB-s\fP \fIsubject\fP\fB]\fP \fIaddress\fP\fB... +\fP +.fi +.RE +.SS Receive Mode +.sp +.RS +.nf + +\fBmailx -e +.sp + +.sp + +mailx\fP \fB[\fP\fB-HiNn\fP\fB][\fP\fB-F\fP\fB][\fP\fB-u\fP \fIuser\fP\fB]\fP\fB +.br + +.sp + +mailx -f\fP\fB[\fP\fB-HiNn\fP\fB][\fP\fB-F\fP\fB][\fP\fIfile\fP\fB]\fP\fB +.br + +\fP +.fi +.RE +.SH DESCRIPTION +.LP +The \fImailx\fP utility provides a message sending and receiving facility. +It has two major modes, selected by the options +used: Send Mode and Receive Mode. +.LP +On systems that do not support the User Portability Utilities option, +an application using \fImailx\fP shall have the ability +to send messages in an unspecified manner (Send Mode). Unless the +first character of one or more lines is tilde ( \fB'~'\fP +), all characters in the input message shall appear in the delivered +message, but additional characters may be inserted in the +message before it is retrieved. +.LP +On systems supporting the User Portability Utilities option, mail-receiving +capabilities and other interactive features, Receive +Mode, described below, also shall be enabled. +.SS Send Mode +.LP +Send Mode can be used by applications or users to send messages from +the text in standard input. +.SS Receive Mode +.LP +Receive Mode is more oriented towards interactive users. Mail can +be read and sent in this interactive mode. +.LP +When reading mail, \fImailx\fP provides commands to facilitate saving, +deleting, and responding to messages. When sending mail, +\fImailx\fP allows editing, reviewing, and other modification of the +message as it is entered. +.LP +Incoming mail shall be stored in one or more unspecified locations +for each user, collectively called the system \fImailbox\fP +for that user. When \fImailx\fP is invoked in Receive Mode, the system +mailbox shall be the default place to find new mail. As +messages are read, they shall be marked to be moved to a secondary +file for storage, unless specific action is taken. This +secondary file is called the \fBmbox\fP and is normally located in +the directory referred to by the \fIHOME\fP environment +variable (see \fIMBOX\fP in the ENVIRONMENT VARIABLES section for +a description of this file). Messages shall remain in this file +until explicitly removed. When the \fB-f\fP option is used to read +mail messages from secondary files, messages shall be retained +in those files unless specifically removed. All three of these locations-system +mailbox, \fBmbox\fP, and secondary file-are +referred to in this section as simply "mailboxes", unless more specific +identification is required. +.SH OPTIONS +.LP +The \fImailx\fP utility shall conform to the Base Definitions volume +of IEEE\ Std\ 1003.1-2001, Section 12.2, Utility Syntax Guidelines. +.LP +The following options shall be supported. (Only the \fB-s\fP \fIsubject\fP +option shall be required on all systems. The other +options are required only on systems supporting the User Portability +Utilities option.) +.TP 7 +\fB-e\fP +Test for the presence of mail in the system mailbox. The \fImailx\fP +utility shall write nothing and exit with a successful +return code if there is mail to read. +.TP 7 +\fB-f\fP +Read messages from the file named by the \fIfile\fP operand instead +of the system mailbox. (See also \fBfolder\fP.) If no +\fIfile\fP operand is specified, read messages from \fBmbox\fP instead +of the system mailbox. +.TP 7 +\fB-F\fP +Record the message in a file named after the first recipient. The +name is the login-name portion of the address found first on +the \fBTo:\fP line in the mail header. Overrides the \fBrecord\fP +variable, if set (see Internal +Variables in mailx .) +.TP 7 +\fB-H\fP +Write a header summary only. +.TP 7 +\fB-i\fP +Ignore interrupts. (See also \fBignore\fP.) +.TP 7 +\fB-n\fP +Do not initialize from the system default start-up file. See the EXTENDED +DESCRIPTION section. +.TP 7 +\fB-N\fP +Do not write an initial header summary. +.TP 7 +\fB-s\ \fP \fIsubject\fP +Set the \fBSubject\fP header field to \fIsubject\fP. All characters +in the \fIsubject\fP string shall appear in the +delivered message. The results are unspecified if \fIsubject\fP is +longer than {LINE_MAX} - 10 bytes or contains a +<newline>. +.TP 7 +\fB-u\ \fP \fIuser\fP +Read the system mailbox of the login name \fIuser\fP. This shall only +be successful if the invoking user has the appropriate +privileges to read the system mailbox of that user. +.sp +.SH OPERANDS +.LP +The following operands shall be supported: +.TP 7 +\fIaddress\fP +Addressee of message. When \fB-n\fP is specified and no user start-up +files are accessed (see the EXTENDED DESCRIPTION +section), the user or application shall ensure this is an address +to pass to the mail delivery system. Any system or user start-up +files may enable aliases (see \fBalias\fP under Commands in mailx +) that may modify the form of +\fIaddress\fP before it is passed to the mail delivery system. +.TP 7 +\fIfile\fP +A pathname of a file to be read instead of the system mailbox when +\fB-f\fP is specified. The meaning of the \fIfile\fP +option-argument shall be affected by the contents of the \fBfolder\fP +internal variable; see Internal +Variables in mailx . +.sp +.SH STDIN +.LP +When \fImailx\fP is invoked in Send Mode (the first synopsis line), +standard input shall be the message to be delivered to the +specified addresses. When in Receive Mode, user commands shall be +accepted from \fIstdin\fP. If the User Portability Utilities +option is not supported, standard input lines beginning with a tilde +( \fB'~'\fP ) character produce unspecified +results. +.LP +If the User Portability Utilities option is supported, then in both +Send and Receive Modes, standard input lines beginning with +the escape character (usually tilde ( \fB'~'\fP )) shall affect processing +as described in Command Escapes in mailx . +.SH INPUT FILES +.LP +When \fImailx\fP is used as described by this volume of IEEE\ Std\ 1003.1-2001, +the \fIfile\fP option-argument (see +the \fB-f\fP option) and the \fBmbox\fP shall be text files containing +mail messages, formatted as described in the OUTPUT FILES +section. The nature of the system mailbox is unspecified; it need +not be a file. +.SH ENVIRONMENT VARIABLES +.LP +The following environment variables shall affect the execution of +\fImailx\fP: +.TP 7 +\fIDEAD\fP +Determine the pathname of the file in which to save partial messages +in case of interrupts or delivery errors. The default +shall be \fBdead.letter\fP in the directory named by the \fIHOME\fP +variable. The behavior of \fImailx\fP in saving partial +messages is unspecified if the User Portability Utilities option is +not supported and \fIDEAD\fP is not defined with the value +\fB/dev/null\fP. +.TP 7 +\fIEDITOR\fP +Determine the name of a utility to invoke when the \fBedit\fP (see +Commands in mailx ) or +\fB~e\fP (see Command Escapes in mailx ) command is used. The default +editor is unspecified. +\ On XSI-conformant systems it is \fIed\fP. The effects of this variable +are unspecified if the User Portability Utilities option is not +supported. +.TP 7 +\fIHOME\fP +Determine the pathname of the user's home directory. +.TP 7 +\fILANG\fP +Provide a default value for the internationalization variables that +are unset or null. (See the Base Definitions volume of +IEEE\ Std\ 1003.1-2001, Section 8.2, Internationalization Variables +for +the precedence of internationalization variables used to determine +the values of locale categories.) +.TP 7 +\fILC_ALL\fP +If set to a non-empty string value, override the values of all the +other internationalization variables. +.TP 7 +\fILC_CTYPE\fP +Determine the locale for the interpretation of sequences of bytes +of text data as characters (for example, single-byte as +opposed to multi-byte characters in arguments and input files) and +the handling of case-insensitive address and header-field +comparisons. +.TP 7 +\fILC_TIME\fP +Determine the format and contents of the date and time strings written +by \fImailx\fP. +.TP 7 +\fILC_MESSAGES\fP +Determine the locale that should be used to affect the format and +contents of diagnostic messages written to standard error and +informative messages written to standard output. +.TP 7 +\fILISTER\fP +Determine a string representing the command for writing the contents +of the \fBfolder\fP directory to standard output when the +\fBfolders\fP command is given (see \fBfolders\fP in Commands in mailx +). Any string acceptable as +a \fIcommand_string\fP operand to the \fIsh\fP \fB-c\fP command shall +be valid. If this +variable is null or not set, the output command shall be \fIls\fP. +The effects of this variable +are unspecified if the User Portability Utilities option is not supported. +.TP 7 +\fIMAILRC\fP +Determine the pathname of the start-up file. The default shall be +\fB\&.mailrc\fP in the directory referred to by the +\fIHOME\fP environment variable. The behavior of \fImailx\fP is unspecified +if the User Portability Utilities option is not +supported and \fIMAILRC\fP is not defined with the value \fB/dev/null\fP. +.TP 7 +\fIMBOX\fP +Determine a pathname of the file to save messages from the system +mailbox that have been read. The \fBexit\fP command shall +override this function, as shall saving the message explicitly in +another file. The default shall be \fBmbox\fP in the directory +named by the \fIHOME\fP variable. The effects of this variable are +unspecified if the User Portability Utilities option is not +supported. +.TP 7 +\fINLSPATH\fP +Determine the location of message catalogs for the processing of \fILC_MESSAGES +\&.\fP +.TP 7 +\fIPAGER\fP +Determine a string representing an output filtering or pagination +command for writing the output to the terminal. Any string +acceptable as a \fIcommand_string\fP operand to the \fIsh\fP \fB-c\fP +command shall be valid. +When standard output is a terminal device, the message output shall +be piped through the command if the \fImailx\fP internal +variable \fBcrt\fP is set to a value less the number of lines in the +message; see Internal Variables in +mailx . If the \fIPAGER\fP variable is null or not set, the paginator +shall be either \fImore\fP or another paginator utility documented +in the system documentation. The effects of this +variable are unspecified if the User Portability Utilities option +is not supported. +.TP 7 +\fISHELL\fP +Determine the name of a preferred command interpreter. The default +shall be \fIsh\fP. The +effects of this variable are unspecified if the User Portability Utilities +option is not supported. +.TP 7 +\fITERM\fP +If the internal variable \fBscreen\fP is not specified, determine +the name of the terminal type to indicate in an unspecified +manner the number of lines in a screenful of headers. If \fITERM\fP +is not set or is set to null, an unspecified default terminal +type shall be used and the value of a screenful is unspecified. The +effects of this variable are unspecified if the User +Portability Utilities option is not supported. +.TP 7 +\fITZ\fP +This variable may determine the timezone used to calculate date and +time strings written by \fImailx\fP. If \fITZ\fP is unset +or null, an unspecified default timezone shall be used. +.TP 7 +\fIVISUAL\fP +Determine a pathname of a utility to invoke when the \fBvisual\fP +command (see Commands in +mailx ) or \fB~v\fP command-escape (see Command Escapes in mailx ) +is used. If this +variable is null or not set, the full-screen editor shall be \fIvi\fP. +The effects of this +variable are unspecified if the User Portability Utilities option +is not supported. +.sp +.SH ASYNCHRONOUS EVENTS +.LP +When \fImailx\fP is in Send Mode and standard input is not a terminal, +it shall take the standard action for all signals. +.LP +In Receive Mode, or in Send Mode when standard input is a terminal, +if a SIGINT signal is received: +.IP " 1." 4 +If in command mode, the current command, if there is one, shall be +aborted, and a command-mode prompt shall be written. +.LP +.IP " 2." 4 +If in input mode: +.RS +.IP " a." 4 +If \fBignore\fP is set, \fImailx\fP shall write \fB"@\\n"\fP , discard +the current input line, and continue processing, +bypassing the message-abort mechanism described in item 2b. +.LP +.IP " b." 4 +If the interrupt was received while sending mail, either when in Receive +Mode or in Send Mode, a message shall be written, and +another subsequent interrupt, with no other intervening characters +typed, shall be required to abort the mail message. If in +Receive Mode and another interrupt is received, a command-mode prompt +shall be written. If in Send Mode and another interrupt is +received, \fImailx\fP shall terminate with a non-zero status. +.LP +In both cases listed in item b, if the message is not empty: +.RS +.IP "i. " 5 +If \fBsave\fP is enabled and the file named by \fIDEAD\fP can be created, +the message shall be written to the file named by +\fIDEAD .\fP If the file exists, the message shall be written to replace +the contents of the file. +.LP +.IP "ii." 5 +If \fBsave\fP is not enabled, or the file named by \fIDEAD\fP cannot +be created, the message shall not be saved. +.LP +.RE +.LP +.RE +.LP +.LP +The \fImailx\fP utility shall take the standard action for all other +signals. +.SH STDOUT +.LP +In command and input modes, all output, including prompts and messages, +shall be written to standard output. +.SH STDERR +.LP +The standard error shall be used only for diagnostic messages. +.SH OUTPUT FILES +.LP +Various \fImailx\fP commands and command escapes can create or add +to files, including the \fBmbox\fP, the dead-letter file, +and secondary mailboxes. When \fImailx\fP is used as described in +this volume of IEEE\ Std\ 1003.1-2001, these files shall +be text files, formatted as follows: +\fBline beginning with\fP \fBFrom<space> +.br +[\fP\fBone or more\fP \fIheader-lines\fP; see Commands in mailx \fB] +.br +\fP \fIempty line +.br +\fP \fB[\fP\fBzero or more\fP \fIbody lines +.br +empty line\fP\fB] +.br +[\fP\fBline beginning with\fP \fBFrom<space>...]\fP +.LP +where each message begins with the \fBFrom\ <space>\fP line shown, +preceded by the beginning of the file or an empty +line. (The \fBFrom <space>\fP line is considered to be part of the +message header, but not one of the header-lines referred +to in Commands in mailx ; thus, it shall not be affected by the \fBdiscard\fP, +\fBignore\fP, or +\fBretain\fP commands.) The formats of the remainder of the \fBFrom +<space>\fP line and any additional header lines are +unspecified, except that none shall be empty. The format of a message +body line is also unspecified, except that no line following +an empty line shall start with \fBFrom <space>\fP; \fImailx\fP shall +modify any such user-entered message body lines +(following an empty line and beginning with \fBFrom <space>\fP) by +adding one or more characters to precede the \fB'F'\fP +; it may add these characters to \fBFrom <space>\fP lines that are +not preceded by an empty line. +.LP +When a message from the system mailbox or entered by the user is not +a text file, it is implementation-defined how such a +message is stored in files written by \fImailx\fP. +.SH EXTENDED DESCRIPTION +.LP +The entire EXTENDED DESCRIPTION section shall apply only to implementations +supporting the User Portability Utilities +option. +.LP +The \fImailx\fP utility cannot guarantee support for all character +encodings in all circumstances. For example, inter-system +mail may be restricted to 7-bit data by the underlying network, 8-bit +data need not be portable to non-internationalized systems, +and so on. Under these circumstances, it is recommended that only +characters defined in the ISO/IEC\ 646:1991 standard +International Reference Version (equivalent to ASCII) 7-bit range +of characters be used. +.LP +When \fImailx\fP is invoked using one of the Receive Mode synopsis +forms, it shall write a page of header-summary lines (if +\fB-N\fP was not specified and there are messages, see below), followed +by a prompt indicating that \fImailx\fP can accept +regular commands (see Commands in mailx ); this is termed \fIcommand +mode\fP. The page of +header-summary lines shall contain the first new message if there +are new messages, or the first unread message if there are unread +messages, or the first message. When \fImailx\fP is invoked using +the Send Mode synopsis and standard input is a terminal, if no +subject is specified on the command line and the \fBasksub\fP variable +is set, a prompt for the subject shall be written. At this +point, \fImailx\fP shall be in input mode. This input mode shall also +be entered when using one of the Receive Mode synopsis forms +and a reply or new message is composed using the \fBreply\fP, \fBReply\fP, +\fBfollowup\fP, \fBFollowup\fP, or \fBmail\fP +commands and standard input is a terminal. When the message is typed +and the end of the message is encountered, the message shall +be passed to the mail delivery software. Commands can be entered by +beginning a line with the escape character (by default, tilde ( +\fB'~'\fP )) followed by a single command letter and optional arguments. +See Commands in +mailx for a summary of these commands. It is unspecified what effect +these commands will have if standard input is not a +terminal when a message is entered using either the Send Mode synopsis, +or the Read Mode commands \fBreply\fP, \fBReply\fP, +\fBfollowup\fP, \fBFollowup\fP, or \fBmail\fP. +.TP 7 +\fBNote:\fP +For notational convenience, this section uses the default escape character, +tilde, in all references and examples. +.sp +.LP +At any time, the behavior of \fImailx\fP shall be governed by a set +of environmental and internal variables. These are flags +and valued parameters that can be set and cleared via the \fImailx\fP +\fBset\fP and \fBunset\fP commands. +.LP +Regular commands are of the form: +.sp +.RS +.nf + +\fB[\fP\fIcommand\fP\fB] [\fP\fImsglist\fP\fB] [\fP\fIargument\fP \fB...\fP\fB] +\fP +.fi +.RE +.LP +If no \fIcommand\fP is specified in command mode, \fBnext\fP shall +be assumed. In input mode, commands shall be recognized by +the escape character, and lines not treated as commands shall be taken +as input for the message. +.LP +In command mode, each message shall be assigned a sequential number, +starting with 1. +.LP +All messages have a state that shall affect how they are displayed +in the header summary and how they are retained or deleted +upon termination of \fImailx\fP. There is at any time the notion of +a \fIcurrent\fP message, which shall be marked by a +\fB'>'\fP at the beginning of a line in the header summary. When \fImailx\fP +is invoked using one of the Receive Mode +synopsis forms, the current message shall be the first new message, +if there is a new message, or the first unread message if there +is an unread message, or the first message if there are any messages, +or unspecified if there are no messages in the mailbox. Each +command that takes an optional list of messages (\fImsglist\fP) or +an optional single message (\fImessage\fP) on which to operate +shall leave the current message set to the highest-numbered message +of the messages specified, unless the command deletes messages, +in which case the current message shall be set to the first undeleted +message (that is, a message not in the deleted state) after +the highest-numbered message deleted by the command, if one exists, +or the first undeleted message before the highest-numbered +message deleted by the command, if one exists, or to an unspecified +value if there are no remaining undeleted messages. All +messages shall be in one of the following states: +.TP 7 +\fInew\fP +The message is present in the system mailbox and has not been viewed +by the user or moved to any other state. Messages in state +\fInew\fP when \fImailx\fP quits shall be retained in the system mailbox. +.TP 7 +\fIunread\fP +The message has been present in the system mailbox for more than one +invocation of \fImailx\fP and has not been viewed by the +user or moved to any other state. Messages in state \fIunread\fP when +\fImailx\fP quits shall be retained in the system +mailbox. +.TP 7 +\fIread\fP +The message has been processed by one of the following commands: \fB~f\fP, +\fB~m\fP, \fB~F\fP, +\fB~M\fP, \fBcopy\fP, \fBmbox\fP, \fBnext\fP, \fBpipe\fP, \fBprint\fP, +\fBPrint\fP, \fBtop\fP, \fBtype\fP, +\fBType\fP, \fBundelete\fP. The \fBdelete\fP, \fBdp\fP, and \fBdt\fP +commands may also cause the next message to be marked as +\fIread\fP, depending on the value of the \fBautoprint\fP variable. +Messages that are in the system mailbox and in state +\fIread\fP when \fImailx\fP quits shall be saved in the \fBmbox\fP, +unless the internal variable \fBhold\fP was set. Messages +that are in the \fBmbox\fP or in a secondary mailbox and in state +\fIread\fP when \fImailx\fP quits shall be retained in their +current location. +.TP 7 +\fIdeleted\fP +The message has been processed by one of the following commands: \fBdelete\fP, +\fBdp\fP, \fBdt\fP. Messages in state +\fIdeleted\fP when \fImailx\fP quits shall be deleted. Deleted messages +shall be ignored until \fImailx\fP quits or changes +mailboxes or they are specified to the undelete command; for example, +the message specification / \fIstring\fP shall only search +the subject lines of messages that have not yet been deleted, unless +the command operating on the list of messages is +\fBundelete\fP. No deleted message or deleted message header shall +be displayed by any \fImailx\fP command other than +\fBundelete\fP. +.TP 7 +\fIpreserved\fP +The message has been processed by a \fBpreserve\fP command. When \fImailx\fP +quits, the message shall be retained in its +current location. +.TP 7 +\fIsaved\fP +The message has been processed by one of the following commands: \fBsave\fP +or \fBwrite\fP. If the current mailbox is the +system mailbox, and the internal variable \fBkeepsave\fP is set, messages +in the state saved shall be saved to the file designated +by the \fIMBOX\fP variable (see the ENVIRONMENT VARIABLES section). +If the current mailbox is the system mailbox, messages in the +state \fIsaved\fP shall be deleted from the current mailbox, when +the \fBquit\fP or \fBfile\fP command is used to exit the +current mailbox. +.sp +.LP +The header-summary line for each message shall indicate the state +of the message. +.LP +Many commands take an optional list of messages ( \fImsglist\fP) on +which to operate, which defaults to the current message. A +\fImsglist\fP is a list of message specifications separated by <blank>s, +which can include: +.TP 7 +\fBn\fP +Message number \fIn\fP. +.TP 7 +\fB+\fP +The next undeleted message, or the next deleted message for the \fBundelete\fP +command. +.TP 7 +\fB-\fP +The next previous undeleted message, or the next previous deleted +message for the \fBundelete\fP command. +.TP 7 +\fB\&.\fP +The current message. +.TP 7 +\fB^\fP +The first undeleted message, or the first deleted message for the +\fBundelete\fP command. +.TP 7 +\fB$\fP +The last message. +.TP 7 +\fB*\fP +All messages. +.TP 7 +\fBn-m\fP +An inclusive range of message numbers. +.TP 7 +\fIaddress\fP +All messages from \fIaddress\fP; any address as shown in a header +summary shall be matchable in this form. +.TP 7 +/\fIstring\fP +All messages with \fIstring\fP in the subject line (case ignored). +.TP 7 +\fB:c\fP +All messages of type \fIc\fP, where \fIc\fP shall be one of: +.TP 7 +\fBd\fP +.RS +Deleted messages. +.RE +.TP 7 +\fBn\fP +.RS +New messages. +.RE +.TP 7 +\fBo\fP +.RS +Old messages (any not in state \fIread\fP or \fInew\fP). +.RE +.TP 7 +\fBr\fP +.RS +Read messages. +.RE +.TP 7 +\fBu\fP +.RS +Unread messages. +.RE +.sp +.sp +.LP +Other commands take an optional message ( \fImessage\fP) on which +to operate, which defaults to the current message. All of the +forms allowed for \fImsglist\fP are also allowed for \fImessage\fP, +but if more than one message is specified, only the first +shall be operated on. +.LP +Other arguments are usually arbitrary strings whose usage depends +on the command involved. +.SS Start-Up in mailx +.LP +At start-up time, \fImailx\fP shall take the following steps in sequence: +.IP " 1." 4 +Establish all variables at their stated default values. +.LP +.IP " 2." 4 +Process command line options, overriding corresponding default values. +.LP +.IP " 3." 4 +Import any of the \fIDEAD ,\fP \fIEDITOR ,\fP \fIMBOX ,\fP \fILISTER +,\fP \fIPAGER ,\fP \fISHELL ,\fP or \fIVISUAL\fP +variables that are present in the environment, overriding the corresponding +default values. +.LP +.IP " 4." 4 +Read \fImailx\fP commands from an unspecified system start-up file, +unless the \fB-n\fP option is given, to initialize any +internal \fImailx\fP variables and aliases. +.LP +.IP " 5." 4 +Process the start-up file of \fImailx\fP commands named in the user +\fIMAILRC\fP variable. +.LP +.LP +Most regular \fImailx\fP commands are valid inside start-up files, +the most common use being to set up initial display options +and alias lists. The following commands shall be invalid in the start-up +file: \fB!\fP, \fBedit\fP, \fBhold\fP, \fBmail\fP, +\fBpreserve\fP, \fBreply\fP, \fBReply\fP, \fBshell\fP, \fBvisual\fP, +\fBCopy\fP, \fBfollowup\fP, and \fBFollowup\fP. Any +errors in the start-up file shall either cause \fImailx\fP to terminate +with a diagnostic message and a non-zero status or to +continue after writing a diagnostic message, ignoring the remainder +of the lines in the start-up file. +.LP +A blank line in a start-up file shall be ignored. +.SS Internal Variables in mailx +.LP +The following variables are internal \fImailx\fP variables. Each internal +variable can be set via the \fImailx\fP \fBset\fP +command at any time. The \fBunset\fP and \fBset\ no\fP \fIname\fP +commands can be used to erase variables. +.LP +In the following list, variables shown as: +.sp +.RS +.nf + +\fBvariable +\fP +.fi +.RE +.LP +represent Boolean values. Variables shown as: +.sp +.RS +.nf + +\fBvariable=\fP\fIvalue\fP +.fi +.RE +.LP +shall be assigned string or numeric values. For string values, the +rules in Commands in mailx +concerning filenames and quoting shall also apply. +.LP +The defaults specified here may be changed by the implementation-defined +system start-up file unless the user specifies the +\fB-n\fP option. +.TP 7 +\fBallnet\fP +All network names whose login name components match shall be treated +as identical. This shall cause the \fImsglist\fP message +specifications to behave similarly. The default shall be \fBnoallnet\fP. +See also the \fBalternates\fP command and the +\fBmetoo\fP variable. +.TP 7 +\fBappend\fP +Append messages to the end of the \fBmbox\fP file upon termination +instead of placing them at the beginning. The default shall +be \fBnoappend\fP. This variable shall not affect the \fBsave\fP command +when saving to \fBmbox\fP. +.TP 7 +\fBask\fP,\ \fBasksub\fP +Prompt for a subject line on outgoing mail if one is not specified +on the command line with the \fB-s\fP option. The +\fBask\fP and \fBasksub\fP forms are synonyms; the system shall refer +to \fBasksub\fP and \fBnoasksub\fP in its messages, but +shall accept \fBask\fP and \fBnoask\fP as user input to mean \fBasksub\fP +and \fBnoasksub\fP. It shall not be possible to set +both \fBask\fP and \fBnoasksub\fP, or \fBnoask\fP and \fBasksub\fP. +The default shall be \fBasksub\fP, but no prompting shall +be done if standard input is not a terminal. +.TP 7 +\fBaskbcc\fP +Prompt for the blind copy list. The default shall be \fBnoaskbcc\fP. +.TP 7 +\fBaskcc\fP +Prompt for the copy list. The default shall be \fBnoaskcc\fP. +.TP 7 +\fBautoprint\fP +Enable automatic writing of messages after \fBdelete\fP and \fBundelete\fP +commands. The default shall be +\fBnoautoprint\fP. +.TP 7 +\fBbang\fP +Enable the special-case treatment of exclamation marks ( \fB'!'\fP +) in escape command lines; see the \fBescape\fP command +and Command Escapes in mailx . The default shall be \fBnobang\fP, +disabling the expansion of +\fB'!'\fP in the \fIcommand\fP argument to the \fB~!\fP command and +the \fB~<!\fP \fIcommand\fP escape. +.TP 7 +\fBcmd\fP=\fIcommand\fP +.sp +Set the default command to be invoked by the \fBpipe\fP command. The +default shall be \fBnocmd\fP. +.TP 7 +\fBcrt\fP=\fInumber\fP +Pipe messages having more than \fInumber\fP lines through the command +specified by the value of the \fIPAGER\fP variable. The +default shall be \fBnocrt\fP. If it is set to null, the value used +is implementation-defined. +.TP 7 +\fBdebug\fP +Enable verbose diagnostics for debugging. Messages are not delivered. +The default shall be \fBnodebug\fP. +.TP 7 +\fBdot\fP +When \fBdot\fP is set, a period on a line by itself during message +input from a terminal shall also signify end-of-file (in +addition to normal end-of-file). The default shall be \fBnodot\fP. +If \fBignoreeof\fP is set (see below), a setting of +\fBnodot\fP shall be ignored and the period is the only method to +terminate input mode. +.TP 7 +\fBescape\fP=\fIc\fP +Set the command escape character to be the character \fB'c'\fP . By +default, the command escape character shall be tilde. If +\fBescape\fP is unset, tilde shall be used; if it is set to null, +command escaping shall be disabled. +.TP 7 +\fBflipr\fP +Reverse the meanings of the \fBR\fP and \fBr\fP commands. The default +shall be \fBnoflipr\fP. +.TP 7 +\fBfolder\fP=\fIdirectory\fP +.sp +The default directory for saving mail files. User-specified filenames +beginning with a plus sign ( \fB'+'\fP ) shall be expanded +by preceding the filename with this directory name to obtain the real +pathname. If \fIdirectory\fP does not start with a slash ( +\fB'/'\fP ), the contents of \fIHOME\fP shall be prefixed to it. The +default shall be \fBnofolder\fP. If \fBfolder\fP is +unset or set to null, user-specified filenames beginning with \fB'+'\fP +shall refer to files in the current directory that begin +with the literal \fB'+'\fP character. See also \fBoutfolder\fP below. +The \fBfolder\fP value need not affect the processing of +the files named in \fIMBOX\fP and \fIDEAD .\fP +.TP 7 +\fBheader\fP +Enable writing of the header summary when entering \fImailx\fP in +Receive Mode. The default shall be \fBheader\fP. +.TP 7 +\fBhold\fP +Preserve all messages that are read in the system mailbox instead +of putting them in the \fBmbox\fP save file. The default +shall be \fBnohold\fP. +.TP 7 +\fBignore\fP +Ignore interrupts while entering messages. The default shall be \fBnoignore\fP. +.TP 7 +\fBignoreeof\fP +Ignore normal end-of-file during message input. Input can be terminated +only by entering a period ( \fB'.'\fP ) on a line by +itself or by the \fB~.\fP command escape. The default shall be \fBnoignoreeof\fP. +See also \fBdot\fP above. +.TP 7 +\fBindentprefix\fP=\fIstring\fP +.sp +A string that shall be added as a prefix to each line that is inserted +into the message by the \fB~m\fP command escape. This +variable shall default to one <tab>. +.TP 7 +\fBkeep\fP +When a system mailbox, secondary mailbox, or \fBmbox\fP is empty, +truncate it to zero length instead of removing it. The +default shall be \fBnokeep\fP. +.TP 7 +\fBkeepsave\fP +Keep the messages that have been saved from the system mailbox into +other files in the file designated by the variable \fIMBOX +,\fP instead of deleting them. The default shall be \fBnokeepsave\fP. +.TP 7 +\fBmetoo\fP +Suppress the deletion of the login name of the user from the recipient +list when replying to a message or sending to a group. +The default shall be \fBnometoo\fP. +.TP 7 +\fBonehop\fP +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 (that is, one hop away). The default +shall be \fBnoonehop\fP. +.TP 7 +\fBoutfolder\fP +Cause the files used to record outgoing messages to be located in +the directory specified by the \fBfolder\fP variable unless +the pathname is absolute. The default shall be \fBnooutfolder\fP. +See the \fBrecord\fP variable. +.TP 7 +\fBpage\fP +Insert a <form-feed> after each message sent through the pipe created +by the \fBpipe\fP command. The default shall be +\fBnopage\fP. +.TP 7 +\fBprompt\fP=\fIstring\fP +.sp +Set the command-mode prompt to \fIstring\fP. If \fIstring\fP is null +or if \fBnoprompt\fP is set, no prompting shall occur. The +default shall be to prompt with the string \fB"?\ "\fP . +.TP 7 +\fBquiet\fP +Refrain from writing the opening message and version when entering +\fImailx\fP. The default shall be \fBnoquiet\fP. +.TP 7 +\fBrecord\fP=\fIfile\fP +Record all outgoing mail in the file with the pathname \fIfile\fP. +The default shall be \fBnorecord\fP. See also +\fBoutfolder\fP above. +.TP 7 +\fBsave\fP +Enable saving of messages in the dead-letter file on interrupt or +delivery error. See the variable \fIDEAD\fP for the location +of the dead-letter file. The default shall be \fBsave\fP. +.TP 7 +\fBscreen\fP=\fInumber\fP +.sp +Set the number of lines in a screenful of headers for the \fBheaders\fP +and \fBz\fP commands. If \fBscreen\fP is not specified, +a value based on the terminal type identified by the \fITERM\fP environment +variable, the window size, the baud rate, or some +combination of these shall be used. +.TP 7 +\fBsendwait\fP +Wait for the background mailer to finish before returning. The default +shall be \fBnosendwait\fP. +.TP 7 +\fBshowto\fP +When the sender of the message was the user who is invoking \fImailx\fP, +write the information from the \fBTo:\fP line +instead of the \fBFrom:\fP line in the header summary. The default +shall be \fBnoshowto\fP. +.TP 7 +\fBsign\fP=\fIstring\fP +Set the variable inserted into the text of a message when the \fB~a\fP +command escape is given. The default shall be +\fBnosign\fP. The character sequences \fB'\\t'\fP and \fB'\\n'\fP +shall be recognized in the variable as <tab>s and +<newline>s, respectively. (See also \fB~i\fP in Command Escapes in +mailx .) +.TP 7 +\fBSign\fP=\fIstring\fP +Set the variable inserted into the text of a message when the \fB~A\fP +command escape is given. The default shall be +\fBnoSign\fP. The character sequences \fB'\\t'\fP and \fB'\\n'\fP +shall be recognized in the variable as <tab>s and +<newline>s, respectively. +.TP 7 +\fBtoplines\fP=\fInumber\fP +.sp +Set the number of lines of the message to write with the \fBtop\fP +command. The default shall be 5. +.sp +.SS Commands in mailx +.LP +The following \fImailx\fP commands shall be provided. In the following +list, header refers to lines from the message header, as +shown in the OUTPUT FILES section. Header-line refers to lines within +the header that begin with one or more non-white-space +characters, immediately followed by a colon and white space and continuing +until the next line beginning with a non-white-space +character or an empty line. Header-field refers to the portion of +a header line prior to the first colon in that line. +.LP +For each of the commands listed below, the command can be entered +as the abbreviation (those characters in the Synopsis command +word preceding the \fB'['\fP ), the full command (all characters shown +for the command word, omitting the \fB'['\fP and +\fB']'\fP ), or any truncation of the full command down to the abbreviation. +For example, the \fBexit\fP command (shown as +\fBex[it]\fP in the Synopsis) can be entered as \fBex\fP, \fBexi\fP, +or \fBexit\fP. +.LP +The arguments to commands can be quoted, using the following methods: +.IP " *" 3 +An argument can be enclosed between paired double-quotes ( \fB""\fP +) or single-quotes ( \fB''\fP ); any white space, +shell word expansion, or backslash characters within the quotes shall +be treated literally as part of the argument. A double-quote +shall be treated literally within single-quotes and \fIvice versa\fP. +These special properties of the quote marks shall occur only +when they are paired at the beginning and end of the argument. +.LP +.IP " *" 3 +A backslash outside of the enclosing quotes shall be discarded and +the following character treated literally as part of the +argument. +.LP +.IP " *" 3 +An unquoted backslash at the end of a command line shall be discarded +and the next line shall continue the command. +.LP +.LP +Filenames, where expected, shall be subjected to the following transformations, +in sequence: +.IP " *" 3 +If the filename begins with an unquoted plus sign, and the \fBfolder\fP +variable is defined (see the \fBfolder\fP variable), +the plus sign shall be replaced by the value of the \fBfolder\fP variable +followed by a slash. If the \fBfolder\fP variable is +unset or is set to null, the filename shall be unchanged. +.LP +.IP " *" 3 +Shell word expansions shall be applied to the filename (see \fIWord +Expansions\fP ). If +more than a single pathname results from this expansion and the command +is expecting one file, the effects are unspecified. +.LP +.SS Declare Aliases +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBa\fP\fB[\fP\fBlias\fP\fB] [\fP\fIalias\fP \fB[\fP\fIaddress\fP\fB...\fP\fB]]\fP\fBg\fP\fB[\fP\fBroup\fP\fB] [\fP\fIalias\fP \fB[\fP\fIaddress\fP\fB...\fP\fB]]\fP +.fi +.RE +.sp +.LP +Add the given addresses to the alias specified by \fIalias\fP. The +names shall be substituted when \fIalias\fP is used as a +recipient address specified by the user in an outgoing message (that +is, other recipients addressed indirectly through the +\fBreply\fP command shall not be substituted in this manner). Mail +address alias substitution shall apply only when the alias +string is used as a full address; for example, when \fBhlj\fP is an +alias, \fIhlj@posix.com\fP does not trigger the alias +substitution. If no arguments are given, write a listing of the current +aliases to standard output. If only an \fIalias\fP +argument is given, write a listing of the specified alias to standard +output. These listings need not reflect the same order of +addresses that were entered. +.SS Declare Alternatives +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBalt\fP\fB[\fP\fBernates\fP\fB]\fP \fIname\fP\fB... +\fP +.fi +.RE +.sp +.LP +(See also the \fBmetoo\fP command.) Declare a list of alternative +names for the user's login. When responding to a message, +these names shall be removed from the list of recipients for the response. +The comparison of names shall be in a case-insensitive +manner. With no arguments, \fBalternates\fP shall write the current +list of alternative names. +.SS Change Current Directory +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBcd\fP \fB[\fP\fIdirectory\fP\fB]\fP\fBch\fP\fB[\fP\fBdir\fP\fB] [\fP\fIdirectory\fP\fB]\fP +.fi +.RE +.sp +.LP +Change directory. If \fIdirectory\fP is not specified, the contents +of \fIHOME\fP shall be used. +.SS Copy Messages +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBc\fP\fB[\fP\fBopy\fP\fB] [\fP\fIfile\fP\fB]\fP\fBc\fP\fB[\fP\fBopy\fP\fB] [\fP\fImsglist\fP\fB]\fP \fIfile\fP\fBC\fP\fB[\fP\fBopy\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Copy messages to the file named by the pathname \fIfile\fP without +marking the messages as saved. Otherwise, it shall be +equivalent to the \fBsave\fP command. +.LP +In the capitalized form, 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, it shall be equivalent +to the \fBSave\fP command. +.SS Delete Messages +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBd\fP\fB[\fP\fBelete\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Mark messages for deletion from the mailbox. The deletions shall not +occur until \fImailx\fP quits (see the \fBquit\fP +command) or changes mailboxes (see the \fBfolder\fP command). If \fBautoprint\fP +is set and there are messages remaining after +the \fBdelete\fP command, the current message shall be written as +described for the \fBprint\fP command (see the \fBprint\fP +command); otherwise, the \fImailx\fP prompt shall be written. +.SS Discard Header Fields +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBdi\fP\fB[\fP\fBscard\fP\fB] [\fP\fIheader-field\fP\fB...\fP\fB]\fP\fBig\fP\fB[\fP\fBnore\fP\fB] [\fP\fIheader-field\fP\fB...\fP\fB]\fP +.fi +.RE +.sp +.LP +Suppress the specified header fields when writing messages. Specified +\fIheader-fields\fP shall be added to the list of +suppressed header fields. Examples of header fields to ignore are +\fBstatus\fP and \fBcc\fP. The fields shall be included when +the message is saved. The \fBPrint\fP and \fBType\fP commands shall +override this command. The comparison of header fields shall +be in a case-insensitive manner. If no arguments are specified, write +a list of the currently suppressed header fields to standard +output; the listing need not reflect the same order of header fields +that were entered. +.LP +If both \fBretain\fP and \fBdiscard\fP commands are given, \fBdiscard\fP +commands shall be ignored. +.SS Delete Messages and Display +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBdp\fP \fB[\fP\fImsglist\fP\fB]\fP\fBdt\fP \fB[\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Delete the specified messages as described for the \fBdelete\fP command, +except that the \fBautoprint\fP variable shall have +no effect, and the current message shall be written only if it was +set to a message after the last message deleted by the command. +Otherwise, an informational message to the effect that there are no +further messages in the mailbox shall be written, followed by +the \fImailx\fP prompt. +.SS Echo a String +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBec\fP\fB[\fP\fBho\fP\fB]\fP \fIstring\fP \fB... +\fP +.fi +.RE +.sp +.LP +Echo the given strings, equivalent to the shell \fIecho\fP utility. +.SS Edit Messages +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBe\fP\fB[\fP\fBdit\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Edit the given messages. The messages shall be placed in a temporary +file and the utility named by the \fIEDITOR\fP variable is +invoked to edit each file in sequence. The default \fIEDITOR\fP is +unspecified. +.LP +The \fBedit\fP command does not modify the contents of those messages +in the mailbox. +.SS Exit +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBex\fP\fB[\fP\fBit\fP\fB]\fP\fBx\fP\fB[\fP\fBit\fP\fB]\fP +.fi +.RE +.sp +.LP +Exit from \fImailx\fP without changing the mailbox. No messages shall +be saved in the \fBmbox\fP (see also \fBquit\fP). +.SS Change Folder +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBfi\fP\fB[\fP\fBle\fP\fB] [\fP\fIfile\fP\fB]\fP\fBfold\fP\fB[\fP\fBer\fP\fB] [\fP\fIfile\fP\fB]\fP +.fi +.RE +.sp +.LP +Quit (see the \fBquit\fP command) from the current file of messages +and read in the file named by the pathname \fIfile\fP. If +no argument is given, the name and status of the current mailbox shall +be written. +.LP +Several unquoted special characters shall be recognized when used +as \fIfile\fP names, with the following substitutions: +.TP 7 +\fB%\fP +The system mailbox for the invoking user. +.TP 7 +\fB%\fP\fIuser\fP +The system mailbox for \fIuser\fP. +.TP 7 +\fB#\fP +The previous file. +.TP 7 +\fB&\fP +The current \fBmbox\fP. +.TP 7 +\fB+\fP\fIfile\fP +The named file in the \fBfolder\fP directory. (See the \fBfolder\fP +variable.) +.sp +.LP +The default file shall be the current mailbox. +.SS Display List of Folders +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBfolders\fP +.fi +.RE +.sp +.LP +Write the names of the files in the directory set by the \fBfolder\fP +variable. The command specified by the \fILISTER\fP +environment variable shall be used (see the ENVIRONMENT VARIABLES +section). +.SS Follow Up Specified Messages +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBfo\fP\fB[\fP\fBllowup\fP\fB] [\fP\fImessage\fP\fB]\fP\fBF\fP\fB[\fP\fBollowup\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +In the lowercase form, respond to a message, recording the response +in a file whose name is derived from the author of the +message. See also the \fBsave\fP and \fBcopy\fP commands and \fBoutfolder\fP. +.LP +In the capitalized form, respond to the first message in the \fImsglist\fP, +sending the message to the author of each message +in the \fImsglist\fP. The subject line shall be taken from the first +message and the response shall be recorded in a file whose +name is derived from the author of the first message. See also the +\fBSave\fP and \fBCopy\fP commands and \fBoutfolder\fP. +.LP +Both forms shall override the \fBrecord\fP variable, if set. +.SS Display Header Summary for Specified Messages +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBf\fP\fB[\fP\fBrom\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Write the header summary for the specified messages. +.SS Display Header Summary +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBh\fP\fB[\fP\fBeaders\fP\fB] [\fP\fImessage\fP\fB]\fP +.fi +.RE +.sp +.LP +Write the page of headers that includes the message specified. If +the \fImessage\fP argument is not specified, the current +message shall not change. However, if the \fImessage\fP argument is +specified, the current message shall become the message that +appears at the top of the page of headers that includes the message +specified. The \fBscreen\fP variable sets the number of +headers per page. See also the \fBz\fP command. +.SS Help +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBhel\fP\fB[\fP\fBp\fP\fB]\fP\fB? +\fP +.fi +.RE +.sp +.LP +Write a summary of commands. +.SS Hold Messages +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBho\fP\fB[\fP\fBld\fP\fB] [\fP\fImsglist\fP\fB]\fP\fBpre\fP\fB[\fP\fBserve\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Mark the messages in \fImsglist\fP to be retained in the mailbox when +\fImailx\fP terminates. This shall override any commands +that might previously have marked the messages to be deleted. During +the current invocation of \fImailx\fP, only the +\fBdelete\fP, \fBdp\fP, or \fBdt\fP commands shall remove the \fIpreserve\fP +marking of a message. +.SS Execute Commands Conditionally +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBi\fP\fB[\fP\fBf\fP\fB]\fP \fBs|r +\fP\fImail-command\fP\fBs +el\fP\fB[\fP\fBse\fP\fB] +\fP\fImail-command\fP\fBs +en\fP\fB[\fP\fBdif\fP\fB]\fP +.fi +.RE +.sp +.LP +Execute commands conditionally, where \fBif\ s\fP executes the following +\fImail-command\fPs, up to an \fBelse\fP or +\fBendif\fP, if the program is in Send Mode, and \fBif\ r\fP shall +cause the \fImail-command\fPs to be executed only in +Receive Mode. +.SS List Available Commands +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBl\fP\fB[\fP\fBist\fP\fB]\fP +.fi +.RE +.sp +.LP +Write a list of all commands available. No explanation shall be given. +.SS Mail a Message +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBm\fP\fB[\fP\fBail\fP\fB]\fP \fIaddress\fP\fB... +\fP +.fi +.RE +.sp +.LP +Mail a message to the specified addresses or aliases. +.SS Direct Messages to mbox +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBmb\fP\fB[\fP\fBox\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Arrange for the given messages to end up in the \fBmbox\fP save file +when \fImailx\fP terminates normally. See \fIMBOX .\fP +See also the \fBexit\fP and \fBquit\fP commands. +.SS Process Next Specified Message +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBn\fP\fB[\fP\fBext\fP\fB] [\fP\fImessage\fP\fB]\fP +.fi +.RE +.sp +.LP +If the current message has not been written (for example, by the \fBprint\fP +command) since \fImailx\fP started or since any +other message was the current message, behave as if the \fBprint\fP +command was entered. Otherwise, if there is an undeleted +message after the current message, make it the current message and +behave as if the \fBprint\fP command was entered. Otherwise, an +informational message to the effect that there are no further messages +in the mailbox shall be written, followed by the +\fImailx\fP prompt. +.SS Pipe Message +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBpi\fP\fB[\fP\fBpe\fP\fB] [[\fP\fImsglist\fP\fB]\fP \fIcommand\fP\fB]\fP\fB|\fP \fB[[\fP\fImsglist\fP\fB]\fP \fIcommand\fP\fB]\fP +.fi +.RE +.sp +.LP +Pipe the messages through the given \fIcommand\fP by invoking the +command interpreter specified by \fISHELL\fP with two +arguments: \fB-c\fP and \fIcommand\fP. (See also \fIsh\fP \fB-c\fP.) +The application shall +ensure that the command is given as a single argument. Quoting, described +previously, can be used to accomplish this. If no +arguments are given, the current message shall be piped through the +command specified by the value of the \fBcmd\fP variable. If +the \fBpage\fP variable is set, a <form-feed> shall be inserted after +each message. +.SS Display Message with Headers +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBP\fP\fB[\fP\fBrint\fP\fB] [\fP\fImsglist\fP\fB]\fP\fBT\fP\fB[\fP\fBype\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Write the specified messages, including all header lines, to standard +output. Override suppression of lines by the +\fBdiscard\fP, \fBignore\fP, and \fBretain\fP commands. If \fBcrt\fP +is set, the messages longer than the number of lines +specified by the \fBcrt\fP variable shall be paged through the command +specified by the \fIPAGER\fP environment variable. +.SS Display Message +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBp\fP\fB[\fP\fBrint\fP\fB] [\fP\fImsglist\fP\fB]\fP\fBt\fP\fB[\fP\fBype\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Write the specified messages to standard output. If \fBcrt\fP is set, +the messages longer than the number of lines specified by +the \fBcrt\fP variable shall be paged through the command specified +by the \fIPAGER\fP environment variable. +.SS Quit +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBq\fP\fB[\fP\fBuit\fP\fB] +\fP\fIend-of-file\fP +.fi +.RE +.sp +.LP +Terminate \fImailx\fP, storing messages that were read in \fBmbox\fP +(if the current mailbox is the system mailbox and unless +\fBhold\fP is set), deleting messages that have been explicitly saved +(unless \fBkeepsave\fP is set), discarding messages that +have been deleted, and saving all remaining messages in the mailbox. +.SS Reply to a Message List +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBR\fP\fB[\fP\fBeply\fP\fB] [\fP\fImsglist\fP\fB]\fP\fBR\fP\fB[\fP\fBespond\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Mail a reply message to the sender of each message in the \fImsglist\fP. +The subject line shall be formed by concatenating +\fBRe:\fP <space> (unless it already begins with that string) and +the subject from the first message. If \fBrecord\fP is +set to a filename, the response shall be saved at the end of that +file. +.LP +See also the \fBflipr\fP variable. +.SS Reply to a Message +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBr\fP\fB[\fP\fBeply\fP\fB] [\fP\fImessage\fP\fB]\fP\fBr\fP\fB[\fP\fBespond\fP\fB] [\fP\fImessage\fP\fB]\fP +.fi +.RE +.sp +.LP +Mail a reply message to all recipients included in the header of the +message. The subject line shall be formed by concatenating +\fBRe:\fP <space> (unless it already begins with that string) and +the subject from the message. If \fBrecord\fP is set to a +filename, the response shall be saved at the end of that file. +.LP +See also the \fBflipr\fP variable. +.SS Retain Header Fields +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBret\fP\fB[\fP\fBain\fP\fB] [\fP\fIheader-field\fP\fB...\fP\fB]\fP +.fi +.RE +.sp +.LP +Retain the specified header fields when writing messages. This command +shall override all \fBdiscard\fP and \fBignore\fP +commands. The comparison of header fields shall be in a case-insensitive +manner. If no arguments are specified, write a list of the +currently retained header fields to standard output; the listing need +not reflect the same order of header fields that were +entered. +.SS Save Messages +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBs\fP\fB[\fP\fBave\fP\fB] [\fP\fIfile\fP\fB]\fP\fBs\fP\fB[\fP\fBave\fP\fB] [\fP\fImsglist\fP\fB]\fP \fIfile\fP\fBS\fP\fB[\fP\fBave\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Save the specified messages in the file named by the pathname \fIfile\fP, +or the \fBmbox\fP if the \fIfile\fP argument is +omitted. The file shall be created if it does not exist; otherwise, +the messages shall be appended to the file. The message shall +be put in the state \fIsaved\fP, and shall behave as specified in +the description of the \fIsaved\fP state when the current +mailbox is exited by the \fBquit\fP or \fBfile\fP command. +.LP +In the capitalized form, save the specified messages in a file whose +name is derived from the author of the first message. The +name of the file shall be taken to be the author's name with all network +addressing stripped off. See also the \fBCopy\fP, +\fBfollowup\fP, and \fBFollowup\fP commands and \fBoutfolder\fP variable. +.SS Set Variables +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBse\fP\fB[\fP\fBt\fP\fB] [\fP\fIname\fP\fB[\fP\fB=\fP\fB[\fP\fIstring\fP\fB]]\fP \fB...\fP\fB] [\fP\fIname\fP\fB=\fP\fInumber\fP \fB...\fP\fB] [\fP\fBno\fP\fIname\fP \fB...\fP\fB]\fP +.fi +.RE +.sp +.LP +Define one or more variables called \fIname\fP. The variable can be +given a null, string, or numeric value. Quoting and +backslash escapes can occur anywhere in \fIstring\fP, as described +previously, as if the \fIstring\fP portion of the argument +were the entire argument. The forms \fIname\fP and \fIname\fP= shall +be equivalent to \fIname\fP="" for variables that take +string values. The \fBset\fP command without arguments shall write +a list of all defined variables and their values. The \fBno\fP +\fIname\fP form shall be equivalent to \fBunset\fP \fIname\fP. +.SS Invoke a Shell +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBsh\fP\fB[\fP\fBell\fP\fB]\fP +.fi +.RE +.sp +.LP +Invoke an interactive command interpreter (see also \fISHELL ).\fP +.SS Display Message Size +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBsi\fP\fB[\fP\fBze\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Write the size in bytes of each of the specified messages. +.SS Read mailx Commands From a File +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBso\fP\fB[\fP\fBurce\fP\fB]\fP \fIfile\fP +.fi +.RE +.sp +.LP +Read and execute commands from the file named by the pathname \fIfile\fP +and return to command mode. +.SS Display Beginning of Messages +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBto\fP\fB[\fP\fBp\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Write the top few lines of each of the specified messages. If the +\fBtoplines\fP variable is set, it is taken as the number of +lines to write. The default shall be 5. +.SS Touch Messages +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBtou\fP\fB[\fP\fBch\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Touch the specified messages. If any message in \fImsglist\fP is not +specifically deleted nor saved in a file, it shall be +placed in the \fBmbox\fP upon normal termination. See \fBexit\fP and +\fBquit\fP. +.SS Delete Aliases +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBuna\fP\fB[\fP\fBlias\fP\fB] [\fP\fIalias\fP\fB]\fP\fB... +\fP +.fi +.RE +.sp +.LP +Delete the specified alias names. If a specified alias does not exist, +the results are unspecified. +.SS Undelete Messages +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBu\fP\fB[\fP\fBndelete\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Change the state of the specified messages from deleted to read. If +\fBautoprint\fP is set, the last message of those restored +shall be written. If \fImsglist\fP is not specified, the message shall +be selected as follows: +.IP " *" 3 +If there are any deleted messages that follow the current message, +the first of these shall be chosen. +.LP +.IP " *" 3 +Otherwise, the last deleted message that also precedes the current +message shall be chosen. +.LP +.SS Unset Variables +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBuns\fP\fB[\fP\fBet\fP\fB]\fP \fIname\fP\fB... +\fP +.fi +.RE +.sp +.LP +Cause the specified variables to be erased. +.SS Edit Message with Full-Screen Editor +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBv\fP\fB[\fP\fBisual\fP\fB] [\fP\fImsglist\fP\fB]\fP +.fi +.RE +.sp +.LP +Edit the given messages with a screen editor. Each message shall be +placed in a temporary file, and the utility named by the +\fIVISUAL\fP variable shall be invoked to edit each file in sequence. +The default editor shall be \fIvi\fP. +.LP +The \fBvisual\fP command does not modify the contents of those messages +in the mailbox. +.SS Write Messages to a File +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBw\fP\fB[\fP\fBrite\fP\fB] [\fP\fImsglist\fP\fB]\fP \fIfile\fP +.fi +.RE +.sp +.LP +Write the given messages to the file specified by the pathname \fIfile\fP, +minus the message header. Otherwise, it shall be +equivalent to the \fBsave\fP command. +.SS Scroll Header Display +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fBz\fP\fB[\fP\fB+|-\fP\fB]\fP +.fi +.RE +.sp +.LP +Scroll the header display forward (if \fB'+'\fP is specified or if +no option is specified) or backward (if \fB'-'\fP is +specified) one screenful. The number of headers written shall be set +by the \fBscreen\fP variable. +.SS Invoke Shell Command +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fB!\fP\fIcommand\fP +.fi +.RE +.sp +.LP +Invoke the command interpreter specified by \fISHELL\fP with two arguments: +\fB-c\fP and \fIcommand\fP. (See also \fIsh\fP \fB-c\fP.) If the \fBbang\fP +variable is set, each unescaped occurrence of \fB'!'\fP in +\fIcommand\fP shall be replaced with the command executed by the previous +\fB!\fP command or \fB~!\fP command escape. +.SS Null Command +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fB#\fP \fIcomment\fP +.fi +.RE +.sp +.LP +This null command (comment) shall be ignored by \fImailx\fP. +.SS Display Current Message Number +.TP 7 +\fISynopsis\fP: +.sp +.RS +.nf + +\fB= +\fP +.fi +.RE +.sp +.LP +Write the current message number. +.SS Command Escapes in mailx +.LP +The following commands can be entered only from input mode, by beginning +a line with the escape character (by default, tilde ( +\fB'~'\fP )). See the \fBescape\fP variable description for changing +this special character. The format for the commands +shall be: +.sp +.RS +.nf + +\fB<\fP\fIescape-character\fP\fB><\fP\fIcommand-char\fP\fB><\fP\fIseparator\fP\fB>\fP\fB[\fP\fB<\fP\fIarguments\fP\fB>\fP\fB]\fP +.fi +.RE +.LP +where the <\fIseparator\fP> can be zero or more <blank>s. +.LP +In the following descriptions, the application shall ensure that the +argument \fIcommand\fP (but not \fImailx-command)\fP is a +shell command string. Any string acceptable to the command interpreter +specified by the \fISHELL\fP variable when it is invoked as +\fISHELL\fP \fB-c\fP \fIcommand_string\fP shall be valid. The command +can be presented as multiple arguments (that is, quoting +is not required). +.LP +Command escapes that are listed with \fImsglist\fP or \fImailx-command\fP +arguments are invalid in Send Mode and produce +unspecified results. +.TP 7 +\fB~!\ \fP \fIcommand\fP +Invoke the command interpreter specified by \fISHELL\fP with two arguments: +\fB-c\fP and \fIcommand\fP; and then return to +input mode. If the \fBbang\fP variable is set, each unescaped occurrence +of \fB'!'\fP in \fIcommand\fP shall be replaced with +the command executed by the previous \fB!\fP command or \fB~!\fP command +escape. +.TP 7 +\fB~.\fP +Simulate end-of-file (terminate message input). +.TP 7 +\fB~:\ \fP \fImailx-command\fP,\ \fB~_\ \fP \fImailx-command\fP +.sp +Perform the command-level request. +.TP 7 +\fB~?\fP +Write a summary of command escapes. +.TP 7 +\fB~A\fP +This shall be equivalent to \fB~i\ Sign\fP. +.TP 7 +\fB~a\fP +This shall be equivalent to \fB~i\ sign\fP. +.TP 7 +\fB~b\ \fP \fIname\fP... +Add the \fIname\fPs to the blind carbon copy ( \fBBcc\fP) list. +.TP 7 +\fB~c\ \fP \fIname\fP... +Add the \fIname\fPs to the carbon copy ( \fBCc\fP) list. +.TP 7 +\fB~d\fP +Read in the dead-letter file. See \fIDEAD\fP for a description of +this file. +.TP 7 +\fB~e\fP +Invoke the editor, as specified by the \fIEDITOR\fP environment variable, +on the partial message. +.TP 7 +\fB~f\ [\fP\fImsglist\fP\fB]\fP +Forward the specified messages. The specified messages shall be inserted +into the current message without alteration. This +command escape also shall insert message headers into the message +with field selection affected by the \fBdiscard\fP, +\fBignore\fP, and \fBretain\fP commands. +.TP 7 +\fB~F\ [\fP\fImsglist\fP\fB]\fP +This shall be the equivalent of the \fB~f\fP command escape, except +that all headers shall be included in the message, +regardless of previous \fBdiscard\fP, \fBignore\fP, and \fBretain\fP +commands. +.TP 7 +\fB~h\fP +If standard input is a terminal, prompt for a \fBSubject\fP line and +the \fBTo\fP, \fBCc\fP, and \fBBcc\fP lists. Other +implementation-defined headers may also be presented for editing. +If the field is written with an initial value, it can be edited +as if it had just been typed. +.TP 7 +\fB~i\ \fP \fIstring\fP +Insert the value of the named variable, followed by a <newline>, into +the text of the message. If the string is unset or +null, the message shall not be changed. +.TP 7 +\fB~m\ [\fP\fImsglist\fP\fB]\fP +Insert the specified messages into the message, prefixing non-empty +lines with the string in the \fBindentprefix\fP variable. +This command escape also shall insert message headers into the message, +with field selection affected by the \fBdiscard\fP, +\fBignore\fP, and \fBretain\fP commands. +.TP 7 +\fB~M\ [\fP\fImsglist\fP\fB]\fP +This shall be the equivalent of the \fB~m\fP command escape, except +that all headers shall be included in the message, +regardless of previous \fBdiscard\fP, \fBignore\fP, and \fBretain\fP +commands. +.TP 7 +\fB~p\fP +Write the message being entered. If the message is longer than \fBcrt\fP +lines (see Internal +Variables in mailx ), the output shall be paginated as described for +the \fIPAGER\fP variable. +.TP 7 +\fB~q\fP +Quit (see the \fBquit\fP command) from input mode by simulating an +interrupt. If the body of the message is not empty, the +partial message shall be saved in the dead-letter file. See \fIDEAD\fP +for a description of this file. +.TP 7 +\fB~r\ \fP \fIfile\fP,\ \fB~<\ \fP +\fIfile\fP,\ \fB~r\ !\fP\fIcommand\fP,\ \fB~<\ !\fP\fIcommand\fP +.sp +Read in the file specified by the pathname \fIfile\fP. If the argument +begins with an exclamation mark ( \fB'!'\fP ), the rest +of the string shall be taken as an arbitrary system command; the command +interpreter specified by \fISHELL\fP shall be invoked +with two arguments: \fB-c\fP and \fIcommand\fP. The standard output +of \fIcommand\fP shall be inserted into the message. +.TP 7 +\fB~s\ \fP \fIstring\fP +Set the subject line to \fIstring\fP. +.TP 7 +\fB~t\ \fP \fIname\fP... +Add the given \fIname\fPs to the \fBTo\fP list. +.TP 7 +\fB~v\fP +Invoke the full-screen editor, as specified by the \fIVISUAL\fP environment +variable, on the partial message. +.TP 7 +\fB~w\ \fP \fIfile\fP +Write the partial message, without the header, onto the file named +by the pathname \fIfile\fP. The file shall be created or +the message shall be appended to it if the file exists. +.TP 7 +\fB~x\fP +Exit as with \fB~q\fP, except the message shall not be saved in the +dead-letter file. +.TP 7 +\fB~|\ \fP \fIcommand\fP +Pipe the body of the message through the given \fIcommand\fP by invoking +the command interpreter specified by \fISHELL\fP +with two arguments: \fB-c\fP and \fIcommand\fP. If the \fIcommand\fP +returns a successful exit status, the standard output of +the command shall replace the message. Otherwise, the message shall +remain unchanged. If the \fIcommand\fP fails, an error message +giving the exit status shall be written. +.sp +.SH EXIT STATUS +.LP +When the \fB-e\fP option is specified, the following exit values are +returned: +.TP 7 +\ 0 +Mail was found. +.TP 7 +>0 +Mail was not found or an error occurred. +.sp +.LP +Otherwise, the following exit values are returned: +.TP 7 +\ 0 +Successful completion; note that this status implies that all messages +were \fIsent\fP, but it gives no assurances that any of +them were actually \fIdelivered\fP. +.TP 7 +>0 +An error occurred. +.sp +.SH CONSEQUENCES OF ERRORS +.LP +When in input mode (Receive Mode) or Send Mode: +.IP " *" 3 +If an error is encountered processing a command escape (see Command +Escapes in mailx ), a +diagnostic message shall be written to standard error, and the message +being composed may be modified, but this condition shall not +prevent the message from being sent. +.LP +.IP " *" 3 +Other errors shall prevent the sending of the message. +.LP +.LP +When in command mode: +.IP " *" 3 +Default. +.LP +.LP +\fIThe following sections are informative.\fP +.SH APPLICATION USAGE +.LP +Delivery of messages to remote systems requires the existence of communication +paths to such systems. These need not exist. +.LP +Input lines are limited to {LINE_MAX} bytes, but mailers between systems +may impose more severe line-length restrictions. This +volume of IEEE\ Std\ 1003.1-2001 does not place any restrictions on +the length of messages handled by \fImailx\fP, and for +delivery of local messages the only limitations should be the normal +problems of available disk space for the target mail file. +When sending messages to external machines, applications are advised +to limit messages to less than 100000 bytes because some mail +gateways impose message-length restrictions. +.LP +The format of the system mailbox is intentionally unspecified. Not +all systems implement system mailboxes as flat files, +particularly with the advent of multimedia mail messages. Some system +mailboxes may be multiple files, others records in a +database. The internal format of the messages themselves is specified +with the historical format from Version\ 7, but only +after the messages have been saved in some file other than the system +mailbox. This was done so that many historical applications +expecting text-file mailboxes are not broken. +.LP +Some new formats for messages can be expected in the future, probably +including binary data, bit maps, and various multimedia +objects. As described here, \fImailx\fP is not prohibited from handling +such messages, but it must store them as text files in +secondary mailboxes (unless some extension, such as a variable or +command line option, is used to change the stored format). Its +method of doing so is implementation-defined and might include translating +the data into text file-compatible or readable form or +omitting certain portions of the message from the stored output. +.LP +The \fBdiscard\fP and \fBignore\fP commands are not inverses of the +\fBretain\fP command. The \fBretain\fP command discards +all header-fields except those explicitly retained. The \fBdiscard\fP +command keeps all header-fields except those explicitly +discarded. If headers exist on the retained header list, \fBdiscard\fP +and \fBignore\fP commands are ignored. +.SH EXAMPLES +.LP +None. +.SH RATIONALE +.LP +The standard developers felt strongly that a method for applications +to send messages to specific users was necessary. The +obvious example is a batch utility, running non-interactively, that +wishes to communicate errors or results to a user. However, the +actual format, delivery mechanism, and method of reading the message +are clearly beyond the scope of this volume of +IEEE\ Std\ 1003.1-2001. +.LP +The intent of this command is to provide a simple, portable interface +for sending messages non-interactively. It merely defines +a "front-end" to the historical mail system. It is suggested that +implementations explicitly denote the sender and recipient in +the body of the delivered message. Further specification of formats +for either the message envelope or the message itself were +deliberately not made, as the industry is in the midst of changing +from the current standards to a more internationalized standard +and it is probably incorrect, at this time, to require either one. +.LP +Implementations are encouraged to conform to the various delivery +mechanisms described in the CCITT X.400 standards or to the +equivalent Internet standards, described in Internet Request for Comment +(RFC) documents RFC\ 819, RFC\ 822, RFC\ 920, +RFC\ 921, and RFC\ 1123. +.LP +Many historical systems modified each body line that started with +\fBFrom\ \fP by prefixing the \fB'F'\fP with +\fB'>'\fP . It is unnecessary, but allowed, to do that when the string +does not follow a blank line because it cannot be +confused with the next header. +.LP +The \fBedit\fP and \fBvisual\fP commands merely edit the specified +messages in a temporary file. They do not modify the +contents of those messages in the mailbox; such a capability could +be added as an extension, such as by using different command +names. +.LP +The restriction on a subject line being {LINE_MAX}-10 bytes is based +on the historical format that consumes 10 bytes for +\fBSubject:\ \fP and the trailing <newline>. Many historical mailers +that a message may encounter on other systems are +not able to handle lines that long, however. +.LP +Like the utilities \fIlogger\fP and \fIlp\fP, +\fImailx\fP admittedly is difficult to test. This was not deemed sufficient +justification to exclude this utility from this volume +of IEEE\ Std\ 1003.1-2001. It is also arguable that it is, in fact, +testable, but that the tests themselves are not +portable. +.LP +When \fImailx\fP is being used by an application that wishes to receive +the results as if none of the User Portability +Utilities option features were supported, the \fIDEAD\fP environment +variable must be set to \fB/dev/null\fP. Otherwise, it may +be subject to the file creations described in \fImailx\fP ASYNCHRONOUS +EVENTS. Similarly, if the \fIMAILRC\fP environment +variable is not set to \fB/dev/null\fP, historical versions of \fImailx\fP +and \fIMail\fP read initialization commands from a +file before processing begins. Since the initialization that a user +specifies could alter the contents of messages an application +is trying to send, such applications must set \fIMAILRC\fP to \fB/dev/null\fP. +.LP +The description of \fILC_TIME\fP uses "may affect" because many historical +implementations do not or cannot manipulate the +date and time strings in the incoming mail headers. Some headers found +in incoming mail do not have enough information to determine +the timezone in which the mail originated, and, therefore, \fImailx\fP +cannot convert the date and time strings into the internal +form that then is parsed by routines like \fIstrftime\fP() that can +take \fILC_TIME\fP +settings into account. Changing all these times to a user-specified +format is allowed, but not required. +.LP +The paginator selected when \fIPAGER\fP is null or unset is partially +unspecified to allow the System V historical practice of +using \fIpg\fP as the default. Bypassing the pagination function, +such as by declaring that \fIcat\fP is the paginator, would not meet +with the intended meaning of this description. However, any +"portable user" would have to set \fIPAGER\fP explicitly to get his +or her preferred paginator on all systems. The paginator +choice was made partially unspecified, unlike the \fIVISUAL\fP editor +choice (mandated to be \fIvi\fP) because most historical pagers follow +a common theme of user input, whereas editors differ +dramatically. +.LP +Options to specify addresses as \fBcc\fP (carbon copy) or \fBbcc\fP +(blind carbon copy) were considered to be format details +and were omitted. +.LP +A zero exit status implies that all messages were \fIsent\fP, but +it gives no assurances that any of them were actually +\fIdelivered\fP. The reliability of the delivery mechanism is unspecified +and is an appropriate marketing distinction between +systems. +.LP +In order to conform to the Utility Syntax Guidelines, a solution was +required to the optional \fIfile\fP option-argument to +\fB-f\fP. By making \fIfile\fP an operand, the guidelines are satisfied +and users remain portable. However, it does force +implementations to support usage such as: +.sp +.RS +.nf + +\fBmailx -fin mymail.box +\fP +.fi +.RE +.LP +The \fBno\fP \fIname\fP method of unsetting variables is not present +in all historical systems, but it is in System V and +provides a logical set of commands corresponding to the format of +the display of options from the \fImailx\fP \fIset\fP command without +arguments. +.LP +The \fBask\fP and \fBasksub\fP variables are the names selected by +BSD and System V, respectively, for the same feature. They +are synonyms in this volume of IEEE\ Std\ 1003.1-2001. +.LP +The \fImailx\fP \fIecho\fP command was not documented in the BSD version +and has been +omitted here because it is not obviously useful for interactive users. +.LP +The default prompt on the System V \fImailx\fP is a question mark, +on BSD \fIMail\fP an ampersand. Since this volume of +IEEE\ Std\ 1003.1-2001 chose the \fImailx\fP name, it kept the System +V default, assuming that BSD users would not have +difficulty with this minor incompatibility (that they can override). +.LP +The meanings of \fBr\fP and \fBR\fP are reversed between System V +\fImailx\fP and SunOS \fIMail\fP. Once again, since this +volume of IEEE\ Std\ 1003.1-2001 chose the \fImailx\fP name, it kept +the System V default, but allows the SunOS user to +achieve the desired results using \fBflipr\fP, an internal variable +in System V \fImailx\fP, although it has not been documented +in the SVID. +.LP +The \fBindentprefix\fP variable, the \fBretain\fP and \fBunalias\fP +commands, and the \fB~F\fP and \fB~M\fP +command escapes were adopted from 4.3 BSD \fIMail\fP. +.LP +The \fBversion\fP command was not included because no sufficiently +general specification of the version information could be +devised that would still be useful to a portable user. This command +name should be used by suppliers who wish to provide version +information about the \fImailx\fP command. +.LP +The "implementation-specific (unspecified) system start-up file" historically +has been named \fB/etc/mailx.rc\fP, but this +specific name and location are not required. +.LP +The intent of the wording for the \fBnext\fP command is that if any +command has already displayed the current message it should +display a following message, but, otherwise, it should display the +current message. Consider the command sequence: +.sp +.RS +.nf + +\fBnext 3 +delete 3 +next +\fP +.fi +.RE +.LP +where the \fBautoprint\fP option was not set. The normative text specifies +that the second \fBnext\fP command should display a +message following the third message, because even though the current +message has not been displayed since it was set by the +\fBdelete\fP command, it has been displayed since the current message +was anything other than message number 3. This does not +always match historical practice in some implementations, where the +command file address followed by \fBnext\fP (or the default +command) would skip the message for which the user had searched. +.SH FUTURE DIRECTIONS +.LP +None. +.SH SEE ALSO +.LP +\fIShell Command Language\fP , \fIed\fP , \fIls\fP , \fImore\fP , +\fIvi\fP +.SH COPYRIGHT +Portions of this text are reprinted and reproduced in electronic form +from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology +-- Portable Operating System Interface (POSIX), The Open Group Base +Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of +Electrical and Electronics Engineers, Inc and The Open Group. In the +event of any discrepancy between this version and the original IEEE and +The Open Group Standard, the original IEEE and The Open Group Standard +is the referee document. The original Standard can be obtained online at +http://www.opengroup.org/unix/online.html . |