📄 sendmail.8
字号:
.\" Copyright (c) 1988, 1991, 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..\".\" @(#)sendmail.8 8.4 (Berkeley) 12/11/93.\".Dd December 11, 1993.Dt SENDMAIL 8.Os BSD 4.Sh NAME.Nm sendmail.Nd send mail over the internet.Sh SYNOPSIS.Nm sendmail.Op Ar flags.Op Ar address ....Nm newaliases.Nm mailq.Op Fl v.Sh DESCRIPTION.Nm Sendmailsends a message to one or more.Em recipients ,routing the message over whatever networksare necessary..Nm Sendmaildoes internetwork forwarding as necessaryto deliver the message to the correct place..Pp.Nm Sendmailis not intended as a user interface routine;other programs provide user-friendlyfront ends;.Nm sendmailis used only to deliver pre-formatted messages..PpWith no flags,.Nm sendmailreads its standard inputup to an end-of-fileor a line consisting only of a single dotand sends a copy of the message found thereto all of the addresses listed.It determines the network(s) to usebased on the syntax and contents of the addresses..PpLocal addresses are looked up in a fileand aliased appropriately.Aliasing can be prevented by preceding the addresswith a backslash.Normally the sender is not included in any aliasexpansions, e.g.,if `john' sends to `group',and `group' includes `john' in the expansion,then the letter will not be delivered to `john'..Ss Parameters.Bl -tag -width Fl.It Fl B Ns Ar typeSet the body type to.Ar type .Current legal values.Li 7BITor.Li 8BITMIME ..It Fl baGo into.Tn ARPANETmode.All input lines must end with a CR-LF,and all messages will be generated with a CR-LF at the end.Also,the ``From:'' and ``Sender:''fields are examined for the name of the sender..It Fl bdRun as a daemon. This requires Berkeley.Tn IPC ..Nm Sendmailwill fork and run in backgroundlistening on socket 25 for incoming.Tn SMTPconnections.This is normally run from.Pa /etc/rc ..It Fl biInitialize the alias database..It Fl bmDeliver mail in the usual way (default)..It Fl bpPrint a listing of the queue..It Fl bsUse the.Tn SMTPprotocol as described in.Tn RFC821on standard input and output.This flag implies all the operations of the.Fl baflag that are compatible with.Tn SMTP ..It Fl btRun in address test mode.This mode reads addresses and shows the steps in parsing;it is used for debugging configuration tables..It Fl bvVerify names only \- do not try to collect or deliver a message.Verify mode is normally used for validatingusers or mailing lists..It Fl C Ns Ar fileUse alternate configuration file..Nm Sendmailrefuses to run as root if an alternate configuration file is specified..It Fl d Ns Ar XSet debugging value to.Ar X ..ne 1i.It Fl F Ns Ar fullnameSet the full name of the sender..It Fl f Ns Ar nameSets the name of the ``from'' person(i.e., the sender of the mail)..Fl fcan only be usedby ``trusted'' users(normally.Em root ,.Em daemon ,and.Em network )or if the person you are trying to becomeis the same as the person you are..It Fl h Ns Ar NSet the hop count to.Ar N .The hop count is incremented every time the mail isprocessed.When it reaches a limit,the mail is returned with an error message,the victim of an aliasing loop.If not specified,``Received:'' lines in the message are counted..It Fl nDon't do aliasing..It Fl o Ns Ar x Em valueSet option.Ar xto the specified.Em value .Options are described below..It Fl p Ns Ar protocolSet the name of the protocol used to receive the message.This can be a simple protocol name such as ``UUCP''or a protocol and hostname, such as ``UUCP:ucbvax''..It Fl q Ns Bq Ar timeProcessed saved messages in the queue at given intervals.If.Ar timeis omitted,process the queue once..Xr Timeis given as a tagged number,with.Ql sbeing seconds,.Ql mbeing minutes,.Ql hbeing hours,.Ql dbeing days,and.Ql wbeing weeks.For example,.Ql \-q1h30mor.Ql \-q90mwould both set the timeout to one hour thirty minutes.If.Ar timeis specified,.Nm sendmailwill run in background.This option can be used safely with.Fl bd ..It Fl r Ns Ar nameAn alternate and obsolete form of the.Fl fflag..It Fl tRead message for recipients.To:, Cc:, and Bcc: lines will be scanned for recipient addresses.The Bcc: line will be deleted before transmission.Any addresses in the argument list will be suppressed,that is,they will.Em notreceive copies even if listed in the message header..It Fl vGo into verbose mode.Alias expansions will be announced, etc..It Fl X Ar logfileLog all traffic in and out of mailers in the indicated log file.This should only be used as a last resortfor debugging mailer bugs.It will log a lot of data very quickly..El.Ss OptionsThere are also a number of processing options that may be set.Normally these will only be used by a system administrator.Options may be set either on the command lineusing the.Fl oflagor in the configuration file.This is a partial list;for a complete list (and details), consult the.%T "Sendmail Installation and Operation Guide" .The options are:.Bl -tag -width Fl.It Li A Ns Ar fileUse alternate alias file..It Li b Ns Ar nblocksThe minimum number of free blocks needed on the spool filesystem..It Li cOn mailers that are considered ``expensive'' to connect to,don't initiate immediate connection.This requires queueing..It Li C Ar NCheckpoint the queue file after every.Ar Nsuccessful deliveries (default 10).This avoids excessive duplicate deliverieswhen sending to long mailing listsinterrupted by system crashes..It Li d Ns Ar xSet the delivery mode to.Ar x .Delivery modes are.Ql ifor interactive (synchronous) delivery,.Ql bfor background (asynchronous) delivery,and.Ql qfor queue only \- i.e.,actual delivery is done the next time the queue is run..It Li DTry to automatically rebuild the alias databaseif necessary..It Li e Ns Ar xSet error processing to mode.Ar x .Valid modes are.Ql mto mail back the error message,.Ql wto ``write'' back the error message(or mail it back if the sender is not logged in),.Ql pto print the errors on the terminal(default),.Ql qto throw away error messages(only exit status is returned),and.Ql eto do special processing for the BerkNet.If the text of the message is not mailed backbymodes.Ql mor.Ql wand if the sender is local to this machine,a copy of the message is appended to the file.Pa dead.letterin the sender's home directory..It Li fSave.Tn UNIX Ns \-styleFrom lines at the front of messages..It Li GMatch local mail names against the GECOS portion of the password file..It Li g Ar NThe default group id to use when calling mailers..It Li H Ns Ar fileThe.Tn SMTPhelp file..It Li h Ar NThe maximum number of times a message is allowed to ``hop''before we decide it is in a loop..It Li iDo not take dots on a line by themselvesas a message terminator..It Li jSend error messages in MIME format..It Li K Ns Ar timeoutSet connection cache timeout..It Li k Ns Ar NSet connection cache size..It Li L Ns Ar nThe log level..It Li lPay attention to the Errors-To: header..It Li mSend to ``me'' (the sender) also if I am in an alias expansion..It Li nValidate the right hand side of aliases during a.Xr newaliases 1command..It Li oIf set, this message may haveold style headers.If not set,this message is guaranteed to have new style headers(i.e., commas instead of spaces between addresses).If set, an adaptive algorithm is used that will correctlydetermine the header format in most cases..It Li Q Ns Ar queuedirSelect the directory in which to queue messages..It Li S Ns Ar fileSave statistics in the named file..It Li sAlways instantiate the queue file,even under circumstances where it is not strictly necessary.This provides safety against system crashes during delivery..It Li T Ns Ar timeSet the timeout on undelivered messages in the queue to the specified time.After delivery has failed(e.g., because of a host being down)for this amount of time,failed messages will be returned to the sender.The default is three days..It Li t Ns Ar stz , Ar dtzSet the name of the time zone..It Li U Ns Ar userdatabaseIf set, a user database is consulted to get forwarding information.You can consider this an adjunct to the aliasing mechanism,except that the database is intended to be distributed;aliases are local to a particular host.This may not be available if your sendmail does not have the.Dv USERDBoption compiled in..It Li u Ns Ar NSet the default user id for mailers..It Li YFork each job during queue runs.May be convenient on memory-poor machines..It Li 7Strip incoming messages to seven bits..El.PpIn aliases,the first character of a name may bea vertical bar to cause interpretation ofthe rest of the name as a commandto pipe the mail to.It may be necessary to quote the nameto keep.Nm sendmailfrom suppressing the blanks from between arguments.For example, a common alias is:.Pp.Bd -literal -offset indent -compactmsgs: "|/usr/bin/msgs -s".Ed.PpAliases may also have the syntax.Dq :include: Ns Ar filenameto ask.Xr sendmailto read the named file for a list of recipients.For example, an alias such as:.Pp.Bd -literal -offset indent -compactpoets: ":include:/usr/local/lib/poets.list".Ed.Ppwould read.Pa /usr/local/lib/poets.listfor the list of addresses making up the group..Pp.Nm Sendmailreturns an exit statusdescribing what it did.The codes are defined in.Aq Pa sysexits.h :.Bl -tag -width EX_UNAVAILABLE -compact -offset indent.It Dv EX_OKSuccessful completion on all addresses..It Dv EX_NOUSERUser name not recognized..It Dv EX_UNAVAILABLECatchall meaning necessary resourceswere not available..It Dv EX_SYNTAXSyntax error in address..It Dv EX_SOFTWAREInternal software error,including bad arguments..It Dv EX_OSERRTemporary operating system error,such as.Dq cannot fork ..It Dv EX_NOHOSTHost name not recognized..It Dv EX_TEMPFAILMessage could not be sent immediately,but was queued..El.PpIf invoked as.Nm newaliases ,.Nm sendmailwill rebuild the alias database.If invoked as.Nm mailq ,.Nm sendmailwill print the contents of the mail queue..Sh FILESExcept for the file.Pa /etc/sendmail.cfitself,the following pathnames are all specified in.Pa /etc/sendmail.cf.Thus,these values are only approximations..Pp.Bl -tag -width /usr/lib/sendmail.fc -compact.It Pa /etc/aliasesraw data for alias names.It Pa /etc/aliases.dbdata base of alias names.It Pa /etc/sendmail.cfconfiguration file.It Pa /etc/sendmail.hfhelp file.It Pa /var/log/sendmail.stcollected statistics.It Pa /var/spool/mqueue/*temp files.It Pa /var/run/sendmail.pidThe process id of the daemon.El.Sh SEE ALSO.Xr binmail 1 ,.Xr mail 1 ,.Xr rmail 1 ,.Xr syslog 3 ,.Xr aliases 5 ,.Xr mailaddr 7 ,.Xr rc 8 ;.PpDARPAInternet Request For Comments.%T RFC819 ,.%T RFC821 ,.%T RFC822 ..Rs.%T "Sendmail \- An Internetwork Mail Router".%V SMM.%N \&No. 9.Re.Rs.%T "Sendmail Installation and Operation Guide".%V SMM.%N \&No. 8.Re.Sh HISTORYThe.Nmcommand appeared in.Bx 4.2 .
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -