Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mailx(1) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ed(1)

ls(1)

mail(1)

more(1)

sh(1)

mailx(1)                                                           mailx(1)

NAME
     mailx - interactive message processing system (mail extended)

SYNOPSIS
     mailx [option ...]                                            Format 1

     mailx [option ...] recipient ...                              Format 2

DESCRIPTION
     This description is divided into the following sections:

     -  Introduction

     -  Description of formats

        Format 1: Read mode

             mailx commands in read mode

             Input format

             Functional overview

             Descriptions in alphabetical order

             Functionality in read mode

        Format 2: Send mode

             mailx commands in send mode (tilde commands)

             Input format

             Functional overview

             Descriptions in alphabetical order

             Functionality in send mode

     -  mailx command and startup files

     -  Variables

        mailx variables

        Environment variables

     -  Note on error messages

     -  Files

     -  Examples



Page 1                       Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     -  See also

INTRODUCTION
     mailx enables you to send and receive electronic mail. If your com-
     puter is linked to a network, mailx can also be used to exchange mes-
     sages with users on remote systems.

     The presence of mail, if any, is usually indicated when you log in.
     You are also notified if new mail arrives while you are using mailx.

     Messages are in the form of ASCII text. They have a message header
     holding information needed for message forwarding; the nature of this
     information is partly implementation-specific. The header is followed
     by a blank line and then the text of the message.

     mailx is an extended version of the mail utility. It allows you to:

     -  check for the presence of mail (read mode, Format 1, option -e)

     -  read messages (read mode, Format 1)

     -  use Reliant UNIX commands to process incoming messages (read mode,
        Format 1, mailx commands !, | and pipe)

     -  send messages (send mode, Format 2)

     -  use an editor to edit messages during a mailx session (read and
        send mode, mailx commands edit, visual, ~e and ~v).

     Unlike mail, mailx automatically collects read messages in a user-
     specific mailbox (HOME/mbox by default).

DESCRIPTION OF FORMATS
   Format 1: Read mode

     mailx [option ...]

     No option specified:
          mailx behaves as described in Functionality in read mode.

     -e   mailx simply checks whether there are any messages, terminating
          with an exit status of 0 if the user has mail. Otherwise, an exit
          status of 1 is returned.

          mailx does not execute any startup files (see mailx command and
          startup files).

     -f [filename]
          mailx reads messages from filename.





Page 2                       Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          file not specified:

          mailx reads messages from the user-specific mailbox $HOME/mbox.

          -f file not specified:

          mailx reads messages from the default mailbox /var/mail/$USER.

          -F (F - file) mailx records all messages which are sent to a log
          file. The file name is the name of the first specified recipient.
          It will be stored in your HOME directory and can be used with
          mailx like a mailbox.

     -F not specified:

          mailx looks for the file name of the log file in the mailx vari-
          able record. If the variable is not set, no log file will be gen-
          erated.

     -H   mailx displays only the header summaries and terminates. The exit
          status is 0 if the user has mail, otherwise 1.

          The structure of a header summary is described in Functionality
          in read mode).

     -i   (i - ignore) mailx ignores the signal SIGINT (see the mailx vari-
          able ignore).

     -I   Only allowed in conjunction with -f.

          mailx includes the newsgroup and article-id header lines when
          printing mail messages. Only useful for "News" system users.

     -n   mailx does not initialize from the global startup file
          /etc/mail/mailx.rc (see mailx command and startup files).

     -N   mailx does not print the initial header summary.

     -T filename
          mailx records message-id and article-id header lines in filename
          once the messages have been read.

          This option automatically sets the -I option.

     -u loginname
          mailx reads messages from the default mailbox of the specified
          user, provided you have the required read permission.

     -V   mailx displays its version number and exits.

     -~   Permit tilde escapes no matter where the input is coming from.



Page 3                       Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

   mailx commands in read mode

     Input format

     mailx commands in read mode have the following format:

     [command] [msglist] [argument ...]

     command
          Name of a mailx command. Most command names can be abbreviated.
          In Descriptions in alphabetical order the accepted abbreviations
          are shown in italic print.

          command not specified:

          If you simply press <RETURN> at the mailx prompt, mailx executes
          the print command.

     msglist
          One or more messages to be processed by the command. If several
          messages are specified, they are separated by blanks.

          msglist can be one or more of the following:

          n    Message number n

          .    The current message (marked > in the header summary).

          ^    The first undeleted message.

          $    The last message.

          *    All messages.

          +    The next message.

          -    The preceding message.

          n-m  Messages n through m inclusive.

          loginname
               All messages from the specified user.

          /str All messages with the string str in the subject field (the
               case is ignored).

          :msgtype
               All messages of type msgtype, which can be any of the fol-
               lowing:

               d    deleted messages



Page 4                       Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

               n    new messages

               o    old messages

               r    read messages

               u    unread messages

               msglist not specified:

               mailx defaults to the current message.

     argument
          String argument as appropriate to the command (see descriptions).
          If argument is a file name, the usual shell metanotation may be
          used. If a string containing blanks is to be interpreted as a
          single argument, it must be enclosed in double quotes.

   Functional overview

     This section provides an overview of all mailx read-mode commands,
     grouped by function. Some commands may appear more than once.

     The overview is followed by descriptions of all the commands in alpha-
     betical order.

     Most commands can be abbreviated. In Descriptions in alphabetical
     order the abbreviated forms are shown in italic print.

     Help functions

     ?           Display summary of mailx commands

     help        Display summary of mailx commands

     list        List names of all mailx commands

     =           Display current message number

     size        Display size of message

     from        Display header summary

     z+          Scroll header display one page forward

     z-          Scroll header display one page back

     headers     Display screen page of headers

     top         Display first five lines of message header




Page 5                       Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     folders     List contents of directory defined by mailx variable
                 folder

     version     Display mailx version number

     Quitting mailx

     exit        Quit mailx without changing mailbox

     xit         Quit mailx without changing mailbox

     quit        Quit mailx

     Displaying the header summary

     from        Display header summary

     headers     Display screen page of headers

     z+          Scroll header display one page forward

     z-          Scroll header display one page back

     Manipulating and displaying the message header

     discard     Suppress message header fields

     undiscard   Undo the effect of discard

     ignore      Suppress message header fields

     unignore    Undo the effect of ignore

     top         Display first five lines of message header

     retain      Display only specified fields of message header

     Displaying messages

     print       Display message

     type        Display message

     next        Skip to next matching message

     Print       Display message with full message header, ignoring discard

     Type        Display message with full message header, ignoring discard






Page 6                       Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     Editing messages

     edit        Call editor to edit message (value of variable EDITOR,
                 default: ed)

     visual      Call editor to edit message (value of variable VISUAL,
                 default: vi)

     Changing the mailbox

     file        Close current mailbox and open named one

     folder      Close current mailbox and open named one

     Saving messages

     hold        Hold messages in mailbox

     preserve    Hold messages in mailbox

     save        Write message to file

     copy        Write message to file

     write       Write message to file, omitting header

     mbox        Write message to user's standard mailbox

     touch       Write message to user's standard mailbox

     Deleting messages

     delete      Delete message

     dp          Delete message, display next

     dt          Delete message, display next

     Switch to send mode and send or reply to message

     mail        Send message

     Mail        Send message, recording copy in file

     reply       Reply to message

     respond     Reply to message

     followup    Reply to message, recording reply

     Reply       Reply to list of messages



Page 7                       Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     Respond     Reply to list of messages

     Followup    Reply to list of messages, recording replies

     Undoing mailx commands during a mailx session

     undelete    Restore deleted messages

     touch       Undo effect of hold

     hold        Undo effect of touch

     undiscard   Undo effect of discard

     unignore    Undo effect of ignore

     unset       Erase variables

     unalias     Erase aliases

     Invoking command interpreters, running shell commands

     !           Escape to shell

     !!          Repeat last shell command

     shell       Invoke command interpreter

     pipe        Pipe messages to standard input of shell command

     |           Pipe messages to standard input of shell command

     Miscellaneous

     #           Null command (for including comments in command files)

     =           Display current message number

     alias       Declare aliases for mail recipients (same as group)

     alternates  Declare alternate names for your login name

     cd          Change directory

     chdir       Change directory

     echo        Echo string (like Reliant UNIX echo command)

     folders     List contents of directory defined by mailx variable
                 folder

     group       Declare aliases for mail recipients (same as alias)


Page 8                       Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     if mode cmdlist1 else cmdlist2 endif
                 if construct which selects a command list to execute on
                 the basis of the mode (send, read)

     set         Set variables

     size        Display size of message

     source      Read and execute command file

     unset       Erase variables

     mailx commands not allowed in command files

     !           Escape to shell

     edit        Call editor to edit message

     followup    Reply to message, recording reply

     Followup    Reply to list of messages, recording replies

     mail        Send message

     Mail        Send message, recording copy in file

     reply       Reply to message

     Reply       Reply to list of messages

     respond     Reply to message

     Respond     Reply to list of messages

     shell       Invoke command interpreter

     visual      Call editor to edit message

   Descriptions in alphabetical order

     Some command names have synonyms. The full description is always next
     to the name which comes first in alphabetical order.

     Most of these commands can be used both interactively and in command
     files. Exceptions to this rule are mentioned at the appropriate place
     (see Functional overview).

     The italic print in the command names refers to the abbreviated forms.






Page 9                       Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     !shellcommand
          Executes shellcommand. By default the command interpreter speci-
          fied in the mailx variable SHELL will be invoked and the speci-
          fied command line will be passed to it.

          If SHELL is not set, /bin/sh will be invoked.

          If the bang variable is set, the last shell command executed is
          saved by mailx and can be repeated with !!.

          The ! command is not permitted in a command file.

     #comment
          This is the null command used to introduce comments in command
          files (e.g. .mailrc).

     =    Displays the current message number.

     ?    Displays a summary of all mailx commands.

     alias [alias-name [recipient ...]]
     group [alias-name [recipient ...]]
          Declares an alias for the given recipients. The defined reci-
          pients are substituted when you use the aliases as recipients.

          alias-name
               Any string.

               alias-name not specified:

               mailx displays a list of defined aliases.

               recipient not specified:

               mailx displays the definitions for alias-name.

     alternates [name ...]
          Declares alternate names for your login name. Once you reply to a
          message, mailx deletes these alternative names from the list of
          recipients.

          name

          String for the alternate name.

          name not specified:

          mailx displays the current list of alternate names.






Page 10                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     cd [directory]
     chdir [directory]
          Changes to the indicated directory.

          directory not specified:

          mailx changes to $HOME.

     copy[ [msglist] file]
          Copies the specified messages to the named file. If file already
          exists, it is extended.

          The messages are marked as read (O) and copied to the user-
          specific mailbox when the default mailbox is closed.

          No argument specified:

          mailx appends the current message to $HOME/mbox. If you do not
          subsequently delete the message, it will be saved again the next
          time the default mailbox is closed.

          It is possible to include a copy command in a command file, but
          then any subsequent commands which are intended to operate on a
          message list will be ignored.

     Copy [msglist]
          Copies the specified messages to a file in the current directory.
          The name of this file is derived from the name of the author of
          the first message in the message list (From entry).

          If this file already exists, it is extended.

          The messages are marked as read (O) and copied to the user-
          specific mailbox when the default mailbox is closed.

          It is possible to include a Copy command in a command file, but
          then any subsequent commands which are intended to operate on a
          message list will be ignored.

     delete [msglist]
          Deletes the specified messages from the current mailbox. If the
          mailx variable autoprint is set, the message following the last
          deleted message is printed.

          A deleted message can be restored with undelete during a mailx
          session.








Page 11                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     discard [field ...]
     ignore [field ...]
          Suppresses printing of the specified header fields in the output
          if they appear at the start of a line and come before a colon,
          e.g.: Cc:, Date:, Status:, Subject:, To:. You do not need to
          include the colon, and mailx ignores the case of the letters in
          field.

          discard has an effect on the mailx commands next, pipe (or |),
          print, type, ~f and ~m, but on Print, Type ~F and ~M.

          No fields are suppressed when messages are saved.

          The effect of discard can be undone with undiscard or unignore.
          retain suppresses the effect of discard: all fields are ignored
          except those explicitly specified.

          field not specified:

          discard displays the current list of fields being ignored, if
          any.

     dp [msglist]
     dt [msglist]
          (delete and print) Deletes messages from the mailbox and displays
          the message that follows the last one deleted.

          A deleted message can be restored with undelete during a mailx
          session.

     echo string ...
          Echoes string on standard output (like the Reliant UNIX echo com-
          mand).

          The value of an environment variable can be accessed as $name.
          echo always displays the value of the environment variable, even
          if a mailx variable of the same name has been defined.

     edit [msglist]
          Invokes the editor specified with the mailx variable EDITOR
          (default editor: ed) and loads the specified messages.

          The edited message will be available in the mailbox again at the
          end of the editing session.

          The text is edited in a temporary file named /tmp/Rz$$, where $$
          is the process ID of the mailx process (see FILES).

          The edit command is not permitted in a command file.

     exit
     xit  Exits from mailx without changing the current mailbox, i.e.


