MAIL(1)
๐ MAIL(1) โ General Commands Manual ๐
okay bestie, welcome to the MAIL(1) page. It's giving iconic Unix mail energy, and we're about to read every single detail together. No skimming, no cap. ๐
โจ NAME โจ
mail, mailx, Mail โ send and receive mail. That's the whole vibe. ๐
๐ฌ SYNOPSIS ๐ฌ
mail [-dEIinv] [-a header] [-b bcc-addr] [-c cc-addr] [-r from-addr]
[-s subject] [--] to-addr ...
mail [-dEIiNnv] -f [file]
mail [-dEIiNnv] [-u user]
๐ธ DESCRIPTION ๐ธ
mail is an intelligent mail processing system which has a command syntax reminiscent of ed(1) with lines replaced by messages. It's literally ed(1) but make it mail, and we are obsessed. ๐
The options are as follows:
-aโ Specify additional header fields on the command line such as"X-Loop: foo@bar"etc. It can be also used to override MIME headersmailadds by default to each outgoing mail, see โCharacter sets and MIMEโ below. You have to use quotes if the string contains spaces. This argument may be specified more than once, the headers will then be concatenated. ๐ซถ-b bcc-addrโ Send blind carbon copies tobcc-addr. Sneaky but valid. ๐-c cc-addrโ Send carbon copies to list of users.cc-addrshould be a comma separated list of names. Commas are the moment. โจ-dโ Causesmailto output all sorts of information useful for debuggingmail. It's giving debug mode, very loud. ๐-Eโ Don't send messages with an empty body. No empty vibes allowed. ๐ซ-fโ Use an alternate mailbox. Defaults to the user'smboxif no file is specified. Whenquit,mailwrites undeleted messages back to this file. ๐๏ธ-Iโ Forcesmailto run in interactive mode, even when input is not a terminal. In particular, the special~command character, used when sending mail, is only available interactively. So if you want the~escapes, you need this. ๐-iโ Ignore tty interrupt signals. This is particularly useful when usingmailon noisy phone lines. Retro but valid. โ๏ธ-Nโ Inhibits initial display of message headers when reading mail or editing a mail folder. Sometimes you just want the messages, not the header spam. ๐ โโ๏ธ-nโ Inhibits reading/etc/mail.rcupon startup. No system rc for you. ๐-r from-addrโ Usefrom-addras the from address in the message and envelope. Overrides anyfromoptions in the startup files. Main character energy. ๐-s subjectโ Specify subject on command line (only the first argument after the-sflag is used as a subject; be careful to quote subjects containing spaces). So-s "hi bestie"not-s hi bestie. ๐ญ-u userโ Equivalent to:
$ mail -f /var/mail/user
except that locking is done. Locking is the extra slay. ๐
-vโ Verbose mode. The details of delivery are displayed on the user's terminal. You'll see everything. ๐--โ 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). This is not a drill. ๐จ
๐ Startup actions ๐
At startup time, mail will execute commands in the system command file, /etc/mail.rc, unless explicitly told not to by using the -n option. Next, the commands in the user's personal command file ~/.mailrc are executed. mail then examines its command line options to determine whether the user requested a new message to be sent or existing messages in a mailbox to be examined. It's a whole little startup routine. โจ
โ๏ธ Sending mail โ๏ธ
To send a message to one or more people, mail can be invoked with arguments which are the names of people to whom the mail will be sent. You are then expected to type in your message, followed by a control-D (โ^Dโ) at the beginning of a line. The section below, โReplying to or originating mailโ, describes some features of mail available to help you compose your letter. So type, then ^D, and you're done. ๐
๐ฅ Reading mail ๐ฅ
In normal usage, mail is given no arguments and checks your mail out of the post office, then prints out a one line header of each message found. The current message is initially set to the first message (numbered 1) and can be printed using the print command (which can be abbreviated p). Moving among the messages is much like moving between lines in ed(1); you may use + and - to shift forwards and backwards, or simply enter a message number to move directly. Very ed-coded, we love to see it. ๐
๐๏ธ Disposing of mail ๐๏ธ
After examining a message, you can delete (d) or reply (r) to it. Deletion causes the mail program to forget about the message. This is not irreversible; the message can be undeleted (u) by giving its number, or the mail session can be aborted by giving the exit (x) command. Deleted messages, however, will usually disappear, never to be seen again. So be careful, bestie. ๐ญ
๐ข Specifying messages ๐ข
Commands such as print and delete can be given a list of message numbers as arguments to apply to a number of messages at once. Thus delete 1 2 deletes messages 1 and 2, while delete 1-5 deletes messages 1 through 5. Group chat energy: you can address multiple messages at once. ๐ซถ
Messages may also be selected using one of the following categories:
*โ all messages$โ last message:dโ deleted messages:nโ new messages:oโ old messages:rโ read messages:uโ unread messages
Thus the command top, which prints the first few lines of a message, could be used in top * to print the first few lines of all messages. Iconic. โจ
๐ฌ Replying to or originating mail ๐ฌ
You can use the reply command to set up a response to a message, sending it back to the person who it was from. Text you then type in, up to an end-of-file, defines the contents of the message. While you are composing a message, mail treats lines beginning with the tilde (โ~โ) character specially. For instance, typing ~m (alone on a line) will place a copy of the current message into the response, right shifting it by a single tab-stop (see the indentprefix variable, below). Other escapes will set up subject fields, add and delete recipients to the message, and allow you to escape to an editor to revise the message or to a shell to run some commands. (These options are given in the summary below.) So ~ is your little command magic while composing. ๐ช
๐ Ending a mail processing session ๐
You can end a mail session with the quit (q) command. Messages which have been examined go to your mbox file unless they have been deleted, in which case they are discarded. Unexamined messages go back to the post office (see the -f option above). Bye bestie, but responsibly. ๐
๐ฏ Personal and system wide distribution lists ๐ฏ
It is also possible to create personal distribution lists so that, for instance, you can send mail to โcohortsโ and have it go to a group of people. Such lists can be defined by placing a line like
alias cohorts bill ozalp jkf mark kridle@ucbcory
in the file .mailrc in your home directory. The current list of such aliases can be displayed with the alias command in mail. System wide distribution lists can be created by editing /etc/aliases, (see aliases(5)); these are kept in a different syntax. In mail you send, personal aliases will be expanded in mail sent to others so that they will be able to reply to the recipients. System wide aliases are not expanded when the mail is sent, but any reply returned to the machine will have the system wide alias expanded as all mail goes through an MTA. Group chats but make it Unix. ๐ซ
๐ฎ Recipient address specifications ๐ฎ
Recipient addresses (any of the โToโ, โCcโ or โBccโ header fields) are subject to expansion when the expandaddr option is set.
An address may be expanded as follows:
- An address that starts with a pipe (
โ|โ) character is treated as a command to run. The command immediately following theโ|โis executed with the message as its standard input. - An address that starts with a
โ+โcharacter is treated as a folder. - An address that contains a
โ/โcharacter but noโ!โ,โ%โ, orโ@โcharacters is also treated as a folder. - If none of the above apply, the recipient is treated as a local or network mail address.
If the expandaddr option is not set (the default), no expansion is performed and the recipient is treated as a local or network mail address. So default is no expansion, no cap. ๐ซ
๐ค Character sets and MIME ๐ค
Generally mail does not handle neither different character sets nor any other MIME feature. Especially it does not perform any any conversions between character sets while displaying or sending mails. So no MIME magic, okay? ๐
Starting from April 2017, however, as a Debian extension this version of mail adds a few MIME headers to every outgoing mail in order to indicate that the mail is sent as 8-bit plain text data that uses character set encoding detected from the current locale(7) settings. The -a command-line option can be used to override those headers, for example:
$ mail -a 'Content-Type: text/plain; charset="ISO-8859-1"'
sets header indicating legacy character encoding. So if you need old-school charset vibes, use -a. ๐
๐ SUMMARY ๐
(Adapted from the โMail Reference Manualโ.)
Each command is typed on a line by itself, and may take arguments following the command word. The command need not be typed in its entirety โ the first command which matches the typed prefix is used. For commands which take message lists as arguments, if no message list is given, then the next message forward which satisfies the command's requirements is used. If there are no messages forward of the current message, the search proceeds backwards, and if there are no good messages at all, mail types โNo applicable messagesโ and aborts the command. So abbreviations are your friend, but only the first match wins. ๐
-โ Print out the preceding message. If given a numeric argumentn, goes to thenth previous message and prints it. Backwards but make it fashion. โช=โ Prints the currently selected message number. So you know where you are. ๐?โ Prints a brief summary of commands. Help is here. ๐!โ Executes the shell (seesh(1)andcsh(1)) command which follows. Shell escape, periodt. ๐ปaliasโ (a) With no arguments, prints out all currently defined aliases. With one argument, prints out that alias. With more than one argument, creates a new alias or changes an old one. Alias queen. ๐alternatesโ (alt) Thealternatescommand is useful if you have accounts on several machines. It can be used to informmailthat the listed addresses are really you. When you reply to messages,mailwill not send a copy of the message to any of the addresses listed on thealternateslist. If thealternatescommand is given with no argument, the current set of alternate names is displayed. Multiple accounts? Valid. ๐ซถchdirโ (cdorch) Changes the user's working directory to that specified, if given. If no directory is given, then changes to the user's login directory. Directory hopping. ๐copyโ (c) Thecopycommand does the same thing thatsavedoes, except that it does not mark the messages it is used on for deletion when you quit. Save but no delete. ๐ซกdeleteโ (d) Takes a list of messages as argument and marks them all as deleted. Deleted messages will not be saved inmbox, nor will they be available for most other commands. Gone but not forgotten? Actually forgotten. ๐dpโ (alsodt) Deletes the current message and prints the next message. If there is no next message,mailsays โNo more messages.โedit,eโ takes a list of messages and points the text editor at each one in turn. On return from the editor, the message is read back in. So like, you edit, you come back, it's updated. ๐exit,ex,xโ effects an immediate return to the shell without modifying the user's system mailbox,mboxfile, or edit file in-f. So it's the "I'm out, don't touch anything" move. ๐จfile,fiโ the same asfolder. Periodt.folder,foโ thefoldercommand switches to a new mail file or folder. With no arguments, it tells you which file you are currently reading. If you give it an argument, it will write out changes (such as deletions) you have made in the current file and read in the new file. Some special conventions are recognized for the name:#means the previous file,%means your system mailbox,%usermeans user's system mailbox,&means yourmboxfile, and+foldermeans a file in your folder directory. So many shortcuts, iykyk. ๐๏ธfoldersโ list the names of the folders in your folder directory. Like a little folder fashion show. ๐โจfrom,fโ takes a list of messages and prints their message headers. Just the receipts, bestie. ๐งพheaders,hโ lists the current windowful of headers. To view the next or previous group of headers, see thezcommand. So it's like scrolling but make it mail. ๐helpโ a synonym for?. So if you're confused, just ask. ๐hold,ho, alsopreserveโ takes a message list and marks each message therein to be saved in the user's system mailbox instead of inmbox. Does not override thedeletecommand. So it's like "keep this one safe, but delete still wins." ๐ก๏ธignoreโ add the list of header fields named to the ignored list. Header fields in the ignore list are not printed on your terminal when you print a message. This command is very handy for suppression of certain machine-generated header fields. TheTypeandPrintcommands can be used to print a message in its entirety, including ignored fields. Ifignoreis executed with no arguments, it lists the current set of ignored fields. So you can ghost those annoying headers. ๐incโ incorporate any new messages that have arrived while mail is being read. The new messages are added to the end of the message list, and the current message is reset to be the first new mail message. This does not renumber the existing message list, nor does it cause any changes made so far to be saved. So fresh mail, but no renumbering and no saving. ๐list,lโ list the valid mail commands. A menu of moves. ๐mail,mโ takes as argument login names and distribution group names and sends mail to those people. Slide into their inbox. โ๏ธmboxโ indicate that a list of messages be sent tomboxin your home directory when you quit. This is the default action for messages if you do not have theholdoption set. So it's the default "save to mbox" vibe. ๐ฆmore,moโ takes a message list and invokes the pager on that list. Because sometimes you need to scroll. ๐next,n, like+orCRโ goes to the next message in sequence and types it. With an argument list, types the next matching message. Next, next, next. โญ๏ธpreserve,preโ a synonym forhold. Same energy. ๐ซถPrint,Pโ likeprintbut also prints out ignored header fields. See alsoprint,ignore, andretain. So it shows everything, no secrets. ๐print,pโ takes a message list and types out each message on the user's terminal. Just prints it. ๐จ๏ธquit,qโ terminates the session, saving all undeleted, unsaved messages in themboxfile in the user's login directory, preserving all messages marked withholdorpreserveor never referenced in the user's system mailbox, and removing all other messages from the user's system mailbox. If new mail has arrived during the session, the message โYou have new mailโ is given. If given while editing a mailbox file with the-fflag, then the edit file is rewritten. A return to the shell is effected, unless the rewrite of edit file fails, in which case the user can escape with theexitcommand. So it's the big goodbye, but with rules. ๐Reply,Rโ reply to originator. Does not reply to other recipients of the original message. So just the sender, not the whole group chat. ๐ฉreply,rโ takes a message list and sends mail to the sender and all recipients of the specified message. The default message must not be deleted. So reply-all energy, but don't delete the original. ๐ฃ๏ธrespondโ a synonym forreply. Same thing, different name. ๐ฌretainโ add the list of header fields named to the retained list. Only the header fields in the retain list are shown on your terminal when you print a message. All other header fields are suppressed. TheTypeandPrintcommands can be used to print a message in its entirety. Ifretainis executed with no arguments, it lists the current set of retained fields. So it's the opposite ofignoreโ only the chosen ones show. ๐save,sโ takes a message list and a filename and appends each message in turn to the end of the file. The filename in quotes, followed by the line count and character count is echoed on the user's terminal. So it saves and tells you the stats. ๐พsaveignoreโsaveignoreis tosavewhatignoreis toprintandtype. Header fields thus marked are filtered out when saving a message bysaveor when automatically saving tombox. So it's ignore, but for saving. ๐ซsaveretainโsaveretainis tosavewhatretainis toprintandtype. Header fields thus marked are the only ones saved with a message when saving bysaveor when automatically saving tombox.saveretainoverridessaveignore. So it's retain, but for saving, and it wins. ๐set,seโ with no arguments, prints all variable values. Otherwise, sets option. Arguments are of the formoption=value(no space before or after=) oroption. Quotation marks may be placed around any part of the assignment statement to quote blanks or tabs, i.e.,set indentprefix="->". So you can customize your mail vibe. ๐๏ธshell,shโ invokes an interactive version of the shell. Escape to the command line. ๐sizeโ takes a message list and prints out the size in characters of each message. How many characters? This many. ๐sourceโ thesourcecommand reads commands from a file. So you can script your mail session. ๐topโ takes a message list and prints the top few lines of each. The number of lines printed is controlled by the variabletoplinesand defaults to five. Just a little peek. ๐Type,Tโ identical to thePrintcommand. Same asPrint. ๐type,tโ a synonym forprint. Just another name for print. ๐จ๏ธunaliasโ takes a list of names defined byaliascommands and discards the remembered groups of users. The group names no longer have any significance. So bye-bye aliases. ๐undelete,uโ takes a message list and marks each message as not being deleted. Oops, undo. โฉ๏ธunread,Uโ takes a message list and marks each message as not having been read. So you can pretend you never saw it. ๐unsetโ takes a list of option names and discards their remembered values; the inverse ofset. So it's the undo for settings. ๐๏ธvisual,vโ takes a message list and invokes the display editor on each message. Fancy editor time. โจwrite,wโ similar tosave, except that only the message body (without the header) is saved. Extremely useful for such tasks as sending and receiving source program text over the message system. So just the body, no header. ๐xit,xโ a synonym forexit. Same as exit. ๐ชzโ mail presents message headers in windowfuls as described under theheaderscommand. You can move mail's attention forward to the next window with thezcommand. Also, you can move to the previous window by usingz-. Sozfor next,z-for previous. ๐
โจ Tilde/escapes โจ
Here's the tea on tilde escapes, which are used when composing messages to perform special functions. Tilde escapes are only recognized at the beginning of lines. The name โtilde escapeโ is somewhat of a misnomer since the actual escape character can be set by the option escape. So even though we call them tilde escapes, the escape char can be changed. ๐
~bname ...โ add the given names to the list of carbon copy recipients but do not make the names visible in theCc:line ("blind" carbon copy). So secret cc. ๐คซ~cname ...โ add the given names to the list of carbon copy recipients. Regular cc. ๐~dโ read the filedead.letterfrom your home directory into the message. So it pulls in your dead letter. ๐~eโ invoke the text editor on the message collected so far. After the editing session is finished, you may continue appending text to the message. Edit, then keep typing. โ๏ธ~Fmessagesโ identical to~f, except all message headers are included. So like~fbut with all headers. ๐จ~fmessagesโ read the named messages into the message being sent. If no messages are specified, read in the current message. Message headers currently being ignored (by theignoreorretaincommand) are not included. So it includes messages, but not ignored headers. ๐ฅ~hโ edit the message header fields by typing each one in turn and allowing the user to append text to the end or modify the field by using the current terminal erase and kill characters. So you can edit headers one by one. โ๏ธ~Mmessagesโ identical to~m, except all message headers are included. Like~mbut all headers. ๐ฌ~mmessagesโ read the named messages into the message being sent, indented by a tab or by the value ofindentprefix. If no messages are specified, read the current message. Message headers currently being ignored (by theignoreorretaincommand) are not included. So it indents them. ๐~pโ print out the message collected so far, prefaced by the message header fields. So you can preview. ๐~qโ abort the message being sent, copying the message todead.letterin your home directory ifsaveis set. So if you bail, it might save to dead.letter. ๐ซ~Rstringโ usestringas theReply-Tofield. So you can set a custom reply-to. ๐ง~rfilename,~<filenameโ read the named file into the message. So you can include a file. ๐~sstringโ cause the namedstringto become the current subject field. So set the subject. ๐~tname ...โ add the given names to the direct recipient list. So add to the To: line. ๐ฌ~vโ invoke an alternate editor (defined by theVISUALoption) on the message collected so far. Usually, the alternate editor will be a screen editor. After you quit the editor, you may resume appending text to the end of your message. So fancy editor time. ๐ฅ๏ธ~wfilenameโ write the message onto the named file. So save it. ๐พ~xโ abort the message being sent. No message is copied to~/dead.letter, even ifsaveis set. So unlike~q, this one doesn't save to dead.letter. โ~?โ prints a brief summary of tilde escapes. So help for tilde escapes. โ~!commandโ execute the indicated shell command, then return to the message. So you can run a command mid-message. ๐~|commandโ pipe the message through the command as a filter. If the command gives no output or terminates abnormally, retain the original text of the message. The commandfmt(1)is often used as command to rejustify the message. So you can filter your message. ๐ฐ~:mail-command,~_mail-commandโ execute the given mail command. Not all commands, however, are allowed. So some mail commands work, some don't. โ ๏ธ~~stringโ insert the string of text in the message prefaced by a single~. If you have changed the escape character, then you should double that character in order to send it. So to send a literal tilde, you double it. ~~.โ simulate end of file on input. So it's like EOF. ๐
โจ Mail options โจ
okay so you can set a whole bunch of options in your .mailrc file to change how mail behaves, and you flip them with the set and unset commands. some of them are binary โ for those you only care whether they're on, not what they're worth โ and the rest are string options, where the actual value is the whole point. the binary girlies are these:
appendโ makes messages you save into mbox get appended to the end instead of prepended to the front. bestie, this one should always be set (maybe in/etc/mail.rc, so you never forget).ask,asksubโ makesmailask you for the subject of every message you send. if you just hit newline and nothing else, no subject field goes out at all. no subject, no problem.askbccโ prompts you for extra blind carbon copy recipients at the end of each message. hit newline and that means "yeah I'm happy with the list I already have."askccโ same vibe, but for extra carbon copy recipients at the end of each message. newline = you're satisfied with the current list.autoincโ new mail gets automatically incorporated when it arrives. it's basically like running theinccommand at every prompt, except the current message doesn't get reset when new mail shows up.autoprintโ makesdeleteact likedp, so after you delete a message, the next one just gets typed out for you automatically. main character convenience ๐debugโ setting this binary option is exactly the same as putting-don the command line, and it makesmailspit out all sorts of info that's genuinely useful for debuggingmail. it's giving detective energy ๐dotโ this binary option makesmailtreat a lone period on a line as the terminator of a message you're sending. yes, just a.all by itself.expandaddrโ makesmailexpand message recipient addresses, exactly as explained in the section "Recipient address specifications".fromโ makesmailuse the sender address you specify in theFrom:field of the message header. a stripped down version of that address also goes into the message envelope. if it's unset, the message won't include an explicit sender address, and a default value gets added by the MTA โ typicallyuser@host. and heads up, this value can be overridden by specifying the-rflag on the command line.holdโ holds messages in the system mailbox by default.ignoreโ makes interrupt signals from your terminal get ignored and echoed back as@'s.ignoreeofโ a cousin ofdot, this one makesmailrefuse to accept a control-D as the end of a message.ignoreeofalso applies tomailcommand mode.keepโ setting this makesmailtruncate your system mailbox instead of deleting it when it's empty.keepsaveโ messages saved with thesavecommand don't normally get saved in mbox at quit time. use this option to keep them around.metooโ usually, when a group gets expanded and the sender is in it, the sender is removed from the expansion. setting this option makes the sender stay included in the group. don't leave yourself out ๐ซถnoheaderโ setting this is the same as giving the-Nflag on the command line.nosaveโ normally, when you abort a message with two interrupt characters (usually control-C),mailcopies the partial letter into the filedead.letterin your home directory. setting this binary option stops that from happening.quietโ suppresses the printing of the version whenmailis first invoked. shhh ๐คซReplyallโ reverses the sense of thereplyandReplycommands. plot twist.searchheadersโ if this is set, then a message-list specifier shaped like/x:yexpands to all messages containing the substringyin the header fieldx. the string search is case insensitive. ifxis left out, it defaults to theSubjectheader field. the form/to:yis a special case and expands to all messages containing the substringyin theTo,CcorBccheader fields. but the check fortois case sensitive, so/To:ylets you limit the search foryto just theTo:field. iykyk โจskipemptyโ don't send messages with an empty body. no empty texts, we don't do that here ๐verboseโ setting this is the same as using the-vflag on the command line. whenmailruns in verbose mode, the actual delivery of messages gets displayed on your terminal. very "watch me cook" energy.
๐ Option string values ๐
these ones actually hold a value, so the value matters. slay:
EDITORโ the pathname of the text editor used by theeditcommand and the~eescape. if it's not defined,/usr/bin/exgets used.LISTERโ the pathname of the directory lister used by thefolderscommand. default is/bin/ls.MBOXโ the name of the mbox file. it can be the name of a folder. the default ismboxin the user's home directory.PAGERโ the pathname of the program used by themorecommand, or whenever thecrtvariable is set. if this option isn't defined, the default paginatormore(1)is used.REPLYTOโ if it's set, it gets used to initialize theReply-Tofield for outgoing messages.SHELLโ the pathname of the shell used by the!command and the~!escape. a default shell gets used if this option isn't defined.VISUALโ the pathname of the text editor used by thevisualcommand and the~vescape. if it's not defined,/usr/bin/vigets used.crtโ this valued option is a threshold that decides how long a message has to be beforePAGERgets used to read it. ifcrtis set without a value, then the height of the terminal screen stored in the system is used to compute that threshold (seestty(1)).escapeโ if it's defined, the first character of this option gives the character to use in place of~to denote escapes.folderโ the name of the directory used for storing folders of messages. if this name begins with a/,mailtreats it as an absolute pathname; otherwise the folder directory is found relative to your home directory.indentprefixโ the string used by the~mtilde escape for indenting messages, in place of the normal tab character (^I). be sure to quote the value if it contains spaces or tabs! ๐recordโ if it's defined, this gives the pathname of the file used to record all outgoing mail. if it's not defined, then outgoing mail is simply not saved.screenโ the size of the window of message headers forz.sendmailโ pathname to an alternative mail delivery system.toplinesโ if it's defined, this gives the number of lines of a message that get printed out with thetopcommand; normally, the first five lines are printed.
๐ธ ENVIRONMENT ๐ธ
mail utilizes the HOME, LOGNAME, USER, SHELL, DEAD, PAGER, LISTER, EDITOR, VISUAL, REPLYTO, MAIL, MAILRC, and MBOX environment variables. that's a whole roster ๐
if the MAIL environment variable is set, its value is used as the path to the user's mail spool.
๐ FILES ๐
/var/mail/*โ post office (unless overridden by theMAILenvironment variable)~/mboxโ user's old mail~/.mailrcโ file giving initial mail commands; can be overridden by setting theMAILRCenvironment variable/tmp/R*โ temporary files/usr/share/bsd-mailx/mail.*helpโ help files/etc/mail.rcโ system initialization file
๐ช EXIT STATUS ๐ช
the mail utility exits 0 on success, and >0 if an error occurs. so if it's zero we're chilling, and anything above zero means something went wrong.
๐ SEE ALSO ๐
fmt(1), newaliases(1), vacation(1), aliases(5), mail.local(8), newaliases(8), sendmail(8), smtpd(8)
Kurt Shoens, "Mail Reference Manual", 4.4BSD User's Supplementary Documents (USD).
๐ STANDARDS ๐
the mailx utility is compliant with the IEEE Std 1003.1-2008 ("POSIX.1") specification. certified, no cap ๐ฏ
the flags [-iNnu] are marked by IEEE Std 1003.1-2008 ("POSIX.1") as being optional.
the flags [-eFH] are marked by IEEE Std 1003.1-2008 ("POSIX.1") as being optional, and are not supported by this implementation of mailx.
the flags [-abcdEIrv] are extensions to the specification.
๐ฐ๏ธ HISTORY ๐ฐ๏ธ
a mail command appeared in Version 1 AT&T UNIX. this man page is derived from the Mail Reference Manual originally written by Kurt Shoens. we're standing on the shoulders of legends ๐ซก
๐ BUGS ๐
usually, Mail and mailx are just links to mail, which can be confusing. yeah bestie, that one's a little confusing fr fr.
and that's the whole page, bestie!! this one's from Debian, dated March 31, 2022, and the page itself is MAIL(1). go forth and send your emails, you've got this ๐โจ
๐ฆ where this page comes from
- debian bookworm: bsd-mailx 8.1.2-0.20220412cvs-1 ยท BSD-3-Clause
- debian trixie: bsd-mailx 8.1.2-0.20220412cvs-1.1 ยท BSD-3-Clause
- ubuntu noble: bsd-mailx 8.1.2-0.20220412cvs-1build1 ยท BSD-3-Clause
- ubuntu questing: bsd-mailx 8.1.2-0.20220412cvs-1.1
- ubuntu resolute: bsd-mailx 8.1.2-0.20220412cvs-1.1build1 ยท BSD-3-Clause
- ubuntu stonking: bsd-mailx 8.1.2-0.20220412cvs-1.1build1 ยท BSD-3-Clause
- Copyright (c) 1980, 1990, 1993 The Regents of the University of California. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms