logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

mailx.1p (74659B)


  1. '\" et
  2. .TH MAILX "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. mailx
  12. \(em process messages
  13. .SH SYNOPSIS
  14. .SS "Send Mode"
  15. .sp
  16. .RS 4
  17. .nf
  18. mailx \fB[\fR-s \fIsubject\fB]\fI address\fR...
  19. .fi
  20. .P
  21. .RE
  22. .SS "Receive Mode"
  23. .sp
  24. .RS 4
  25. .nf
  26. mailx -e
  27. .P
  28. mailx \fB[\fR-HiNn\fB] [\fR-F\fB] [\fR-u \fIuser\fB]\fR
  29. .P
  30. mailx -f \fB[\fR-HiNn\fB] [\fR-F\fB] [\fIfile\fB]\fR
  31. .fi
  32. .P
  33. .RE
  34. .SH DESCRIPTION
  35. The
  36. .IR mailx
  37. utility provides a message sending and receiving facility. It has two
  38. major modes, selected by the options used: Send Mode and Receive
  39. Mode.
  40. .P
  41. On systems that do not support the User Portability Utilities option,
  42. an application using
  43. .IR mailx
  44. shall have the ability to send messages in an unspecified manner (Send
  45. Mode). Unless the first character of one or more lines is
  46. <tilde>
  47. (\c
  48. .BR '\(ti' ),
  49. all characters in the input message shall appear in the delivered
  50. message, but additional characters may be inserted in the message
  51. before it is retrieved.
  52. .P
  53. On systems supporting the User Portability Utilities option,
  54. mail-receiving capabilities and other interactive features, Receive
  55. Mode, described below, also shall be enabled.
  56. .SS "Send Mode"
  57. .P
  58. Send Mode can be used by applications or users to send messages from
  59. the text in standard input.
  60. .SS "\*!Receive Mode"
  61. .P
  62. Receive Mode is more oriented towards interactive users. Mail can be read
  63. and sent in this interactive mode.
  64. .P
  65. When reading mail,
  66. .IR mailx
  67. provides commands to facilitate saving, deleting, and responding to
  68. messages. When sending mail,
  69. .IR mailx
  70. allows editing, reviewing, and other modification of the message as it
  71. is entered.
  72. .P
  73. Incoming mail shall be stored in one or more unspecified locations for
  74. each user, collectively called the system
  75. .IR mailbox
  76. for that user. When
  77. .IR mailx
  78. is invoked in Receive Mode, the system mailbox shall be the default
  79. place to find new mail. As messages are read, they shall be marked to
  80. be moved to a secondary file for storage, unless specific action is
  81. taken. This secondary file is called the
  82. .BR mbox
  83. and is normally located in the directory referred to by the
  84. .IR HOME
  85. environment variable (see
  86. .IR MBOX
  87. in the ENVIRONMENT VARIABLES section for a description of this file).
  88. Messages shall remain in this file until explicitly removed. When the
  89. .BR \-f
  90. option is used to read mail messages from secondary files, messages
  91. shall be retained in those files unless specifically removed. All
  92. three of these locations\(emsystem mailbox,
  93. .BR mbox ,
  94. and secondary file\(emare referred to in this section as simply
  95. ``mailboxes'', unless more specific identification is required.
  96. .SH OPTIONS
  97. The
  98. .IR mailx
  99. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  100. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  101. .P
  102. The following options shall be supported. (Only the
  103. .BR \-s
  104. .IR subject
  105. option shall be required on all systems. The other options are required
  106. only on systems supporting the User Portability Utilities option.)
  107. .IP "\fB\-e\fP" 10
  108. Test for the presence of mail in the system mailbox. The
  109. .IR mailx
  110. utility shall write nothing and exit with a successful return code if
  111. there is mail to read.
  112. .IP "\fB\-f\fP" 10
  113. Read messages from the file named by the
  114. .IR file
  115. operand instead of the system mailbox. (See also
  116. .BR folder .)
  117. If no
  118. .IR file
  119. operand is specified, read messages from
  120. .BR mbox
  121. instead of the system mailbox.
  122. .IP "\fB\-F\fP" 10
  123. Record the message in a file named after the first recipient. The name
  124. is the login-name portion of the address found first on the
  125. .BR To:
  126. line in the mail header. Overrides the
  127. .BR record
  128. variable, if set (see
  129. .IR "Internal Variables in mailx").
  130. .IP "\fB\-H\fP" 10
  131. Write a header summary only.
  132. .IP "\fB\-i\fP" 10
  133. Ignore interrupts. (See also
  134. .BR ignore .)
  135. .IP "\fB\-n\fP" 10
  136. Do not initialize from the system default start-up file. See the
  137. EXTENDED DESCRIPTION section.
  138. .IP "\fB\-N\fP" 10
  139. Do not write an initial header summary.
  140. .IP "\fB\-s\0\fIsubject\fR" 10
  141. Set the
  142. .BR Subject
  143. header field to
  144. .IR subject .
  145. All characters in the
  146. .IR subject
  147. string shall appear in the delivered message. The results are
  148. unspecified if
  149. .IR subject
  150. is longer than
  151. {LINE_MAX}
  152. \- 10 bytes or contains a
  153. <newline>.
  154. .IP "\fB\-u\0\fIuser\fR" 10
  155. Read the system mailbox of the login name
  156. .IR user .
  157. This shall only be successful if the invoking user has appropriate
  158. privileges to read the system mailbox of that user.
  159. .SH OPERANDS
  160. The following operands shall be supported:
  161. .IP "\fIaddress\fR" 10
  162. Addressee of message. When
  163. .BR \-n
  164. is specified and no user start-up files are accessed (see the EXTENDED
  165. DESCRIPTION section), the user or application shall ensure this is an
  166. address to pass to the mail delivery system. Any system or user
  167. start-up files may enable aliases (see
  168. .BR alias
  169. under
  170. .IR "Commands in mailx")
  171. that may modify the form of
  172. .IR address
  173. before it is passed to the mail delivery system.
  174. .IP "\fIfile\fR" 10
  175. A pathname of a file to be read instead of the system mailbox when
  176. .BR \-f
  177. is specified. The meaning of the
  178. .IR file
  179. option-argument shall be affected by the contents of the
  180. .BR folder
  181. internal variable; see
  182. .IR "Internal Variables in mailx".
  183. .SH STDIN
  184. When
  185. .IR mailx
  186. is invoked in Send Mode (the first synopsis line), standard input shall
  187. be the message to be delivered to the specified addresses.
  188. When in Receive Mode, user commands shall be accepted from
  189. .IR stdin .
  190. If the User Portability Utilities option is not supported, standard
  191. input lines beginning with a
  192. <tilde>
  193. (\c
  194. .BR '\(ti' )
  195. character produce unspecified results.
  196. .P
  197. If the User Portability Utilities option is supported, then in both
  198. Send and Receive Modes, standard input lines beginning with the escape
  199. character (usually
  200. <tilde>
  201. (\c
  202. .BR '\(ti' ))
  203. shall affect processing as described in
  204. .IR "Command Escapes in mailx".
  205. .SH "INPUT FILES"
  206. When
  207. .IR mailx
  208. is used as described by this volume of POSIX.1\(hy2017, the
  209. .IR file
  210. option-argument (see the
  211. .BR \-f
  212. option) and the
  213. .BR mbox
  214. shall be text files containing mail messages, formatted as described in
  215. the OUTPUT FILES section. The nature of the system mailbox is
  216. unspecified; it need not be a file.
  217. .SH "ENVIRONMENT VARIABLES"
  218. Some of the functionality described in this section shall be provided on
  219. implementations that support the User Portability Utilities option
  220. as described in the text, and is not further shaded for this option.
  221. .P
  222. The following environment variables shall affect the execution of
  223. .IR mailx :
  224. .IP "\fIDEAD\fP" 10
  225. Determine the pathname of the file in which to save partial messages in
  226. case of interrupts or delivery errors. The default shall be
  227. .BR dead.letter
  228. in the directory named by the
  229. .IR HOME
  230. variable. The behavior of
  231. .IR mailx
  232. in saving partial messages is unspecified if the User Portability
  233. Utilities option is not supported and
  234. .IR DEAD
  235. is not defined with the value
  236. .BR /dev/null .
  237. .IP "\fIEDITOR\fP" 10
  238. Determine the name of a utility to invoke when the
  239. .BR edit
  240. (see
  241. .IR "Commands in mailx")
  242. or
  243. .BR ~e
  244. (see
  245. .IR "Command Escapes in mailx")
  246. command is used. The default editor is unspecified.
  247. On XSI-conformant systems it is
  248. .IR ed .
  249. The effects of this variable are unspecified if the User Portability
  250. Utilities option is not supported.
  251. .IP "\fIHOME\fP" 10
  252. Determine the pathname of the user's home directory.
  253. .IP "\fILANG\fP" 10
  254. Provide a default value for the internationalization variables that are
  255. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  256. .IR "Section 8.2" ", " "Internationalization Variables"
  257. for the precedence of internationalization variables used to determine
  258. the values of locale categories.)
  259. .IP "\fILC_ALL\fP" 10
  260. If set to a non-empty string value, override the values of all the
  261. other internationalization variables.
  262. .IP "\fILC_CTYPE\fP" 10
  263. Determine the locale for the interpretation of sequences of bytes of
  264. text data as characters (for example, single-byte as opposed to
  265. multi-byte characters in arguments and input files) and the handling of
  266. case-insensitive address and header-field comparisons.
  267. .IP "\fILC_TIME\fP" 10
  268. This variable may determine the format and contents of the date and
  269. time strings written by
  270. .IR mailx .
  271. This volume of POSIX.1\(hy2017 specifies the effects of this variable only for systems
  272. supporting the User Portability Utilities option.
  273. .IP "\fILC_MESSAGES\fP" 10
  274. .br
  275. Determine the locale that should be used to affect the format and
  276. contents of diagnostic messages written to standard error and
  277. informative messages written to standard output.
  278. .IP "\fILISTER\fP" 10
  279. Determine a string representing the command for writing the contents of
  280. the
  281. .BR folder
  282. directory to standard output when the
  283. .BR folders
  284. command is given (see
  285. .BR folders
  286. in
  287. .IR "Commands in mailx").
  288. Any string acceptable as a
  289. .IR command_string
  290. operand to the
  291. .IR sh
  292. .BR \-c
  293. command shall be valid. If this variable is null or not set, the output
  294. command shall be
  295. .IR ls .
  296. The effects of this variable are unspecified if the User Portability
  297. Utilities option is not supported.
  298. .IP "\fIMAILRC\fP" 10
  299. Determine the pathname of the user start-up file. The default shall be
  300. .BR .mailrc
  301. in the directory referred to by the
  302. .IR HOME
  303. environment variable. The behavior of
  304. .IR mailx
  305. is unspecified if the User Portability Utilities option is not
  306. supported and
  307. .IR MAILRC
  308. is not defined with the value
  309. .BR /dev/null .
  310. .IP "\fIMBOX\fP" 10
  311. Determine a pathname of the file to save messages from the system
  312. mailbox that have been read. The
  313. .BR exit
  314. command shall override this function, as shall saving the message
  315. explicitly in another file. The default shall be
  316. .BR mbox
  317. in the directory named by the
  318. .IR HOME
  319. variable. The effects of this variable are unspecified if the User
  320. Portability Utilities option is not supported.
  321. .IP "\fINLSPATH\fP" 10
  322. Determine the location of message catalogs for the processing of
  323. .IR LC_MESSAGES .
  324. .IP "\fIPAGER\fP" 10
  325. Determine a string representing an output filtering or pagination
  326. command for writing the output to the terminal. Any string acceptable
  327. as a
  328. .IR command_string
  329. operand to the
  330. .IR sh
  331. .BR \-c
  332. command shall be valid. When standard output is a terminal device, the
  333. message output shall be piped through the command if the
  334. .IR mailx
  335. internal variable
  336. .BR crt
  337. is set to a value less the number of lines in the message; see
  338. .IR "Internal Variables in mailx".
  339. If the
  340. .IR PAGER
  341. variable is null or not set, the paginator shall be either
  342. .IR more
  343. or another paginator utility documented in the system documentation.
  344. The effects of this variable are unspecified if the User Portability
  345. Utilities option is not supported.
  346. .IP "\fISHELL\fP" 10
  347. Determine the name of a preferred command interpreter. The default
  348. shall be
  349. .IR sh .
  350. The effects of this variable are unspecified if the User Portability
  351. Utilities option is not supported.
  352. .IP "\fITERM\fP" 10
  353. If the internal variable
  354. .BR screen
  355. is not specified, determine the name of the terminal type to indicate
  356. in an unspecified manner the number of lines in a screenful of headers.
  357. If
  358. .IR TERM
  359. is not set or is set to null, an unspecified default terminal type
  360. shall be used and the value of a screenful is unspecified. The effects
  361. of this variable are unspecified if the User Portability Utilities
  362. option is not supported.
  363. .IP "\fITZ\fP" 10
  364. This variable may determine the timezone used to calculate date and
  365. time strings written by
  366. .IR mailx .
  367. If
  368. .IR TZ
  369. is unset or null, an unspecified default timezone shall be used.
  370. .IP "\fIVISUAL\fP" 10
  371. Determine a pathname of a utility to invoke when the
  372. .BR visual
  373. command (see
  374. .IR "Commands in mailx")
  375. or
  376. .BR ~v
  377. command-escape (see
  378. .IR "Command Escapes in mailx")
  379. is used. If this variable is null or not set, the full-screen editor
  380. shall be
  381. .IR vi .
  382. The effects of this variable are unspecified if the User Portability
  383. Utilities option is not supported.
  384. .SH "ASYNCHRONOUS EVENTS"
  385. When
  386. .IR mailx
  387. is in Send Mode and standard input is not a terminal, it shall take the
  388. standard action for all signals.
  389. .P
  390. In
  391. Receive Mode, or in
  392. Send Mode when standard input is a terminal, if a SIGINT signal
  393. is received:
  394. .IP " 1." 4
  395. If in command mode, the current command, if there is one, shall be
  396. aborted, and a command-mode prompt shall be written.
  397. .IP " 2." 4
  398. If in input mode:
  399. .RS 4
  400. .IP " a." 4
  401. If
  402. .BR ignore
  403. is set,
  404. .IR mailx
  405. shall write
  406. .BR \(dq@\en\(dq ,
  407. discard the current input line, and continue processing, bypassing the
  408. message-abort mechanism described in item 2b.
  409. .IP " b." 4
  410. If the interrupt was received while sending mail, either when in
  411. Receive Mode or in
  412. Send Mode, a message shall be written, and another
  413. subsequent interrupt, with no other intervening characters typed, shall
  414. be required to abort the mail message.
  415. If in Receive Mode and another
  416. interrupt is received, a command-mode prompt shall be written.
  417. If in Send Mode and another interrupt is received,
  418. .IR mailx
  419. shall terminate with a non-zero status.
  420. .RS 4
  421. .P
  422. In both cases listed in item b, if the message is not empty:
  423. .IP " i." 5
  424. If
  425. .BR save
  426. is enabled and the file named by
  427. .IR DEAD
  428. can be created, the message shall be written to the file named by
  429. .IR DEAD .
  430. If the file exists, the message shall be written to replace the
  431. contents of the file.
  432. .IP ii. 5
  433. If
  434. .BR save
  435. is not enabled, or
  436. the file named by
  437. .IR DEAD
  438. cannot be created, the message shall not be saved.
  439. .RE
  440. .RE
  441. .P
  442. The
  443. .IR mailx
  444. utility shall take the standard action for all other signals.
  445. .SH STDOUT
  446. In command and input modes, all output, including prompts and messages,
  447. shall be written to standard output.
  448. .SH STDERR
  449. The standard error shall be used only for diagnostic messages.
  450. .SH "OUTPUT FILES"
  451. Various
  452. .IR mailx
  453. commands and command escapes can create or add to files, including the
  454. .BR mbox ,
  455. the dead-letter file, and secondary mailboxes. When
  456. .IR mailx
  457. is used as described in this volume of POSIX.1\(hy2017, these files shall be text files,
  458. formatted as follows:
  459. .sp
  460. .RS
  461. \fRline beginning with \fBFrom<space>
  462. .br
  463. [\fRone or more \fIheader-lines\fR; see
  464. .IR "Commands in mailx"]
  465. .br
  466. \fIempty line
  467. .br
  468. \fB[\fRzero or more \fIbody lines
  469. .br
  470. \fIempty line]
  471. .br
  472. \fB[\fRline beginning with \fBFrom<space>...]\fR
  473. .RE
  474. .P
  475. where each message begins with the
  476. .BR "From\0<space>"
  477. line shown, preceded by the beginning of the file or an empty line.
  478. (The
  479. .BR "From <space>"
  480. line is considered to be part of the message header, but not one of the
  481. header-lines referred to in
  482. .IR "Commands in mailx";
  483. thus, it shall not be affected by the
  484. .BR discard ,
  485. .BR ignore ,
  486. or
  487. .BR retain
  488. commands.) The formats of the remainder of the
  489. .BR "From <space>"
  490. line and any additional header lines are unspecified, except that none
  491. shall be empty. The format of a message body line is also unspecified,
  492. except that no line following an empty line shall start with
  493. .BR "From <space>" ;
  494. .IR mailx
  495. shall modify any such user-entered message body lines (following an
  496. empty line and beginning with
  497. .BR "From <space>" )
  498. by adding one or more characters to precede the
  499. .BR 'F' ;
  500. it may add these characters to
  501. .BR "From <space>"
  502. lines that are not preceded by an empty line.
  503. .P
  504. When a message from the system mailbox or entered by the user is not a
  505. text file, it is implementation-defined how such a message is stored
  506. in files written by
  507. .IR mailx .
  508. .SH "EXTENDED DESCRIPTION"
  509. The functionality in the entire EXTENDED DESCRIPTION section shall
  510. be provided on implementations supporting the User Portability
  511. Utilities option.
  512. The functionality described in this section shall be provided on
  513. implementations that support the User Portability Utilities option
  514. (and the rest of this section is not further shaded for this option).
  515. .P
  516. The
  517. .IR mailx
  518. utility need not support for all character encodings in all
  519. circumstances. For example, inter-system mail may be restricted to
  520. 7-bit data by the underlying network, 8-bit data need not be portable
  521. to non-internationalized systems, and so on. Under these
  522. circumstances, it is recommended that only characters defined in the
  523. ISO/IEC\ 646:\|1991 standard International Reference Version (equivalent to ASCII) 7-bit range
  524. of characters be used.
  525. .P
  526. When
  527. .IR mailx
  528. is invoked using one of the Receive Mode synopsis forms, it shall write
  529. a page of header-summary lines (if
  530. .BR \-N
  531. was not specified and there are messages, see below), followed by a
  532. prompt indicating that
  533. .IR mailx
  534. can accept regular commands (see
  535. .IR "Commands in mailx");
  536. this is termed
  537. .IR "command mode" .
  538. The page of header-summary lines shall contain the first new message if
  539. there are new messages, or the first unread message if there are unread
  540. messages, or the first message. When
  541. .IR mailx
  542. is invoked using the Send Mode synopsis and standard input is a
  543. terminal, if no subject is specified on the command line and the
  544. .BR asksub
  545. variable is set, a prompt for the subject shall be written. At this
  546. point,
  547. .IR mailx
  548. shall be in input mode. This input mode shall also be entered when using
  549. one of the Receive Mode synopsis forms and a reply or new message is
  550. composed using the
  551. .BR reply ,
  552. .BR Reply ,
  553. .BR followup ,
  554. .BR Followup ,
  555. or
  556. .BR mail
  557. commands and standard input is a terminal. When the message is typed
  558. and the end of the message is encountered, the message shall be passed to
  559. the mail delivery software. Commands can be entered by beginning a line
  560. with the escape character (by default,
  561. <tilde>
  562. (\c
  563. .BR '\(ti' ))
  564. followed by a single command letter and optional arguments. See
  565. .IR "Commands in mailx"
  566. for a summary of these commands. It is unspecified what effect these
  567. commands will have if standard input is not a terminal when a message
  568. is entered using either the Send Mode synopsis, or the Read Mode
  569. commands
  570. .BR reply ,
  571. .BR Reply ,
  572. .BR followup ,
  573. .BR Followup ,
  574. or
  575. .BR mail .
  576. .TP 10
  577. .BR Note:
  578. For notational convenience, this section uses the default escape
  579. character,
  580. <tilde>,
  581. in all references and examples.
  582. .P
  583. .P
  584. At any time, the behavior of
  585. .IR mailx
  586. shall be governed by a set of environmental and internal variables.
  587. These are flags and valued parameters that can be set and cleared via
  588. the
  589. .IR mailx
  590. .BR set
  591. and
  592. .BR unset
  593. commands.
  594. .P
  595. Regular commands are of the form:
  596. .sp
  597. .RS 4
  598. .nf
  599. \fB[\fIcommand\fB] [\fImsglist\fB] [\fIargument \fR...\fB]
  600. .fi
  601. .P
  602. .RE
  603. .P
  604. If no
  605. .IR command
  606. is specified in command mode,
  607. .BR next
  608. shall be assumed. In input mode, commands shall be recognized by the
  609. escape character, and lines not treated as commands shall be taken as
  610. input for the message.
  611. .P
  612. In command mode, each message shall be assigned a sequential number,
  613. starting with 1.
  614. .P
  615. All messages have a state that shall affect how they are displayed in
  616. the header summary and how they are retained or deleted upon
  617. termination of
  618. .IR mailx .
  619. There is at any time the notion of a
  620. .IR current
  621. message, which shall be marked by a
  622. .BR '>'
  623. at the beginning of a line in the header summary. When
  624. .IR mailx
  625. is invoked using one of the Receive Mode synopsis forms, the current
  626. message shall be the first new message, if there is a new message, or
  627. the first unread message if there is an unread message, or the first
  628. message if there are any messages, or unspecified if there are no
  629. messages in the mailbox. Each command that takes an optional list of
  630. messages (\fImsglist\fP) or an optional single message (\fImessage\fP)
  631. on which to operate shall leave the current message set to the
  632. highest-numbered message of the messages specified, unless the command
  633. deletes messages, in which case the current message shall be set to the
  634. first undeleted message (that is, a message not in the deleted state)
  635. after the highest-numbered message deleted by the command, if one
  636. exists, or the first undeleted message before the highest-numbered
  637. message deleted by the command, if one exists, or to an unspecified
  638. value if there are no remaining undeleted messages. All messages
  639. shall be in one of the following states:
  640. .IP "\fInew\fR" 10
  641. The message is present in the system mailbox and has not been viewed by
  642. the user or moved to any other state. Messages in state
  643. .IR new
  644. when
  645. .IR mailx
  646. quits shall be retained in the system mailbox.
  647. .IP "\fIunread\fR" 10
  648. The message has been present in the system mailbox for more than one
  649. invocation of
  650. .IR mailx
  651. and has not been viewed by the user or moved to any other state.
  652. Messages in state
  653. .IR unread
  654. when
  655. .IR mailx
  656. quits shall be retained in the system mailbox.
  657. .IP "\fIread\fR" 10
  658. The message has been processed by one of the following commands:
  659. .BR ~f ,
  660. .BR ~m ,
  661. .BR ~F ,
  662. .BR ~M ,
  663. .BR copy ,
  664. .BR mbox ,
  665. .BR next ,
  666. .BR pipe ,
  667. .BR print ,
  668. .BR Print ,
  669. .BR top ,
  670. .BR type ,
  671. .BR Type ,
  672. .BR undelete .
  673. The
  674. .BR delete ,
  675. .BR dp ,
  676. and
  677. .BR dt
  678. commands may also cause the next message to be marked as
  679. .IR read ,
  680. depending on the value of the
  681. .BR autoprint
  682. variable. Messages that are in the system mailbox and in state
  683. .IR read
  684. when
  685. .IR mailx
  686. quits shall be saved in the
  687. .BR mbox ,
  688. unless the internal variable
  689. .BR hold
  690. was set. Messages that are in the
  691. .BR mbox
  692. or in a secondary mailbox and in state
  693. .IR read
  694. when
  695. .IR mailx
  696. quits shall be retained in their current location.
  697. .IP "\fIdeleted\fR" 10
  698. The message has been processed by one of the following commands:
  699. .BR delete ,
  700. .BR dp ,
  701. .BR dt .
  702. Messages in state
  703. .IR deleted
  704. when
  705. .IR mailx
  706. quits shall be deleted. Deleted messages shall be ignored until
  707. .IR mailx
  708. quits or changes mailboxes or they are specified to the undelete
  709. command; for example, the message specification /\c
  710. .IR string
  711. shall only search the subject lines of messages that have not yet been
  712. deleted, unless the command operating on the list of messages is
  713. .BR undelete .
  714. No deleted message or deleted message header shall be displayed by any
  715. .IR mailx
  716. command other than
  717. .BR undelete .
  718. .IP "\fIpreserved\fR" 10
  719. The message has been processed by a
  720. .BR preserve
  721. command. When
  722. .IR mailx
  723. quits, the message shall be retained in its current location.
  724. .IP "\fIsaved\fR" 10
  725. The message has been processed by one of the following commands:
  726. .BR save
  727. or
  728. .BR write .
  729. If the current mailbox is the system mailbox, and the internal variable
  730. .BR keepsave
  731. is set, messages in the state saved shall be saved to the file
  732. designated by the
  733. .IR MBOX
  734. variable (see the ENVIRONMENT VARIABLES section). If the current
  735. mailbox is the system mailbox, messages in the state
  736. .IR saved
  737. shall be deleted from the current mailbox, when the
  738. .BR quit
  739. or
  740. .BR file
  741. command is used to exit the current mailbox.
  742. .P
  743. The header-summary line for each message shall indicate the state of
  744. the message.
  745. .P
  746. Many commands take an optional list of messages (\c
  747. .IR msglist )
  748. on which to operate, which defaults to the current message. A
  749. .IR msglist
  750. is a list of message specifications separated by
  751. <blank>
  752. characters, which can include:
  753. .IP "\fRn\fR" 8
  754. Message number
  755. .IR n .
  756. .IP "\fR+\fR" 8
  757. The next undeleted message, or the next deleted message for the
  758. .BR undelete
  759. command.
  760. .IP "\fR\-\fR" 8
  761. The next previous undeleted message, or the next previous deleted
  762. message for the
  763. .BR undelete
  764. command.
  765. .IP "\fR.\fR" 8
  766. The current message.
  767. .IP "\fR^\fR" 8
  768. The first undeleted message, or the first deleted message for the
  769. .BR undelete
  770. command.
  771. .IP "\fR$\fR" 8
  772. The last message.
  773. .IP "\fR*\fR" 8
  774. All messages.
  775. .IP "\fRn\(hym\fR" 8
  776. An inclusive range of message numbers.
  777. .IP "\fIaddress\fR" 8
  778. All messages from
  779. .IR address ;
  780. any address as shown in a header summary shall be matchable in this
  781. form.
  782. .IP "/\fIstring\fR" 8
  783. All messages with
  784. .IR string
  785. in the subject line (case ignored).
  786. .IP "\fR:c\fR" 8
  787. All messages of type
  788. .IR c ,
  789. where
  790. .IR c
  791. shall be one of:
  792. .RS 8
  793. .IP "\fRd\fR" 6
  794. Deleted messages.
  795. .IP "\fRn\fR" 6
  796. New messages.
  797. .IP "\fRo\fR" 6
  798. Old messages (any not in state
  799. .IR read
  800. or
  801. .IR new ).
  802. .IP "\fRr\fR" 6
  803. Read messages.
  804. .IP "\fRu\fR" 6
  805. Unread messages.
  806. .RE
  807. .P
  808. Other commands take an optional message (\c
  809. .IR message )
  810. on which to operate, which defaults to the current message. All of the
  811. forms allowed for
  812. .IR msglist
  813. are also allowed for
  814. .IR message ,
  815. but if more than one message is specified, only the first shall be
  816. operated on.
  817. .P
  818. Other arguments are usually arbitrary strings whose usage depends on
  819. the command involved.
  820. .SS "Start-Up in mailx"
  821. .P
  822. At start-up time,
  823. .IR mailx
  824. shall take the following steps in sequence:
  825. .IP " 1." 4
  826. Establish all variables at their stated default values.
  827. .IP " 2." 4
  828. Process command line options, overriding corresponding default values.
  829. .IP " 3." 4
  830. Import any of the
  831. .IR DEAD ,
  832. .IR EDITOR ,
  833. .IR MBOX ,
  834. .IR LISTER ,
  835. .IR PAGER ,
  836. .IR SHELL ,
  837. or
  838. .IR VISUAL
  839. variables that are present in the environment, overriding the
  840. corresponding default values.
  841. .IP " 4." 4
  842. Read
  843. .IR mailx
  844. commands from an unspecified system start-up file, unless the
  845. .BR \-n
  846. option is given, to initialize any internal
  847. .IR mailx
  848. variables and aliases.
  849. .IP " 5." 4
  850. Process the user start-up file of
  851. .IR mailx
  852. commands named in the user
  853. .IR MAILRC
  854. variable.
  855. .P
  856. Most regular
  857. .IR mailx
  858. commands are valid inside start-up files, the most common use being to
  859. set up initial display options and alias lists. The following commands
  860. shall be invalid in a start-up file:
  861. .BR ! ,
  862. .BR edit ,
  863. .BR hold ,
  864. .BR mail ,
  865. .BR preserve ,
  866. .BR reply ,
  867. .BR Reply ,
  868. .BR shell ,
  869. .BR visual ,
  870. .BR Copy ,
  871. .BR followup ,
  872. and
  873. .BR Followup .
  874. Any errors in a start-up file shall either cause
  875. .IR mailx
  876. to terminate with a diagnostic message and a non-zero status or to
  877. continue after writing a diagnostic message, ignoring the remainder of
  878. the lines in the file.
  879. .P
  880. A blank line in a start-up file shall be ignored.
  881. .SS "Internal Variables in mailx"
  882. .P
  883. The following variables are internal
  884. .IR mailx
  885. variables. Each internal variable can be set via the
  886. .IR mailx
  887. .BR set
  888. command at any time. The
  889. .BR unset
  890. and
  891. .BR "set\0no"
  892. .IR name
  893. commands can be used to erase variables.
  894. .P
  895. In the following list, variables shown as:
  896. .sp
  897. .RS 4
  898. .nf
  899. variable
  900. .fi
  901. .P
  902. .RE
  903. .P
  904. represent Boolean values. Variables shown as:
  905. .sp
  906. .RS 4
  907. .nf
  908. variable=\fIvalue\fP
  909. .fi
  910. .P
  911. .RE
  912. .P
  913. shall be assigned string or numeric values. For string values, the
  914. rules in
  915. .IR "Commands in mailx"
  916. concerning filenames and quoting shall also apply.
  917. .P
  918. The defaults specified here may be changed by the unspecified system
  919. start-up file unless the user specifies the
  920. .BR \-n
  921. option.
  922. .IP "\fBallnet\fP" 10
  923. All network names whose login name components match shall be treated as
  924. identical. This shall cause the
  925. .IR msglist
  926. message specifications to behave similarly. The default shall be
  927. .BR noallnet .
  928. See also the
  929. .BR alternates
  930. command and the
  931. .BR metoo
  932. variable.
  933. .IP "\fBappend\fR" 10
  934. Append messages to the end of the
  935. .BR mbox
  936. file upon termination instead of placing them at the beginning. The
  937. default shall be
  938. .BR noappend .
  939. This variable shall not affect the
  940. .BR save
  941. command when saving to
  942. .BR mbox .
  943. .IP "\fBask\fR,\0\fBasksub\fR" 10
  944. Prompt for a subject line on outgoing mail if one is not specified on
  945. the command line with the
  946. .BR \-s
  947. option. The
  948. .BR ask
  949. and
  950. .BR asksub
  951. forms are synonyms; the system shall refer to
  952. .BR asksub
  953. and
  954. .BR noasksub
  955. in its messages, but shall accept
  956. .BR ask
  957. and
  958. .BR noask
  959. as user input to mean
  960. .BR asksub
  961. and
  962. .BR noasksub .
  963. It shall not be possible to set both
  964. .BR ask
  965. and
  966. .BR noasksub ,
  967. or
  968. .BR noask
  969. and
  970. .BR asksub .
  971. The default shall be
  972. .BR asksub ,
  973. but no prompting shall be done if standard input is not a terminal.
  974. .IP "\fBaskbcc\fR" 10
  975. Prompt for the blind copy list. The default shall be
  976. .BR noaskbcc .
  977. .IP "\fBaskcc\fR" 10
  978. Prompt for the copy list. The default shall be
  979. .BR noaskcc .
  980. .IP "\fBautoprint\fR" 10
  981. Enable automatic writing of messages after
  982. .BR delete
  983. and
  984. .BR undelete
  985. commands. The default shall be
  986. .BR noautoprint .
  987. .IP "\fBbang\fR" 10
  988. Enable the special-case treatment of
  989. <exclamation-mark>
  990. characters (\c
  991. .BR '!' )
  992. in escape command lines; see the
  993. .BR escape
  994. command and
  995. .IR "Command Escapes in mailx".
  996. The default shall be
  997. .BR nobang ,
  998. disabling the expansion of
  999. .BR '!'
  1000. in the
  1001. .IR command
  1002. argument to the
  1003. .BR ~!
  1004. command and the
  1005. .BR ~<! \c
  1006. .IR command
  1007. escape.
  1008. .IP "\fBcmd\fR=\fIcommand\fR" 10
  1009. .br
  1010. Set the default command to be invoked by the
  1011. .BR pipe
  1012. command. The default shall be
  1013. .BR nocmd .
  1014. .IP "\fBcrt\fR=\fInumber\fR" 10
  1015. Pipe messages having more than
  1016. .IR number
  1017. lines through the command specified by the value of the
  1018. .IR PAGER
  1019. variable. The default shall be
  1020. .BR nocrt .
  1021. If it is set to null, the value used is implementation-defined.
  1022. .IP "\fBdebug\fR" 10
  1023. Enable verbose diagnostics for debugging. Messages are not delivered.
  1024. The default shall be
  1025. .BR nodebug .
  1026. .IP "\fBdot\fR" 10
  1027. When
  1028. .BR dot
  1029. is set, a
  1030. <period>
  1031. on a line by itself during message input from a terminal shall also
  1032. signify end-of-file (in addition to normal end-of-file). The default
  1033. shall be
  1034. .BR nodot .
  1035. If
  1036. .BR ignoreeof
  1037. is set (see below), a setting of
  1038. .BR nodot
  1039. shall be ignored and the
  1040. <period>
  1041. is the only method to terminate input mode.
  1042. .IP "\fBescape\fR=\fIc\fR" 10
  1043. Set the command escape character to be the character
  1044. .BR 'c' .
  1045. By default, the command escape character shall be
  1046. <tilde>.
  1047. If
  1048. .BR escape
  1049. is unset,
  1050. <tilde>
  1051. shall be used; if it is set to null, command escaping shall be disabled.
  1052. .IP "\fBflipr\fR" 10
  1053. Reverse the meanings of the
  1054. .BR R
  1055. and
  1056. .BR r
  1057. commands. The default shall be
  1058. .BR noflipr .
  1059. .IP "\fBfolder\fR=\fIdirectory\fR" 10
  1060. .br
  1061. The default directory for saving mail files. User-specified filenames
  1062. beginning with a
  1063. <plus-sign>
  1064. (\c
  1065. .BR '\(pl' )
  1066. shall be expanded by preceding the filename with this directory name
  1067. to obtain the real pathname. If
  1068. .IR directory
  1069. does not start with a
  1070. <slash>
  1071. (\c
  1072. .BR '/' ),
  1073. the contents of
  1074. .IR HOME
  1075. shall be prefixed to it. The default shall be
  1076. .BR nofolder .
  1077. If
  1078. .BR folder
  1079. is unset or set to null, user-specified filenames beginning with
  1080. .BR '\(pl'
  1081. shall refer to files in the current directory that begin with the
  1082. literal
  1083. .BR '\(pl'
  1084. character. See also
  1085. .BR outfolder
  1086. below. The
  1087. .BR folder
  1088. value need not affect the processing of the files named in
  1089. .IR MBOX
  1090. and
  1091. .IR DEAD .
  1092. .IP "\fBheader\fR" 10
  1093. Enable writing of the header summary when entering
  1094. .IR mailx
  1095. in Receive Mode. The default shall be
  1096. .BR header .
  1097. .IP "\fBhold\fR" 10
  1098. Preserve all messages that are read in the system mailbox instead of
  1099. putting them in the
  1100. .BR mbox
  1101. save file. The default shall be
  1102. .BR nohold .
  1103. .IP "\fBignore\fR" 10
  1104. Ignore interrupts while entering messages. The default shall be
  1105. .BR noignore .
  1106. .IP "\fBignoreeof\fR" 10
  1107. Ignore normal end-of-file during message input. Input can be
  1108. terminated only by entering a
  1109. <period>
  1110. (\c
  1111. .BR '.' )
  1112. on a line by itself or by the
  1113. .BR ~.
  1114. command escape. The default shall be
  1115. .BR noignoreeof .
  1116. See also
  1117. .BR dot
  1118. above.
  1119. .IP "\fBindentprefix\fR=\fIstring\fR" 10
  1120. .br
  1121. A string that shall be added as a prefix to each line that is inserted
  1122. into the message by the
  1123. .BR ~m
  1124. command escape. This variable shall default to one
  1125. <tab>.
  1126. .IP "\fBkeep\fR" 10
  1127. When a system mailbox, secondary mailbox, or
  1128. .BR mbox
  1129. is empty, truncate it to zero length instead of removing it. The
  1130. default shall be
  1131. .BR nokeep .
  1132. .IP "\fBkeepsave\fR" 10
  1133. Keep the messages that have been saved from the system mailbox into
  1134. other files in the file designated by the variable
  1135. .IR MBOX ,
  1136. instead of deleting them. The default shall be
  1137. .BR nokeepsave .
  1138. .IP "\fBmetoo\fR" 10
  1139. Suppress the deletion of the login name of the user from the recipient
  1140. list when replying to a message or sending to a group. The default
  1141. shall be
  1142. .BR nometoo .
  1143. .IP "\fBonehop\fR" 10
  1144. When responding to a message that was originally sent to several
  1145. recipients, the other recipient addresses are normally forced to be
  1146. relative to the originating author's machine for the response. This
  1147. flag disables alteration of the recipients' addresses, improving
  1148. efficiency in a network where all machines can send directly to all
  1149. other machines (that is, one hop away). The default shall be
  1150. .BR noonehop .
  1151. .IP "\fBoutfolder\fR" 10
  1152. Cause the files used to record outgoing messages to be located in the
  1153. directory specified by the
  1154. .BR folder
  1155. variable unless the pathname is absolute. The default shall be
  1156. .BR nooutfolder .
  1157. See the
  1158. .BR record
  1159. variable.
  1160. .IP "\fBpage\fR" 10
  1161. Insert a
  1162. <form-feed>
  1163. after each message sent through the pipe created by the
  1164. .BR pipe
  1165. command. The default shall be
  1166. .BR nopage .
  1167. .IP "\fBprompt\fR=\fIstring\fR" 10
  1168. .br
  1169. Set the command-mode prompt to
  1170. .IR string .
  1171. If
  1172. .IR string
  1173. is null or if
  1174. .BR noprompt
  1175. is set, no prompting shall occur. The default shall be to prompt with
  1176. the string
  1177. .BR \(dq?\0\(dq .
  1178. .IP "\fBquiet\fR" 10
  1179. Refrain from writing the opening message and version when entering
  1180. .IR mailx .
  1181. The default shall be
  1182. .BR noquiet .
  1183. .IP "\fBrecord\fR=\fIfile\fR" 10
  1184. Record all outgoing mail in the file with the pathname
  1185. .IR file .
  1186. The default shall be
  1187. .BR norecord .
  1188. See also
  1189. .BR outfolder
  1190. above.
  1191. .IP "\fBsave\fR" 10
  1192. Enable saving of messages in the dead-letter file on interrupt or
  1193. delivery error. See the variable
  1194. .IR DEAD
  1195. for the location of the dead-letter file. The default shall be
  1196. .BR save .
  1197. .IP "\fBscreen\fR=\fInumber\fR" 10
  1198. .br
  1199. Set the number of lines in a screenful of headers for the
  1200. .BR headers
  1201. and
  1202. .BR z
  1203. commands. If
  1204. .BR screen
  1205. is not specified, a value based on the terminal type identified by the
  1206. .IR TERM
  1207. environment variable, the window size, the baud rate, or some
  1208. combination of these shall be used.
  1209. .IP "\fBsendwait\fR" 10
  1210. Wait for the background mailer to finish before returning. The default
  1211. shall be
  1212. .BR nosendwait .
  1213. .IP "\fBshowto\fR" 10
  1214. When the sender of the message was the user who is invoking
  1215. .IR mailx ,
  1216. write the information from the
  1217. .BR To:
  1218. line instead of the
  1219. .BR From:
  1220. line in the header summary. The default shall be
  1221. .BR noshowto .
  1222. .IP "\fBsign\fR=\fIstring\fR" 10
  1223. Set the variable inserted into the text of a message when the
  1224. .BR ~a
  1225. command escape is given. The default shall be
  1226. .BR nosign .
  1227. The character sequences
  1228. .BR '\et'
  1229. and
  1230. .BR '\en'
  1231. shall be recognized in the variable as
  1232. <tab>
  1233. and
  1234. <newline>
  1235. characters, respectively. (See also
  1236. .BR ~i
  1237. in
  1238. .IR "Command Escapes in mailx".)
  1239. .IP "\fBSign\fR=\fIstring\fR" 10
  1240. Set the variable inserted into the text of a message when the
  1241. .BR ~A
  1242. command escape is given. The default shall be
  1243. .BR noSign .
  1244. The character sequences
  1245. .BR '\et'
  1246. and
  1247. .BR '\en'
  1248. shall be recognized in the variable as
  1249. <tab>
  1250. and
  1251. <newline>
  1252. characters, respectively.
  1253. .IP "\fBtoplines\fR=\fInumber\fR" 10
  1254. .br
  1255. Set the number of lines of the message to write with the
  1256. .BR top
  1257. command. The default shall be 5.
  1258. .SS "Commands in mailx"
  1259. .P
  1260. The following
  1261. .IR mailx
  1262. commands shall be provided. In the following list, header refers to
  1263. lines from the message header, as shown in the OUTPUT FILES section.
  1264. Header-line refers to lines within the header that begin with one or
  1265. more non-white-space characters, immediately followed by a
  1266. <colon>
  1267. and white space and continuing until the next line beginning with a
  1268. non-white-space character or an empty line. Header-field refers to the
  1269. portion of a header line prior to the first
  1270. <colon>
  1271. in that line.
  1272. .P
  1273. For each of the commands listed below, the command can be entered as
  1274. the abbreviation (those characters in the Synopsis command word
  1275. preceding the
  1276. .BR '[' ),
  1277. the full command (all characters shown for the command word, omitting
  1278. the
  1279. .BR '['
  1280. and
  1281. .BR ']' ),
  1282. or any truncation of the full command down to the abbreviation. For
  1283. example, the
  1284. .BR exit
  1285. command (shown as \fBex[it]\fR in the Synopsis) can be entered as
  1286. .BR ex ,
  1287. .BR exi ,
  1288. or
  1289. .BR exit .
  1290. .P
  1291. The arguments to commands can be quoted, using the following methods:
  1292. .IP " *" 4
  1293. An argument can be enclosed between paired double-quotes (\c
  1294. .BR \(dq\^\(dq )
  1295. or single-quotes (\c
  1296. .BR '\^' );
  1297. any white space, shell word expansion, or
  1298. <backslash>
  1299. characters within the quotes shall be treated literally as part of the
  1300. argument. A double-quote shall be treated literally within single-quotes
  1301. and \fIvice versa\fP. These special properties of the
  1302. <quotation-mark>
  1303. characters shall occur only when they are paired at the beginning and
  1304. end of the argument.
  1305. .IP " *" 4
  1306. A
  1307. <backslash>
  1308. outside of the enclosing quotes shall be discarded and the following
  1309. character treated literally as part of the argument.
  1310. .IP " *" 4
  1311. An unquoted
  1312. <backslash>
  1313. at the end of a command line shall be discarded and the next line shall
  1314. continue the command.
  1315. .br
  1316. .P
  1317. Filenames, where expected, shall be subjected to the following
  1318. transformations, in sequence:
  1319. .IP " *" 4
  1320. If the filename begins with an unquoted
  1321. <plus-sign>,
  1322. and the
  1323. .BR folder
  1324. variable is defined (see the
  1325. .BR folder
  1326. variable), the
  1327. <plus-sign>
  1328. shall be replaced by the value of the
  1329. .BR folder
  1330. variable followed by a
  1331. <slash>.
  1332. If the
  1333. .BR folder
  1334. variable is unset or is set to null, the filename shall be unchanged.
  1335. .IP " *" 4
  1336. Shell word expansions shall be applied to the filename (see
  1337. .IR "Section 2.6" ", " "Word Expansions").
  1338. If more than a single pathname results from this expansion and the
  1339. command is expecting one file, the effects are unspecified.
  1340. .SS "Declare Aliases"
  1341. .IP "\fISynopsis\fR:" 10
  1342. .sp -1v
  1343. .RS 10
  1344. .sp
  1345. .RS 4
  1346. .nf
  1347. a\fB[\fRlias\fB] [\fIalias \fB[\fIaddress\fR...\fB]]\fR
  1348. g\fB[\fRroup\fB] [\fIalias \fB[\fIaddress\fR...\fB]]\fR
  1349. .fi
  1350. .P
  1351. .RE
  1352. .RE
  1353. .P
  1354. Add the given addresses to the alias specified by
  1355. .IR alias .
  1356. The names shall be substituted when
  1357. .IR alias
  1358. is used as a recipient address specified by the user in an outgoing
  1359. message (that is, other recipients addressed indirectly through the
  1360. .BR reply
  1361. command shall not be substituted in this manner). Mail address alias
  1362. substitution shall apply only when the alias string is used as a full
  1363. address; for example, when
  1364. .BR hlj
  1365. is an alias,
  1366. .IR hlj@posix.com
  1367. does not trigger the alias substitution. If no arguments are given,
  1368. write a listing of the current aliases to standard output. If only an
  1369. .IR alias
  1370. argument is given, write a listing of the specified alias to standard
  1371. output. These listings need not reflect the same order of addresses
  1372. that were entered.
  1373. .SS "Declare Alternatives"
  1374. .IP "\fISynopsis\fR:" 10
  1375. .sp -1v
  1376. .RS 10
  1377. .sp
  1378. .RS 4
  1379. .nf
  1380. alt\fB[\fRernates\fB] \fIname\fR...
  1381. .fi
  1382. .P
  1383. .RE
  1384. .RE
  1385. .P
  1386. (See also the
  1387. .BR metoo
  1388. variable.) Declare a list of alternative names for the user's login.
  1389. When responding to a message, these names shall be removed from the
  1390. list of recipients for the response. The comparison of names shall be
  1391. in a case-insensitive manner. With no arguments,
  1392. .BR alternates
  1393. shall write the current list of alternative names.
  1394. .SS "Change Current Directory"
  1395. .IP "\fISynopsis\fR:" 10
  1396. .sp -1v
  1397. .RS 10
  1398. .sp
  1399. .RS 4
  1400. .nf
  1401. cd \fB[\fIdirectory\fB]\fR
  1402. ch\fB[\fRdir\fB] [\fIdirectory\fB]\fR
  1403. .fi
  1404. .P
  1405. .RE
  1406. .RE
  1407. .P
  1408. Change directory. If
  1409. .IR directory
  1410. is not specified, the contents of
  1411. .IR HOME
  1412. shall be used.
  1413. .SS "Copy Messages"
  1414. .IP "\fISynopsis\fR:" 10
  1415. .sp -1v
  1416. .RS 10
  1417. .sp
  1418. .RS 4
  1419. .nf
  1420. c\fB[\fRopy\fB] [\fIfile\fB]\fR
  1421. c\fB[\fRopy\fB] [\fImsglist\fB] \fIfile\fR
  1422. C\fB[\fRopy\fB] [\fImsglist\fB]\fR
  1423. .fi
  1424. .P
  1425. .RE
  1426. .RE
  1427. .P
  1428. Copy messages to the file named by the pathname
  1429. .IR file
  1430. without marking the messages as saved. Otherwise, it shall be
  1431. equivalent to the
  1432. .BR save
  1433. command.
  1434. .P
  1435. In the capitalized form, save the specified messages in a file whose
  1436. name is derived from the author of the message to be saved, without
  1437. marking the messages as saved. Otherwise, it shall be equivalent to
  1438. the
  1439. .BR Save
  1440. command.
  1441. .SS "Delete Messages"
  1442. .IP "\fISynopsis\fR:" 10
  1443. .sp -1v
  1444. .RS 10
  1445. .sp
  1446. .RS 4
  1447. .nf
  1448. d\fB[\fRelete\fB] [\fImsglist\fB]\fR
  1449. .fi
  1450. .P
  1451. .RE
  1452. .RE
  1453. .P
  1454. Mark messages for deletion from the mailbox. The deletions shall not
  1455. occur until
  1456. .IR mailx
  1457. quits (see the
  1458. .BR quit
  1459. command) or changes mailboxes (see the
  1460. .BR folder
  1461. command). If
  1462. .BR autoprint
  1463. is set and there are messages remaining after the
  1464. .BR delete
  1465. command, the current message shall be written as described for the
  1466. .BR print
  1467. command (see the
  1468. .BR print
  1469. command); otherwise, the
  1470. .IR mailx
  1471. prompt shall be written.
  1472. .SS "Discard Header Fields"
  1473. .IP "\fISynopsis\fR:" 10
  1474. .sp -1v
  1475. .RS 10
  1476. .sp
  1477. .RS 4
  1478. .nf
  1479. di\fB[\fRscard\fB] [\fIheader-field\fR...\fB]\fR
  1480. ig\fB[\fRnore\fB] [\fIheader-field\fR...\fB]\fR
  1481. .fi
  1482. .P
  1483. .RE
  1484. .RE
  1485. .P
  1486. Suppress the specified header fields when writing messages. Specified
  1487. .IR header-fields
  1488. shall be added to the list of suppressed header fields. Examples of
  1489. header fields to ignore are
  1490. .BR status
  1491. and
  1492. .BR cc .
  1493. The fields shall be included when the message is saved. The
  1494. .BR Print
  1495. and
  1496. .BR Type
  1497. commands shall override this command. The comparison of header fields
  1498. shall be in a case-insensitive manner. If no arguments are specified,
  1499. write a list of the currently suppressed header fields to standard
  1500. output; the listing need not reflect the same order of header fields
  1501. that were entered.
  1502. .P
  1503. If both
  1504. .BR retain
  1505. and
  1506. .BR discard
  1507. commands are given,
  1508. .BR discard
  1509. commands shall be ignored.
  1510. .SS "Delete Messages and Display"
  1511. .IP "\fISynopsis\fR:" 10
  1512. .sp -1v
  1513. .RS 10
  1514. .sp
  1515. .RS 4
  1516. .nf
  1517. dp \fB[\fImsglist\fB]\fR
  1518. dt \fB[\fImsglist\fB]\fR
  1519. .fi
  1520. .P
  1521. .RE
  1522. .RE
  1523. .P
  1524. Delete the specified messages as described for the
  1525. .BR delete
  1526. command, except that the
  1527. .BR autoprint
  1528. variable shall have no effect, and the current message shall be written
  1529. only if it was set to a message after the last message deleted by the
  1530. command. Otherwise, an informational message to the effect that there
  1531. are no further messages in the mailbox shall be written, followed by
  1532. the
  1533. .IR mailx
  1534. prompt.
  1535. .SS "Echo a String"
  1536. .IP "\fISynopsis\fR:" 10
  1537. .sp -1v
  1538. .RS 10
  1539. .sp
  1540. .RS 4
  1541. .nf
  1542. ec\fB[\fRho\fB] \fIstring\fR ...
  1543. .fi
  1544. .P
  1545. .RE
  1546. .RE
  1547. .P
  1548. Echo the given strings, equivalent to the shell
  1549. .IR echo
  1550. utility.
  1551. .SS "Edit Messages"
  1552. .IP "\fISynopsis\fR:" 10
  1553. .sp -1v
  1554. .RS 10
  1555. .sp
  1556. .RS 4
  1557. .nf
  1558. e\fB[\fRdit\fB] [\fImsglist\fB]\fR
  1559. .fi
  1560. .P
  1561. .RE
  1562. .RE
  1563. .P
  1564. Edit the given messages. The messages shall be placed in a temporary
  1565. file and the utility named by the
  1566. .IR EDITOR
  1567. variable is invoked to edit each file in sequence. The default
  1568. .IR EDITOR
  1569. is unspecified.
  1570. .P
  1571. The
  1572. .BR edit
  1573. command does not modify the contents of those messages in the mailbox.
  1574. .SS "Exit"
  1575. .IP "\fISynopsis\fR:" 10
  1576. .sp -1v
  1577. .RS 10
  1578. .sp
  1579. .RS 4
  1580. .nf
  1581. ex\fB[\fRit\fB]\fR
  1582. x\fB[\fRit\fB]\fR
  1583. .fi
  1584. .P
  1585. .RE
  1586. .RE
  1587. .P
  1588. Exit from
  1589. .IR mailx
  1590. without changing the mailbox. No messages shall be saved in the
  1591. .BR mbox
  1592. (see also
  1593. .BR quit ).
  1594. .SS "Change Folder"
  1595. .IP "\fISynopsis\fR:" 10
  1596. .sp -1v
  1597. .RS 10
  1598. .sp
  1599. .RS 4
  1600. .nf
  1601. fi\fB[\fRle\fB] [\fIfile\fB]\fR
  1602. fold\fB[\fRer\fB] [\fIfile\fB]\fR
  1603. .fi
  1604. .P
  1605. .RE
  1606. .RE
  1607. .P
  1608. Quit (see the
  1609. .BR quit
  1610. command) from the current file of messages and read in the file named
  1611. by the pathname
  1612. .IR file .
  1613. If no argument is given, the name and status of the current mailbox
  1614. shall be written.
  1615. .P
  1616. Several unquoted special characters shall be recognized when used as
  1617. .IR file
  1618. names, with the following substitutions:
  1619. .IP "\fR%\fR" 8
  1620. The system mailbox for the invoking user.
  1621. .IP "\fR%\fIuser\fR" 8
  1622. The system mailbox for
  1623. .IR user .
  1624. .IP "\fR#\fR" 8
  1625. The previous file.
  1626. .IP "\fR&\fR" 8
  1627. The current
  1628. .BR mbox .
  1629. .IP "\fR+\fIfile\fR" 8
  1630. The named file in the
  1631. .BR folder
  1632. directory. (See the
  1633. .BR folder
  1634. variable.)
  1635. .P
  1636. The default file shall be the current mailbox.
  1637. .SS "Display List of Folders"
  1638. .IP "\fISynopsis\fR:" 10
  1639. .sp -1v
  1640. .RS 10
  1641. .sp
  1642. .RS 4
  1643. .nf
  1644. \fRfolders\fR
  1645. .fi
  1646. .P
  1647. .RE
  1648. .RE
  1649. .P
  1650. Write the names of the files in the directory set by the
  1651. .BR folder
  1652. variable. The command specified by the
  1653. .IR LISTER
  1654. environment variable shall be used (see the ENVIRONMENT VARIABLES
  1655. section).
  1656. .SS "Follow Up Specified Messages"
  1657. .IP "\fISynopsis\fR:" 10
  1658. .sp -1v
  1659. .RS 10
  1660. .sp
  1661. .RS 4
  1662. .nf
  1663. fo\fB[\fRllowup\fB] [\fImessage\fB]\fR
  1664. F\fB[\fRollowup\fB] [\fImsglist\fB]\fR
  1665. .fi
  1666. .P
  1667. .RE
  1668. .RE
  1669. .P
  1670. In the lowercase form, respond to a message, recording the response in
  1671. a file whose name is derived from the author of the message. See also
  1672. the
  1673. .BR save
  1674. and
  1675. .BR copy
  1676. commands and
  1677. .BR outfolder .
  1678. .P
  1679. In the capitalized form, respond to the first message in the
  1680. .IR msglist ,
  1681. sending the message to the author of each message in the
  1682. .IR msglist .
  1683. The subject line shall be taken from the first message and the response
  1684. shall be recorded in a file whose name is derived from the author of
  1685. the first message. See also the
  1686. .BR Save
  1687. and
  1688. .BR Copy
  1689. commands and
  1690. .BR outfolder .
  1691. .P
  1692. Both forms shall override the
  1693. .BR record
  1694. variable, if set.
  1695. .SS "Display Header Summary for Specified Messages"
  1696. .IP "\fISynopsis\fR:" 10
  1697. .sp -1v
  1698. .RS 10
  1699. .sp
  1700. .RS 4
  1701. .nf
  1702. f\fB[\fRrom\fB] [\fImsglist\fB]\fR
  1703. .fi
  1704. .P
  1705. .RE
  1706. .RE
  1707. .P
  1708. Write the header summary for the specified messages.
  1709. .SS "Display Header Summary"
  1710. .IP "\fISynopsis\fR:" 10
  1711. .sp -1v
  1712. .RS 10
  1713. .sp
  1714. .RS 4
  1715. .nf
  1716. h\fB[\fReaders\fB] [\fImessage\fB]\fR
  1717. .fi
  1718. .P
  1719. .RE
  1720. .RE
  1721. .P
  1722. Write the page of headers that includes the message specified. If the
  1723. .IR message
  1724. argument is not specified, the current message shall not change.
  1725. However, if the
  1726. .IR message
  1727. argument is specified, the current message shall become the message
  1728. that appears at the top of the page of headers that includes the
  1729. message specified. The
  1730. .BR screen
  1731. variable sets the number of headers per page. See also the
  1732. .BR z
  1733. command.
  1734. .SS "Help"
  1735. .IP "\fISynopsis\fR:" 10
  1736. .sp -1v
  1737. .RS 10
  1738. .sp
  1739. .RS 4
  1740. .nf
  1741. hel\fB[\fRp\fB]\fR
  1742. ?
  1743. .fi
  1744. .P
  1745. .RE
  1746. .RE
  1747. .P
  1748. Write a summary of commands.
  1749. .SS "Hold Messages"
  1750. .IP "\fISynopsis\fR:" 10
  1751. .sp -1v
  1752. .RS 10
  1753. .sp
  1754. .RS 4
  1755. .nf
  1756. ho\fB[\fRld\fB] [\fImsglist\fB]\fR
  1757. pre\fB[\fRserve\fB] [\fImsglist\fB]\fR
  1758. .fi
  1759. .P
  1760. .RE
  1761. .RE
  1762. .P
  1763. Mark the messages in
  1764. .IR msglist
  1765. to be retained in the mailbox when
  1766. .IR mailx
  1767. terminates. This shall override any commands that might previously
  1768. have marked the messages to be deleted. During the current invocation
  1769. of
  1770. .IR mailx ,
  1771. only the
  1772. .BR delete ,
  1773. .BR dp ,
  1774. or
  1775. .BR dt
  1776. commands shall remove the
  1777. .IR preserve
  1778. marking of a message.
  1779. .SS "Execute Commands Conditionally"
  1780. .IP "\fISynopsis\fR:" 10
  1781. .sp -1v
  1782. .RS 10
  1783. .sp
  1784. .RS 4
  1785. .nf
  1786. i\fB[\fRf\fB]\fR s|r
  1787. \fImail-command\fRs
  1788. el\fB[\fRse\fB]
  1789. \fImail-command\fRs
  1790. en\fB[\fRdif\fB]\fR
  1791. .fi
  1792. .P
  1793. .RE
  1794. .RE
  1795. .P
  1796. Execute commands conditionally, where
  1797. .BR "if\0s"
  1798. executes the following
  1799. .IR mail-command s,
  1800. up to an
  1801. .BR else
  1802. or
  1803. .BR endif ,
  1804. if the program is in Send Mode, and
  1805. .BR "if\0r"
  1806. shall cause the
  1807. .IR mail-command s
  1808. to be executed only in Receive Mode.
  1809. .SS "List Available Commands"
  1810. .IP "\fISynopsis\fR:" 10
  1811. .sp -1v
  1812. .RS 10
  1813. .sp
  1814. .RS 4
  1815. .nf
  1816. l\fB[\fRist\fB]\fR
  1817. .fi
  1818. .P
  1819. .RE
  1820. .RE
  1821. .P
  1822. Write a list of all commands available. No explanation shall be
  1823. given.
  1824. .SS "Mail a Message"
  1825. .IP "\fISynopsis\fR:" 10
  1826. .sp -1v
  1827. .RS 10
  1828. .sp
  1829. .RS 4
  1830. .nf
  1831. m\fB[\fRail\fB] \fIaddress\fR...
  1832. .fi
  1833. .P
  1834. .RE
  1835. .RE
  1836. .P
  1837. Mail a message to the specified addresses or aliases.
  1838. .SS "Direct Messages to mbox"
  1839. .IP "\fISynopsis\fR:" 10
  1840. .sp -1v
  1841. .RS 10
  1842. .sp
  1843. .RS 4
  1844. .nf
  1845. mb\fB[\fRox\fB] [\fImsglist\fB]\fR
  1846. .fi
  1847. .P
  1848. .RE
  1849. .RE
  1850. .P
  1851. Arrange for the given messages to end up in the
  1852. .BR mbox
  1853. save file when
  1854. .IR mailx
  1855. terminates normally. See
  1856. .IR MBOX .
  1857. See also the
  1858. .BR exit
  1859. and
  1860. .BR quit
  1861. commands.
  1862. .SS "Process Next Specified Message"
  1863. .IP "\fISynopsis\fR:" 10
  1864. .sp -1v
  1865. .RS 10
  1866. .sp
  1867. .RS 4
  1868. .nf
  1869. n\fB[\fRext\fB] [\fImessage\fB]\fR
  1870. .fi
  1871. .P
  1872. .RE
  1873. .RE
  1874. .P
  1875. If the current message has not been written (for example, by the
  1876. .BR print
  1877. command) since
  1878. .IR mailx
  1879. started or since any other message was the current message, behave as
  1880. if the
  1881. .BR print
  1882. command was entered. Otherwise, if there is an undeleted message after
  1883. the current message, make it the current message and behave as if the
  1884. .BR print
  1885. command was entered. Otherwise, an informational message to the effect
  1886. that there are no further messages in the mailbox shall be written,
  1887. followed by the
  1888. .IR mailx
  1889. prompt. Should the current message location be the result of an
  1890. immediately preceding
  1891. .BR hold ,
  1892. .BR mbox ,
  1893. .BR preserve ,
  1894. or
  1895. .BR touch
  1896. command,
  1897. .BR next
  1898. will act as if the current message has already been written.
  1899. .SS "Pipe Message"
  1900. .IP "\fISynopsis\fR:" 10
  1901. .sp -1v
  1902. .RS 10
  1903. .sp
  1904. .RS 4
  1905. .nf
  1906. pi\fB[\fRpe\fB] [[\fImsglist\fB] \fIcommand\fB]\fR
  1907. | \fB[[\fImsglist\fB] \fIcommand\fB]\fR
  1908. .fi
  1909. .P
  1910. .RE
  1911. .RE
  1912. .P
  1913. Pipe the messages through the given
  1914. .IR command
  1915. by invoking the command interpreter specified by
  1916. .IR SHELL
  1917. with two arguments:
  1918. .BR \-c
  1919. and
  1920. .IR command .
  1921. (See also
  1922. .IR sh
  1923. .BR \-c .)
  1924. The application shall ensure that the command is given as a single
  1925. argument. Quoting, described previously, can be used to accomplish
  1926. this. If no arguments are given, the current message shall be piped
  1927. through the command specified by the value of the
  1928. .BR cmd
  1929. variable. If the
  1930. .BR page
  1931. variable is set, a
  1932. <form-feed>
  1933. shall be inserted after each message.
  1934. .SS "Display Message with Headers"
  1935. .IP "\fISynopsis\fR:" 10
  1936. .sp -1v
  1937. .RS 10
  1938. .sp
  1939. .RS 4
  1940. .nf
  1941. P\fB[\fRrint\fB] [\fImsglist\fB]\fR
  1942. T\fB[\fRype\fB] [\fImsglist\fB]\fR
  1943. .fi
  1944. .P
  1945. .RE
  1946. .RE
  1947. .P
  1948. Write the specified messages, including all header lines, to standard
  1949. output. Override suppression of lines by the
  1950. .BR discard ,
  1951. .BR ignore ,
  1952. and
  1953. .BR retain
  1954. commands. If
  1955. .BR crt
  1956. is set, the messages longer than the number of lines specified by the
  1957. .BR crt
  1958. variable shall be paged through the command specified by the
  1959. .IR PAGER
  1960. environment variable.
  1961. .SS "Display Message"
  1962. .IP "\fISynopsis\fR:" 10
  1963. .sp -1v
  1964. .RS 10
  1965. .sp
  1966. .RS 4
  1967. .nf
  1968. p\fB[\fRrint\fB] [\fImsglist\fB]\fR
  1969. t\fB[\fRype\fB] [\fImsglist\fB]\fR
  1970. .fi
  1971. .P
  1972. .RE
  1973. .RE
  1974. .P
  1975. Write the specified messages to standard output. If
  1976. .BR crt
  1977. is set, the messages longer than the number of lines specified by the
  1978. .BR crt
  1979. variable shall be paged through the command specified by the
  1980. .IR PAGER
  1981. environment variable.
  1982. .SS "Quit"
  1983. .IP "\fISynopsis\fR:" 10
  1984. .sp -1v
  1985. .RS 10
  1986. .sp
  1987. .RS 4
  1988. .nf
  1989. q\fB[\fRuit\fB]
  1990. \fIend-of-file\fR
  1991. .fi
  1992. .P
  1993. .RE
  1994. .RE
  1995. .P
  1996. Terminate
  1997. .IR mailx ,
  1998. storing messages that were read in
  1999. .BR mbox
  2000. (if the current mailbox is the system mailbox and unless
  2001. .BR hold
  2002. is set), deleting messages that have been explicitly saved (unless
  2003. .BR keepsave
  2004. is set), discarding messages that have been deleted, and saving all
  2005. remaining messages in the mailbox.
  2006. .SS "Reply to a Message List"
  2007. .IP "\fISynopsis\fR:" 10
  2008. .sp -1v
  2009. .RS 10
  2010. .sp
  2011. .RS 4
  2012. .nf
  2013. R\fB[\fReply\fB] [\fImsglist\fB]\fR
  2014. R\fB[\fRespond\fB] [\fImsglist\fB]\fR
  2015. .fi
  2016. .P
  2017. .RE
  2018. .RE
  2019. .P
  2020. Mail a reply message to the sender of each message in the
  2021. .IR msglist .
  2022. The subject line shall be formed by concatenating
  2023. .BR Re: \c
  2024. <space>
  2025. (unless it already begins with that string) and the subject from the
  2026. first message. If
  2027. .BR record
  2028. is set to a filename, the response shall be saved at the end of that
  2029. file.
  2030. .P
  2031. See also the
  2032. .BR flipr
  2033. variable.
  2034. .SS "Reply to a Message"
  2035. .IP "\fISynopsis\fR:" 10
  2036. .sp -1v
  2037. .RS 10
  2038. .sp
  2039. .RS 4
  2040. .nf
  2041. r\fB[\fReply\fB] [\fImessage\fB]\fR
  2042. r\fB[\fRespond\fB] [\fImessage\fB]\fR
  2043. .fi
  2044. .P
  2045. .RE
  2046. .RE
  2047. .P
  2048. Mail a reply message to all recipients included in the header of the
  2049. message. The subject line shall be formed by concatenating
  2050. .BR Re: \c
  2051. <space>
  2052. (unless it already begins with that string) and the subject from the
  2053. message. If
  2054. .BR record
  2055. is set to a filename, the response shall be saved at the end of that
  2056. file.
  2057. .P
  2058. See also the
  2059. .BR flipr
  2060. variable.
  2061. .SS "Retain Header Fields"
  2062. .IP "\fISynopsis\fR:" 10
  2063. .sp -1v
  2064. .RS 10
  2065. .sp
  2066. .RS 4
  2067. .nf
  2068. ret\fB[\fRain\fB] [\fIheader-field\fR...\fB]\fR
  2069. .fi
  2070. .P
  2071. .RE
  2072. .RE
  2073. .P
  2074. Retain the specified header fields when writing messages. This command
  2075. shall override all
  2076. .BR discard
  2077. and
  2078. .BR ignore
  2079. commands. The comparison of header fields shall be in a
  2080. case-insensitive manner. If no arguments are specified, write a list
  2081. of the currently retained header fields to standard output; the listing
  2082. need not reflect the same order of header fields that were entered.
  2083. .SS "Save Messages"
  2084. .IP "\fISynopsis\fR:" 10
  2085. .sp -1v
  2086. .RS 10
  2087. .sp
  2088. .RS 4
  2089. .nf
  2090. s\fB[\fRave\fB] [\fIfile\fB]\fR
  2091. s\fB[\fRave\fB] [\fImsglist\fB] \fIfile\fR
  2092. S\fB[\fRave\fB] [\fImsglist\fB]\fR
  2093. .fi
  2094. .P
  2095. .RE
  2096. .RE
  2097. .P
  2098. Save the specified messages in the file named by the pathname
  2099. .IR file ,
  2100. or the
  2101. .BR mbox
  2102. if the
  2103. .IR file
  2104. argument is omitted. The file shall be created if it does not exist;
  2105. otherwise, the messages shall be appended to the file. The message
  2106. shall be put in the state
  2107. .IR saved ,
  2108. and shall behave as specified in the description of the
  2109. .IR saved
  2110. state when the current mailbox is exited by the
  2111. .BR quit
  2112. or
  2113. .BR file
  2114. command.
  2115. .P
  2116. In the capitalized form, save the specified messages in a file whose
  2117. name is derived from the author of the first message. The name of the
  2118. file shall be taken to be the author's name with all network addressing
  2119. stripped off. See also the
  2120. .BR Copy ,
  2121. .BR followup ,
  2122. and
  2123. .BR Followup
  2124. commands and
  2125. .BR outfolder
  2126. variable.
  2127. .SS "Set Variables"
  2128. .IP "\fISynopsis\fR:" 10
  2129. .sp -1v
  2130. .RS 10
  2131. .sp
  2132. .RS 4
  2133. .nf
  2134. se\fB[\fRt\fB] [\fIname\fB[\fR=\fB[\fIstring\fB]] \fR...\fB] [\fIname\fR=\fInumber \fR...\fB] [\fRno\fIname \fR...\fB]\fR
  2135. .fi
  2136. .P
  2137. .RE
  2138. .RE
  2139. .P
  2140. Define one or more variables called
  2141. .IR name .
  2142. The variable can be given a null, string, or numeric value. Quoting and
  2143. <backslash>-escapes
  2144. can occur anywhere in
  2145. .IR string ,
  2146. as described previously, as if the
  2147. .IR string
  2148. portion of the argument were the entire argument. The forms
  2149. .IR name
  2150. and
  2151. .IR name =
  2152. shall be equivalent to
  2153. .IR name =""
  2154. for variables that take string values. The
  2155. .BR set
  2156. command without arguments shall write a list of all defined variables
  2157. and their values. The
  2158. .BR no
  2159. .IR name
  2160. form shall be equivalent to
  2161. .BR unset
  2162. .IR name .
  2163. .SS "Invoke a Shell"
  2164. .IP "\fISynopsis\fR:" 10
  2165. .sp -1v
  2166. .RS 10
  2167. .sp
  2168. .RS 4
  2169. .nf
  2170. sh\fB[\fRell\fB]\fR
  2171. .fi
  2172. .P
  2173. .RE
  2174. .RE
  2175. .P
  2176. Invoke an interactive command interpreter (see also
  2177. .IR SHELL ).
  2178. .SS "Display Message Size"
  2179. .IP "\fISynopsis\fR:" 10
  2180. .sp -1v
  2181. .RS 10
  2182. .sp
  2183. .RS 4
  2184. .nf
  2185. si\fB[\fRze\fB] [\fImsglist\fB]\fR
  2186. .fi
  2187. .P
  2188. .RE
  2189. .RE
  2190. .P
  2191. Write the size in bytes of each of the specified messages.
  2192. .SS "Read mailx Commands From a File"
  2193. .IP "\fISynopsis\fR:" 10
  2194. .sp -1v
  2195. .RS 10
  2196. .sp
  2197. .RS 4
  2198. .nf
  2199. so\fB[\fRurce\fB] \fIfile\fR
  2200. .fi
  2201. .P
  2202. .RE
  2203. .RE
  2204. .P
  2205. Read and execute commands from the file named by the pathname
  2206. .IR file
  2207. and return to command mode.
  2208. .SS "Display Beginning of Messages"
  2209. .IP "\fISynopsis\fR:" 10
  2210. .sp -1v
  2211. .RS 10
  2212. .sp
  2213. .RS 4
  2214. .nf
  2215. to\fB[\fRp\fB] [\fImsglist\fB]\fR
  2216. .fi
  2217. .P
  2218. .RE
  2219. .RE
  2220. .P
  2221. Write the top few lines of each of the specified messages. If the
  2222. .BR toplines
  2223. variable is set, it is taken as the number of lines to write. The
  2224. default shall be 5.
  2225. .SS "Touch Messages"
  2226. .IP "\fISynopsis\fR:" 10
  2227. .sp -1v
  2228. .RS 10
  2229. .sp
  2230. .RS 4
  2231. .nf
  2232. tou\fB[\fRch\fB] [\fImsglist\fB]\fR
  2233. .fi
  2234. .P
  2235. .RE
  2236. .RE
  2237. .P
  2238. Touch the specified messages. If any message in
  2239. .IR msglist
  2240. is not specifically deleted nor saved in a file, it shall be placed in
  2241. the
  2242. .BR mbox
  2243. upon normal termination. See
  2244. .BR exit
  2245. and
  2246. .BR quit .
  2247. .SS "Delete Aliases"
  2248. .IP "\fISynopsis\fR:" 10
  2249. .sp -1v
  2250. .RS 10
  2251. .sp
  2252. .RS 4
  2253. .nf
  2254. una\fB[\fRlias\fB] [\fIalias\fB]\fR...
  2255. .fi
  2256. .P
  2257. .RE
  2258. .RE
  2259. .P
  2260. Delete the specified alias names. If a specified alias does not exist,
  2261. the results are unspecified.
  2262. .SS "Undelete Messages"
  2263. .IP "\fISynopsis\fR:" 10
  2264. .sp -1v
  2265. .RS 10
  2266. .sp
  2267. .RS 4
  2268. .nf
  2269. u\fB[\fRndelete\fB] [\fImsglist\fB]\fR
  2270. .fi
  2271. .P
  2272. .RE
  2273. .RE
  2274. .P
  2275. Change the state of the specified messages from deleted to read. If
  2276. .BR autoprint
  2277. is set, the last message of those restored shall be written. If
  2278. .IR msglist
  2279. is not specified, the message shall be selected as follows:
  2280. .IP " *" 4
  2281. If there are any deleted messages that follow the current message, the
  2282. first of these shall be chosen.
  2283. .IP " *" 4
  2284. Otherwise, the last deleted message that also precedes the current
  2285. message shall be chosen.
  2286. .SS "Unset Variables"
  2287. .IP "\fISynopsis\fR:" 10
  2288. .sp -1v
  2289. .RS 10
  2290. .sp
  2291. .RS 4
  2292. .nf
  2293. uns\fB[\fRet\fB] \fIname\fR...
  2294. .fi
  2295. .P
  2296. .RE
  2297. .RE
  2298. .P
  2299. Cause the specified variables to be erased.
  2300. .SS "Edit Message with Full-Screen Editor"
  2301. .IP "\fISynopsis\fR:" 10
  2302. .sp -1v
  2303. .RS 10
  2304. .sp
  2305. .RS 4
  2306. .nf
  2307. v\fB[\fRisual\fB] [\fImsglist\fB]\fR
  2308. .fi
  2309. .P
  2310. .RE
  2311. .RE
  2312. .P
  2313. Edit the given messages with a screen editor. Each message shall be
  2314. placed in a temporary file, and the utility named by the
  2315. .IR VISUAL
  2316. variable shall be invoked to edit each file in sequence. The default
  2317. editor shall be
  2318. .IR vi .
  2319. .P
  2320. The
  2321. .BR visual
  2322. command does not modify the contents of those messages in the mailbox.
  2323. .SS "Write Messages to a File"
  2324. .IP "\fISynopsis\fR:" 10
  2325. .sp -1v
  2326. .RS 10
  2327. .sp
  2328. .RS 4
  2329. .nf
  2330. w\fB[\fRrite\fB] [\fImsglist\fB] \fIfile\fR
  2331. .fi
  2332. .P
  2333. .RE
  2334. .RE
  2335. .P
  2336. Write the given messages to the file specified by the pathname
  2337. .IR file ,
  2338. minus the message header. Otherwise, it shall be equivalent to the
  2339. .BR save
  2340. command.
  2341. .SS "Scroll Header Display"
  2342. .IP "\fISynopsis\fR:" 10
  2343. .sp -1v
  2344. .RS 10
  2345. .sp
  2346. .RS 4
  2347. .nf
  2348. z\fB[\fR+|-\fB]\fR
  2349. .fi
  2350. .P
  2351. .RE
  2352. .RE
  2353. .P
  2354. Scroll the header display forward (if
  2355. .BR '\(pl'
  2356. is specified or if no option is specified) or backward (if
  2357. .BR '\-'
  2358. is specified) one screenful. The number of headers written shall be
  2359. set by the
  2360. .BR screen
  2361. variable.
  2362. .SS "Invoke Shell Command"
  2363. .IP "\fISynopsis\fR:" 10
  2364. .sp -1v
  2365. .RS 10
  2366. .sp
  2367. .RS 4
  2368. .nf
  2369. !\fIcommand\fR
  2370. .fi
  2371. .P
  2372. .RE
  2373. .RE
  2374. .P
  2375. Invoke the command interpreter specified by
  2376. .IR SHELL
  2377. with two arguments:
  2378. .BR \-c
  2379. and
  2380. .IR command .
  2381. (See also
  2382. .IR sh
  2383. .BR \-c .)
  2384. If the
  2385. .BR bang
  2386. variable is set, each unescaped occurrence of
  2387. .BR '!'
  2388. in
  2389. .IR command
  2390. shall be replaced with the command executed by the previous
  2391. .BR !
  2392. command or
  2393. .BR ~!
  2394. command escape.
  2395. .SS "Null Command"
  2396. .IP "\fISynopsis\fR:" 10
  2397. .sp -1v
  2398. .RS 10
  2399. .sp
  2400. .RS 4
  2401. .nf
  2402. # \fIcomment\fR
  2403. .fi
  2404. .P
  2405. .RE
  2406. .RE
  2407. .P
  2408. This null command (comment) shall be ignored by
  2409. .IR mailx .
  2410. .SS "Display Current Message Number"
  2411. .IP "\fISynopsis\fR:" 10
  2412. .sp -1v
  2413. .RS 10
  2414. .sp
  2415. .RS 4
  2416. .nf
  2417. =
  2418. .fi
  2419. .P
  2420. .RE
  2421. .RE
  2422. .P
  2423. Write the current message number.
  2424. .SS "Command Escapes in mailx"
  2425. .P
  2426. The following commands can be entered only from input mode, by
  2427. beginning a line with the escape character (by default,
  2428. <tilde>
  2429. (\c
  2430. .BR '\(ti' )).
  2431. See the
  2432. .BR escape
  2433. variable description for changing this special character. The format
  2434. for the commands shall be:
  2435. .sp
  2436. .RS 4
  2437. .nf
  2438. <\fIescape-character\fR><\fIcommand-char\fR><\fIseparator\fR>\fB[\fR<\fIarguments\fR>\fB]\fR
  2439. .fi
  2440. .P
  2441. .RE
  2442. .P
  2443. where the <\fIseparator\fP> can be zero or more
  2444. <blank>
  2445. characters.
  2446. .P
  2447. In the following descriptions, the application shall ensure that the
  2448. argument
  2449. .IR command
  2450. (but not
  2451. .IR mailx-command)
  2452. is a shell command string. Any string acceptable to the command
  2453. interpreter specified by the
  2454. .IR SHELL
  2455. variable when it is invoked as
  2456. .IR SHELL
  2457. .BR \-c
  2458. .IR command_string
  2459. shall be valid. The command can be presented as multiple arguments
  2460. (that is, quoting is not required).
  2461. .P
  2462. Command escapes that are listed with
  2463. .IR msglist
  2464. or
  2465. .IR mailx-command
  2466. arguments are invalid in Send Mode and produce unspecified results.
  2467. .IP "\fB~!\0\fIcommand\fR" 10
  2468. Invoke the command interpreter specified by
  2469. .IR SHELL
  2470. with two arguments:
  2471. .BR \-c
  2472. and
  2473. .IR command ;
  2474. and then return to input mode. If the
  2475. .BR bang
  2476. variable is set, each unescaped occurrence of
  2477. .BR '!'
  2478. in
  2479. .IR command
  2480. shall be replaced with the command executed by the previous
  2481. .BR !
  2482. command or
  2483. .BR ~!
  2484. command escape.
  2485. .IP "\fB~.\fR" 10
  2486. Simulate end-of-file (terminate message input).
  2487. .IP "\fB~:\0\fImailx-command\fR,\0\fB~_\0\fImailx-command\fR" 10
  2488. .br
  2489. Perform the command-level request.
  2490. .IP "\fB~?\fR" 10
  2491. Write a summary of command escapes.
  2492. .IP "\fB~A\fR" 10
  2493. This shall be equivalent to
  2494. .BR "~i\0Sign" .
  2495. .IP "\fB~a\fR" 10
  2496. This shall be equivalent to
  2497. .BR "~i\0sign" .
  2498. .IP "\fB~b\0\fIname\fR.\|.\|." 10
  2499. Add the
  2500. .IR name s
  2501. to the blind carbon copy (\c
  2502. .BR Bcc )
  2503. list.
  2504. .IP "\fB~c\0\fIname\fR.\|.\|." 10
  2505. Add the
  2506. .IR name s
  2507. to the carbon copy (\c
  2508. .BR Cc )
  2509. list.
  2510. .IP "\fB~d\fR" 10
  2511. Read in the dead-letter file. See
  2512. .IR DEAD
  2513. for a description of this file.
  2514. .IP "\fB~e\fR" 10
  2515. Invoke the editor, as specified by the
  2516. .IR EDITOR
  2517. environment variable, on the partial message.
  2518. .IP "\fB~f\0[\fImsglist\fB]\fR" 10
  2519. Forward the specified messages. The specified messages shall be
  2520. inserted into the current message without alteration. This command
  2521. escape also shall insert message headers into the message with field
  2522. selection affected by the
  2523. .BR discard ,
  2524. .BR ignore ,
  2525. and
  2526. .BR retain
  2527. commands.
  2528. .IP "\fB~F\0[\fImsglist\fB]\fR" 10
  2529. This shall be the equivalent of the
  2530. .BR ~f
  2531. command escape, except that all headers shall be included in the
  2532. message, regardless of previous
  2533. .BR discard ,
  2534. .BR ignore ,
  2535. and
  2536. .BR retain
  2537. commands.
  2538. .IP "\fB~h\fR" 10
  2539. If standard input is a terminal, prompt for a
  2540. .BR Subject
  2541. line and the
  2542. .BR To ,
  2543. .BR Cc ,
  2544. and
  2545. .BR Bcc
  2546. lists. Other implementation-defined headers may also be presented
  2547. for editing. If the field is written with an initial value, it can be
  2548. edited as if it had just been typed.
  2549. .IP "\fB~i\0\fIstring\fR" 10
  2550. Insert the value of the named variable, followed by a
  2551. <newline>,
  2552. into the text of the message. If the string is unset or null, the
  2553. message shall not be changed.
  2554. .IP "\fB~m\0[\fImsglist\fB]\fR" 10
  2555. Insert the specified messages into the message, prefixing non-empty
  2556. lines with the string in the
  2557. .BR indentprefix
  2558. variable. This command escape also shall insert message headers into
  2559. the message, with field selection affected by the
  2560. .BR discard ,
  2561. .BR ignore ,
  2562. and
  2563. .BR retain
  2564. commands.
  2565. .IP "\fB~M\0[\fImsglist\fB]\fR" 10
  2566. This shall be the equivalent of the
  2567. .BR ~m
  2568. command escape, except that all headers shall be included in the
  2569. message, regardless of previous
  2570. .BR discard ,
  2571. .BR ignore ,
  2572. and
  2573. .BR retain
  2574. commands.
  2575. .IP "\fB~p\fR" 10
  2576. Write the message being entered. If the message is longer than
  2577. .BR crt
  2578. lines (see
  2579. .IR "Internal Variables in mailx"),
  2580. the output shall be paginated as described for the
  2581. .IR PAGER
  2582. variable.
  2583. .IP "\fB~q\fR" 10
  2584. Quit (see the
  2585. .BR quit
  2586. command) from input mode by simulating an interrupt. If the body of
  2587. the message is not empty, the partial message shall be saved in the
  2588. dead-letter file. See
  2589. .IR DEAD
  2590. for a description of this file.
  2591. .IP "\fB~r\0\fIfile\fR,\0\fB~<\0\fIfile\fR,\0\fB~r\0!\fIcommand\fR,\0\fB~<\0!\fIcommand\fR" 10
  2592. .br
  2593. Read in the file specified by the pathname
  2594. .IR file .
  2595. If the argument begins with an
  2596. <exclamation-mark>
  2597. (\c
  2598. .BR '!' ),
  2599. the rest of the string shall be taken as an arbitrary system command;
  2600. the command interpreter specified by
  2601. .IR SHELL
  2602. shall be invoked with two arguments:
  2603. .BR \-c
  2604. and
  2605. .IR command .
  2606. The standard output of
  2607. .IR command
  2608. shall be inserted into the message.
  2609. .IP "\fB~s\0\fIstring\fR" 10
  2610. Set the subject line to
  2611. .IR string .
  2612. .IP "\fB~t\0\fIname\fR.\|.\|." 10
  2613. Add the given
  2614. .IR name s
  2615. to the
  2616. .BR To
  2617. list.
  2618. .IP "\fB~v\fR" 10
  2619. Invoke the full-screen editor, as specified by the
  2620. .IR VISUAL
  2621. environment variable, on the partial message.
  2622. .IP "\fB~w\0\fIfile\fR" 10
  2623. Write the partial message, without the header, onto the file named by
  2624. the pathname
  2625. .IR file .
  2626. The file shall be created or the message shall be appended to it if the
  2627. file exists.
  2628. .IP "\fB~x\fR" 10
  2629. Exit as with
  2630. .BR ~q ,
  2631. except the message shall not be saved in the dead-letter file.
  2632. .IP "\fB~|\0\fIcommand\fR" 10
  2633. Pipe the body of the message through the given
  2634. .IR command
  2635. by invoking the command interpreter specified by
  2636. .IR SHELL
  2637. with two arguments:
  2638. .BR \-c
  2639. and
  2640. .IR command .
  2641. If the
  2642. .IR command
  2643. returns a successful exit status, the standard output of the command
  2644. shall replace the message. Otherwise, the message shall remain
  2645. unchanged. If the
  2646. .IR command
  2647. fails, an error message giving the exit status shall be written.
  2648. .br
  2649. .SH "EXIT STATUS"
  2650. When the
  2651. .BR \-e
  2652. option is specified, the following exit values are returned:
  2653. .IP "\00" 6
  2654. Mail was found.
  2655. .IP >0 6
  2656. Mail was not found or an error occurred.
  2657. .P
  2658. Otherwise, the following exit values are returned:
  2659. .IP "\00" 6
  2660. Successful completion; note that this status implies that all messages
  2661. were
  2662. .IR sent ,
  2663. but it gives no assurances that any of them were actually
  2664. .IR delivered .
  2665. .IP >0 6
  2666. An error occurred.
  2667. .SH "CONSEQUENCES OF ERRORS"
  2668. When in
  2669. input mode (Receive Mode)
  2670. or Send Mode:
  2671. .IP " *" 4
  2672. If an error is encountered processing an input line beginning
  2673. with a
  2674. <tilde>
  2675. (\c
  2676. .BR '\(ti' )
  2677. character,
  2678. (see
  2679. .IR "Command Escapes in mailx"),
  2680. a diagnostic message shall be written to standard error, and the
  2681. message being composed may be modified, but this condition shall not
  2682. prevent the message from being sent.
  2683. .IP " *" 4
  2684. Other errors shall prevent the sending of the message.
  2685. .P
  2686. When in command mode:
  2687. .IP " *" 4
  2688. Default.
  2689. .LP
  2690. .IR "The following sections are informative."
  2691. .SH "APPLICATION USAGE"
  2692. Delivery of messages to remote systems requires the existence of
  2693. communication paths to such systems. These need not exist.
  2694. .P
  2695. Input lines are limited to
  2696. {LINE_MAX}
  2697. bytes, but mailers between systems may impose more severe line-length
  2698. restrictions. This volume of POSIX.1\(hy2017 does not place any restrictions on the length of
  2699. messages handled by
  2700. .IR mailx ,
  2701. and for delivery of local messages the only limitations should be the
  2702. normal problems of available disk space for the target mail file. When
  2703. sending messages to external machines, applications are advised to
  2704. limit messages to less than 100\|000 bytes because some mail gateways
  2705. impose message-length restrictions.
  2706. .P
  2707. The format of the system mailbox is intentionally unspecified. Not all
  2708. systems implement system mailboxes as flat files, particularly with the
  2709. advent of multimedia mail messages. Some system mailboxes may be
  2710. multiple files, others records in a database. The internal format of
  2711. the messages themselves is specified with the historical format from
  2712. Version\ 7, but only after the messages have been saved in some file
  2713. other than the system mailbox. This was done so that many historical
  2714. applications expecting text-file mailboxes are not broken.
  2715. .P
  2716. Some new formats for messages can be expected in the future, probably
  2717. including binary data, bit maps, and various multimedia objects. As
  2718. described here,
  2719. .IR mailx
  2720. is not prohibited from handling such messages, but it must store them
  2721. as text files in secondary mailboxes (unless some extension, such as a
  2722. variable or command line option, is used to change the stored format).
  2723. Its method of doing so is implementation-defined and might include
  2724. translating the data into text file-compatible or readable form or
  2725. omitting certain portions of the message from the stored output.
  2726. .P
  2727. The
  2728. .BR discard
  2729. and
  2730. .BR ignore
  2731. commands are not inverses of the
  2732. .BR retain
  2733. command. The
  2734. .BR retain
  2735. command discards all header-fields except those explicitly retained.
  2736. The
  2737. .BR discard
  2738. command keeps all header-fields except those explicitly discarded. If
  2739. headers exist on the retained header list,
  2740. .BR discard
  2741. and
  2742. .BR ignore
  2743. commands are ignored.
  2744. .SH EXAMPLES
  2745. None.
  2746. .SH RATIONALE
  2747. The standard developers felt strongly that a method for applications to
  2748. send messages to specific users was necessary. The obvious example is a
  2749. batch utility, running non-interactively, that wishes to communicate
  2750. errors or results to a user. However, the actual format, delivery
  2751. mechanism, and method of reading the message are clearly beyond the
  2752. scope of this volume of POSIX.1\(hy2017.
  2753. .P
  2754. The intent of this command is to provide a simple, portable interface
  2755. for sending messages non-interactively. It merely defines a
  2756. ``front-end'' to the historical mail system. It is suggested that
  2757. implementations explicitly denote the sender and recipient in the body
  2758. of the delivered message. Further specification of formats for either
  2759. the message envelope or the message itself were deliberately not made,
  2760. as the industry is in the midst of changing from the current standards
  2761. to a more internationalized standard and it is probably incorrect, at
  2762. this time, to require either one.
  2763. .P
  2764. Implementations are encouraged to conform to the various delivery
  2765. mechanisms described in the CCITT X.400 standards or to the equivalent
  2766. Internet standards, described in Internet Request for Comment (RFC)
  2767. documents RFC\ 819, RFC\ 920, RFC\ 921, RFC\ 1123, and RFC\ 5322 (which
  2768. succeeded RFC\ 822).
  2769. .P
  2770. Many historical systems modified each body line that started with
  2771. .BR "From\0"
  2772. by prefixing the
  2773. .BR 'F'
  2774. with
  2775. .BR '>' .
  2776. It is unnecessary, but allowed, to do that when the string does not
  2777. follow a blank line because it cannot be confused with the next
  2778. header.
  2779. .P
  2780. The
  2781. .BR edit
  2782. and
  2783. .BR visual
  2784. commands merely edit the specified messages in a temporary file. They
  2785. do not modify the contents of those messages in the mailbox; such a
  2786. capability could be added as an extension, such as by using different
  2787. command names.
  2788. .P
  2789. The restriction on a subject line being
  2790. {LINE_MAX}\-10
  2791. bytes is based on the historical format that consumes 10 bytes for
  2792. .BR "Subject:\0"
  2793. and the trailing
  2794. <newline>.
  2795. Many historical mailers that a message may encounter on other systems
  2796. are not able to handle lines that long, however.
  2797. .P
  2798. Like the utilities
  2799. .IR logger
  2800. and
  2801. .IR lp ,
  2802. .IR mailx
  2803. admittedly is difficult to test. This was not deemed sufficient
  2804. justification to exclude this utility from this volume of POSIX.1\(hy2017. It is also arguable
  2805. that it is, in fact, testable, but that the tests themselves are not
  2806. portable.
  2807. .P
  2808. When
  2809. .IR mailx
  2810. is being used by an application that wishes to receive the results as
  2811. if none of the User Portability Utilities option features were
  2812. supported, the
  2813. .IR DEAD
  2814. environment variable must be set to
  2815. .BR /dev/null .
  2816. Otherwise, it may be subject to the file creations described in
  2817. .IR mailx
  2818. ASYNCHRONOUS EVENTS. Similarly, if the
  2819. .IR MAILRC
  2820. environment variable is not set to
  2821. .BR /dev/null ,
  2822. historical versions of
  2823. .IR mailx
  2824. and
  2825. .IR Mail
  2826. read initialization commands from a file before processing begins.
  2827. Since the initialization that a user specifies could alter the contents
  2828. of messages an application is trying to send, such applications must
  2829. set
  2830. .IR MAILRC
  2831. to
  2832. .BR /dev/null .
  2833. .P
  2834. The description of
  2835. .IR LC_TIME
  2836. uses ``may affect'' because many historical implementations do not or
  2837. cannot manipulate the date and time strings in the incoming mail
  2838. headers. Some headers found in incoming mail do not have enough
  2839. information to determine the timezone in which the mail originated,
  2840. and, therefore,
  2841. .IR mailx
  2842. cannot convert the date and time strings into the internal form that
  2843. then is parsed by routines like
  2844. \fIstrftime\fR()
  2845. that can take
  2846. .IR LC_TIME
  2847. settings into account. Changing all these times to a user-specified
  2848. format is allowed, but not required.
  2849. .P
  2850. The paginator selected when
  2851. .IR PAGER
  2852. is null or unset is partially unspecified to allow the System V
  2853. historical practice of using
  2854. .IR pg
  2855. as the default. Bypassing the pagination function, such as by declaring
  2856. that
  2857. .IR cat
  2858. is the paginator, would not meet with the intended meaning of this
  2859. description. However, any ``portable user'' would have to set
  2860. .IR PAGER
  2861. explicitly to get his or her preferred paginator on all systems. The
  2862. paginator choice was made partially unspecified, unlike the
  2863. .IR VISUAL
  2864. editor choice (mandated to be
  2865. .IR vi )
  2866. because most historical pagers follow a common theme of user input,
  2867. whereas editors differ dramatically.
  2868. .P
  2869. Options to specify addresses as
  2870. .BR cc
  2871. (carbon copy) or
  2872. .BR bcc
  2873. (blind carbon copy) were considered to be format details and were
  2874. omitted.
  2875. .P
  2876. A zero exit status implies that all messages were
  2877. .IR sent ,
  2878. but it gives no assurances that any of them were actually
  2879. .IR delivered .
  2880. The reliability of the delivery mechanism is unspecified and is an
  2881. appropriate marketing distinction between systems.
  2882. .P
  2883. In order to conform to the Utility Syntax Guidelines, a solution was
  2884. required to the optional
  2885. .IR file
  2886. option-argument to
  2887. .BR \-f .
  2888. By making
  2889. .IR file
  2890. an operand, the guidelines are satisfied and users remain portable.
  2891. However, it does force implementations to support usage such as:
  2892. .sp
  2893. .RS 4
  2894. .nf
  2895. mailx -fin mymail.box
  2896. .fi
  2897. .P
  2898. .RE
  2899. .P
  2900. The
  2901. .BR no
  2902. .IR name
  2903. method of unsetting variables is not present in all historical systems,
  2904. but it is in System V and provides a logical set of commands
  2905. corresponding to the format of the display of options from the
  2906. .IR mailx
  2907. .IR set
  2908. command without arguments.
  2909. .P
  2910. The
  2911. .BR ask
  2912. and
  2913. .BR asksub
  2914. variables are the names selected by BSD and System V, respectively, for
  2915. the same feature. They are synonyms in this volume of POSIX.1\(hy2017.
  2916. .P
  2917. The
  2918. .IR mailx
  2919. .IR echo
  2920. command was not documented in the BSD version and has been omitted here
  2921. because it is not obviously useful for interactive users.
  2922. .P
  2923. The default prompt on the System V
  2924. .IR mailx
  2925. is a
  2926. <question-mark>,
  2927. on BSD
  2928. .IR Mail
  2929. an
  2930. <ampersand>.
  2931. Since this volume of POSIX.1\(hy2017 chose the
  2932. .IR mailx
  2933. name, it kept the System V default, assuming that BSD users would not
  2934. have difficulty with this minor incompatibility (that they can
  2935. override).
  2936. .P
  2937. The meanings of
  2938. .BR r
  2939. and
  2940. .BR R
  2941. are reversed between System V
  2942. .IR mailx
  2943. and SunOS
  2944. .IR Mail .
  2945. Once again, since this volume of POSIX.1\(hy2017 chose the
  2946. .IR mailx
  2947. name, it kept the System V default, but allows the SunOS user to
  2948. achieve the desired results using
  2949. .BR flipr ,
  2950. an internal variable in System V
  2951. .IR mailx ,
  2952. although it has not been documented in the SVID.
  2953. .P
  2954. The
  2955. .BR indentprefix
  2956. variable, the
  2957. .BR retain
  2958. and
  2959. .BR unalias
  2960. commands, and the
  2961. .BR ~F
  2962. and
  2963. .BR ~M
  2964. command escapes were adopted from 4.3 BSD
  2965. .IR Mail .
  2966. .P
  2967. The
  2968. .BR version
  2969. command was not included because no sufficiently general specification
  2970. of the version information could be devised that would still be useful
  2971. to a portable user. This command name should be used by suppliers who
  2972. wish to provide version information about the
  2973. .IR mailx
  2974. command.
  2975. .P
  2976. The ``implementation-specific (unspecified) system start-up file''
  2977. historically has been named
  2978. .BR /etc/mailx.rc ,
  2979. but this specific name and location are not required.
  2980. .P
  2981. The intent of the wording for the
  2982. .BR next
  2983. command is that if any command has already displayed the current
  2984. message it should display a following message, but, otherwise, it
  2985. should display the current message. Consider the command sequence:
  2986. .sp
  2987. .RS 4
  2988. .nf
  2989. next 3
  2990. delete 3
  2991. next
  2992. .fi
  2993. .P
  2994. .RE
  2995. .P
  2996. where the
  2997. .BR autoprint
  2998. option was not set. The normative text specifies that the second
  2999. .BR next
  3000. command should display a message following the third message, because
  3001. even though the current message has not been displayed since it was set
  3002. by the
  3003. .BR delete
  3004. command, it has been displayed since the current message was anything
  3005. other than message number 3. This does not always match historical
  3006. practice in some implementations, where the command file address
  3007. followed by
  3008. .BR next
  3009. (or the default command) would skip the message for which the user had
  3010. searched.
  3011. .SH "FUTURE DIRECTIONS"
  3012. None.
  3013. .SH "SEE ALSO"
  3014. .IR "Chapter 2" ", " "Shell Command Language",
  3015. .IR "\fIed\fR\^",
  3016. .IR "\fIls\fR\^",
  3017. .IR "\fImore\fR\^",
  3018. .IR "\fIvi\fR\^"
  3019. .P
  3020. The Base Definitions volume of POSIX.1\(hy2017,
  3021. .IR "Chapter 8" ", " "Environment Variables",
  3022. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  3023. .\"
  3024. .SH COPYRIGHT
  3025. Portions of this text are reprinted and reproduced in electronic form
  3026. from IEEE Std 1003.1-2017, Standard for Information Technology
  3027. -- Portable Operating System Interface (POSIX), The Open Group Base
  3028. Specifications Issue 7, 2018 Edition,
  3029. Copyright (C) 2018 by the Institute of
  3030. Electrical and Electronics Engineers, Inc and The Open Group.
  3031. In the event of any discrepancy between this version and the original IEEE and
  3032. The Open Group Standard, the original IEEE and The Open Group Standard
  3033. is the referee document. The original Standard can be obtained online at
  3034. http://www.opengroup.org/unix/online.html .
  3035. .PP
  3036. Any typographical or formatting errors that appear
  3037. in this page are most likely
  3038. to have been introduced during the conversion of the source files to
  3039. man page format. To report such errors, see
  3040. https://www.kernel.org/doc/man-pages/reporting_bugs.html .