Page 12                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          -  deleted messages are restored,

          -  read messages are not saved in $HOME/mbox, and

          -  edited messages retain their original status.

          Also refer to the mailx command quit.

     file [file]
     folder [file]
          Quits the current mailbox (like quit) and reads in the specified
          file as another mailbox. The appropriate header lines are
          displayed.

          file Name of the mailbox to be processed, or the following
               metanotation:

               %    the current mailbox

               %loginname
                    the default mailbox of the named user (/var/mail/$USER)

               #    the previous mailbox

               &    the user-specific mailbox ($HOME/mbox or the mailbox
                    defined by the variable $MBOX)

               file not specified:

               mailx remains in the current mailbox and simply reports the
               number of messages in it.

               fi % closes and reopens the current mailbox. This allows you
               to read any new messages that have arrived during your mailx
               session.

     folders
          Lists the names of all files in the directory defined by the
          mailx variable folder (messages are saved and recorded in this
          directory by mailx).

     followup [message]
          Replies to the specified message like the mailx command reply.

          mailx switches to send mode and considers the recipients to be

          -  the author of the specified message, i.e. the entry in the
             "From" field is taken over to the "To" field,

          -  the other recipients of the message, i.e. the entries in the
             "To" field are transferred to the "To" list, while those in
             the Cc field are copied to the Cc list.


Page 13                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          mailx takes the contents of the subject field from the corre-
          sponding field of message and precedes it with Re:. If there is
          no subject entry, you are prompted to enter one.

          When you have completed your input, mailx sends the message.

          In contrast to reply, followup records the message in a file
          named after the recipient (with the network path removed). The
          storage location of this file depends on whether the mailx vari-
          ables folder and outfolder are set. If both are set, the file is
          stored in the directory defined by the folder variable. Otherwise
          it is stored in the current directory. The file is extended if it
          already exists.

          The followup command is not permitted in a command file.

     Followup [msglist]
          Replies to the first of the messages specified in the message
          list in the same way as the mailx command Reply.

          mailx switches to send mode and sends the reply to each sender of
          a message in msglist.

          mailx takes the contents of the subject field from the corre-
          sponding field of the first message in msglist and precedes it
          with Re:. If there is no subject entry, you are prompted to enter
          one.

          When you have completed your input, mailx sends the message.

          In contrast to reply, Followup records the message in a file
          named after the sender of the first message (with the network
          path removed). The storage location of this file depends on
          whether the mailx variables folder and outfolder are set. If both
          are set, the file is stored in the directory defined by the
          folder variable. Otherwise it is stored in the current directory.
          The file is extended if it already exists.

          The Followup command is not permitted in a command file.

     from [msglist]
          Prints the header summary for all specified messages on the stan-
          dard output.

     group alias-name recipient ...
          Declares aliases for the given recipients (see alias).

     headers [message]
          Displays the screen page of headers which includes the specified
          message.




Page 14                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          message not specified:

          mailx displays the first 20 headers, or the number defined by the
          screen variable.

     help Displays a summary of the mailx commands (see also ?).

     hold [msglist]
     preserve [msglist]
          Holds (i.e. preserves) the specified messages in the default
          mailbox.

          The messages are marked H in the header and remain in the mail-
          box, even if they have been read or saved.

          The effect of hold can be undone with touch (and vice versa).

          It is possible to include hold and preserve commands in a command
          file, but then any subsequent commands which are intended to
          operate on a message list will be ignored.

     if mode
     commandlist1
     else
     commandlist2
     endif
          If construct which selects a command list to execute on the basis
          of the specified mode.

          mode mode is the mode (send or read) in which you invoked mailx.
               It can be:

               s  (send) commandlist1 is executed if you invoked mailx in
                  send mode; otherwise, commandlist2 is executed.

               r  (read) commandlist1 is executed if you invoked mailx in
                  read mode; otherwise, commandlist2 is executed.

          commandlist1
          commandlist2
               Lists of mailx commands. Commands which are not permitted in
               command files are also not permitted here, i.e.: !, edit,
               followup, Followup, mail, Mail, reply, Reply, respond,
               Respond, shell and visual.

               if, else, endif and all the commands in the command lists
               must each be on a separate line.

     ignore [field ...]
          Suppresses printing of the specified header fields (see discard).




Page 15                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     list Lists the names of all available mailx commands on standard out-
          put (also refer to help and ?).

          mail recipient ... Sends a message to recipient.

          mailx switches to send mode and mails the message as soon as you
          have finished entering the text.

          If the mailx variable record is set, the message will be written
          to the file defined there. If the file already exists, it is
          extended.

          The mail command is not permitted in a command file.

     Mail recipient ...
          Sends a message to recipient.

          mailx switches to send mode and mails the message as soon as you
          have finished entering the text.

          mailx records your message in the current directory in a file
          named after the recipient. If the file already exists, it is
          extended.

          The Mail command is not permitted in a command file.

     mbox [msglist]
          Writes the listed messages to the user-specific mailbox when the
          current mailbox is closed and then deletes them from the current
          mailbox, even if they have not been read. All such messages are
          marked M in the header summary.

          The user-specific mailbox is $HOME/mbox or the file defined by
          the variable MBOX.

     next [message]
          Goes to the next message containing message in the header sum-
          mary. For message you can enter characteristics as for a message
          list.

          This is useful e.g. for jumping to the next message of a specific
          sender (next loginname).

          message not specified:

          mailx displays the message following the current one.

          next otherwise works in the same way as print.






Page 16                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     pipe [[msglist] shellcommand]
     | [[msglist] shellcommand]
          Pipes the specified messages to the standard input of the given
          shellcommand.

          The messages are marked as read (O) in the header summary. If the
          mailx variable page is set, a form feed character is inserted
          after each message (FF = CTRL-L = X'0C').

          No argument specified:

          The default message is the current message, and the default com-
          mand is the one specified by the mailx variable cmd. If cmd is
          not set, the pipe command is ignored.

     preserve [msglist]
          Preserves the specified messages in the default mailbox (see
          hold).

     print [msglist]
     type [msglist]
          Prints the specified messages on the standard output.

          The messages are marked as read (O) in the header summary. They
          are copied to the user-specific mailbox upon termination of the
          default mailbox and then deleted from the current one. The user-
          specific mailbox is $HOME/mbox or the file defined by the vari-
          able MBOX.

          If the mailx variable crt is set, messages longer than the number
          of lines specified by the crt variable are paged through the
          Reliant UNIX command more. You can use the variable PAGER to
          specify a Reliant UNIX command other than more.

     Print [msglist]
     Type [msglist]
          Like print, except that the whole header is always displayed,
          i.e. Print overrides the effect of discard and ignore.

     quit Exits from mailx, closing the currently processed mailbox.

          If the default mailbox was being processed, the following
          applies:

          -  Read messages (O) and messages processed with mbox (M) are
             copied to the user-specific mailbox and then deleted. The
             user-specific mailbox is $HOME/mbox or the file defined by the
             variable MBOX.

          -  Unread messages (U) and messages processed with hold or
             preserve (P) are retained in the default mailbox.



