📄 mail.1
字号:
.\" Copyright (c) 1980, 1990, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)mail.1 8.2 (Berkeley) 12/30/93.\".Dd December 30, 1993.Dt MAIL 1.Os BSD 4.Sh NAME.Nm mail.Nd send and receive mail.Sh SYNOPSIS.Nm mail.Op Fl iInv.Op Fl s Ar subject.Op Fl c Ar cc-addr.Op Fl b Ar bcc-addr.Ar to-addr....Nm mail.Op Fl iInNv.Fl f.Op Ar name.Nm mail.Op Fl iInNv.Op Fl u Ar user.Sh INTRODUCTION.Nm Mailis an intelligent mail processing system, which hasa command syntax reminiscent of.Xr \&ed 1with lines replaced by messages..Pp.Bl -tag -width flag.It Fl vVerbose mode.The details ofdelivery are displayed on the user's terminal..It Fl iIgnore tty interrupt signals.This isparticularly useful when using.Nm mailon noisy phone lines..It Fl IForces mail to run in interactive mode even wheninput isn't a terminal.In particular, the.Sq Ic \&~specialcharacter when sending mail is only active in interactive mode..It Fl nInhibits reading.Pa /usr/share/misc/Mail.rcupon startup..It Fl NInhibits the initial display of message headerswhen reading mail or editing a mail folder..It Fl sSpecify subject on command line(only the first argument after the.Fl sflag is used as a subject; be careful to quote subjectscontaining spaces.).It Fl cSend carbon copies to.Ar listof users..It Fl bSend blind carbon copies to.Ar list .List should be a comma-separated list of names..It Fl fRead in the contents of your.Ar mbox(or the specified file)for processing; when you.Ar quit ,.Nm mailwrites undeleted messages back to this file..It Fl uIs equivalent to:.Pp.Dl mail -f /var/spool/mail/user.El.Ss Sending mailTo send a message to one or more people,.Nm mailcan be invoked with arguments which are the names of people towhom the mail will be sent.You are then expected to type inyour message, followedby an.Sq Li control\-Dat the beginning of a line.The section below.Ar Replying to or originating mail ,describes some features of.Nm mailavailable to help you compose your letter..Pp.Ss Reading mailIn normal usage.Nm mailis given no arguments and checks your mail out of thepost office, thenprints out a one line header of each message found.The current message is initially the first message (numbered 1)and can be printed using the.Ic printcommand (which can be abbreviated.Ql Ic p ) .You can move among the messages much as you move between lines in.Xr \&ed 1 ,with the commands.Ql Ic \&+and.Ql Ic \&\-moving backwards and forwards, andsimple numbers..Pp.Ss Disposing of mail.After examining a message you can.Ic delete.Ql Ic d )the message or.Ic reply.Ql Ic r )to it.Deletion causes the.Nm mailprogram to forget about the message.This is not irreversible; the message can be.Ic undeleted.Ql Ic u )by giving its number, or the.Nm mailsession can be aborted by giving the.Ic exit.Ql Ic x )command.Deleted messages will, however, usually disappear never to be seen again..Pp.Ss Specifying messagesCommands such as.Ic printand.Ic deletecan be given a list of message numbers as arguments to applyto a number of messages at once.Thus.Dq Li delete 1 2deletes messages 1 and 2, while.Dq Li delete 1\-5deletes messages 1 through 5.The special name.Ql Li \&*addresses all messages, and.Ql Li \&$addressesthe last message; thus the command.Ic topwhich prints the first few lines of a message could be used in.Dq Li top \&*to print the first few lines of all messages..Pp.Ss Replying to or originating mail.You can use the.Ic replycommand toset up a response to a message, sending it back to theperson 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,.Nm mailtreats lines beginning with the character.Ql Ic \&~specially.For instance, typing.Ql Ic \&~m(alone on a line) will place a copyof the current message into the response right shifting it by a tabstop(see.Em indentprefixvariable, below).Other escapes will set up subject fields, add and delete recipientsto the message and allow you to escape to an editor to revise themessage or to a shell to run some commands.(These optionsare given in the summary below.).Pp.Ss Ending a mail processing session.You can end a.Nm mailsession with the.Ic quit.Ql Ic q )command.Messages which have been examined go to your.Ar mboxfile unless they have been deleted in which case they are discarded.Unexamined messages go back to the post office.(See the.Fl foption above)..Pp.Ss Personal and systemwide distribution lists.It is also possible to create a personal distribution lists so that,for instance, you can send mail to.Dq Li cohortsand have it goto a group of people.Such lists can be defined by placing a line like.Pp.Dl alias cohorts bill ozalp jkf mark kridle@ucbcory.Ppin the file.Pa \&.mailrcin your home directory.The current list of such aliases can be displayed with the.Ic aliascommand in.Nm mail .System wide distribution lists can be created by editing.Pa /etc/aliases ,see.Xr aliases 5and.Xr sendmail 8 ;these are kept in a different syntax.In mail you send, personal aliases will be expanded in mail sentto others so that they will be able to.Ic replyto the recipients.System wide.Ic aliasesare not expanded when the mail is sent,but any reply returned to the machine will have the system widealias expanded as all mail goes through.Xr sendmail ..Pp.Ss Network mail (ARPA, UUCP, Berknet)See.Xr mailaddr 7for a description of network addresses..Pp.Nm Mailhas a number of options which can be set in the.Pa .mailrcfile to alter its behavior; thus.Dq Li set askccenables the.Ar askccfeature.(These options are summarized below.).Sh SUMMARY(Adapted from the `Mail Reference Manual').PpEach command is typed on a line by itself, and may take argumentsfollowing the command word.The command need not be typed in itsentirety \- the first command which matches the typed prefix is used.For commands which take message lists as arguments, if no messagelist is given, then the next message forward which satisfies thecommand's requirements is used.If there are no messages forward ofthe current message, the search proceeds backwards, and if there are nogood messages at all,.Nm mailtypes.Dq Li No applicable messagesandaborts the command..Bl -tag -width delete.It Ic \&\-Print out the preceding message.If given a numericargument.Ar n ,goes to the.Ar n Ns 'thprevious message and prints it..It Ic \&?Prints a brief summary of commands..It Ic \&!Executes the shell(see.Xr sh 1and.Xr csh 1 )command which follows..It Ic Print.Pq Ic PLike.Ic printbut also prints out ignored header fields.See also.Ic print ,.Ic ignoreand.Ic retain ..It Ic Reply.Pq Ic RReply to originator.Does not reply to otherrecipients of the original message..It Ic Type.Pq Ic TIdentical to the.Ic Printcommand..It Ic alias.Pq Ic aWith no arguments, prints out all currently-defined aliases.With oneargument, prints out that alias.With more than one argument, createsa new alias or changes an old one..It Ic alternates.Pq Ic altThe.Ic alternatescommand is useful if you have accounts on several machines.It can be used to inform.Nm mailthat the listed addresses are really you.When you.Ic replyto messages,.Nm mailwill not send a copy of the message to any of the addresseslisted on the.Ic alternateslist.If the.Ic alternatescommand is given with no argument, the current set of alternatenames is displayed..It Ic chdir.Pq Ic cChanges the user's working directory to that specified, if given.Ifno directory is given, then changes to the user's login directory..It Ic copy.Pq Ic coThe.Ic copycommand does the same thing that.Ic savedoes, except that it does not mark the messages itis used on for deletion when you quit..It Ic delete.Pq Ic dTakes a list of messages as argument and marks them all as deleted.Deleted messages will not be saved in.Ar mbox ,nor will they be available for most other commands..It Ic dp(also.Ic dt )Deletes the current message and prints the next message.If there is no next message,.Nm mailsays.Dq Li "at EOF" ..It Ic edit.Pq Ic eTakes a list of messages and points the text editor at each one inturn.On return from the editor, the message is read back in..It Ic exit.Pf ( Ic exor.Ic x )Effects an immediate return to the Shell withoutmodifying the user's system mailbox, his.Ar mboxfile, or his edit file in.Fl f ..It Ic file.Pq Ic fiThe same as.Ic folder ..It Ic foldersList the names of the folders in your folder directory..It Ic folder.Pq Ic foThe.Ic foldercommand switches to a new mail file or folder.With noarguments, it tells you which file you are currently reading.If you give it an argument, it will write out changes (suchas deletions) you have made in the current file and read inthe new file.Some special conventions are recognized forthe name.# means the previous file, % means your systemmailbox, %user means user's system mailbox, & meansyour.Ar mboxfile, and\&+\&folder means a file in your folderdirectory..It Ic from.Pq Ic fTakes a list of messages and prints their message headers..It Ic headers.Pq Ic hLists the current range of headers, which is an 18\-message group.Ifa.Ql \&+argument is given, then the next 18\-message group is printed, and ifa.Ql \&\-argument is given, the previous 18\-message group is printed..It Ic helpA synonym for.Ic \&?.It Ic hold.Pf ( Ic ho ,also.Ic preserve )Takes a message list and marks eachmessage therein to be saved in theuser's system mailbox instead of in.Ar mbox .Does not override the.Ic deletecommand..It Ic ignoreAdd the list of header fields named to the.Ar ignored list .Header fields in the ignore list are not printedon your terminal when you print a message.Thiscommand is very handy for suppression of certain machine-generatedheader fields.The.Ic Typeand.Ic Printcommands can be used to print a message in its entirety, includingignored fields.If.Ic ignoreis executed with no arguments, it lists the current set ofignored fields..It Ic mail.Pq Ic mTakes as argument login names and distribution group names and sendsmail to those people..It Ic mboxIndicate that a list of messages be sent to.Ic mboxin your home directory when you quit.This is the defaultaction for messages if you do.Em nothave the.Ic holdoption set..It Ic next.Pq Ic nlike.Ic \&+or.Tn CR )Goes to the next message in sequence and types it.With an argument list, types the next matching message..It Ic preserve.Pq Ic preA synonym for.Ic hold ..It Ic print.Pq Ic pTakes a message list and types out each message on the user's terminal..It Ic quit.Pq Ic qTerminates the session, saving all undeleted, unsaved messages inthe user's.Ar mboxfile in his login directory, preserving all messages marked with.Ic holdor.Ic preserveor never referenced
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -