{
    "content": [
        {
            "type": "text",
            "text": "# Mail (man)\n\n## NAME\n\nmail, mailx, Mail — send and receive mail\n\n## SYNOPSIS\n\nmail  [-dEIinv]  [-a  header]  [-b  bcc-addr]  [-c  cc-addr] [-r from-addr] [-s subject] [--]\nto-addr ...\nmail [-dEIiNnv] -f [file]\nmail [-dEIiNnv] [-u user]\n\n## DESCRIPTION\n\nmail is an intelligent mail processing system which has a command syntax reminiscent of ed(1)\nwith lines replaced by messages.\n\n## TLDR\n\n> Operate on the user's mailbox.\n\n- Open an interactive prompt to check personal mail:\n  `mail`\n- Send a typed email message with optional CC. The command-line below continues after pressing `<Enter>`. Input message text (can be multiline). Press `<Ctrl d>` to complete the message text:\n  `mail --subject \"{{subject line}}\" {{to_user@example.com}} --cc \"{{cc_email_address}}\"`\n- Send an email that contains file content:\n  `mail < {{path/to/file.txt}} --subject \"{{$HOSTNAME filename.txt}}\" {{to_user@example.com}}`\n- Send a `.tar.gz` file as an attachment:\n  `tar cvzf - {{path/to/directory1 path/to/directory2}} | uuencode {{data.tar.gz}} | mail --subject \"{{subject_line}}\" {{to_user@example.com}}`\n- Display help:\n  `mail {{-h|--help}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (24 subsections)\n- **SUMMARY** (12 subsections)\n- **ENVIRONMENT**\n- **FILES**\n- **EXIT STATUS**\n- **SEE ALSO**\n- **STANDARDS**\n- **HISTORY**\n- **BUGS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Mail",
        "section": "",
        "mode": "man",
        "summary": "mail, mailx, Mail — send and receive mail",
        "synopsis": "mail  [-dEIinv]  [-a  header]  [-b  bcc-addr]  [-c  cc-addr] [-r from-addr] [-s subject] [--]\nto-addr ...\nmail [-dEIiNnv] -f [file]\nmail [-dEIiNnv] [-u user]",
        "tldr_summary": "Operate on the user's mailbox.",
        "tldr_examples": [
            {
                "description": "Open an interactive prompt to check personal mail",
                "command": "mail"
            },
            {
                "description": "Send a typed email message with optional CC. The command-line below continues after pressing `<Enter>`. Input message text (can be multiline). Press `<Ctrl d>` to complete the message text",
                "command": "mail --subject \"{{subject line}}\" {{to_user@example.com}} --cc \"{{cc_email_address}}\""
            },
            {
                "description": "Send an email that contains file content",
                "command": "mail < {{path/to/file.txt}} --subject \"{{$HOSTNAME filename.txt}}\" {{to_user@example.com}}"
            },
            {
                "description": "Send a `.tar.gz` file as an attachment",
                "command": "tar cvzf - {{path/to/directory1 path/to/directory2}} | uuencode {{data.tar.gz}} | mail --subject \"{{subject_line}}\" {{to_user@example.com}}"
            },
            {
                "description": "Display help",
                "command": "mail {{-h|--help}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-a",
                "long": null,
                "arg": null,
                "description": "It can be also used to override MIME headers mail adds by default to each outgoing mail, see “Character sets and MIME” below. You have to use quotes if the string con‐ tains spaces. This argument may be specified more than once, the headers will then be concatenated."
            },
            {
                "flag": "-b",
                "long": null,
                "arg": null,
                "description": "Send blind carbon copies to bcc-addr."
            },
            {
                "flag": "-c",
                "long": null,
                "arg": null,
                "description": "Send carbon copies to list of users. cc-addr should be a comma separated list of names."
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-E",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-f",
                "long": null,
                "arg": null,
                "description": "quit, mail writes undeleted messages back to this file."
            },
            {
                "flag": "-I",
                "long": null,
                "arg": null,
                "description": "ticular, the special ~ command character, used when sending mail, is only available interactively."
            },
            {
                "flag": "-i",
                "long": null,
                "arg": null,
                "description": "phone lines."
            },
            {
                "flag": "-N",
                "long": null,
                "arg": null,
                "description": "folder."
            },
            {
                "flag": "-n",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-r",
                "long": null,
                "arg": null,
                "description": "Use from-addr as the from address in the message and envelope. Overrides any from options in the startup files."
            },
            {
                "flag": "-s",
                "long": null,
                "arg": null,
                "description": "Specify subject on command line (only the first argument after the -s flag is used as a subject; be careful to quote subjects containing spaces)."
            },
            {
                "flag": "-u",
                "long": null,
                "arg": null,
                "description": "Equivalent to: $ mail -f /var/mail/user except that locking is done."
            },
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": "-- End of options. Any further argument is treated as a direct receipient address. Note: For security reasons the -- separator is strongly recommended for scripts that need to send mails to addresses obtained from untrusted sources (such as web forms)."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "fmt",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/fmt/1/json"
            },
            {
                "name": "newaliases",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/newaliases/1/json"
            },
            {
                "name": "vacation",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/vacation/1/json"
            },
            {
                "name": "aliases",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/aliases/5/json"
            },
            {
                "name": "mail.local",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mail.local/8/json"
            },
            {
                "name": "newaliases",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/newaliases/8/json"
            },
            {
                "name": "sendmail",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/sendmail/8/json"
            },
            {
                "name": "smtpd",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/smtpd/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": [
                    {
                        "name": "-a",
                        "lines": 5,
                        "flag": "-a"
                    },
                    {
                        "name": "-b _",
                        "lines": 2,
                        "flag": "-b"
                    },
                    {
                        "name": "-c _",
                        "lines": 3,
                        "flag": "-c"
                    },
                    {
                        "name": "-d",
                        "lines": 1,
                        "flag": "-d"
                    },
                    {
                        "name": "-E",
                        "lines": 1,
                        "flag": "-E"
                    },
                    {
                        "name": "-f",
                        "lines": 2,
                        "flag": "-f"
                    },
                    {
                        "name": "-I",
                        "lines": 3,
                        "flag": "-I"
                    },
                    {
                        "name": "-i",
                        "lines": 2,
                        "flag": "-i"
                    },
                    {
                        "name": "-N",
                        "lines": 2,
                        "flag": "-N"
                    },
                    {
                        "name": "-n",
                        "lines": 1,
                        "flag": "-n"
                    },
                    {
                        "name": "-r _",
                        "lines": 3,
                        "flag": "-r"
                    },
                    {
                        "name": "-s _",
                        "lines": 3,
                        "flag": "-s"
                    },
                    {
                        "name": "-u _",
                        "lines": 6,
                        "flag": "-u"
                    },
                    {
                        "name": "-v",
                        "lines": 5,
                        "flag": "-v"
                    },
                    {
                        "name": "Startup actions",
                        "lines": 6
                    },
                    {
                        "name": "Sending mail",
                        "lines": 6
                    },
                    {
                        "name": "Reading mail",
                        "lines": 7
                    },
                    {
                        "name": "Disposing of mail",
                        "lines": 5
                    },
                    {
                        "name": "Specifying messages",
                        "lines": 17
                    },
                    {
                        "name": "Replying to or originating mail",
                        "lines": 9
                    },
                    {
                        "name": "Ending a mail processing session",
                        "lines": 4
                    },
                    {
                        "name": "Personal and system wide distribution lists",
                        "lines": 14
                    },
                    {
                        "name": "Recipient address specifications",
                        "lines": 20
                    },
                    {
                        "name": "Character sets and MIME",
                        "lines": 11
                    }
                ]
            },
            {
                "name": "SUMMARY",
                "lines": 23,
                "subsections": [
                    {
                        "name": "alternates",
                        "lines": 33
                    },
                    {
                        "name": "folders",
                        "lines": 4
                    },
                    {
                        "name": "headers",
                        "lines": 34
                    },
                    {
                        "name": "preserve",
                        "lines": 20
                    },
                    {
                        "name": "respond",
                        "lines": 12
                    },
                    {
                        "name": "saveignore",
                        "lines": 3
                    },
                    {
                        "name": "saveretain",
                        "lines": 22
                    },
                    {
                        "name": "unalias",
                        "lines": 3
                    },
                    {
                        "name": "undelete",
                        "lines": 19
                    },
                    {
                        "name": "Tilde/escapes",
                        "lines": 85
                    },
                    {
                        "name": "Mail options",
                        "lines": 93
                    },
                    {
                        "name": "Option string values",
                        "lines": 46
                    }
                ]
            },
            {
                "name": "ENVIRONMENT",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "EXIT STATUS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "STANDARDS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "mail, mailx, Mail — send and receive mail\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "mail  [-dEIinv]  [-a  header]  [-b  bcc-addr]  [-c  cc-addr] [-r from-addr] [-s subject] [--]\nto-addr ...\nmail [-dEIiNnv] -f [file]\nmail [-dEIiNnv] [-u user]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "mail is an intelligent mail processing system which has a command syntax reminiscent of ed(1)\nwith lines replaced by messages.\n\nThe options are as follows:\n",
                "subsections": [
                    {
                        "name": "-a",
                        "content": "It  can  be  also used to override MIME headers mail adds by default to each outgoing\nmail, see “Character sets and MIME” below.  You have to use quotes if the string con‐\ntains spaces.  This argument may be specified more than once, the headers  will  then\nbe concatenated.\n",
                        "flag": "-a"
                    },
                    {
                        "name": "-b _",
                        "content": "Send blind carbon copies to bcc-addr.\n",
                        "flag": "-b"
                    },
                    {
                        "name": "-c _",
                        "content": "Send  carbon  copies  to  list of users.  cc-addr should be a comma separated list of\nnames.\n",
                        "flag": "-c"
                    },
                    {
                        "name": "-d",
                        "content": "",
                        "flag": "-d"
                    },
                    {
                        "name": "-E",
                        "content": "",
                        "flag": "-E"
                    },
                    {
                        "name": "-f",
                        "content": "quit, mail writes undeleted messages back to this file.\n",
                        "flag": "-f"
                    },
                    {
                        "name": "-I",
                        "content": "ticular,  the  special ~ command character, used when sending mail, is only available\ninteractively.\n",
                        "flag": "-I"
                    },
                    {
                        "name": "-i",
                        "content": "phone lines.\n",
                        "flag": "-i"
                    },
                    {
                        "name": "-N",
                        "content": "folder.\n",
                        "flag": "-N"
                    },
                    {
                        "name": "-n",
                        "content": "",
                        "flag": "-n"
                    },
                    {
                        "name": "-r _",
                        "content": "Use from-addr as the from address in the message and envelope.   Overrides  any  from\noptions in the startup files.\n",
                        "flag": "-r"
                    },
                    {
                        "name": "-s _",
                        "content": "Specify subject on command line (only the first argument after the -s flag is used as\na subject; be careful to quote subjects containing spaces).\n",
                        "flag": "-s"
                    },
                    {
                        "name": "-u _",
                        "content": "Equivalent to:\n\n$ mail -f /var/mail/user\n\nexcept that locking is done.\n",
                        "flag": "-u"
                    },
                    {
                        "name": "-v",
                        "content": "--      End of options. Any further argument is treated as a direct receipient address.\n\nNote:  For security reasons the -- separator is strongly recommended for scripts that\nneed to send mails to addresses obtained from untrusted sources (such as web forms).\n",
                        "flag": "-v"
                    },
                    {
                        "name": "Startup actions",
                        "content": "At startup time, mail will execute commands in the system command file, /etc/mail.rc,  unless\nexplicitly  told  not  to  by using the -n option.  Next, the commands in the user's personal\ncommand file ~/.mailrc are executed.  mail then examines its command line options  to  deter‐\nmine whether the user requested a new message to be sent or existing messages in a mailbox to\nbe examined.\n"
                    },
                    {
                        "name": "Sending mail",
                        "content": "To  send  a  message  to one or more people, mail can be invoked with arguments which are the\nnames of people to whom the mail will be sent.  You are then expected to type  in  your  mes‐\nsage,  followed  by  a  control-D  (‘^D’)  at  the  beginning  of a line.  The section below,\n“Replying to or originating mail”, describes some features of mail available to help you com‐\npose your letter.\n"
                    },
                    {
                        "name": "Reading mail",
                        "content": "In normal usage, mail is given no arguments and checks your mail out of the post office, then\nprints out a one line header of each message found.  The current message is initially set  to\nthe  first  message (numbered 1) and can be printed using the print command (which can be ab‐\nbreviated p).  Moving among the messages is much like moving between lines in ed(1); you  may\nuse  +  and  -  to shift forwards and backwards, or simply enter a message number to move di‐\nrectly.\n"
                    },
                    {
                        "name": "Disposing of mail",
                        "content": "After examining a message, you can delete (d) or reply (r) to it.  Deletion causes  the  mail\nprogram  to forget about the message.  This is not irreversible; the message can be undeleted\n(u) by giving its number, or the mail session can be aborted by giving the exit (x)  command.\nDeleted messages, however, will usually disappear, never to be seen again.\n"
                    },
                    {
                        "name": "Specifying messages",
                        "content": "Commands  such as print and delete can be given a list of message numbers as arguments to ap‐\nply to a number of messages at once.  Thus delete 1 2 deletes messages 1 and 2, while  delete\n1-5 deletes messages 1 through 5.\n\nMessages may also be selected using one of the following categories:\n\n*       all messages\n$       last message\n:d      deleted messages\n:n      new messages\n:o      old messages\n:r      read messages\n:u      unread messages\n\nThus  the  command top, which prints the first few lines of a message, could be used in top *\nto print the first few lines of all messages.\n"
                    },
                    {
                        "name": "Replying to or originating mail",
                        "content": "You can use the reply command to set up a response to a message, sending it back to the  per‐\nson  who  it  was from.  Text you then type in, up to an end-of-file, defines the contents of\nthe message.  While you are composing a message, mail treats lines beginning with  the  tilde\n(‘~’)  character  specially.   For instance, typing ~m (alone on a line) will place a copy of\nthe current message into the response, right shifting  it  by  a  single  tab-stop  (see  the\nindentprefix  variable, below).  Other escapes will set up subject fields, add and delete re‐\ncipients to the message, and allow you to escape to an editor to revise the message or  to  a\nshell to run some commands.  (These options are given in the summary below.)\n"
                    },
                    {
                        "name": "Ending a mail processing session",
                        "content": "You  can  end a mail session with the quit (q) command.  Messages which have been examined go\nto your mbox file unless they have been deleted, in which case they are  discarded.   Unexam‐\nined messages go back to the post office (see the -f option above).\n"
                    },
                    {
                        "name": "Personal and system wide distribution lists",
                        "content": "It is also possible to create personal distribution lists so that, for instance, you can send\nmail  to “cohorts” and have it go to a group of people.  Such lists can be defined by placing\na line like\n\nalias cohorts bill ozalp jkf mark kridle@ucbcory\n\nin the file .mailrc in your home directory.  The current list of such  aliases  can  be  dis‐\nplayed  with  the  alias  command  in mail.  System wide distribution lists can be created by\nediting /etc/aliases, (see aliases(5)); these are kept in a different syntax.   In  mail  you\nsend,  personal  aliases will be expanded in mail sent to others so that they will be able to\nreply to the recipients.  System wide aliases are not expanded when the mail is sent, but any\nreply returned to the machine will have the system wide  alias  expanded  as  all  mail  goes\nthrough an MTA.\n"
                    },
                    {
                        "name": "Recipient address specifications",
                        "content": "Recipient  addresses  (any of the “To”, “Cc” or “Bcc” header fields) are subject to expansion\nwhen the expandaddr option is set.\n\nAn address may be expanded as follows:\n\n•       An address that starts with a pipe (‘|’) character is treated as a  command  to  run.\nThe  command  immediately following the ‘|’ is executed with the message as its stan‐\ndard input.\n\n•       An address that starts with a ‘+’ character is treated as a folder.\n\n•       An address that contains a ‘/’ character but no ‘!’, ‘%’, or ‘@’ characters  is  also\ntreated as a folder.\n\n•       If  none  of the above apply, the recipient is treated as a local or network mail ad‐\ndress.\n\nIf the expandaddr option is not set (the default), no expansion is performed and the  recipi‐\nent is treated as a local or network mail address.\n"
                    },
                    {
                        "name": "Character sets and MIME",
                        "content": "Generally  mail  does not handle neither different character sets nor any other MIME feature.\nEspecially it does not perform any any conversions between character sets while displaying or\nsending mails.\n\nStarting from April 2017, however, as a Debian extension this version of mail adds a few MIME\nheaders to every outgoing mail in order to indicate that the mail is sent as 8-bit plain text\ndata that uses character set encoding detected from the current locale(7) settings.   The  -a\ncommand-line option can be used to override those headers, for example:\n$ mail -a 'Content-Type: text/plain; charset=\"ISO-8859-1\"'\nsets header indicating legacy character encoding.\n"
                    }
                ]
            },
            "SUMMARY": {
                "content": "(Adapted from the “Mail Reference Manual”.)\n\nEach command is typed on a line by itself, and may take arguments following the command word.\nThe  command  need  not  be typed in its entirety — the first command which matches the typed\nprefix is used.  For commands which take message lists as arguments, if no  message  list  is\ngiven,  then the next message forward which satisfies the command's requirements is used.  If\nthere are no messages forward of the current message, the search proceeds backwards,  and  if\nthere  are  no  good messages at all, mail types “No applicable messages” and aborts the com‐\nmand.\n\n-       Print out the preceding message.  If given a numeric argument n, goes to the nth pre‐\nvious message and prints it.\n\n=       Prints the currently selected message number.\n\n?       Prints a brief summary of commands.\n\n!       Executes the shell (see sh(1) and csh(1)) command which follows.\n\nalias   (a) With no arguments, prints out all currently defined aliases.  With one  argument,\nprints  out  that alias.  With more than one argument, creates a new alias or changes\nan old one.\n",
                "subsections": [
                    {
                        "name": "alternates",
                        "content": "(alt) The alternates command is useful if you have accounts on several machines.   It\ncan  be used to inform mail that the listed addresses are really you.  When you reply\nto messages, mail will not send a copy of the message to any of the addresses  listed\non  the  alternates  list.   If the alternates command is given with no argument, the\ncurrent set of alternate names is displayed.\n\nchdir   (cd or ch) Changes the user's working directory to that specified, if given.   If  no\ndirectory is given, then changes to the user's login directory.\n\ncopy    (c) The copy command does the same thing that save does, except that it does not mark\nthe messages it is used on for deletion when you quit.\n\ndelete  (d) Takes a list of messages as argument and marks them all as deleted.  Deleted mes‐\nsages will not be saved in mbox, nor will they be available for most other commands.\n\ndp      (also  dt)  Deletes  the current message and prints the next message.  If there is no\nnext message, mail says “No more messages.”\n\nedit    (e) Takes a list of messages and points the text editor at each one in turn.  On  re‐\nturn from the editor, the message is read back in.\n\nexit    (ex  or x) Effects an immediate return to the shell without modifying the user's sys‐\ntem mailbox, mbox file, or edit file in -f.\n\nfile    (fi) The same as folder.\n\nfolder  (fo) The folder command switches to a new mail file or folder.  With no arguments, it\ntells you which file you are currently reading.  If you give it an argument, it  will\nwrite  out  changes (such as deletions) you have made in the current file and read in\nthe new file.  Some special conventions are recognized for the  name.   #  means  the\nprevious  file,  %  means  your  system mailbox, %user means user's system mailbox, &\nmeans your mbox file, and +folder means a file in your folder directory.\n"
                    },
                    {
                        "name": "folders",
                        "content": "List the names of the folders in your folder directory.\n\nfrom    (f) Takes a list of messages and prints their message headers.\n"
                    },
                    {
                        "name": "headers",
                        "content": "(h) Lists the current windowful of headers.  To view the next or  previous  group  of\nheaders, see the z command.\n\nhelp    A synonym for ?.\n\nhold    (ho,  also  preserve) Takes a message list and marks each message therein to be saved\nin the user's system mailbox instead of in mbox.  Does not override the  delete  com‐\nmand.\n\nignore  Add the list of header fields named to the ignored list.  Header fields in the ignore\nlist are not printed on your terminal when you print a message.  This command is very\nhandy for suppression of certain machine-generated header fields.  The Type and Print\ncommands  can  be  used to print a message in its entirety, including ignored fields.\nIf ignore is executed with no arguments, it lists the current set of ignored fields.\n\ninc     Incorporate any new messages that have arrived while mail is  being  read.   The  new\nmessages  are  added to the end of the message list, and the current message is reset\nto be the first new mail message.  This does not renumber the existing message  list,\nnor does it cause any changes made so far to be saved.\n\nlist    (l) List the valid mail commands.\n\nmail    (m)  Takes  as  argument  login  names and distribution group names and sends mail to\nthose people.\n\nmbox    Indicate that a list of messages be sent to mbox in  your  home  directory  when  you\nquit.   This  is  the  default action for messages if you do not have the hold option\nset.\n\nmore    (mo) Takes a message list and invokes the pager on that list.\n\nnext    (n) (like + or CR) Goes to the next message in sequence and types it.  With an  argu‐\nment list, types the next matching message.\n"
                    },
                    {
                        "name": "preserve",
                        "content": "(pre) A synonym for hold.\n\nPrint   (P)  Like  print  but also prints out ignored header fields.  See also print, ignore,\nand retain.\n\nprint   (p) Takes a message list and types out each message on the user's terminal.\n\nquit    (q) Terminates the session, saving all undeleted, unsaved messages in the  mbox  file\nin  the  user's login directory, preserving all messages marked with hold or preserve\nor never referenced in the user's system mailbox, and  removing  all  other  messages\nfrom the user's system mailbox.  If new mail has arrived during the session, the mes‐\nsage “You have new mail” is given.  If given while editing a mailbox file with the -f\nflag, then the edit file is rewritten.  A return to the shell is effected, unless the\nrewrite of edit file fails, in which case the user can escape with the exit command.\n\nReply   (R) Reply to originator.  Does not reply to other recipients of the original message.\n\nreply   (r) Takes a message list and sends mail to the sender and all recipients of the spec‐\nified message.  The default message must not be deleted.\n"
                    },
                    {
                        "name": "respond",
                        "content": "A synonym for reply.\n\nretain  Add  the list of header fields named to the retained list.  Only the header fields in\nthe retain list are shown on your terminal when  you  print  a  message.   All  other\nheader  fields  are  suppressed.   The Type and Print commands can be used to print a\nmessage in its entirety.  If retain is executed with no arguments, it lists the  cur‐\nrent set of retained fields.\n\nsave    (s)  Takes  a message list and a filename and appends each message in turn to the end\nof the file.  The filename in quotes, followed by the line count and character  count\nis echoed on the user's terminal.\n"
                    },
                    {
                        "name": "saveignore",
                        "content": "saveignore  is  to  save what ignore is to print and type.  Header fields thus marked\nare filtered out when saving a message by save or when automatically saving to mbox.\n"
                    },
                    {
                        "name": "saveretain",
                        "content": "saveretain is to save what retain is to print and type.  Header  fields  thus  marked\nare the only ones saved with a message when saving by save or when automatically sav‐\ning to mbox.  saveretain overrides saveignore.\n\nset     (se)  With  no arguments, prints all variable values.  Otherwise, sets option.  Argu‐\nments are of the form option=value (no space before or after =) or option.  Quotation\nmarks may be placed around any part of the assignment statement to  quote  blanks  or\ntabs, i.e., set indentprefix=\"->\".\n\nshell   (sh) Invokes an interactive version of the shell.\n\nsize    Takes a message list and prints out the size in characters of each message.\n\nsource  The source command reads commands from a file.\n\ntop     Takes  a  message  list  and  prints  the top few lines of each.  The number of lines\nprinted is controlled by the variable toplines and defaults to five.\n\nType    (T) Identical to the Print command.\n\ntype    (t) A synonym for print.\n"
                    },
                    {
                        "name": "unalias",
                        "content": "Takes a list of names defined by alias commands and discards the remembered groups of\nusers.  The group names no longer have any significance.\n"
                    },
                    {
                        "name": "undelete",
                        "content": "(u) Takes a message list and marks each message as not being deleted.\n\nunread  (U) Takes a message list and marks each message as not having been read.\n\nunset   Takes a list of option names and discards their remembered  values;  the  inverse  of\nset.\n\nvisual  (v) Takes a message list and invokes the display editor on each message.\n\nwrite   (w) Similar to save, except that only the message body (without the header) is saved.\nExtremely useful for such tasks as sending and receiving source program text over the\nmessage system.\n\nxit     (x) A synonym for exit.\n\nz       mail  presents  message headers in windowfuls as described under the headers command.\nYou can move mail's attention forward to the next window with the z  command.   Also,\nyou can move to the previous window by using z-.\n"
                    },
                    {
                        "name": "Tilde/escapes",
                        "content": "Here  is  a  summary  of the tilde escapes, which are used when composing messages to perform\nspecial functions.  Tilde escapes are only recognized at the beginning of  lines.   The  name\n“tilde  escape” is somewhat of a misnomer since the actual escape character can be set by the\noption escape.\n\n~bname ...\nAdd the given names to the list of carbon copy recipients but do not make  the  names\nvisible in the Cc: line (\"blind\" carbon copy).\n\n~cname ...\nAdd the given names to the list of carbon copy recipients.\n\n~d      Read the file dead.letter from your home directory into the message.\n\n~e      Invoke the text editor on the message collected so far.  After the editing session is\nfinished, you may continue appending text to the message.\n\n~Fmessages\nIdentical to ~f, except all message headers are included.\n\n~fmessages\nRead  the  named messages into the message being sent.  If no messages are specified,\nread in the current message.  Message headers currently being ignored (by the  ignore\nor retain command) are not included.\n\n~h      Edit  the  message  header fields by typing each one in turn and allowing the user to\nappend text to the end or modify the field by using the current  terminal  erase  and\nkill characters.\n\n~Mmessages\nIdentical to ~m, except all message headers are included.\n\n~mmessages\nRead  the  named  messages  into  the message being sent, indented by a tab or by the\nvalue of indentprefix.  If no messages are specified, read the current message.  Mes‐\nsage headers currently being ignored (by the ignore or retain command)  are  not  in‐\ncluded.\n\n~p      Print out the message collected so far, prefaced by the message header fields.\n\n~q      Abort  the message being sent, copying the message to dead.letter in your home direc‐\ntory if save is set.\n~Rstring\nUse string as the Reply-To field.\n\n~rfilename\n~<filename\nRead the named file into the message.\n\n~sstring\nCause the named string to become the current subject field.\n\n~tname ...\nAdd the given names to the direct recipient list.\n\n~v      Invoke an alternate editor (defined by the VISUAL option) on the message collected so\nfar.  Usually, the alternate editor will be a screen editor.  After you quit the edi‐\ntor, you may resume appending text to the end of your message.\n\n~wfilename\nWrite the message onto the named file.\n\n~x      Abort the message being sent.  No message is copied to ~/dead.letter, even if save is\nset.\n\n~?      Prints a brief summary of tilde escapes.\n\n~!command\nExecute the indicated shell command, then return to the message.\n\n~|command\nPipe the message through the command as a filter.  If the command gives no output  or\nterminates  abnormally,  retain the original text of the message.  The command fmt(1)\nis often used as command to rejustify the message.\n\n~:mail-command\n~mail-command\nExecute the given mail command.  Not all commands, however, are allowed.\n\n~~string\nInsert the string of text in the message prefaced by a single ~.  If you have changed\nthe escape character, then you should double that character in order to send it.\n\n~.      Simulate end of file on input.\n"
                    },
                    {
                        "name": "Mail options",
                        "content": "A number of options can be set in the .mailrc file to alter the behavior of mail,  controlled\nvia  the set and unset commands.  Options may be either binary, in which case it is only sig‐\nnificant to see whether they are set or not; or string, in which case the actual value is  of\ninterest.  The binary options include the following:\n\nappend  Causes  messages saved in mbox to be appended to the end rather than prepended.  This\nshould always be set (perhaps in /etc/mail.rc).\n\nask, asksub\nCauses mail to prompt you for the subject of each message you send.  If  you  respond\nwith simply a newline, no subject field will be sent.\n\naskbcc  Causes  you  to be prompted for additional blind carbon copy recipients at the end of\neach message.  Responding with a newline indicates your satisfaction with the current\nlist.\n\naskcc   Causes you to be prompted for additional carbon copy recipients at the  end  of  each\nmessage.   Responding  with  a  newline  indicates your satisfaction with the current\nlist.\n\nautoinc\nCauses new mail to be automatically incorporated when it arrives.   Setting  this  is\nsimilar to issuing the inc command at each prompt, except that the current message is\nnot reset when new mail arrives.\n\nautoprint\nCauses the delete command to behave like dp; thus, after deleting a message, the next\none will be typed automatically.\n\ndebug   Setting  the binary option debug is the same as specifying -d on the command line and\ncauses mail to output all sorts of information useful for debugging mail.\n\ndot     The binary option dot causes mail to interpret a period alone on a line as the termi‐\nnator of a message you are sending.\n\nexpandaddr\nCauses mail to expand message  recipient  addresses,  as  explained  in  the  section\n“Recipient address specifications”.\n\nfrom    Causes  mail  to use the specified sender address in the “From:” field of the message\nheader.  A stripped down version of the address is also used in the message envelope.\nIf unset, the message will not include an explicit sender address and a default value\nwill be added by the MTA, typically “user@host”.  This value  can  be  overridden  by\nspecifying the -r flag on the command line.\n\nhold    This option is used to hold messages in the system mailbox by default.\n\nignore  Causes interrupt signals from your terminal to be ignored and echoed as @'s.\n\nignoreeof\nAn  option  related to dot is ignoreeof which makes mail refuse to accept a control-D\nas the end of a message.  ignoreeof also applies to mail command mode.\n\nkeep    Setting this option causes mail to truncate your system mailbox instead  of  deleting\nit when it's empty.\n\nkeepsave\nMessages  saved  with  the  save command are not normally saved in mbox at quit time.\nUse this option to retain those messages.\n\nmetoo   Usually, when a group is expanded that contains the sender,  the  sender  is  removed\nfrom  the  expansion.   Setting  this  option causes the sender to be included in the\ngroup.\n\nnoheader\nSetting the option noheader is the same as giving the -N flag on the command line.\n\nnosave  Normally, when you abort a message with two interrupt characters (usually control-C),\nmail copies the partial letter to the file dead.letter in your home directory.   Set‐\nting the binary option nosave prevents this.\n\nquiet   Suppresses the printing of the version when first invoked.\n\nReplyall\nReverses the sense of reply and Reply commands.\n\nsearchheaders\nIf  this  option is set, then a message-list specifier in the form “/x:y” will expand\nto all messages containing the substring ‘y’ in the header  field  ‘x’.   The  string\nsearch  is  case  insensitive.   If  ‘x’ is omitted, it will default to the “Subject”\nheader field.  The form “/to:y” is a special case, and will expand  to  all  messages\ncontaining the substring ‘y’ in the “To”, “Cc” or “Bcc” header fields.  The check for\n“to”  is  case  sensitive, so that “/To:y” can be used to limit the search for ‘y’ to\njust the “To:” field.\n\nskipempty\nDon't send messages with an empty body.\n\nverbose\nSetting the option verbose is the same as using the -v  flag  on  the  command  line.\nWhen  mail  runs in verbose mode, the actual delivery of messages is displayed on the\nuser's terminal.\n"
                    },
                    {
                        "name": "Option string values",
                        "content": "EDITOR        Pathname of the text editor to use in the edit command and ~e escape.   If  not\ndefined, /usr/bin/ex is used.\n\nLISTER        Pathname  of  the  directory  lister to use in the folders command.  Default is\n/bin/ls.\n\nMBOX          The name of the mbox file.  It can be the name of a  folder.   The  default  is\n“mbox” in the user's home directory.\n\nPAGER         Pathname  of the program to use in the more command or when the crt variable is\nset.  The default paginator more(1) is used if this option is not defined.\n\nREPLYTO       If set, will be used to initialize the Reply-To field for outgoing messages.\n\nSHELL         Pathname of the shell to use in the ! command and the  ~!  escape.   A  default\nshell is used if this option is not defined.\n\nVISUAL        Pathname of the text editor to use in the visual command and ~v escape.  If not\ndefined, /usr/bin/vi is used.\n\ncrt           The  valued  option  crt is used as a threshold to determine how long a message\nmust be before PAGER is used to read it.  If crt is set without a  value,  then\nthe  height  of the terminal screen stored in the system is used to compute the\nthreshold (see stty(1)).\n\nescape        If defined, the first character of this option gives the character  to  use  in\nthe place of ~ to denote escapes.\n\nfolder        The name of the directory to use for storing folders of messages.  If this name\nbegins with a ‘/’, mail considers it to be an absolute pathname; otherwise, the\nfolder directory is found relative to your home directory.\n\nindentprefix  String used by the ~m tilde escape for indenting messages, in place of the nor‐\nmal  tab character (‘^I’).  Be sure to quote the value if it contains spaces or\ntabs.\n\nrecord        If defined, gives the pathname of the file used to record  all  outgoing  mail.\nIf not defined, then outgoing mail is not so saved.\n\nscreen        Size of window of message headers for z.\n\nsendmail      Pathname to an alternative mail delivery system.\n\ntoplines      If  defined,  gives the number of lines of a message to be printed out with the\ntop command; normally, the first five lines are printed.\n"
                    }
                ]
            },
            "ENVIRONMENT": {
                "content": "mail utilizes the HOME, LOGNAME, USER, SHELL, DEAD, PAGER, LISTER, EDITOR,  VISUAL,  REPLYTO,\nMAIL, MAILRC, and MBOX environment variables.\n\nIf  the  MAIL  environment  variable is set, its value is used as the path to the user's mail\nspool.\n",
                "subsections": []
            },
            "FILES": {
                "content": "/var/mail/*                      post office (unless overridden by the MAIL environment vari‐\nable)\n~/mbox                           user's old mail\n~/.mailrc                        file giving initial mail commands; can be overridden by set‐\nting the MAILRC environment variable\n/tmp/R*                          temporary files\n/usr/share/bsd-mailx/mail.*help  help files\n/etc/mail.rc                     system initialization file\n",
                "subsections": []
            },
            "EXIT STATUS": {
                "content": "The mail utility exits 0 on success, and >0 if an error occurs.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "fmt(1), newaliases(1), vacation(1), aliases(5),  mail.local(8),  newaliases(8),  sendmail(8),\nsmtpd(8)\n\nKurt Shoens, “Mail Reference Manual”, 4.4BSD User's Supplementary Documents (USD).\n",
                "subsections": []
            },
            "STANDARDS": {
                "content": "The mailx utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification.\n\nThe flags [-iNnu] are marked by IEEE Std 1003.1-2008 (“POSIX.1”) as being optional.\n\nThe  flags  [-eFH]  are marked by IEEE Std 1003.1-2008 (“POSIX.1”) as being optional, and are\nnot supported by this implementation of mailx.\n\nThe flags [-abcdEIrv] are extensions to the specification.\n",
                "subsections": []
            },
            "HISTORY": {
                "content": "A mail command appeared in Version 1 AT&T UNIX.  This man  page  is  derived  from  the  Mail\nReference Manual originally written by Kurt Shoens.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Usually, Mail and mailx are just links to mail, which can be confusing.\n\nDebian                                     March 31, 2022                                    MAIL(1)",
                "subsections": []
            }
        }
    }
}