Page 17                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          -  Explicitly saved messages (S) are deleted from the default
             mailbox.

          Also refer to the mailx commands exit and xit.

     reply [message]
     respond [message]
          Replies to the indicated message.

          mailx switches to send mode and considers the recipients to be

          -  the author of the specified message, i.e. the entry in the
             "From" field is taken over to the "To" field,

          -  the other recipients of the message, i.e. the entries in the
             "To" field are transferred to the "To" list, while those in
             the Cc field are copied to the Cc list.

          mailx takes the contents of the subject field from the corre-
          sponding field of message and precedes it with Re:. If there is
          no subject entry, you are prompted to enter one.

          When you have completed your input, mailx sends the message.

          Unlike followup, reply does not automatically create a file to
          record your reply. It only does so if the mailx variable record
          is set, in which case the message will be written to the file
          defined there. If the file already exists, it is extended.

          The reply and respond commands are not permitted in a command
          file.

     Reply [msglist]
     Respond [msglist]
          Replies to the first message in the message list.

          mailx switches to send mode and sends the response to the sender
          of each message in msglist.

          mailx takes the contents of the subject field from the corre-
          sponding field of the first message in msglist and precedes it
          with Re:. If there is no subject entry, you are prompted to enter
          one.

          When you have completed your input, mailx sends the message.

          Unlike Followup, Reply does not automatically create a file to
          record your reply. It only does so if the mailx variable record
          is set, in which case the message will be written to the file
          defined there. If the file already exists, it is extended.

          The Reply and Respond commands are not permitted in a command file.


Page 18                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     retain [field ...]
          displays only the specified fields of the message header. The
          other fields are suppressed. retain displays the specified fields
          as well, if they are contained in the list of fields to suppress,
          i.e. retain overrides the effects of discard or ignore.

          field not specified:

          retain displays the current list of fields to display if avail-
          able.

     save [[msglist] file]
          Saves the indicated messages in the named file, extending it if
          it already exists.

          The messages are marked as saved (S), which means that they are
          deleted from the default mailbox as soon as you quit mailx,
          unless you have set the keepsave variable).

          No argument specified:

          mailx appends the current message to the end of $HOME/mbox.

     Save [msglist]
          Saves the specified messages in a file in the current directory.
          The file name is derived from the name of the sender of the first
          message in msglist ("From" entry; network addresses are removed).
          If the file already exists, it is extended.

          The messages are marked as saved (S), which means that they are
          deleted from the default mailbox as soon as you quit mailx,
          unless you have set the keepsave variable).

     set [name[=value]]
          Sets the variable name.

          name

          Name of a mailx variable or a freely defined variable.

          value

          Any string or numeric value. \n within value is interpreted as a
          newline character, \t as a tab.

          value not specified:

          name is set to the null string.

          No argument specified: Prints all set variables and their values.
          The values are enclosed in double quotes.



Page 19                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          You cannot change the values of environment variables. However,
          if you define an internal variable of the same name, mailx will
          use its value until you reset it (this does not apply to the
          mailx echo command).

          The tilde command ~i variable can be used to insert the value of
          variable in the text of a message.

          You can delete variables with unset or set noname.

     shell
          Invokes by default the command interpreter specified in the SHELL
          variable. If SHELL is not set, /bin/sh will be invoked.

          You can specify a different command interpreter with the mailx
          variable SHELL.

          The shell command is not permitted in a command file.

     size [msglist]
          Displays the size of the specified messages on standard output in
          the form

          messagenumber: numberofcharacters.

     source file
          Reads the specified file as a command file and executes the mailx
          commands in it. mailx then returns to the interactive mode (see
          mailx command and startup files below).

     top [msglist]
          Displays the first 5 lines of the header for each specified mes-
          sage on the standard output. You can change the number of lines
          displayed with the mailx variable toplines.

     touch [msglist]
          Causes the specified messages to be treated as read, i.e. they
          are copied to the user-specific mailbox upon termination of the
          default mailbox and then deleted from the current one. The user-
          specific mailbox is $HOME/mbox or the file defined by the MBOX
          variable.

          This does not apply to messages that were saved with save or
          Save.

          touch cancels the effect of hold and vice versa.

     type [msglist]
          Prints the specified messages on standard output (see print).





Page 20                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     Type [msglist]
          Like print, except that the whole header is always displayed (see
          Print).

     unalias [alias-name ...]
          deletes the specified alias names.

     undelete [msglist]
          Restores the specified messages provided they were deleted during
          the current session. The messages are marked as read (O).

          If the autoprint variable is set, the last restored message is
          displayed.

     undiscard [field]
     unignore [field]
          Deletes the specified header fields from the list of fields being
          ignored.

          field not specified:

          Deletes the whole of the list of fields being ignored.

     unset [name ...]
     set [noname ...]
          Deletes the specified variables.

          If you delete a variable with the same name as an environment
          variable, you can access the value of the corresponding environ-
          ment variable again.

     version
          Displays the current version and release number of mailx.

     visual [msglist]
          Invokes the editor specified by the variable VISUAL (default edi-
          tor: vi) and loads the indicated messages.

          The edited message is placed in the mailbox at the end of the
          editing session.

          The text is processed in a temporary file named /tmp/Re$$, where
          $$ is the process ID of the mailx process.

          The visual command is not permitted in a command file.

     write [msglist] file
          Writes the specified messages in the named file. If the file
          already exists, it is extended.

          write does not copy the header and the trailing blank line.



Page 21                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          The messages are marked as saved (S) in the header summary. They
          are deleted from the default mailbox as soon as you quit mailx,
          unless you have set the keepsave variable.

     xit  Exits from mailx without changing the current mailbox (see exit).

     z[±] Scrolls the header display one page forward (z+) or back (z-).
          The number of lines per page is set by the screen variable. If
          screen is not set, 20 lines are displayed by default.

          ± not specified:

          Same as z+.

   Functionality in read mode

     mailx checks the contents of the default mailbox /var/mail/$USER,
     where all incoming messages arrive.

     mailx then processes startup files. These files may be used to ini-
     tialize mailx variables, for example (see mailx command and startup
     files below).

     If no mail is present, mailx issues the message:

     No mail for loginname

     If mail has been received, mailx responds with a message line, an
     overview of all messages currently in the mailbox, and the mailx
     prompt ?. You can now enter mailx commands. You can use the ?, help
     and list command to get a list of all the available commands.

     Headers

     When you call mailx or use one of the mailx commands from, headers or
     z, mailx displays a header line for each message present. A header can
     have up to 9 blank-separated fields, e.g.:

     N   1 marvin    Mon Sep    21 13:05    10/164    Beeblebrox

     These fields refer to:

     N            Processing status (see next subsection)

     1            Message number. The messages are renumbered each time
                  mailx is invoked. The oldest message is numbered 1.

     marvin       Sender

     Mon Sep 21   Date message received

     13:05        Time message received


