{
	"id": "db2c4565-f244-4853-8dd6-e72962570cc4",
	"created_at": "2026-04-06T00:06:53.337795Z",
	"updated_at": "2026-04-10T13:13:06.854353Z",
	"deleted_at": null,
	"sha1_hash": "1c17d0b4e3b1833859e259622863897efc1ed029",
	"title": "mailx(1p) - Linux manual page",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 188955,
	"plain_text": "mailx(1p) - Linux manual page\r\nArchived: 2026-04-05 19:24:07 UTC\r\nMAILX(1P) POSIX Programmer's Manual MAILX(1P)\r\nPROLOG         top\r\n This manual page is part of the POSIX Programmer's Manual. The\r\n Linux implementation of this interface may differ (consult the\r\n corresponding Linux manual page for details of Linux behavior), or\r\n the interface may not be implemented on Linux.\r\nNAME         top\r\n mailx — process messages\r\nSYNOPSIS         top\r\n Send Mode\r\n mailx [-s subject] address...\r\n Receive Mode\r\n mailx -e\r\n mailx [-HiNn] [-F] [-u user]\r\n mailx -f [-HiNn] [-F] [file]\r\nDESCRIPTION         top\r\n The mailx utility provides a message sending and receiving\r\n facility. It has two major modes, selected by the options used:\r\n Send Mode and Receive Mode.\r\n On systems that do not support the User Portability Utilities\r\n option, an application using mailx shall have the ability to send\r\n messages in an unspecified manner (Send Mode). Unless the first\r\n character of one or more lines is \u003ctilde\u003e ('~'), all characters in\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 1 of 39\n\nthe input message shall appear in the delivered message, but\r\n additional characters may be inserted in the message before it is\r\n retrieved.\r\n On systems supporting the User Portability Utilities option, mail-\r\n receiving capabilities and other interactive features, Receive\r\n Mode, described below, also shall be enabled.\r\n Send Mode\r\n Send Mode can be used by applications or users to send messages\r\n from the text in standard input.\r\n Receive Mode\r\n Receive Mode is more oriented towards interactive users. Mail can\r\n be read and sent in this interactive mode.\r\n When reading mail, mailx provides commands to facilitate saving,\r\n deleting, and responding to messages. When sending mail, mailx\r\n allows editing, reviewing, and other modification of the message\r\n as it is entered.\r\n Incoming mail shall be stored in one or more unspecified locations\r\n for each user, collectively called the system mailbox for that\r\n user. When mailx is invoked in Receive Mode, the system mailbox\r\n shall be the default place to find new mail. As messages are read,\r\n they shall be marked to be moved to a secondary file for storage,\r\n unless specific action is taken. This secondary file is called the\r\n mbox and is normally located in the directory referred to by the\r\n HOME environment variable (see MBOX in the ENVIRONMENT VARIABLES\r\n section for a description of this file). Messages shall remain in\r\n this file until explicitly removed. When the -f option is used to\r\n read mail messages from secondary files, messages shall be\r\n retained in those files unless specifically removed. All three of\r\n these locations—system mailbox, mbox, and secondary file—are\r\n referred to in this section as simply ``mailboxes'', unless more\r\n specific identification is required.\r\nOPTIONS         top\r\n The mailx utility shall conform to the Base Definitions volume of\r\n POSIX.1‐2017, Section 12.2, Utility Syntax Guidelines.\r\n The following options shall be supported. (Only the -s subject\r\n option shall be required on all systems. The other options are\r\n required only on systems supporting the User Portability Utilities\r\n option.)\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 2 of 39\n\n-e Test for the presence of mail in the system mailbox. The\r\n mailx utility shall write nothing and exit with a\r\n successful return code if there is mail to read.\r\n -f Read messages from the file named by the file operand\r\n instead of the system mailbox. (See also folder.) If no\r\n file operand is specified, read messages from mbox\r\n instead of the system mailbox.\r\n -F Record the message in a file named after the first\r\n recipient. The name is the login-name portion of the\r\n address found first on the To: line in the mail header.\r\n Overrides the record variable, if set (see Internal\r\n Variables in mailx).\r\n -H Write a header summary only.\r\n -i Ignore interrupts. (See also ignore.)\r\n -n Do not initialize from the system default start-up file.\r\n See the EXTENDED DESCRIPTION section.\r\n -N Do not write an initial header summary.\r\n -s subject\r\n Set the Subject header field to subject. All characters\r\n in the subject string shall appear in the delivered\r\n message. The results are unspecified if subject is\r\n longer than {LINE_MAX} - 10 bytes or contains a\r\n \u003cnewline\u003e.\r\n -u user Read the system mailbox of the login name user. This\r\n shall only be successful if the invoking user has\r\n appropriate privileges to read the system mailbox of\r\n that user.\r\nOPERANDS         top\r\n The following operands shall be supported:\r\n address Addressee of message. When -n is specified and no user\r\n start-up files are accessed (see the EXTENDED\r\n DESCRIPTION section), the user or application shall\r\n ensure this is an address to pass to the mail delivery\r\n system. Any system or user start-up files may enable\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 3 of 39\n\naliases (see alias under Commands in mailx) that may\r\n modify the form of address before it is passed to the\r\n mail delivery system.\r\n file A pathname of a file to be read instead of the system\r\n mailbox when -f is specified. The meaning of the file\r\n option-argument shall be affected by the contents of the\r\n folder internal variable; see Internal Variables in\r\n mailx.\r\nSTDIN         top\r\n When mailx is invoked in Send Mode (the first synopsis line),\r\n standard input shall be the message to be delivered to the\r\n specified addresses. When in Receive Mode, user commands shall be\r\n accepted from stdin. If the User Portability Utilities option is\r\n not supported, standard input lines beginning with a \u003ctilde\u003e ('~')\r\n character produce unspecified results.\r\n If the User Portability Utilities option is supported, then in\r\n both Send and Receive Modes, standard input lines beginning with\r\n the escape character (usually \u003ctilde\u003e ('~')) shall affect\r\n processing as described in Command Escapes in mailx.\r\nINPUT FILES         top\r\n When mailx is used as described by this volume of POSIX.1‐2017,\r\n the file option-argument (see the -f option) and the mbox shall be\r\n text files containing mail messages, formatted as described in the\r\n OUTPUT FILES section. The nature of the system mailbox is\r\n unspecified; it need not be a file.\r\nENVIRONMENT VARIABLES         top\r\n Some of the functionality described in this section shall be\r\n provided on implementations that support the User Portability\r\n Utilities option as described in the text, and is not further\r\n shaded for this option.\r\n The following environment variables shall affect the execution of\r\n mailx:\r\n DEAD Determine the pathname of the file in which to save\r\n partial messages in case of interrupts or delivery\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 4 of 39\n\nerrors. The default shall be dead.letter in the\r\n directory named by the HOME variable. The behavior of\r\n mailx in saving partial messages is unspecified if the\r\n User Portability Utilities option is not supported and\r\n DEAD is not defined with the value /dev/null.\r\n EDITOR Determine the name of a utility to invoke when the edit\r\n (see Commands in mailx) or ~e (see Command Escapes in\r\n mailx) command is used. The default editor is\r\n unspecified. On XSI-conformant systems it is ed. The\r\n effects of this variable are unspecified if the User\r\n Portability Utilities option is not supported.\r\n HOME Determine the pathname of the user's home directory.\r\n LANG Provide a default value for the internationalization\r\n variables that are unset or null. (See the Base\r\n Definitions volume of POSIX.1‐2017, Section 8.2,\r\n Internationalization Variables for the precedence of\r\n internationalization variables used to determine the\r\n values of locale categories.)\r\n LC_ALL If set to a non-empty string value, override the values\r\n of all the other internationalization variables.\r\n LC_CTYPE Determine the locale for the interpretation of sequences\r\n of bytes of text data as characters (for example,\r\n single-byte as opposed to multi-byte characters in\r\n arguments and input files) and the handling of case-\r\n insensitive address and header-field comparisons.\r\n LC_TIME This variable may determine the format and contents of\r\n the date and time strings written by mailx. This volume\r\n of POSIX.1‐2017 specifies the effects of this variable\r\n only for systems supporting the User Portability\r\n Utilities option.\r\n LC_MESSAGES\r\n Determine the locale that should be used to affect the\r\n format and contents of diagnostic messages written to\r\n standard error and informative messages written to\r\n standard output.\r\n LISTER Determine a string representing the command for writing\r\n the contents of the folder directory to standard output\r\n when the folders command is given (see folders in\r\n Commands in mailx). Any string acceptable as a\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 5 of 39\n\ncommand_string operand to the sh -c command shall be\r\n valid. If this variable is null or not set, the output\r\n command shall be ls. The effects of this variable are\r\n unspecified if the User Portability Utilities option is\r\n not supported.\r\n MAILRC Determine the pathname of the user start-up file. The\r\n default shall be .mailrc in the directory referred to by\r\n the HOME environment variable. The behavior of mailx is\r\n unspecified if the User Portability Utilities option is\r\n not supported and MAILRC is not defined with the value\r\n /dev/null.\r\n MBOX Determine a pathname of the file to save messages from\r\n the system mailbox that have been read. The exit command\r\n shall override this function, as shall saving the\r\n message explicitly in another file. The default shall be\r\n mbox in the directory named by the HOME variable. The\r\n effects of this variable are unspecified if the User\r\n Portability Utilities option is not supported.\r\n NLSPATH Determine the location of message catalogs for the\r\n processing of LC_MESSAGES.\r\n PAGER Determine a string representing an output filtering or\r\n pagination command for writing the output to the\r\n terminal. Any string acceptable as a command_string\r\n operand to the sh -c command shall be valid. When\r\n standard output is a terminal device, the message output\r\n shall be piped through the command if the mailx internal\r\n variable crt is set to a value less the number of lines\r\n in the message; see Internal Variables in mailx. If the\r\n PAGER variable is null or not set, the paginator shall\r\n be either more or another paginator utility documented\r\n in the system documentation. The effects of this\r\n variable are unspecified if the User Portability\r\n Utilities option is not supported.\r\n SHELL Determine the name of a preferred command interpreter.\r\n The default shall be sh. The effects of this variable\r\n are unspecified if the User Portability Utilities option\r\n is not supported.\r\n TERM If the internal variable screen is not specified,\r\n determine the name of the terminal type to indicate in\r\n an unspecified manner the number of lines in a screenful\r\n of headers. If TERM is not set or is set to null, an\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 6 of 39\n\nunspecified default terminal type shall be used and the\r\n value of a screenful is unspecified. The effects of this\r\n variable are unspecified if the User Portability\r\n Utilities option is not supported.\r\n TZ This variable may determine the timezone used to\r\n calculate date and time strings written by mailx. If TZ\r\n is unset or null, an unspecified default timezone shall\r\n be used.\r\n VISUAL Determine a pathname of a utility to invoke when the\r\n visual command (see Commands in mailx) or ~v command-\r\n escape (see Command Escapes in mailx) is used. If this\r\n variable is null or not set, the full-screen editor\r\n shall be vi. The effects of this variable are\r\n unspecified if the User Portability Utilities option is\r\n not supported.\r\nASYNCHRONOUS EVENTS         top\r\n When mailx is in Send Mode and standard input is not a terminal,\r\n it shall take the standard action for all signals.\r\n In Receive Mode, or in Send Mode when standard input is a\r\n terminal, if a SIGINT signal is received:\r\n 1. If in command mode, the current command, if there is one,\r\n shall be aborted, and a command-mode prompt shall be written.\r\n 2. If in input mode:\r\n a. If ignore is set, mailx shall write \"@\\n\", discard the\r\n current input line, and continue processing, bypassing the\r\n message-abort mechanism described in item 2b.\r\n b. If the interrupt was received while sending mail, either\r\n when in Receive Mode or in Send Mode, a message shall be\r\n written, and another subsequent interrupt, with no other\r\n intervening characters typed, shall be required to abort\r\n the mail message. If in Receive Mode and another\r\n interrupt is received, a command-mode prompt shall be\r\n written. If in Send Mode and another interrupt is\r\n received, mailx shall terminate with a non-zero status.\r\n In both cases listed in item b, if the message is not\r\n empty:\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 7 of 39\n\ni. If save is enabled and the file named by DEAD can be\r\n created, the message shall be written to the file\r\n named by DEAD. If the file exists, the message shall\r\n be written to replace the contents of the file.\r\n ii. If save is not enabled, or the file named by DEAD\r\n cannot be created, the message shall not be saved.\r\n The mailx utility shall take the standard action for all other\r\n signals.\r\nSTDOUT         top\r\n In command and input modes, all output, including prompts and\r\n messages, shall be written to standard output.\r\nSTDERR         top\r\n The standard error shall be used only for diagnostic messages.\r\nOUTPUT FILES         top\r\n Various mailx commands and command escapes can create or add to\r\n files, including the mbox, the dead-letter file, and secondary\r\n mailboxes. When mailx is used as described in this volume of\r\n POSIX.1‐2017, these files shall be text files, formatted as\r\n follows:\r\n line beginning with From\u003cspace\u003e\r\n [one or more header-lines; see Commands in mailx]\r\n empty line\r\n [zero or more body lines\r\n empty line]\r\n [line beginning with From\u003cspace\u003e...]\r\n where each message begins with the From \u003cspace\u003e line shown,\r\n preceded by the beginning of the file or an empty line. (The From\r\n \u003cspace\u003e line is considered to be part of the message header, but\r\n not one of the header-lines referred to in Commands in mailx;\r\n thus, it shall not be affected by the discard, ignore, or retain\r\n commands.) The formats of the remainder of the From \u003cspace\u003e line\r\n and any additional header lines are unspecified, except that none\r\n shall be empty. The format of a message body line is also\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 8 of 39\n\nunspecified, except that no line following an empty line shall\r\n start with From \u003cspace\u003e; mailx shall modify any such user-entered\r\n message body lines (following an empty line and beginning with\r\n From \u003cspace\u003e) by adding one or more characters to precede the 'F';\r\n it may add these characters to From \u003cspace\u003e lines that are not\r\n preceded by an empty line.\r\n When a message from the system mailbox or entered by the user is\r\n not a text file, it is implementation-defined how such a message\r\n is stored in files written by mailx.\r\nEXTENDED DESCRIPTION         top\r\n The functionality in the entire EXTENDED DESCRIPTION section shall\r\n be provided on implementations supporting the User Portability\r\n Utilities option. The functionality described in this section\r\n shall be provided on implementations that support the User\r\n Portability Utilities option (and the rest of this section is not\r\n further shaded for this option).\r\n The mailx utility need not support for all character encodings in\r\n all circumstances. For example, inter-system mail may be\r\n restricted to 7-bit data by the underlying network, 8-bit data\r\n need not be portable to non-internationalized systems, and so on.\r\n Under these circumstances, it is recommended that only characters\r\n defined in the ISO/IEC 646:1991 standard International Reference\r\n Version (equivalent to ASCII) 7-bit range of characters be used.\r\n When mailx is invoked using one of the Receive Mode synopsis\r\n forms, it shall write a page of header-summary lines (if -N was\r\n not specified and there are messages, see below), followed by a\r\n prompt indicating that mailx can accept regular commands (see\r\n Commands in mailx); this is termed command mode. The page of\r\n header-summary lines shall contain the first new message if there\r\n are new messages, or the first unread message if there are unread\r\n messages, or the first message. When mailx is invoked using the\r\n Send Mode synopsis and standard input is a terminal, if no subject\r\n is specified on the command line and the asksub variable is set, a\r\n prompt for the subject shall be written. At this point, mailx\r\n shall be in input mode. This input mode shall also be entered when\r\n using one of the Receive Mode synopsis forms and a reply or new\r\n message is composed using the reply, Reply, followup, Followup, or\r\n mail commands and standard input is a terminal. When the message\r\n is typed and the end of the message is encountered, the message\r\n shall be passed to the mail delivery software. Commands can be\r\n entered by beginning a line with the escape character (by default,\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 9 of 39\n\n\u003ctilde\u003e ('~')) followed by a single command letter and optional\r\n arguments. See Commands in mailx for a summary of these commands.\r\n It is unspecified what effect these commands will have if standard\r\n input is not a terminal when a message is entered using either the\r\n Send Mode synopsis, or the Read Mode commands reply, Reply,\r\n followup, Followup, or mail.\r\n Note: For notational convenience, this section uses the default\r\n escape character, \u003ctilde\u003e, in all references and examples.\r\n At any time, the behavior of mailx shall be governed by a set of\r\n environmental and internal variables. These are flags and valued\r\n parameters that can be set and cleared via the mailx set and unset\r\n commands.\r\n Regular commands are of the form:\r\n [command] [msglist] [argument ...]\r\n If no command is specified in command mode, next shall be assumed.\r\n In input mode, commands shall be recognized by the escape\r\n character, and lines not treated as commands shall be taken as\r\n input for the message.\r\n In command mode, each message shall be assigned a sequential\r\n number, starting with 1.\r\n All messages have a state that shall affect how they are displayed\r\n in the header summary and how they are retained or deleted upon\r\n termination of mailx. There is at any time the notion of a\r\n current message, which shall be marked by a '\u003e' at the beginning\r\n of a line in the header summary. When mailx is invoked using one\r\n of the Receive Mode synopsis forms, the current message shall be\r\n the first new message, if there is a new message, or the first\r\n unread message if there is an unread message, or the first message\r\n if there are any messages, or unspecified if there are no messages\r\n in the mailbox. Each command that takes an optional list of\r\n messages (msglist) or an optional single message (message) on\r\n which to operate shall leave the current message set to the\r\n highest-numbered message of the messages specified, unless the\r\n command deletes messages, in which case the current message shall\r\n be set to the first undeleted message (that is, a message not in\r\n the deleted state) after the highest-numbered message deleted by\r\n the command, if one exists, or the first undeleted message before\r\n the highest-numbered message deleted by the command, if one\r\n exists, or to an unspecified value if there are no remaining\r\n undeleted messages. All messages shall be in one of the following\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 10 of 39\n\nstates:\r\n new The message is present in the system mailbox and has not\r\n been viewed by the user or moved to any other state.\r\n Messages in state new when mailx quits shall be retained\r\n in the system mailbox.\r\n unread The message has been present in the system mailbox for\r\n more than one invocation of mailx and has not been\r\n viewed by the user or moved to any other state.\r\n Messages in state unread when mailx quits shall be\r\n retained in the system mailbox.\r\n read The message has been processed by one of the following\r\n commands: ~f, ~m, ~F, ~M, copy, mbox, next, pipe, print,\r\n Print, top, type, Type, undelete. The delete, dp, and\r\n dt commands may also cause the next message to be marked\r\n as read, depending on the value of the autoprint\r\n variable. Messages that are in the system mailbox and in\r\n state read when mailx quits shall be saved in the mbox,\r\n unless the internal variable hold was set. Messages that\r\n are in the mbox or in a secondary mailbox and in state\r\n read when mailx quits shall be retained in their current\r\n location.\r\n deleted The message has been processed by one of the following\r\n commands: delete, dp, dt. Messages in state deleted\r\n when mailx quits shall be deleted. Deleted messages\r\n shall be ignored until mailx quits or changes mailboxes\r\n or they are specified to the undelete command; for\r\n example, the message specification /string shall only\r\n search the subject lines of messages that have not yet\r\n been deleted, unless the command operating on the list\r\n of messages is undelete. No deleted message or deleted\r\n message header shall be displayed by any mailx command\r\n other than undelete.\r\n preserved The message has been processed by a preserve command.\r\n When mailx quits, the message shall be retained in its\r\n current location.\r\n saved The message has been processed by one of the following\r\n commands: save or write. If the current mailbox is the\r\n system mailbox, and the internal variable keepsave is\r\n set, messages in the state saved shall be saved to the\r\n file designated by the MBOX variable (see the\r\n ENVIRONMENT VARIABLES section). If the current mailbox\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 11 of 39\n\nis the system mailbox, messages in the state saved shall\r\n be deleted from the current mailbox, when the quit or\r\n file command is used to exit the current mailbox.\r\n The header-summary line for each message shall indicate the state\r\n of the message.\r\n Many commands take an optional list of messages (msglist) on which\r\n to operate, which defaults to the current message. A msglist is a\r\n list of message specifications separated by \u003cblank\u003e characters,\r\n which can include:\r\n n Message number n.\r\n + The next undeleted message, or the next deleted message\r\n for the undelete command.\r\n - The next previous undeleted message, or the next previous\r\n deleted message for the undelete command.\r\n . The current message.\r\n ^ The first undeleted message, or the first deleted message\r\n for the undelete command.\r\n $ The last message.\r\n * All messages.\r\n n‐m An inclusive range of message numbers.\r\n address All messages from address; any address as shown in a\r\n header summary shall be matchable in this form.\r\n /string All messages with string in the subject line (case\r\n ignored).\r\n :c All messages of type c, where c shall be one of:\r\n d Deleted messages.\r\n n New messages.\r\n o Old messages (any not in state read or new).\r\n r Read messages.\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 12 of 39\n\nu Unread messages.\r\n Other commands take an optional message (message) on which to\r\n operate, which defaults to the current message. All of the forms\r\n allowed for msglist are also allowed for message, but if more than\r\n one message is specified, only the first shall be operated on.\r\n Other arguments are usually arbitrary strings whose usage depends\r\n on the command involved.\r\n Start-Up in mailx\r\n At start-up time, mailx shall take the following steps in\r\n sequence:\r\n 1. Establish all variables at their stated default values.\r\n 2. Process command line options, overriding corresponding default\r\n values.\r\n 3. Import any of the DEAD, EDITOR, MBOX, LISTER, PAGER, SHELL, or\r\n VISUAL variables that are present in the environment,\r\n overriding the corresponding default values.\r\n 4. Read mailx commands from an unspecified system start-up file,\r\n unless the -n option is given, to initialize any internal\r\n mailx variables and aliases.\r\n 5. Process the user start-up file of mailx commands named in the\r\n user MAILRC variable.\r\n Most regular mailx commands are valid inside start-up files, the\r\n most common use being to set up initial display options and alias\r\n lists. The following commands shall be invalid in a start-up file:\r\n !, edit, hold, mail, preserve, reply, Reply, shell, visual, Copy,\r\n followup, and Followup. Any errors in a start-up file shall\r\n either cause mailx to terminate with a diagnostic message and a\r\n non-zero status or to continue after writing a diagnostic message,\r\n ignoring the remainder of the lines in the file.\r\n A blank line in a start-up file shall be ignored.\r\n Internal Variables in mailx\r\n The following variables are internal mailx variables. Each\r\n internal variable can be set via the mailx set command at any\r\n time. The unset and set no name commands can be used to erase\r\n variables.\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 13 of 39\n\nIn the following list, variables shown as:\r\n variable\r\n represent Boolean values. Variables shown as:\r\n variable=value\r\n shall be assigned string or numeric values. For string values, the\r\n rules in Commands in mailx concerning filenames and quoting shall\r\n also apply.\r\n The defaults specified here may be changed by the unspecified\r\n system start-up file unless the user specifies the -n option.\r\n allnet All network names whose login name components match\r\n shall be treated as identical. This shall cause the\r\n msglist message specifications to behave similarly. The\r\n default shall be noallnet. See also the alternates\r\n command and the metoo variable.\r\n append Append messages to the end of the mbox file upon\r\n termination instead of placing them at the beginning.\r\n The default shall be noappend. This variable shall not\r\n affect the save command when saving to mbox.\r\n ask, asksub\r\n Prompt for a subject line on outgoing mail if one is not\r\n specified on the command line with the -s option. The\r\n ask and asksub forms are synonyms; the system shall\r\n refer to asksub and noasksub in its messages, but shall\r\n accept ask and noask as user input to mean asksub and\r\n noasksub. It shall not be possible to set both ask and\r\n noasksub, or noask and asksub. The default shall be\r\n asksub, but no prompting shall be done if standard input\r\n is not a terminal.\r\n askbcc Prompt for the blind copy list. The default shall be\r\n noaskbcc.\r\n askcc Prompt for the copy list. The default shall be noaskcc.\r\n autoprint Enable automatic writing of messages after delete and\r\n undelete commands. The default shall be noautoprint.\r\n bang Enable the special-case treatment of \u003cexclamation-mark\u003e\r\n characters ('!') in escape command lines; see the\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 14 of 39\n\nescape command and Command Escapes in mailx. The\r\n default shall be nobang, disabling the expansion of '!'\r\n in the command argument to the ~! command and the\r\n ~\u003c!command escape.\r\n cmd=command\r\n Set the default command to be invoked by the pipe\r\n command. The default shall be nocmd.\r\n crt=number\r\n Pipe messages having more than number lines through the\r\n command specified by the value of the PAGER variable.\r\n The default shall be nocrt. If it is set to null, the\r\n value used is implementation-defined.\r\n debug Enable verbose diagnostics for debugging. Messages are\r\n not delivered. The default shall be nodebug.\r\n dot When dot is set, a \u003cperiod\u003e on a line by itself during\r\n message input from a terminal shall also signify end-of-\r\n file (in addition to normal end-of-file). The default\r\n shall be nodot. If ignoreeof is set (see below), a\r\n setting of nodot shall be ignored and the \u003cperiod\u003e is\r\n the only method to terminate input mode.\r\n escape=c Set the command escape character to be the character\r\n 'c'. By default, the command escape character shall be\r\n \u003ctilde\u003e. If escape is unset, \u003ctilde\u003e shall be used; if\r\n it is set to null, command escaping shall be disabled.\r\n flipr Reverse the meanings of the R and r commands. The\r\n default shall be noflipr.\r\n folder=directory\r\n The default directory for saving mail files. User-\r\n specified filenames beginning with a \u003cplus-sign\u003e ('+')\r\n shall be expanded by preceding the filename with this\r\n directory name to obtain the real pathname. If directory\r\n does not start with a \u003cslash\u003e ('/'), the contents of\r\n HOME shall be prefixed to it. The default shall be\r\n nofolder. If folder is unset or set to null, user-\r\n specified filenames beginning with '+' shall refer to\r\n files in the current directory that begin with the\r\n literal '+' character. See also outfolder below. The\r\n folder value need not affect the processing of the files\r\n named in MBOX and DEAD.\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 15 of 39\n\nheader Enable writing of the header summary when entering mailx\r\n in Receive Mode. The default shall be header.\r\n hold Preserve all messages that are read in the system\r\n mailbox instead of putting them in the mbox save file.\r\n The default shall be nohold.\r\n ignore Ignore interrupts while entering messages. The default\r\n shall be noignore.\r\n ignoreeof Ignore normal end-of-file during message input. Input\r\n can be terminated only by entering a \u003cperiod\u003e ('.') on\r\n a line by itself or by the ~. command escape. The\r\n default shall be noignoreeof. See also dot above.\r\n indentprefix=string\r\n A string that shall be added as a prefix to each line\r\n that is inserted into the message by the ~m command\r\n escape. This variable shall default to one \u003ctab\u003e.\r\n keep When a system mailbox, secondary mailbox, or mbox is\r\n empty, truncate it to zero length instead of removing\r\n it. The default shall be nokeep.\r\n keepsave Keep the messages that have been saved from the system\r\n mailbox into other files in the file designated by the\r\n variable MBOX, instead of deleting them. The default\r\n shall be nokeepsave.\r\n metoo Suppress the deletion of the login name of the user from\r\n the recipient list when replying to a message or sending\r\n to a group. The default shall be nometoo.\r\n onehop When responding to a message that was originally sent to\r\n several recipients, the other recipient addresses are\r\n normally forced to be relative to the originating\r\n author's machine for the response. This flag disables\r\n alteration of the recipients' addresses, improving\r\n efficiency in a network where all machines can send\r\n directly to all other machines (that is, one hop away).\r\n The default shall be noonehop.\r\n outfolder Cause the files used to record outgoing messages to be\r\n located in the directory specified by the folder\r\n variable unless the pathname is absolute. The default\r\n shall be nooutfolder. See the record variable.\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 16 of 39\n\npage Insert a \u003cform-feed\u003e after each message sent through the\r\n pipe created by the pipe command. The default shall be\r\n nopage.\r\n prompt=string\r\n Set the command-mode prompt to string. If string is\r\n null or if noprompt is set, no prompting shall occur.\r\n The default shall be to prompt with the string \"? \".\r\n quiet Refrain from writing the opening message and version\r\n when entering mailx. The default shall be noquiet.\r\n record=file\r\n Record all outgoing mail in the file with the pathname\r\n file. The default shall be norecord. See also\r\n outfolder above.\r\n save Enable saving of messages in the dead-letter file on\r\n interrupt or delivery error. See the variable DEAD for\r\n the location of the dead-letter file. The default shall\r\n be save.\r\n screen=number\r\n Set the number of lines in a screenful of headers for\r\n the headers and z commands. If screen is not specified,\r\n a value based on the terminal type identified by the\r\n TERM environment variable, the window size, the baud\r\n rate, or some combination of these shall be used.\r\n sendwait Wait for the background mailer to finish before\r\n returning. The default shall be nosendwait.\r\n showto When the sender of the message was the user who is\r\n invoking mailx, write the information from the To: line\r\n instead of the From: line in the header summary. The\r\n default shall be noshowto.\r\n sign=string\r\n Set the variable inserted into the text of a message\r\n when the ~a command escape is given. The default shall\r\n be nosign. The character sequences '\\t' and '\\n' shall\r\n be recognized in the variable as \u003ctab\u003e and \u003cnewline\u003e\r\n characters, respectively. (See also ~i in Command\r\n Escapes in mailx.)\r\n Sign=string\r\n Set the variable inserted into the text of a message\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 17 of 39\n\nwhen the ~A command escape is given. The default shall\r\n be noSign. The character sequences '\\t' and '\\n' shall\r\n be recognized in the variable as \u003ctab\u003e and \u003cnewline\u003e\r\n characters, respectively.\r\n toplines=number\r\n Set the number of lines of the message to write with the\r\n top command. The default shall be 5.\r\n Commands in mailx\r\n The following mailx commands shall be provided. In the following\r\n list, header refers to lines from the message header, as shown in\r\n the OUTPUT FILES section. Header-line refers to lines within the\r\n header that begin with one or more non-white-space characters,\r\n immediately followed by a \u003ccolon\u003e and white space and continuing\r\n until the next line beginning with a non-white-space character or\r\n an empty line. Header-field refers to the portion of a header line\r\n prior to the first \u003ccolon\u003e in that line.\r\n For each of the commands listed below, the command can be entered\r\n as the abbreviation (those characters in the Synopsis command word\r\n preceding the '['), the full command (all characters shown for the\r\n command word, omitting the '[' and ']'), or any truncation of the\r\n full command down to the abbreviation. For example, the exit\r\n command (shown as ex[it] in the Synopsis) can be entered as ex,\r\n exi, or exit.\r\n The arguments to commands can be quoted, using the following\r\n methods:\r\n * An argument can be enclosed between paired double-quotes (\"\")\r\n or single-quotes (''); any white space, shell word expansion,\r\n or \u003cbackslash\u003e characters within the quotes shall be treated\r\n literally as part of the argument. A double-quote shall be\r\n treated literally within single-quotes and vice versa. These\r\n special properties of the \u003cquotation-mark\u003e characters shall\r\n occur only when they are paired at the beginning and end of\r\n the argument.\r\n * A \u003cbackslash\u003e outside of the enclosing quotes shall be\r\n discarded and the following character treated literally as\r\n part of the argument.\r\n * An unquoted \u003cbackslash\u003e at the end of a command line shall be\r\n discarded and the next line shall continue the command.\r\n Filenames, where expected, shall be subjected to the following\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 18 of 39\n\ntransformations, in sequence:\r\n * If the filename begins with an unquoted \u003cplus-sign\u003e, and the\r\n folder variable is defined (see the folder variable), the\r\n \u003cplus-sign\u003e shall be replaced by the value of the folder\r\n variable followed by a \u003cslash\u003e. If the folder variable is\r\n unset or is set to null, the filename shall be unchanged.\r\n * Shell word expansions shall be applied to the filename (see\r\n Section 2.6, Word Expansions). If more than a single pathname\r\n results from this expansion and the command is expecting one\r\n file, the effects are unspecified.\r\n Declare Aliases\r\n Synopsis:\r\n a[lias] [alias [address...]]\r\n g[roup] [alias [address...]]\r\n Add the given addresses to the alias specified by alias. The\r\n names shall be substituted when alias is used as a recipient\r\n address specified by the user in an outgoing message (that is,\r\n other recipients addressed indirectly through the reply command\r\n shall not be substituted in this manner). Mail address alias\r\n substitution shall apply only when the alias string is used as a\r\n full address; for example, when hlj is an alias, hlj@posix.com\r\n does not trigger the alias substitution. If no arguments are\r\n given, write a listing of the current aliases to standard output.\r\n If only an alias argument is given, write a listing of the\r\n specified alias to standard output. These listings need not\r\n reflect the same order of addresses that were entered.\r\n Declare Alternatives\r\n Synopsis:\r\n alt[ernates] name...\r\n (See also the metoo variable.) Declare a list of alternative names\r\n for the user's login. When responding to a message, these names\r\n shall be removed from the list of recipients for the response. The\r\n comparison of names shall be in a case-insensitive manner. With no\r\n arguments, alternates shall write the current list of alternative\r\n names.\r\n Change Current Directory\r\n Synopsis:\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 19 of 39\n\ncd [directory]\r\n ch[dir] [directory]\r\n Change directory. If directory is not specified, the contents of\r\n HOME shall be used.\r\n Copy Messages\r\n Synopsis:\r\n c[opy] [file]\r\n c[opy] [msglist] file\r\n C[opy] [msglist]\r\n Copy messages to the file named by the pathname file without\r\n marking the messages as saved. Otherwise, it shall be equivalent\r\n to the save command.\r\n In the capitalized form, save the specified messages in a file\r\n whose name is derived from the author of the message to be saved,\r\n without marking the messages as saved. Otherwise, it shall be\r\n equivalent to the Save command.\r\n Delete Messages\r\n Synopsis:\r\n d[elete] [msglist]\r\n Mark messages for deletion from the mailbox. The deletions shall\r\n not occur until mailx quits (see the quit command) or changes\r\n mailboxes (see the folder command). If autoprint is set and there\r\n are messages remaining after the delete command, the current\r\n message shall be written as described for the print command (see\r\n the print command); otherwise, the mailx prompt shall be written.\r\n Discard Header Fields\r\n Synopsis:\r\n di[scard] [header-field...]\r\n ig[nore] [header-field...]\r\n Suppress the specified header fields when writing messages.\r\n Specified header-fields shall be added to the list of suppressed\r\n header fields. Examples of header fields to ignore are status and\r\n cc. The fields shall be included when the message is saved. The\r\n Print and Type commands shall override this command. The\r\n comparison of header fields shall be in a case-insensitive manner.\r\n If no arguments are specified, write a list of the currently\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 20 of 39\n\nsuppressed header fields to standard output; the listing need not\r\n reflect the same order of header fields that were entered.\r\n If both retain and discard commands are given, discard commands\r\n shall be ignored.\r\n Delete Messages and Display\r\n Synopsis:\r\n dp [msglist]\r\n dt [msglist]\r\n Delete the specified messages as described for the delete command,\r\n except that the autoprint variable shall have no effect, and the\r\n current message shall be written only if it was set to a message\r\n after the last message deleted by the command. Otherwise, an\r\n informational message to the effect that there are no further\r\n messages in the mailbox shall be written, followed by the mailx\r\n prompt.\r\n Echo a String\r\n Synopsis:\r\n ec[ho] string ...\r\n Echo the given strings, equivalent to the shell echo utility.\r\n Edit Messages\r\n Synopsis:\r\n e[dit] [msglist]\r\n Edit the given messages. The messages shall be placed in a\r\n temporary file and the utility named by the EDITOR variable is\r\n invoked to edit each file in sequence. The default EDITOR is\r\n unspecified.\r\n The edit command does not modify the contents of those messages in\r\n the mailbox.\r\n Exit\r\n Synopsis:\r\n ex[it]\r\n x[it]\r\n Exit from mailx without changing the mailbox. No messages shall be\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 21 of 39\n\nsaved in the mbox (see also quit).\r\n Change Folder\r\n Synopsis:\r\n fi[le] [file]\r\n fold[er] [file]\r\n Quit (see the quit command) from the current file of messages and\r\n read in the file named by the pathname file. If no argument is\r\n given, the name and status of the current mailbox shall be\r\n written.\r\n Several unquoted special characters shall be recognized when used\r\n as file names, with the following substitutions:\r\n % The system mailbox for the invoking user.\r\n %user The system mailbox for user.\r\n # The previous file.\r\n \u0026 The current mbox.\r\n +file The named file in the folder directory. (See the folder\r\n variable.)\r\n The default file shall be the current mailbox.\r\n Display List of Folders\r\n Synopsis:\r\n folders\r\n Write the names of the files in the directory set by the folder\r\n variable. The command specified by the LISTER environment variable\r\n shall be used (see the ENVIRONMENT VARIABLES section).\r\n Follow Up Specified Messages\r\n Synopsis:\r\n fo[llowup] [message]\r\n F[ollowup] [msglist]\r\n In the lowercase form, respond to a message, recording the\r\n response in a file whose name is derived from the author of the\r\n message. See also the save and copy commands and outfolder.\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 22 of 39\n\nIn the capitalized form, respond to the first message in the\r\n msglist, sending the message to the author of each message in the\r\n msglist. The subject line shall be taken from the first message\r\n and the response shall be recorded in a file whose name is derived\r\n from the author of the first message. See also the Save and Copy\r\n commands and outfolder.\r\n Both forms shall override the record variable, if set.\r\n Display Header Summary for Specified Messages\r\n Synopsis:\r\n f[rom] [msglist]\r\n Write the header summary for the specified messages.\r\n Display Header Summary\r\n Synopsis:\r\n h[eaders] [message]\r\n Write the page of headers that includes the message specified. If\r\n the message argument is not specified, the current message shall\r\n not change. However, if the message argument is specified, the\r\n current message shall become the message that appears at the top\r\n of the page of headers that includes the message specified. The\r\n screen variable sets the number of headers per page. See also the\r\n z command.\r\n Help\r\n Synopsis:\r\n hel[p]\r\n ?\r\n Write a summary of commands.\r\n Hold Messages\r\n Synopsis:\r\n ho[ld] [msglist]\r\n pre[serve] [msglist]\r\n Mark the messages in msglist to be retained in the mailbox when\r\n mailx terminates. This shall override any commands that might\r\n previously have marked the messages to be deleted. During the\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 23 of 39\n\ncurrent invocation of mailx, only the delete, dp, or dt commands\r\n shall remove the preserve marking of a message.\r\n Execute Commands Conditionally\r\n Synopsis:\r\n i[f] s|r\r\n mail-commands\r\n el[se]\r\n mail-commands\r\n en[dif]\r\n Execute commands conditionally, where if s executes the following\r\n mail-commands, up to an else or endif, if the program is in Send\r\n Mode, and if r shall cause the mail-commands to be executed only\r\n in Receive Mode.\r\n List Available Commands\r\n Synopsis:\r\n l[ist]\r\n Write a list of all commands available. No explanation shall be\r\n given.\r\n Mail a Message\r\n Synopsis:\r\n m[ail] address...\r\n Mail a message to the specified addresses or aliases.\r\n Direct Messages to mbox\r\n Synopsis:\r\n mb[ox] [msglist]\r\n Arrange for the given messages to end up in the mbox save file\r\n when mailx terminates normally. See MBOX. See also the exit and\r\n quit commands.\r\n Process Next Specified Message\r\n Synopsis:\r\n n[ext] [message]\r\n If the current message has not been written (for example, by the\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 24 of 39\n\nprint command) since mailx started or since any other message was\r\n the current message, behave as if the print command was entered.\r\n Otherwise, if there is an undeleted message after the current\r\n message, make it the current message and behave as if the print\r\n command was entered. Otherwise, an informational message to the\r\n effect that there are no further messages in the mailbox shall be\r\n written, followed by the mailx prompt. Should the current message\r\n location be the result of an immediately preceding hold, mbox,\r\n preserve, or touch command, next will act as if the current\r\n message has already been written.\r\n Pipe Message\r\n Synopsis:\r\n pi[pe] [[msglist] command]\r\n | [[msglist] command]\r\n Pipe the messages through the given command by invoking the\r\n command interpreter specified by SHELL with two arguments: -c and\r\n command. (See also sh -c.) The application shall ensure that the\r\n command is given as a single argument. Quoting, described\r\n previously, can be used to accomplish this. If no arguments are\r\n given, the current message shall be piped through the command\r\n specified by the value of the cmd variable. If the page variable\r\n is set, a \u003cform-feed\u003e shall be inserted after each message.\r\n Display Message with Headers\r\n Synopsis:\r\n P[rint] [msglist]\r\n T[ype] [msglist]\r\n Write the specified messages, including all header lines, to\r\n standard output. Override suppression of lines by the discard,\r\n ignore, and retain commands. If crt is set, the messages longer\r\n than the number of lines specified by the crt variable shall be\r\n paged through the command specified by the PAGER environment\r\n variable.\r\n Display Message\r\n Synopsis:\r\n p[rint] [msglist]\r\n t[ype] [msglist]\r\n Write the specified messages to standard output. If crt is set,\r\n the messages longer than the number of lines specified by the crt\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 25 of 39\n\nvariable shall be paged through the command specified by the PAGER\r\n environment variable.\r\n Quit\r\n Synopsis:\r\n q[uit]\r\n end-of-file\r\n Terminate mailx, storing messages that were read in mbox (if the\r\n current mailbox is the system mailbox and unless hold is set),\r\n deleting messages that have been explicitly saved (unless keepsave\r\n is set), discarding messages that have been deleted, and saving\r\n all remaining messages in the mailbox.\r\n Reply to a Message List\r\n Synopsis:\r\n R[eply] [msglist]\r\n R[espond] [msglist]\r\n Mail a reply message to the sender of each message in the msglist.\r\n The subject line shall be formed by concatenating Re:\u003cspace\u003e\r\n (unless it already begins with that string) and the subject from\r\n the first message. If record is set to a filename, the response\r\n shall be saved at the end of that file.\r\n See also the flipr variable.\r\n Reply to a Message\r\n Synopsis:\r\n r[eply] [message]\r\n r[espond] [message]\r\n Mail a reply message to all recipients included in the header of\r\n the message. The subject line shall be formed by concatenating\r\n Re:\u003cspace\u003e (unless it already begins with that string) and the\r\n subject from the message. If record is set to a filename, the\r\n response shall be saved at the end of that file.\r\n See also the flipr variable.\r\n Retain Header Fields\r\n Synopsis:\r\n ret[ain] [header-field...]\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 26 of 39\n\nRetain the specified header fields when writing messages. This\r\n command shall override all discard and ignore commands. The\r\n comparison of header fields shall be in a case-insensitive manner.\r\n If no arguments are specified, write a list of the currently\r\n retained header fields to standard output; the listing need not\r\n reflect the same order of header fields that were entered.\r\n Save Messages\r\n Synopsis:\r\n s[ave] [file]\r\n s[ave] [msglist] file\r\n S[ave] [msglist]\r\n Save the specified messages in the file named by the pathname\r\n file, or the mbox if the file argument is omitted. The file shall\r\n be created if it does not exist; otherwise, the messages shall be\r\n appended to the file. The message shall be put in the state saved,\r\n and shall behave as specified in the description of the saved\r\n state when the current mailbox is exited by the quit or file\r\n command.\r\n In the capitalized form, save the specified messages in a file\r\n whose name is derived from the author of the first message. The\r\n name of the file shall be taken to be the author's name with all\r\n network addressing stripped off. See also the Copy, followup, and\r\n Followup commands and outfolder variable.\r\n Set Variables\r\n Synopsis:\r\n se[t] [name[=[string]] ...] [name=number ...] [noname ...]\r\n Define one or more variables called name. The variable can be\r\n given a null, string, or numeric value. Quoting and\r\n \u003cbackslash\u003e-escapes can occur anywhere in string, as described\r\n previously, as if the string portion of the argument were the\r\n entire argument. The forms name and name= shall be equivalent to\r\n name=\"\" for variables that take string values. The set command\r\n without arguments shall write a list of all defined variables and\r\n their values. The no name form shall be equivalent to unset name.\r\n Invoke a Shell\r\n Synopsis:\r\n sh[ell]\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 27 of 39\n\nInvoke an interactive command interpreter (see also SHELL).\r\n Display Message Size\r\n Synopsis:\r\n si[ze] [msglist]\r\n Write the size in bytes of each of the specified messages.\r\n Read mailx Commands From a File\r\n Synopsis:\r\n so[urce] file\r\n Read and execute commands from the file named by the pathname file\r\n and return to command mode.\r\n Display Beginning of Messages\r\n Synopsis:\r\n to[p] [msglist]\r\n Write the top few lines of each of the specified messages. If the\r\n toplines variable is set, it is taken as the number of lines to\r\n write. The default shall be 5.\r\n Touch Messages\r\n Synopsis:\r\n tou[ch] [msglist]\r\n Touch the specified messages. If any message in msglist is not\r\n specifically deleted nor saved in a file, it shall be placed in\r\n the mbox upon normal termination. See exit and quit.\r\n Delete Aliases\r\n Synopsis:\r\n una[lias] [alias]...\r\n Delete the specified alias names. If a specified alias does not\r\n exist, the results are unspecified.\r\n Undelete Messages\r\n Synopsis:\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 28 of 39\n\nu[ndelete] [msglist]\r\n Change the state of the specified messages from deleted to read.\r\n If autoprint is set, the last message of those restored shall be\r\n written. If msglist is not specified, the message shall be\r\n selected as follows:\r\n * If there are any deleted messages that follow the current\r\n message, the first of these shall be chosen.\r\n * Otherwise, the last deleted message that also precedes the\r\n current message shall be chosen.\r\n Unset Variables\r\n Synopsis:\r\n uns[et] name...\r\n Cause the specified variables to be erased.\r\n Edit Message with Full-Screen Editor\r\n Synopsis:\r\n v[isual] [msglist]\r\n Edit the given messages with a screen editor. Each message shall\r\n be placed in a temporary file, and the utility named by the VISUAL\r\n variable shall be invoked to edit each file in sequence. The\r\n default editor shall be vi.\r\n The visual command does not modify the contents of those messages\r\n in the mailbox.\r\n Write Messages to a File\r\n Synopsis:\r\n w[rite] [msglist] file\r\n Write the given messages to the file specified by the pathname\r\n file, minus the message header. Otherwise, it shall be equivalent\r\n to the save command.\r\n Scroll Header Display\r\n Synopsis:\r\n z[+|-]\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 29 of 39\n\nScroll the header display forward (if '+' is specified or if no\r\n option is specified) or backward (if '-' is specified) one\r\n screenful. The number of headers written shall be set by the\r\n screen variable.\r\n Invoke Shell Command\r\n Synopsis:\r\n !command\r\n Invoke the command interpreter specified by SHELL with two\r\n arguments: -c and command. (See also sh -c.) If the bang\r\n variable is set, each unescaped occurrence of '!' in command\r\n shall be replaced with the command executed by the previous !\r\n command or ~! command escape.\r\n Null Command\r\n Synopsis:\r\n # comment\r\n This null command (comment) shall be ignored by mailx.\r\n Display Current Message Number\r\n Synopsis:\r\n =\r\n Write the current message number.\r\n Command Escapes in mailx\r\n The following commands can be entered only from input mode, by\r\n beginning a line with the escape character (by default, \u003ctilde\u003e\r\n ('~')). See the escape variable description for changing this\r\n special character. The format for the commands shall be:\r\n \u003cescape-character\u003e\u003ccommand-char\u003e\u003cseparator\u003e[\u003carguments\u003e]\r\n where the \u003cseparator\u003e can be zero or more \u003cblank\u003e characters.\r\n In the following descriptions, the application shall ensure that\r\n the argument command (but not mailx-command) is a shell command\r\n string. Any string acceptable to the command interpreter specified\r\n by the SHELL variable when it is invoked as SHELL -c\r\n command_string shall be valid. The command can be presented as\r\n multiple arguments (that is, quoting is not required).\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 30 of 39\n\nCommand escapes that are listed with msglist or mailx-command\r\n arguments are invalid in Send Mode and produce unspecified\r\n results.\r\n ~! command\r\n Invoke the command interpreter specified by SHELL with\r\n two arguments: -c and command; and then return to input\r\n mode. If the bang variable is set, each unescaped\r\n occurrence of '!' in command shall be replaced with the\r\n command executed by the previous ! command or ~!\r\n command escape.\r\n ~. Simulate end-of-file (terminate message input).\r\n ~: mailx-command, ~_ mailx-command\r\n Perform the command-level request.\r\n ~? Write a summary of command escapes.\r\n ~A This shall be equivalent to ~i Sign.\r\n ~a This shall be equivalent to ~i sign.\r\n ~b name...\r\n Add the names to the blind carbon copy (Bcc) list.\r\n ~c name...\r\n Add the names to the carbon copy (Cc) list.\r\n ~d Read in the dead-letter file. See DEAD for a description\r\n of this file.\r\n ~e Invoke the editor, as specified by the EDITOR\r\n environment variable, on the partial message.\r\n ~f [msglist]\r\n Forward the specified messages. The specified messages\r\n shall be inserted into the current message without\r\n alteration. This command escape also shall insert\r\n message headers into the message with field selection\r\n affected by the discard, ignore, and retain commands.\r\n ~F [msglist]\r\n This shall be the equivalent of the ~f command escape,\r\n except that all headers shall be included in the\r\n message, regardless of previous discard, ignore, and\r\n retain commands.\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 31 of 39\n\n~h If standard input is a terminal, prompt for a Subject\r\n line and the To, Cc, and Bcc lists. Other\r\n implementation-defined headers may also be presented for\r\n editing. If the field is written with an initial value,\r\n it can be edited as if it had just been typed.\r\n ~i string Insert the value of the named variable, followed by a\r\n \u003cnewline\u003e, into the text of the message. If the string\r\n is unset or null, the message shall not be changed.\r\n ~m [msglist]\r\n Insert the specified messages into the message,\r\n prefixing non-empty lines with the string in the\r\n indentprefix variable. This command escape also shall\r\n insert message headers into the message, with field\r\n selection affected by the discard, ignore, and retain\r\n commands.\r\n ~M [msglist]\r\n This shall be the equivalent of the ~m command escape,\r\n except that all headers shall be included in the\r\n message, regardless of previous discard, ignore, and\r\n retain commands.\r\n ~p Write the message being entered. If the message is\r\n longer than crt lines (see Internal Variables in mailx),\r\n the output shall be paginated as described for the PAGER\r\n variable.\r\n ~q Quit (see the quit command) from input mode by\r\n simulating an interrupt. If the body of the message is\r\n not empty, the partial message shall be saved in the\r\n dead-letter file. See DEAD for a description of this\r\n file.\r\n ~r file, ~\u003c file, ~r !command, ~\u003c !command\r\n Read in the file specified by the pathname file. If the\r\n argument begins with an \u003cexclamation-mark\u003e ('!'), the\r\n rest of the string shall be taken as an arbitrary system\r\n command; the command interpreter specified by SHELL\r\n shall be invoked with two arguments: -c and command.\r\n The standard output of command shall be inserted into\r\n the message.\r\n ~s string Set the subject line to string.\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 32 of 39\n\n~t name...\r\n Add the given names to the To list.\r\n ~v Invoke the full-screen editor, as specified by the\r\n VISUAL environment variable, on the partial message.\r\n ~w file Write the partial message, without the header, onto the\r\n file named by the pathname file. The file shall be\r\n created or the message shall be appended to it if the\r\n file exists.\r\n ~x Exit as with ~q, except the message shall not be saved\r\n in the dead-letter file.\r\n ~| command\r\n Pipe the body of the message through the given command\r\n by invoking the command interpreter specified by SHELL\r\n with two arguments: -c and command. If the command\r\n returns a successful exit status, the standard output of\r\n the command shall replace the message. Otherwise, the\r\n message shall remain unchanged. If the command fails, an\r\n error message giving the exit status shall be written.\r\nEXIT STATUS         top\r\n When the -e option is specified, the following exit values are\r\n returned:\r\n 0 Mail was found.\r\n \u003e0 Mail was not found or an error occurred.\r\n Otherwise, the following exit values are returned:\r\n 0 Successful completion; note that this status implies that\r\n all messages were sent, but it gives no assurances that any\r\n of them were actually delivered.\r\n \u003e0 An error occurred.\r\nCONSEQUENCES OF ERRORS         top\r\n When in input mode (Receive Mode) or Send Mode:\r\n * If an error is encountered processing an input line beginning\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 33 of 39\n\nwith a \u003ctilde\u003e ('~') character, (see Command Escapes in\r\n mailx), a diagnostic message shall be written to standard\r\n error, and the message being composed may be modified, but\r\n this condition shall not prevent the message from being sent.\r\n * Other errors shall prevent the sending of the message.\r\n When in command mode:\r\n * Default.\r\n The following sections are informative.\r\nAPPLICATION USAGE         top\r\n Delivery of messages to remote systems requires the existence of\r\n communication paths to such systems. These need not exist.\r\n Input lines are limited to {LINE_MAX} bytes, but mailers between\r\n systems may impose more severe line-length restrictions. This\r\n volume of POSIX.1‐2017 does not place any restrictions on the\r\n length of messages handled by mailx, and for delivery of local\r\n messages the only limitations should be the normal problems of\r\n available disk space for the target mail file. When sending\r\n messages to external machines, applications are advised to limit\r\n messages to less than 100000 bytes because some mail gateways\r\n impose message-length restrictions.\r\n The format of the system mailbox is intentionally unspecified. Not\r\n all systems implement system mailboxes as flat files, particularly\r\n with the advent of multimedia mail messages. Some system mailboxes\r\n may be multiple files, others records in a database. The internal\r\n format of the messages themselves is specified with the historical\r\n format from Version 7, but only after the messages have been saved\r\n in some file other than the system mailbox. This was done so that\r\n many historical applications expecting text-file mailboxes are not\r\n broken.\r\n Some new formats for messages can be expected in the future,\r\n probably including binary data, bit maps, and various multimedia\r\n objects. As described here, mailx is not prohibited from handling\r\n such messages, but it must store them as text files in secondary\r\n mailboxes (unless some extension, such as a variable or command\r\n line option, is used to change the stored format). Its method of\r\n doing so is implementation-defined and might include translating\r\n the data into text file-compatible or readable form or omitting\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 34 of 39\n\ncertain portions of the message from the stored output.\r\n The discard and ignore commands are not inverses of the retain\r\n command. The retain command discards all header-fields except\r\n those explicitly retained. The discard command keeps all header-\r\n fields except those explicitly discarded. If headers exist on the\r\n retained header list, discard and ignore commands are ignored.\r\nEXAMPLES         top\r\n None.\r\nRATIONALE         top\r\n The standard developers felt strongly that a method for\r\n applications to send messages to specific users was necessary. The\r\n obvious example is a batch utility, running non-interactively,\r\n that wishes to communicate errors or results to a user. However,\r\n the actual format, delivery mechanism, and method of reading the\r\n message are clearly beyond the scope of this volume of\r\n POSIX.1‐2017.\r\n The intent of this command is to provide a simple, portable\r\n interface for sending messages non-interactively. It merely\r\n defines a ``front-end'' to the historical mail system. It is\r\n suggested that implementations explicitly denote the sender and\r\n recipient in the body of the delivered message. Further\r\n specification of formats for either the message envelope or the\r\n message itself were deliberately not made, as the industry is in\r\n the midst of changing from the current standards to a more\r\n internationalized standard and it is probably incorrect, at this\r\n time, to require either one.\r\n Implementations are encouraged to conform to the various delivery\r\n mechanisms described in the CCITT X.400 standards or to the\r\n equivalent Internet standards, described in Internet Request for\r\n Comment (RFC) documents RFC 819, RFC 920, RFC 921, RFC 1123, and\r\n RFC 5322 (which succeeded RFC 822).\r\n Many historical systems modified each body line that started with\r\n From by prefixing the 'F' with '\u003e'. It is unnecessary, but\r\n allowed, to do that when the string does not follow a blank line\r\n because it cannot be confused with the next header.\r\n The edit and visual commands merely edit the specified messages in\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 35 of 39\n\na temporary file. They do not modify the contents of those\r\n messages in the mailbox; such a capability could be added as an\r\n extension, such as by using different command names.\r\n The restriction on a subject line being {LINE_MAX}-10 bytes is\r\n based on the historical format that consumes 10 bytes for\r\n Subject: and the trailing \u003cnewline\u003e. Many historical mailers\r\n that a message may encounter on other systems are not able to\r\n handle lines that long, however.\r\n Like the utilities logger and lp, mailx admittedly is difficult to\r\n test. This was not deemed sufficient justification to exclude this\r\n utility from this volume of POSIX.1‐2017. It is also arguable that\r\n it is, in fact, testable, but that the tests themselves are not\r\n portable.\r\n When mailx is being used by an application that wishes to receive\r\n the results as if none of the User Portability Utilities option\r\n features were supported, the DEAD environment variable must be set\r\n to /dev/null. Otherwise, it may be subject to the file creations\r\n described in mailx ASYNCHRONOUS EVENTS. Similarly, if the MAILRC\r\n environment variable is not set to /dev/null, historical versions\r\n of mailx and Mail read initialization commands from a file before\r\n processing begins. Since the initialization that a user specifies\r\n could alter the contents of messages an application is trying to\r\n send, such applications must set MAILRC to /dev/null.\r\n The description of LC_TIME uses ``may affect'' because many\r\n historical implementations do not or cannot manipulate the date\r\n and time strings in the incoming mail headers. Some headers found\r\n in incoming mail do not have enough information to determine the\r\n timezone in which the mail originated, and, therefore, mailx\r\n cannot convert the date and time strings into the internal form\r\n that then is parsed by routines like strftime() that can take\r\n LC_TIME settings into account. Changing all these times to a user-\r\n specified format is allowed, but not required.\r\n The paginator selected when PAGER is null or unset is partially\r\n unspecified to allow the System V historical practice of using pg\r\n as the default. Bypassing the pagination function, such as by\r\n declaring that cat is the paginator, would not meet with the\r\n intended meaning of this description. However, any ``portable\r\n user'' would have to set PAGER explicitly to get his or her\r\n preferred paginator on all systems. The paginator choice was made\r\n partially unspecified, unlike the VISUAL editor choice (mandated\r\n to be vi) because most historical pagers follow a common theme of\r\n user input, whereas editors differ dramatically.\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 36 of 39\n\nOptions to specify addresses as cc (carbon copy) or bcc (blind\r\n carbon copy) were considered to be format details and were\r\n omitted.\r\n A zero exit status implies that all messages were sent, but it\r\n gives no assurances that any of them were actually delivered. The\r\n reliability of the delivery mechanism is unspecified and is an\r\n appropriate marketing distinction between systems.\r\n In order to conform to the Utility Syntax Guidelines, a solution\r\n was required to the optional file option-argument to -f. By\r\n making file an operand, the guidelines are satisfied and users\r\n remain portable. However, it does force implementations to\r\n support usage such as:\r\n mailx -fin mymail.box\r\n The no name method of unsetting variables is not present in all\r\n historical systems, but it is in System V and provides a logical\r\n set of commands corresponding to the format of the display of\r\n options from the mailx set command without arguments.\r\n The ask and asksub variables are the names selected by BSD and\r\n System V, respectively, for the same feature. They are synonyms in\r\n this volume of POSIX.1‐2017.\r\n The mailx echo command was not documented in the BSD version and\r\n has been omitted here because it is not obviously useful for\r\n interactive users.\r\n The default prompt on the System V mailx is a \u003cquestion-mark\u003e, on\r\n BSD Mail an \u003campersand\u003e. Since this volume of POSIX.1‐2017 chose\r\n the mailx name, it kept the System V default, assuming that BSD\r\n users would not have difficulty with this minor incompatibility\r\n (that they can override).\r\n The meanings of r and R are reversed between System V mailx and\r\n SunOS Mail. Once again, since this volume of POSIX.1‐2017 chose\r\n the mailx name, it kept the System V default, but allows the SunOS\r\n user to achieve the desired results using flipr, an internal\r\n variable in System V mailx, although it has not been documented in\r\n the SVID.\r\n The indentprefix variable, the retain and unalias commands, and\r\n the ~F and ~M command escapes were adopted from 4.3 BSD Mail.\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 37 of 39\n\nThe version command was not included because no sufficiently\r\n general specification of the version information could be devised\r\n that would still be useful to a portable user. This command name\r\n should be used by suppliers who wish to provide version\r\n information about the mailx command.\r\n The ``implementation-specific (unspecified) system start-up file''\r\n historically has been named /etc/mailx.rc, but this specific name\r\n and location are not required.\r\n The intent of the wording for the next command is that if any\r\n command has already displayed the current message it should\r\n display a following message, but, otherwise, it should display the\r\n current message. Consider the command sequence:\r\n next 3\r\n delete 3\r\n next\r\n where the autoprint option was not set. The normative text\r\n specifies that the second next command should display a message\r\n following the third message, because even though the current\r\n message has not been displayed since it was set by the delete\r\n command, it has been displayed since the current message was\r\n anything other than message number 3. This does not always match\r\n historical practice in some implementations, where the command\r\n file address followed by next (or the default command) would skip\r\n the message for which the user had searched.\r\nFUTURE DIRECTIONS         top\r\n None.\r\nSEE ALSO         top\r\n Chapter 2, Shell Command Language, ed(1p), ls(1p), more(1p),\r\n vi(1p)\r\n The Base Definitions volume of POSIX.1‐2017, Chapter 8,\r\n Environment Variables, Section 12.2, Utility Syntax Guidelines\r\nCOPYRIGHT         top\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 38 of 39\n\nPortions of this text are reprinted and reproduced in electronic\r\n form from IEEE Std 1003.1-2017, Standard for Information\r\n Technology -- Portable Operating System Interface (POSIX), The\r\n Open Group Base Specifications Issue 7, 2018 Edition, Copyright\r\n (C) 2018 by the Institute of Electrical and Electronics Engineers,\r\n Inc and The Open Group. In the event of any discrepancy between\r\n this version and the original IEEE and The Open Group Standard,\r\n the original IEEE and The Open Group Standard is the referee\r\n document. The original Standard can be obtained online at\r\n http://www.opengroup.org/unix/online.html .\r\n Any typographical or formatting errors that appear in this page\r\n are most likely to have been introduced during the conversion of\r\n the source files to man page format. To report such errors, see\r\n https://www.kernel.org/doc/man-pages/reporting_bugs.html .\r\nIEEE/The Open Group 2017 MAILX(1P)\r\nPages that refer to this page: logger(1p),  lp(1p),  uucp(1p),  uuencode(1p)\r\nSource: https://man7.org/linux/man-pages/man1/mailx.1p.html\r\nhttps://man7.org/linux/man-pages/man1/mailx.1p.html\r\nPage 39 of 39",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"origins": [
		"web"
	],
	"references": [
		"https://man7.org/linux/man-pages/man1/mailx.1p.html"
	],
	"report_names": [
		"mailx.1p.html"
	],
	"threat_actors": [
		{
			"id": "1f6ae238-765f-4495-9d54-6a7883d7a319",
			"created_at": "2022-10-25T16:07:24.573456Z",
			"updated_at": "2026-04-10T02:00:05.037738Z",
			"deleted_at": null,
			"main_name": "TA511",
			"aliases": [
				"MAN1",
				"Moskalvzapoe"
			],
			"source_name": "ETDA:TA511",
			"tools": [
				"Agentemis",
				"Chanitor",
				"Cobalt Strike",
				"CobaltStrike",
				"Ficker Stealer",
				"Hancitor",
				"NetSupport",
				"NetSupport Manager",
				"NetSupport Manager RAT",
				"NetSupport RAT",
				"NetSupportManager RAT",
				"cobeacon"
			],
			"source_id": "ETDA",
			"reports": null
		},
		{
			"id": "542cf9d0-9c68-428c-aff8-81b6f59dc985",
			"created_at": "2023-02-15T02:01:49.554105Z",
			"updated_at": "2026-04-10T02:00:03.347115Z",
			"deleted_at": null,
			"main_name": "Moskalvzapoe",
			"aliases": [
				"MAN1",
				"TA511"
			],
			"source_name": "MISPGALAXY:Moskalvzapoe",
			"tools": [],
			"source_id": "MISPGALAXY",
			"reports": null
		}
	],
	"ts_created_at": 1775434013,
	"ts_updated_at": 1775826786,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/1c17d0b4e3b1833859e259622863897efc1ed029.pdf",
		"text": "https://archive.orkl.eu/1c17d0b4e3b1833859e259622863897efc1ed029.txt",
		"img": "https://archive.orkl.eu/1c17d0b4e3b1833859e259622863897efc1ed029.jpg"
	}
}