{
    "content": [
        {
            "type": "text",
            "text": "# bsd-mailx(1) (man)\n\n**Summary:** mail, mailx, Mail — send and receive mail\n\n**Synopsis:** mail [-dEIinv] [-a header] [-b bcc-addr] [-c cc-addr] [-r from-addr] [-s subject] [--] to-addr\n...\nmail [-dEIiNnv] -f [file]\nmail [-dEIiNnv] [-u user]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -a | — | — | can be also used to override MIME headers mail adds by default to each outgoing mail, see Character sets and MIME below. |\n| -b | — | — | Send blind carbon copies to bcc-addr. |\n| -c | — | — | Send carbon copies to list of users. cc-addr should be a comma separated list of names. |\n| -d | — | — |  |\n| -E | — | — |  |\n| -f | — | — | quit, mail writes undeleted messages back to this file. |\n| -I | — | — | lar, the special ~ command character, used when sending mail, is only available inter‐ actively. |\n| -i | — | — | phone lines. |\n| -N | — | — |  |\n| -n | — | — |  |\n| -r | — | — | Use from-addr as the from address in the message and envelope. Overrides any from op‐ tions in the startup files. |\n| -s | — | — | Specify subject on command line (only the first argument after the -s flag is used as a subject; be careful to quote sub |\n| -u | — | — | Equivalent to: $ mail -f /var/mail/user except that locking is done. |\n| -v | — | — | -- End of options. Any further argument is treated as a direct receipient address. Note: For security reasons the -- sep |\n\n## See Also\n\n- fmt(1)\n- newaliases(1)\n- vacation(1)\n- aliases(5)\n- mail.local(8)\n- newaliases(8)\n- sendmail(8)\n- smtpd(8)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (5 lines)\n- **DESCRIPTION** (5 lines) — 24 subsections\n  - -a (5 lines)\n  - -b (2 lines)\n  - -c (3 lines)\n  - -d (1 lines)\n  - -E (1 lines)\n  - -f (2 lines)\n  - -I (3 lines)\n  - -i (2 lines)\n  - -N (1 lines)\n  - -n (1 lines)\n  - -r (3 lines)\n  - -s (3 lines)\n  - -u (6 lines)\n  - -v (5 lines)\n  - Startup actions (6 lines)\n  - Sending mail (5 lines)\n  - Reading mail (6 lines)\n  - Disposing of mail (5 lines)\n  - Specifying messages (17 lines)\n  - Replying to or originating mail (9 lines)\n  - Ending a mail processing session (4 lines)\n  - Personal and system wide distribution lists (13 lines)\n  - Recipient address specifications (20 lines)\n  - Character sets and MIME (11 lines)\n- **SUMMARY** (22 lines) — 12 subsections\n  - alternates (33 lines)\n  - folders (4 lines)\n  - headers (32 lines)\n  - preserve (20 lines)\n  - respond (12 lines)\n  - saveignore (3 lines)\n  - saveretain (22 lines)\n  - unalias (3 lines)\n  - undelete (18 lines)\n  - Tilde/escapes (84 lines)\n  - Mail options (90 lines)\n  - Option string values (45 lines)\n- **ENVIRONMENT** (6 lines)\n- **FILES** (9 lines)\n- **EXIT STATUS** (2 lines)\n- **SEE ALSO** (3 lines)\n- **STANDARDS** (9 lines)\n- **HISTORY** (3 lines)\n- **BUGS** (3 lines)\n\n## Full Content\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] [--] to-addr\n...\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\nThe options are as follows:\n\n#### -a\n\ncan be also used to override MIME headers mail adds by default to each outgoing mail,\nsee Character sets and MIME below.  You have to use quotes if the string contains spa‐\nces.  This argument may be specified more than once, the headers will then be concate‐\nnated.\n\n#### -b\n\nSend blind carbon copies to bcc-addr.\n\n#### -c\n\nSend carbon copies to list of users.  cc-addr should be a comma separated list of\nnames.\n\n#### -d\n\n#### -E\n\n#### -f\n\nquit, mail writes undeleted messages back to this file.\n\n#### -I\n\nlar, the special ~ command character, used when sending mail, is only available inter‐\nactively.\n\n#### -i\n\nphone lines.\n\n#### -N\n\n#### -n\n\n#### -r\n\nUse from-addr as the from address in the message and envelope.  Overrides any from op‐\ntions in the startup files.\n\n#### -s\n\nSpecify subject on command line (only the first argument after the -s flag is used as a\nsubject; be careful to quote subjects containing spaces).\n\n#### -u\n\nEquivalent to:\n\n$ mail -f /var/mail/user\n\nexcept that locking is done.\n\n#### -v\n\n--      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\n#### Startup actions\n\nAt 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 com‐\nmand file ~/.mailrc are executed.  mail then examines its command line options to determine\nwhether the user requested a new message to be sent or existing messages in a mailbox to be ex‐\namined.\n\n#### Sending mail\n\nTo send a message to one or more people, mail can be invoked with arguments which are the names\nof people to whom the mail will be sent.  You are then expected to type in your message, fol‐\nlowed by a control-D (‘^D’) at the beginning of a line.  The section below, Replying to or\noriginating mail, describes some features of mail available to help you compose your letter.\n\n#### Reading mail\n\nIn 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 abbre‐\nviated p).  Moving among the messages is much like moving between lines in ed(1); you may use +\nand - to shift forwards and backwards, or simply enter a message number to move directly.\n\n#### Disposing of mail\n\nAfter examining a message you can delete (d) or reply (r) to it.  Deletion causes the mail pro‐\ngram to forget about the message.  This is not irreversible; the message can be undeleted (u)\nby 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\n#### Specifying messages\n\nCommands such as print and delete can be given a list of message numbers as arguments to apply\nto a number of messages at once.  Thus delete 1 2 deletes messages 1 and 2, while delete 1-5\ndeletes 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 * to\nprint the first few lines of all messages.\n\n#### Replying to or originating mail\n\nYou can use the reply command to set up a response to a message, sending it back to the person\nwho it was from.  Text you then type in, up to an end-of-file, defines the contents of the mes‐\nsage.  While you are composing a message, mail treats lines beginning with the tilde (‘~’)\ncharacter specially.  For instance, typing ~m (alone on a line) will place a copy of the cur‐\nrent message into the response, right shifting it by a single tab-stop (see the indentprefix\nvariable, below).  Other escapes will set up subject fields, add and delete recipients to the\nmessage, and allow you to escape to an editor to revise the message or to a shell to run some\ncommands.  (These options are given in the summary below.)\n\n#### Ending a mail processing session\n\nYou can end a mail session with the quit (q) command.  Messages which have been examined go to\nyour mbox file unless they have been deleted, in which case they are discarded.  Unexamined\nmessages go back to the post office (see the -f option above).\n\n#### Personal and system wide distribution lists\n\nIt 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 a\nline 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 displayed\nwith the alias command in mail.  System wide distribution lists can be created by editing\n/etc/aliases, (see aliases(5)); these are kept in a different syntax.  In mail you send, per‐\nsonal aliases will be expanded in mail sent to others so that they will be able to reply to the\nrecipients.  System wide aliases are not expanded when the mail is sent, but any reply returned\nto the machine will have the system wide alias expanded as all mail goes through an MTA.\n\n#### Recipient address specifications\n\nRecipient 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.  The\ncommand immediately following the ‘|’ is executed with the message as its standard in‐\nput.\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 recipient\nis treated as a local or network mail address.\n\n#### Character sets and MIME\n\nGenerally 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\n### SUMMARY\n\n(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 pre‐\nfix is used.  For commands which take message lists as arguments, if no message list is given,\nthen the next message forward which satisfies the command's requirements is used.  If there are\nno messages forward of the current message, the search proceeds backwards, and if there are no\ngood messages at all, mail types “No applicable messages” and aborts the command.\n\n-       Print out the preceding message.  If given a numeric argument n, goes to the nth previ‐\nous 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 an\nold one.\n\n#### alternates\n\n(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 to\nmessages, mail will not send a copy of the message to any of the addresses listed on\nthe alternates list.  If the alternates command is given with no argument, the current\nset of alternate names is displayed.\n\nchdir   (cd or ch) Changes the user's working directory to that specified, if given.  If no di‐\nrectory 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 next\nmessage, mail says “No more messages.”\n\nedit    (e) Takes a list of messages and points the text editor at each one in turn.  On return\nfrom 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 system\nmailbox, his mbox file, or his 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 the\nnew file.  Some special conventions are recognized for the name.  # means the previous\nfile, % means your system mailbox, %user means user's system mailbox, & means your mbox\nfile, and +folder means a file in your folder directory.\n\n#### folders\n\nList the names of the folders in your folder directory.\n\nfrom    (f) Takes a list of messages and prints their message headers.\n\n#### headers\n\n(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 in\nthe user's system mailbox instead of in mbox.  Does not override the delete command.\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.  If\nignore 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 mes‐\nsages are added to the end of the message list, and the current message is reset to be\nthe first new mail message.  This does not renumber the existing message list, nor does\nit 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 those\npeople.\n\nmbox    Indicate that a list of messages be sent to mbox in your home directory when you quit.\nThis is the default action for messages if you do not have the hold option set.\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 argument\nlist, types the next matching message.\n\n#### preserve\n\n(pre) A synonym for hold.\n\nPrint   (P) Like print but also prints out ignored header fields.  See also print, ignore, and\nretain.\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 user's mbox\nfile in his login directory, preserving all messages marked with hold or preserve or\nnever referenced in his system mailbox, and removing all other messages from his system\nmailbox.  If new mail has arrived during the session, the message “You have new mail”\nis given.  If given while editing a mailbox file with the -f flag, then the edit file\nis rewritten.  A return to the shell is effected, unless the rewrite of edit file\nfails, 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 speci‐\nfied message.  The default message must not be deleted.\n\n#### respond\n\nA 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 header\nfields are suppressed.  The Type and Print commands can be used to print a message in\nits entirety.  If retain is executed with no arguments, it lists the current set of re‐\ntained fields.\n\nsave    (s) Takes a message list and a filename and appends each message in turn to the end of\nthe file.  The filename in quotes, followed by the line count and character count is\nechoed on the user's terminal.\n\n#### saveignore\n\nsaveignore is to save what ignore is to print and type.  Header fields thus marked are\nfiltered out when saving a message by save or when automatically saving to mbox.\n\n#### saveretain\n\nsaveretain is to save what retain is to print and type.  Header fields thus marked are\nthe only ones saved with a message when saving by save or when automatically saving to\nmbox.  saveretain overrides saveignore.\n\nset     (se) With no arguments, prints all variable values.  Otherwise, sets option.  Arguments\nare of the form option=value (no space before or after =) or option.  Quotation marks\nmay be placed around any part of the assignment statement to quote blanks or tabs,\ni.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 printed\nis 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\n#### unalias\n\nTakes a list of names defined by alias commands and discards the remembered groups of\nusers.  The group names no longer have any significance.\n\n#### undelete\n\n(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 set.\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, you\ncan move to the previous window by using z-.\n\n#### Tilde/escapes\n\nHere is a summary of the tilde escapes, which are used when composing messages to perform spe‐\ncial functions.  Tilde escapes are only recognized at the beginning of lines.  The name “tilde\nescape” is somewhat of a misnomer since the actual escape character can be set by the option\nescape.\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 or\nretain command) are not included.\n\n~h      Edit the message header fields by typing each one in turn and allowing the user to ap‐\npend text to the end or modify the field by using the current terminal erase and kill\ncharacters.\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 value\nof indentprefix.  If no messages are specified, read the current message.  Message\nheaders currently being ignored (by the ignore or retain command) are not included.\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 directory\nif 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) is\noften 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\n#### Mail options\n\nA 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 signif‐\nicant to see whether they are set or not; or string, in which case the actual value is of in‐\nterest.  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 mes‐\nsage.  Responding with a newline indicates your satisfaction with the current list.\n\nautoinc\nCauses new mail to be automatically incorporated when it arrives.  Setting this is sim‐\nilar to issuing the inc command at each prompt, except that the current message is not\nreset 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 termina‐\ntor of a message you are sending.\n\nexpandaddr\nCauses mail to expand message recipient addresses, as explained in the section\nRecipient 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 spec‐\nifying 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 as\nthe 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 it\nwhen it's empty.\n\nkeepsave\nMessages saved with the save command are not normally saved in mbox at quit time.  Use\nthis option to retain those messages.\n\nmetoo   Usually, when a group is expanded that contains the sender, the sender is removed from\nthe expansion.  Setting this option causes the sender to be included in the group.\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.  Setting\nthe 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 to\nall messages containing the substring ‘y’ in the header field ‘x’.  The string search\nis case insensitive.  If ‘x’ is omitted, it will default to the “Subject” header field.\nThe form “/to:y” is a special case, and will expand to all messages containing the sub‐\nstring ‘y’ in the “To”, “Cc” or “Bcc” header fields.  The check for “to” is case sensi‐\ntive, so that “/To:y” can be used to limit the search for ‘y’ to just 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.  When\nmail runs in verbose mode, the actual delivery of messages is displayed on the user's\nterminal.\n\n#### Option string values\n\nEDITOR        Pathname of the text editor to use in the edit command and ~e escape.  If not de‐\nfined, /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 shell\nis 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 must\nbe before PAGER is used to read it.  If crt is set without a value, then the\nheight of the terminal screen stored in the system is used to compute the thresh‐\nold (see stty(1)).\n\nescape        If defined, the first character of this option gives the character to use in the\nplace 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 normal\ntab character (‘^I’).  Be sure to quote the value if it contains spaces or tabs.\n\nrecord        If defined, gives the pathname of the file used to record all outgoing mail.  If\nnot 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 top\ncommand; normally, the first five lines are printed.\n\n### ENVIRONMENT\n\nmail 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\n### FILES\n\n/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\n### EXIT STATUS\n\nThe mail utility exits 0 on success, and >0 if an error occurs.\n\n### SEE ALSO\n\nfmt(1), newaliases(1), vacation(1), aliases(5), mail.local(8), newaliases(8), sendmail(8),\nsmtpd(8)\n\n### STANDARDS\n\nThe 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 not\nsupported by this implementation of mailx.\n\nThe flags [-abcdEIrv] are extensions to the specification.\n\n### HISTORY\n\nA mail command appeared in Version 3 AT&T UNIX.  This man page is derived from the Mail\nReference Manual originally written by Kurt Shoens.\n\n### BUGS\n\nUsually, Mail and mailx are just links to mail, which can be confusing.\n\nBSD                             March 16, 2018                             BSD\n\n"
        }
    ],
    "structuredContent": {
        "command": "bsd-mailx",
        "section": "1",
        "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] [--] to-addr\n...\nmail [-dEIiNnv] -f [file]\nmail [-dEIiNnv] [-u user]",
        "flags": [
            {
                "flag": "-a",
                "long": null,
                "arg": null,
                "description": "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 contains spa‐ ces. This argument may be specified more than once, the headers will then be concate‐ nated."
            },
            {
                "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": "lar, the special ~ command character, used when sending mail, is only available inter‐ actively."
            },
            {
                "flag": "-i",
                "long": null,
                "arg": null,
                "description": "phone lines."
            },
            {
                "flag": "-N",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "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 op‐ tions 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": 1,
                        "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": 5
                    },
                    {
                        "name": "Reading mail",
                        "lines": 6
                    },
                    {
                        "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": 13
                    },
                    {
                        "name": "Recipient address specifications",
                        "lines": 20
                    },
                    {
                        "name": "Character sets and MIME",
                        "lines": 11
                    }
                ]
            },
            {
                "name": "SUMMARY",
                "lines": 22,
                "subsections": [
                    {
                        "name": "alternates",
                        "lines": 33
                    },
                    {
                        "name": "folders",
                        "lines": 4
                    },
                    {
                        "name": "headers",
                        "lines": 32
                    },
                    {
                        "name": "preserve",
                        "lines": 20
                    },
                    {
                        "name": "respond",
                        "lines": 12
                    },
                    {
                        "name": "saveignore",
                        "lines": 3
                    },
                    {
                        "name": "saveretain",
                        "lines": 22
                    },
                    {
                        "name": "unalias",
                        "lines": 3
                    },
                    {
                        "name": "undelete",
                        "lines": 18
                    },
                    {
                        "name": "Tilde/escapes",
                        "lines": 84
                    },
                    {
                        "name": "Mail options",
                        "lines": 90
                    },
                    {
                        "name": "Option string values",
                        "lines": 45
                    }
                ]
            },
            {
                "name": "ENVIRONMENT",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "EXIT STATUS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "STANDARDS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}