Page 22                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     10/164       Size of message in lines/characters

     Beeblebrox   Title (first 25 characters of subject entry)

     Processing status

     The processing status is the entry in the first header field. The
     status will be one of the following:

     O    (old) The message has been read. It will be stored in $HOME/mbox
          when you quit mailx or close the default mailbox.

     U    (unread) The message has not yet been read. It will be preserved
          in the current mailbox when you quit mailx using quit.

     N    (new) The message has arrived since you last called mailx or
          changed mailboxes.

     M    (mbox) The message has been saved with mbox.

     H    (hold) The message has been marked by the hold or preserve com-
          mand. It will stay in the default mailbox when you close it.

     S    (save) The message has been saved with a save, Save or write com-
          mand. It will be deleted from the default mailbox when you close
          it.

     >c   This is the current message. This is the message referenced by
          mailx commands if you do leave msglist unspecified. The character
          c stands for any of the above status characters.

     User-specific mailbox

     Messages are written to the user-specific mailbox if

     -  you have read them but not deleted or explicitly saved them

     -  you have manipulated them with mbox or touch

     -  you have switched from the default mailbox to another mailbox using
        the file or folder command

     -  you have quit mailx with quit

     except where the variable hold is set (then the messages remain in the
     standard mailbox).

     The user-specific mailbox is $HOME/mbox or the file defined by the
     variable MBOX. The file is extended if it already exists. If you use
     the -f when you call mailx, you can process this file with mailx com-
     mands in exactly the same way as the default mailbox.



Page 23                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

   Format 2: Send mode

     mailx [option ...] recipient ...

     No option specified:
          mailx behaves as described in Functionality in send mode.

     -d   (debug) mailx turns on debugging output.

     -F   (file) mailx records all outgoing messages in a file named after
          the first specified recipient. This file is created in your home
          directory and can be processed with mailx like a mailbox.

          -F not specified:

          mailx searches for the record file defined in the mailx variable
          record. Nothing is recorded if this variable is not set.

     -h n (hop) mailx is to make no more than n network "hops" from one
          terminal to another. This is intended to enable network software
          to avoid infinite delivery loops.

          This option is ignored if the delivery program used is /bin/rmail
          (see mailx variable sendmail).

     -i   mailx ignores the SIGINT signal (see also the mailx variable
          ignore).

     -n   mailx does not initialize from the global startup file
          /etc/mail/mailx.rc (see mailx command and startup files below).

     -r address
          (return) mailx passes the specified address to the delivery pro-
          gram. All tilde commands are disabled. If the message is
          undeliverable, it is sent (or returned) to address.

          This option is ignored if the delivery program used is /bin/rmail
          (see mailx variable sendmail).

     -s subject
          (subject) mailx enters subject in the Subject: header field of
          the header summary. This allows you to indicate the subject of
          the message.

          subject

          Any string. If the string includes blanks or special characters,
          it must be enclosed in double quotes.

     -U   (UUCP) mailx converts UUCP-style addresses to Internet style. The
          setting of the conv environment variable is ignored. Note that
          the Internet standard is not yet fully supported.


Page 24                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     --   If recipient begins with a dash (-), the end of the command-line
          options must be marked with --.

     recipient
          One or more recipients. recipient can be:

          -  a login name on the local system or a network address if the
             computer is connected to a network

          -  an alias group (see mailx read-mode command alias)

          -  a pipe symbol followed by a shell command

          If recipient begins with a pipe symbol (|), the rest of the name
          is taken to be a shell command to pipe the message through. Thus
          you could use the lp command to send a copy of outgoing mail to a
          printer.

   mailx commands in send mode (tilde commands)

     Input format

     Apart from being preceded by an escape symbol, mailx send-mode com-
     mands have the same format as read-mode commands.

     [command] [msglist] [argument ...]

     ~    Tilde as escape symbol. The mailx variable escape can be used to
          define a different character as the escape symbol.

     command
     msglist
     argument
          As described above under mailx commands in read mode, Input for-
          mat.

   Functional overview
     This section provides an overview of all mailx send-mode commands,
     grouped by function. Some commands may appear more than once.

     The overview is followed by descriptions of all the commands in alpha-
     betical order.

     Help functions

     ~?  Display summary of tilde commands

     ~p  Display message being entered

     Terminating/aborting text input

     ~.  Terminate input and send


Page 25                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     ~x  Abort input and do not send

     ~q  Abort input and save but do not send

     Inserting values of variables, old messages and files

     ~a   Insert value of sign variable

     ~A   Insert value of Sign variable

     ~i   Insert value of mailx or environment variable

     ~d   Insert contents of $HOME/dead.letter

     ~f   Insert old messages

     ~F   Insert old messages

     ~m   Insert old messages

     mailx commands in send mode (tilde commands) must start with an escape
     symbol in column one. The default escape symbol is a tilde (~), but
     this can be redefined with the mailx variable escape.

     Tilde commands are not permitted in a command file.

     !shellcommand
          Passes the specified shellcommand to the command interpreter
          specified in the SHELL variable (by default) for execution. If
          SHELL is not set, /bin/sh will be invoked.
























Page 26                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          You can use the mailx variable SHELL to specify a different com-
          mand interpreter.

     ~.   Terminates message input and sends the message.

          If you are working via rlogin on a remote computer, this tilde
          command will be interpreted as an instruction to clear down the
          connection, with the result that the remote session will be ter-
          minated immediately. Here are some possible solutions:

          -  redefine the escape symbol with the mailx variable escape

          -  set the mailx variable dot, so that you can terminate input
             simply with a dot in column one

          -  terminate input with <CTRL-D>

     ~:mailx-read-command
     ~mailx-read-command
          Executes the specified mailx read-mode command.

          You must have invoked mailx in read mode (and then switched to
          send mode with a mailx command such as mail). Otherwise, mailx
          will only execute commands that have nothing to do with the pro-
          cessing of a mailbox (e.g. set or exit).

          The underscore in the second format is mandatory.

     ?    Displays a summary of all tilde commands.

     ~a   (autograph) Inserts the value of the mailx variable sign in the
          message.

     ~A   (autograph) Inserts the value of the mailx variable Sign in the
          message.

          This enables you to define an alternate sign-off string, for
          example.

     ~b name ...
          (blind carbon copy) Adds one or more names to the blind carbon
          copy (Bcc) list. The Bcc list contains the names of additional
          recipients of the message. These names are not included in the
          header.

     ~c name ...
          (carbon copy) Adds one or more names to the carbon copy (Cc)
          list. The Cc list contains the names of additional recipients.
          These names are included as part of the header information (the
          Cc entry).




Page 27                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     ~d   (dead letter) Reads the contents of the file $HOME/dead.letter
          into the message. This file contains messages which mailx could
          not send or which you aborted with q.

     ~e   (e - editor) Invokes the editor specified by the variable EDITOR
          (default editor: ed) and loads the partial message. Input of the
          partial message may be continued after the editing session.

     ~f [msglist]
          (file) Inserts the specified messages, without alteration, into
          the message text.

          This command is only executed if mailx was invoked in read mode
          (Format 1).

     ~F [msglist]
          works like ~f, but inserts always the whole message header.
          discard, ignore und retain will be ignored.

     ~h   (header) Prompts successively for the following information:

          To:        Recipient

          Subject:   Subject of the message

          Cc:        Carbon copy list containing additional recipients of
                     the message; the names in this list appear in the Cc
                     field of the header

          Bcc:       Blind carbon copy list. Like Cc, except that the names
                     do not appear in the header

          The fields are displayed with existing values (if any), which you
          can edit as if you had just entered them.

     ~i variable
          Inserts the value of the named variable into the message text.
          The named variable can be a mailx variable or an environment
          variable.

     ~m [msglist]
          (move) Inserts the indicated messages into the text. The contents
          of the indentprefix variable are inserted in front of each line.

          This command is executed only if mailx was invoked in read mode
          (Format 1).

     ~M [msglist]
          works like ~f, but inserts always the whole message header.
          discard, ignore und retain will be ignored.

     ~p   (print) Displays the message being entered.


Page 28                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     ~q   Quits input mode by simulating an interrupt. The input text is
          not aborted but saved in the $HOME/dead.letter file. This tilde
          command has the same effect as the <DEL> key except that it can-
          not be suppressed with the ignore variable.

     ~r file
     ~r !shellcommand
     ~< file
     ~<! shellcommand
          (read) Inserts the contents of file or the output of
          shellcommand into the message text.

     ~s string ...
          (subject) Sets the Subject field of the header to the specified
          string. Multiple blank-separated strings do not need to be
          quoted.

     ~t recipient ...
          (to) Adds the indicated names of one or more recipients to the
          "To" field of the header. Multiple names must be separated by
          blanks.

     ~v   (vi editor) Invokes the screen editor identified by the variable
          VISUAL (default editor: vi) and loads the partially entered mes-
          sage. Input of the edited message can be continued on completion
          of the editing session.

     ~w file
          (write) Copies the partially entered message, without the header,
          into the specified file.

     ~x   Exits, aborting the message being entered. The partially entered
          message is neither sent nor saved.

     ~| shellcommand
          Pipes the current text of the message to the standard input of
          shellcommand.

          If the shell command returns an exit status of 0, the current
          text is replaced by the output of the command.

          By default the command parameter will be passed to the command
          interpreter specified in the SHELL variable. If SHELL is not set,
          /bin/sh will be invoked.

   Functionality in send mode

     When you call mailx, it first processes startup files. These files may
     be used to initialize mailx variables, for example (see mailx command
     and startup files).




Page 29                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     Then, unless you use the -s option to specify a message subject, mailx
     displays:

     Subject:

     and expects you to enter the subject of the message. This line, which
     may consist of up to 1024 characters, is written by mailx into the
     Subject: field of the message header. If the subject is too long,
     mailx will print the message mail: ERROR signal 10, and the mail will
     not be delivered.

     mailx will now be in send mode, which means that you can enter your
     message text. All mailx tilde commands are permitted during text
     input. They must start in column 1. Once you have sent off a tilde
     command with <RETURN>, mailx redisplays the whole of the command you
     have entered in the same line, followed by the string (continue) when
     it has finished executing the command. If you use one of the commands
     for inserting text into your message text (such as ~a), mailx will not
     echo the text on the screen. You can view the original text and the
     inserted text with the ~p command.

     mailx stores the input text in a temporary file in the /tmp directory.

     The command . or the <CTRL-D> key signals the end of input.

     Tilde commands in read mode

     Some tilde commands only offer their full functionality if you call
     mailx in read mode (Format 1) and temporarily switch from there to
     send mode. The commands in question are: ~ and ~: (execute mailx com-
     mand) and ~f, ~F, ~m and ~M (insert old messages).

     The read commands you can use to switch temporarily to send mode so as
     to send or reply to a message are followup, Followup, mail, Mail,
     reply, Reply, respond and Respond.

   mailx command and startup files

     Command files

     Command files are files that contain mailx commands. Each mailx com-
     mand must be entered in a separate line. You can execute command files
     by using the source command during a mailx session, or you can use
     them as startup files (see below).

     Tilde commands are not permitted in command files, and nor are the
     commands !, edit, followup, Followup, mail, Mail, reply, Reply,
     respond, Respond, shell, and visual.

     The copy, Copy, hold and preserve commands are permitted, but then any
     subsequent commands which are intended to operate on a message list
     will be ignored.


Page 30                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     If an error occurs in a command file, mailx ignores all subsequent
     commands in the file.

     An error also occurs if a message list refers to a non-existent mes-
     sage (see Example 2).

     Startup files

     Startup files are command files that mailx processes every time it is
     invoked, unless you call it in read mode using the -e option.

     mailx first processes the global startup file /etc/mail/mail.rc, fol-
     lowed by the private startup file $HOME/.mailrc, provided such files
     exist.

     You can redefine the path name of the private startup file with the
     MAILRC variable.

   Variables

     mailx utilizes environment variables, mailx variables and freely
     defined variables.

     All variables can be imported, and during a mailx session they can be
     set and reassigned with the set command and deleted with unset. mailx
     variables, i.e. all variables consisting of lowercase letters only,
     can only be set within mailx (e.g. in startup files). Contents of
     shell variables with the same names are not inherited by mailx vari-
     ables.

     If you use set to reassign an imported variable, the new value applies
     until you change it again, delete it or end your mailx session.

     The mailx command echo always references the original value of an
     imported variable.

     asksub, header and save are enabled by default.

     Of the variables which can be assigned values, the following have
     default values:

     -  conv= (disabled, no conversion)

     -  DEAD=$HOME/dead.letter

     -  EDITOR=ed

     -  escape=

     -  MBOX=$HOME/mbox

     -  LISTER=ls


Page 31                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     -  PAGER=more

     -  prompt=?

     -  screen=20

     -  sendmail=/bin/rmail

     -  SHELL=/bin/sh

     -  toplines=5

     -  VISUAL=vi

     The references to Associated commands in the following list relate to
     the mailx commands particularly affected by the setting or deletion of
     the variable in question.

     mailx variables

     allnet
          mailx treats all network names ending with matching login names
          as identical. Addresses in the form

          ...computername!computername!loginname

          are treated as network names.

          See also the metoo variable.

          Default value: The variable is not set.

     append
          Appends messages saved in the user-specific mailbox ($HOME/mbox
          by default) to the end of the file.

          Associated commands: copy, Copy, file, folder, mbox, next, print,
          Print, type, Type, quit, touch

          Default value: The variable is not set.

     ask
     asksub
          Causes mailx to prompt for the subject when invoked (also refer
          to option -s).

          Associated commands: ~h, ~s

          Default value: The variable is set.

     askbcc
          mailx prompts for the Bcc list after the subject is entered.


Page 32                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          Associated commands: ~c, ~h

          Default value: The variable is not set.

     askcc
          mailx prompts for the Cc list after the subject is entered.

          Associated commands: ~c, ~h

          Default value: The variable is not set.

     autoprint
          Displays the next message after the delete command, and the
          restored message after the undelete command.

          Default value: The variable is not set.

     bang A ! within a shellcommand in !shellcommand or ~!shellcommand
          will be replaced by the last shellcommand which was invoked by
          this way.

          Default value: The variable is not set.

     cmd=shellcommand
          Sets the default command used by pipe and | to the specified
          shellcommand (only used if no command is specified in pipe).

          Default value: None.

     conv=conversion
          The only conversion available is internet. mailx then converts
          UUCP addresses to internet addresses (also refer to option -U).

          Associated commands: alias, alternates, followup, Followup, mail,
          Mail, reply, Reply, respond, Respond, ~b, ~c, ~h, ~t

          Default value: no conversion

     crt=number
          Pipes message output having more than number lines through the
          command specified by the PAGER variable (PAGER=more by default).

          Associated commands: dp, dt, next, print, Print, type, Type, ~p

          Default value: The variable is not set.

     debug
          Enables diagnostics for debugging. If you set this variable, mail
          will not be delivered.

          Default value: The variable is not set.



Page 33                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     dot  Causes a line consisting solely of a dot in column one to ter-
          minate input (instead of the command ~.).

          Default value: The variable is not set.

     escape=c
          Substitutes c for the tilde escape symbol.

          Default value: ~

     flipr
          The effects of the commands reply, respond, Reply and Respond are
          exchanged.

          Associated commands: reply, respond, Reply, Respond.

          Default value: The variable is not set.

     folder=directory
          If both folder and outfolder are set, reply texts with the
          followup and Followup commands will be recorded in directory, not
          in the current directory. If directory does not begin with a
          slash, mailx sets the directory name to $HOME/directory.

          You can also use the form +filename to reference these record
          files in any mailx command which accepts file names. mailx will
          then expand the name by prepending directory.

          Default value: The variable is not set.

     header
          Causes the header summary, the current mailx version string and
          the number of messages to be displayed when mailx is invoked.

          Default value: The variable is set.

     hold Preserves read messages in the default mailbox instead of putting
          them in the user-specific mailbox file (also refer to MBOX vari-
          able).

          Associated commands: copy, hold, mbox, next, preserve, print,
          Print, quit, touch, type, Type

          Default value: The variable is not set.

     ignore
          Ignores the SIGINT signal during message input.

          Associated commands: followup, Followup, mail, Mail, reply,
          Reply, respond, Respond, ~q (<DEL>)

          Default value: The variable is not set.


Page 34                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     ignoreeof
          The end-of-file signal (EOF, <CTRL-D> key) is to be ignored dur-
          ing message input (also refer to the dot variable).

          Associated commands: followup, Followup, mail, Mail, reply,
          Reply, respond, Respond, ~.

          Default value: The variable is not set.

     indentprefix=string
          During the insertion of a message into a text each line of the
          message begins with string.

          Associated commands: ~m, ~M

          Default value: Tab character.

     keep The default mailbox should not be deleted when it is empty.

          Default value: The variable is not set.

     keepsave
          Messages that are marked as saved (S) in the header are not to be
          deleted from the default mailbox.

          Associated commands: save, Save, write

          Default value: The variable is not set.

     metoo
          If your own login name appears in the list of recipients ("To"
          list), it is not deleted from the list. See also the mailx com-
          mand alias and the allnet variable.

          Associated commands: alias, alternates, followup, group, reply,
          respond, ~h

          Default value: The variable is not set.

     onehop
          When you reply to a message which has been sent to multiple reci-
          pients, mailx abandons its usual practice of constructing all
          recipients' addresses relative to the originating author's
          machine. This improves efficiency when all network sites have
          direct access to one another.

          Associated commands: followup, Followup, reply, Reply, respond,
          Respond

          Default value: The variable is not set.




Page 35                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     outfolder
          If both outfolder and folder are set, reply files with the
          followup and Followup commands will be stored in the directory
          defined by folder (also refer to record variable).

          If only outfolder (or only folder) is set, reply files will be
          stored in the current directory.

          Default value: The variable is not set.

     page Causes a form feed character (FF = CTRL-L = X'0C') to be inserted
          after each message routed through a pipe or | command.

          Default value: The variable is not set.

     prompt=string
          Sets the input prompt for mailx read-mode commands to string.

          Default value: ?

     quiet
          Suppresses the display of the opening message and version iden-
          tifier when mailx is invoked.

          Default value: The variable is not set.

     record=file
          Records all outgoing mail in the named file. The file is extended
          if it already exists.

          Associated commands: mail, Mail, reply, Reply, respond, Respond,
          ~.

          Default value: The variable is not set.

     save Saves messages that could not be sent, e.g. due to an error or an
          interrupt from <DEL> during input. These messages are saved in
          the file specified by the DEAD variable.

          Associated commands: followup, Followup, mail, Mail, reply,
          Reply, respond, Respond, ~d, ~q (<DEL>)

          Default value: The variable is set.

     screen=number
          mailx displays number header lines.

          Associated commands: header, z+, z-

          Default value: Dependent on the terminal type specified by TERM,
          usually 20.



Page 36                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     sendmail=shellcommand
          mailx uses shellcommand to send messages.

          Associated commands: followup, Followup, mail, Mail, reply,
          Reply, respond, Respond, ~.

          Default value: /bin/rmail

     sendwait
          After a read command, waits for the background mailer to finish
          before returning control to the user.

          Associated commands: followup, Followup, mail, Mail, reply,
          Reply, respond, Respond

          Default value: The variable is not set.

     showto
          If you send a message and include yourself among the recipients,
          the name of the first recipient in the recipient list ("To" list)
          will appear in the header list displayed, not your login name.

          Associated commands: from, headers, z+, z-

          Default value: The variable is not set.

     sign=string
          Defines an autograph string to be inserted into the text of a
          message.

          Associated commands: ~a, ~i

          Default value: The variable is not set.

     Sign=string
          Defines an (additional) autograph string to be inserted into the
          text of a message.

          Associated commands: ~A, ~i

          Default value: The variable is not set.

     toplines=number
          mailx displays number lines from the message header.

          Associated commands: top

          Default value: 5






Page 37                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

     Environment variables

     DEAD=file
          The named file is used by mailx to save messages that could not
          be sent, e.g. due to an error or an interrupt during input. This
          file is extended if it already exists.

          Associated commands: followup, Followup, mail, Mail, reply,
          Reply, respond, Respond, ~d, ~q (<DEL>)

          Default value: $HOME/dead.letter

     EDITOR=shellcommand
          In a mailx session, message texts can be edited with the editor
          named as shellcommand (also refer to variable VISUAL).

          Default value: ed

     HOME=directory
          Home directory.

          Specifies the default directory in which mailx creates or
          searches for the files dead.letter, mbox, .mailrc, and the files
          used to record outgoing messages (see the commands followup,
          Followup and ~f, ~F).

     LISTER=shellcommand
          Uses shellcommand to list files in the folder directory.

          Associated commands: folders

          Default value: ls

     MBOX=file
          file designates the user-specific mailbox in which mailx is to
          save read messages before removing them. Each additional message
          extends the file (also refer to the hold variable).

          Associated commands: copy, hold, mbox, next, preserve, print,
          Print, quit, save, touch, type, Type

          Default value: $HOME/mbox

     MAILRC=file
          file defines the name of the private startup file (default:
          $HOME/.mailrc; see mailx command and startup files).

     PAGER=shellcommand
          Uses the specified shellcommand for the paging of output that
          exceeds the number of lines defined in the crt variable.




Page 38                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          Associated commands: dp, dt, next, print, Print, type, Type, ~p

          Default value: more

     SHELL=shellcommand
          Defines the command interpreter used by mailx to execute Reliant
          UNIX commands.

          Associated commands: !, shell

          Default value: /bin/sh

     TERM Contains information about the terminal type. The TERM variable
          will be evaluated if the mailx variable screen is not set.

     USER The USER variable tells mailx the login name of the user, to
          enable it to identify the default mailbox etc.

     VISUAL=shellcommand

          In a mailx session, message texts can be edited with the editor
          named as shellcommand.

          Associated commands: visual, ~v

          Default value: vi

NOTE ON ERROR MESSAGES
     mailx's error messages are largely self-explanatory.

LOCALE
     The LCMESSAGES environment variable governs the language in which
     message texts are displayed.

     LCTYPE governs character classes and character conversion (shifting).

     LCCOLLATE governs the collating sequence.

     The LCTIME environment variable governs the format of date and time
     strings.

     If LCMESSAGES, LCCTYPE, LCCOLLATE or LCTIME is undefined or is
     defined as the null string, it defaults to the value of LANG. If LANG
     is likewise undefined or null, the system acts as if it were not
     internationalized.

     The LCALL environment variable governs the entire locale. LCALL
     takes precedence over all the other environment variables which affect
     internationalization.

     If any of the locale variables has an invalid value, the system acts
     as if none of the variables were set.


Page 39                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

EXAMPLES
     Example 1

     Replying to a message

     User "marvin" receives the message you have mail, so he calls mailx
     without options. He sees a few lines of text and some header lines,
     has all his messages displayed one after the other (using <RETURN>,
     for example) and finally replies to the fourth message. The text of
     his reply is to be recorded in the current directory (followup or fo).
     While in send mode, he changes the Subject entry assigned automati-
     cally by mailx (~s) and inserts his sign-off string, as defined in his
     sign variable, at the end of the text (~a). Before sending his letter
     (~.), he has it redisplayed (~p) and then quits mailx with xit or x so
     as to retain all his messages in the mailbox.

     mailx
     mailx version 4.0 Type ? for help
     "var/mail/marvin": 4 messages 4 new
     >N 1   arthur     Fri Sep  6   9:21    13/373      betelgeuse
      N 2   frodo      Fri Sep  6  12:00    13/365      sysadm
      N 3   peter      Mon Sep 16  10:01     9/232      qed
      N 4   benny      Tue Sep 17  16:43    21/593      Project S
      <RETURN>
      .
      .
      fo benny
      To: <benny>
      Subject: Re: Project S

      ~s Final report on P S~s Final report on P S
      .
      .
      ~a~a

      ~p~p
      --------
      Message contains:
      To: <benny>
      Subject: Final report on P S

      Hi there, Ben!
      Thanks for the minutes. What I really need is the final report
      itself, and not just Real Soon Now, but tomorrow at the latest.
      I need a printed version, not just a file.
      Regards,
      (-: marvin :-)
      (continue)
      ~.

      ? x
      Held 4 messages in /var/mail/marvin


Page 40                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

      $

     Example 2

     Example of a startup file

     The following startup file sets variables and prints all messages from
     winnie (with lpr) when mailx is invoked in read mode.

     # Processing variables
     set page crt=24 cmd=lpr VISUAL
     set sign="\n\tFord Prefect\n\tSales Division\n\tDetroit"

     # Sender: Network system administrator
     alias sys root@orlando root@annapolis root@chicago

     # Prints specific mail
     if r
     pipe winnie lpr
     from winnie
     endif

     Note that mailx terminates the script if any command cannot be exe-
     cuted. This might be the case here with the pipe command if no mes-
     sages from winnie were present. In other words, mailx then would not
     execute the from command (or any others that might follow).

FILES
     /etc/mail/mail.rc
          Global startup file

     $HOME/.mailrc
          Private startup file

     /var/mail/$USER
          The default mailbox that is searched by mailx for incoming mes-
          sages.

     $HOME/mbox
          User-specific mailbox in which mailx saves messages that have
          been read.

     $HOME/dead.letter
          File that is used by mailx to save messages that could not be
          sent, e.g. due to an error or an interrupt with the <DEL> key
          during input. If the file already exists, it is overwritten.

     ./loginname
          Files created in the current directory with names derived from a
          login name. These files are created by mailx in response to the
          following commands:



Page 41                      Reliant UNIX 5.44                Printed 11/98

mailx(1)                                                           mailx(1)

          Copy, followup, Followup, Save.

          You can also select some other directory instead of the current
          directory (see the mailx variables folder and outfolder).

     /tmp/R[emsxz]*
          Temporary files.

     /tmp/Rz$$
          Temporary file used by the commands edit, visual, e, and v. $$ is
          the process ID of the mailx process.

     /usr/share/lib/mailx/mailx.help*
          Help message files.

SEE ALSO
     ed(1), ls(1), mail(1), more(1), sh(1).





































Page 42                      Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026