📄 op.me
字号:
/usr/lib.I understand it is in /usr/ucblibon System V Release 4..)fIt should be setuid root.For security reasons,/, /usr, and /usr/\*(SDshould be owned by root, mode 755\**..(f\**Some vendors ship them owned by bin;this creates a security hole that is not actually related to.i sendmail .Other important directories that should have restrictive ownershipsand permissions are/bin, /usr/bin, /etc, /usr/etc, /lib, and /usr/lib..)f.sh 3 "/etc/sendmail.cf".ppThis is the configuration file for.i sendmail .This is the only non-library file name compiled into.i sendmail \**..(f\**The system libraries can reference other files;in particular, system library subroutines that.i sendmailcalls probably reference.i /etc/passwdand.i /etc/resolv.conf ..)fSome older systems install it in.b /usr/lib/sendmail.cf ..ppIf you want to move this file,change.i src/pathnames.h ..ppThe configuration file is normally createdusing the distribution files described above.If you have a particularly unusual system configurationyou may need to create a special version.The format of this file is detailed in later sectionsof this document..sh 3 "/usr/\*(SB/newaliases".ppThe.i newaliasescommand should just be a link to.i sendmail :.(brm \-f /usr/\*(SB/newaliasesln \-s /usr/\*(SD/sendmail /usr/\*(SB/newaliases.)bThis can be installed in whatever search path you preferfor your system..sh 3 "/var/spool/mqueue".ppThe directory.i /var/spool/mqueueshould be created to hold the mail queue.This directory should be mode 700and owned by root..ppThe actual path of this directoryis defined in the.b Qoption of the.i sendmail.cffile..sh 3 "/etc/aliases*".ppThe system aliases are held in.q /etc/aliases .A sample is given in.q lib/aliaseswhich includes some aliases which.i mustbe defined:.(bcp lib/aliases /etc/aliases.i "edit /etc/aliases".)bYou should extend this file with any aliases that are apropos to your system..ppNormally.i sendmaillooks at a version of these files maintained by the.i dbm \|(3)or.i db \|(3)routines.These are stored either in.q /etc/aliases.dirand.q /etc/aliases.pagor.q /etc/aliases.dbdepending on which database package you are using.These can initially be created as empty files,but they will have to be initialized promptly.These should be mode 644:.(bcp /dev/null /etc/aliases.dircp /dev/null /etc/aliases.pagchmod 644 /etc/aliases.*newaliases.)bThe.i dbroutines preset the mode reasonably,so this step can be skipped.The actual path of this fileis defined in the.b Aoption of the.i sendmail.cffile..sh 3 "/etc/rc".ppIt will be necessary to start up the.i sendmaildaemon when your system reboots.This daemon performs two functions:it listens on the SMTP socket for connections(to receive mail from a remote system)and it processes the queue periodicallyto insure that mail gets delivered when hosts come up..ppAdd the following lines to.q /etc/rc(or.q /etc/rc.localas appropriate)in the area where it is starting up the daemons:.(bif [ \-f /usr/\*(SD/sendmail \-a \-f /etc/sendmail.cf ]; then (cd /var/spool/mqueue; rm \-f [lnx]f*) /usr/\*(SD/sendmail \-bd \-q30m & echo \-n ' sendmail' >/dev/consolefi.)bThe.q cdand.q rmcommands insure that all lock files have been removed;extraneous lock files may be left aroundif the system goes down in the middle of processing a message.The line that actually invokes.i sendmailhas two flags:.q \-bdcauses it to listen on the SMTP port,and.q \-q30mcauses it to run the queue every half hour..ppSome people use a more complex startup script,removing zero length qf files and df files for which there is no qf file.For example:.(b# remove zero length qf filesfor qffile in qf*do if [ \-r $qffile ] then if [ ! \-s $qffile ] then echo \-n " <zero: $qffile>" > /dev/console rm \-f $qffile fi fidone# rename tf files to be qf if the qf does not existfor tffile in tf*do qffile=`echo $tffile | sed 's/t/q/'` if [ \-r $tffile \-a ! \-f $qffile ] then echo \-n " <recovering: $tffile>" > /dev/console mv $tffile $qffile else echo \-n " <extra: $tffile>" > /dev/console rm \-f $tffile fidone# remove df files with no corresponding qf filesfor dffile in df*do qffile=`echo $dffile | sed 's/d/q/'` if [ \-r $dffile \-a ! \-f $qffile ] then echo \-n " <incomplete: $dffile>" > /dev/console mv $dffile `echo $dffile | sed 's/d/D/'` fidone# announce files that have been saved during disaster recoveryfor xffile in [A-Z]f*do echo \-n " <panic: $xffile>" > /dev/consoledone.)b.ppIf you are not running a version of UNIXthat supports Berkeley TCP/IP,do not include the.b \-bdflag..sh 3 "/usr/lib/sendmail.hf".ppThis is the help file used by the SMTP.b HELPcommand.It should be copied from.q lib/sendmail.hf :.(bcp lib/sendmail.hf /usr/lib.)bThe actual path of this fileis defined in the.b Hoption of the.i sendmail.cffile..sh 3 "/etc/sendmail.st".ppIf you wish to collect statisticsabout your mail traffic,you should create the file.q /etc/sendmail.st :.(bcp /dev/null /etc/sendmail.stchmod 666 /etc/sendmail.st.)bThis file does not grow.It is printed with the program.q mailstats/mailstats.c.The actual path of this fileis defined in the.b Soption of the.i sendmail.cffile..sh 3 "/usr/\*(SB/newaliases".ppIf.i sendmailis invoked as.q newaliases,it will simulate the.b \-biflag(i.e., will rebuild the alias database;see below).This should be a link to /usr/\*(SD/sendmail..sh 3 "/usr/\*(SB/mailq".ppIf.i sendmailis invoked as.q mailq,it will simulate the.b \-bpflag(i.e.,.i sendmailwill print the contents of the mail queue;see below).This should be a link to /usr/\*(SD/sendmail..sh 1 "NORMAL OPERATIONS".sh 2 "The System Log".ppThe system log is supported by the.i syslogd \|(8)program.All messages from.i sendmailare logged under the.sm LOG_MAILfacility..sh 3 "Format".ppEach line in the system logconsists of a timestamp,the name of the machine that generated it(for logging from several machinesover the local area network),the word.q sendmail: ,and a message..sh 3 "Levels".ppIf you have.i syslogd \|(8)or an equivalent installed,you will be able to do logging.There is a large amount of information that can be logged.The log is arranged as a succession of levels.At the lowest levelonly extremely strange situations are logged.At the highest level,even the most mundane and uninteresting eventsare recorded for posterity.As a convention,log levels under tenare considered generally.q useful;log levels above 64are reserved for debugging purposes.Levels from 11\-64 are reserved for verbose informationthat some sites might want..ppA complete description of the log levelsis given in section 4.6..sh 2 "The Mail Queue".ppThe mail queue should be processed transparently.However, you may find that manual intervention is sometimes necessary.For example,if a major host is down for a period of timethe queue may become clogged.Although.i sendmailought to recover gracefully when the host comes up,you may find performance unacceptably bad in the meantime..sh 3 "Printing the queue".ppThe contents of the queue can be printedusing the.i mailqcommand(or by specifying the.b \-bpflag to.i sendmail ):.(bmailq.)bThis will produce a listing of the queue id's,the size of the message,the date the message entered the queue,and the sender and recipients..sh 3 "Forcing the queue".pp.i Sendmailshould run the queue automaticallyat intervals.The algorithm is to read and sort the queue,and then to attempt to process all jobs in order.When it attempts to run the job,.i sendmailfirst checks to see if the job is locked.If so, it ignores the job..ppThere is no attempt to insure that only one queue processorexists at any time,since there is no guarantee that a job cannot take foreverto process(however,.i sendmaildoes include heuristics to try to abort jobsthat are taking absurd amounts of time;technically, this violates RFC 821, but is blessed by RFC 1123).Due to the locking algorithm,it is impossible for one job to freeze the entire queue.However,an uncooperative recipient hostor a program recipientthat never returnscan accumulate many processes in your system.Unfortunately,there is no completely general way to solve this..ppIn some cases,you may find that a major host going downfor a couple of daysmay create a prohibitively large queue.This will result in.i sendmailspending an inordinate amount of timesorting the queue.This situation can be fixed by moving the queue to a temporary placeand creating a new queue.The old queue can be run later when the offending host returns to service..ppTo do this,it is acceptable to move the entire queue directory:.(bcd /var/spoolmv mqueue omqueue; mkdir mqueue; chmod 700 mqueue.)bYou should then kill the existing daemon(since it will still be processing in the old queue directory)and create a new daemon..ppTo run the old mail queue,run the following command:.(b/usr/\*(SD/sendmail \-oQ/var/spool/omqueue \-q.)bThe.b \-oQflag specifies an alternate queue directoryand the.b \-qflag says to just run every job in the queue.If you have a tendency toward voyeurism,you can use the.b \-vflag to watch what is going on..ppWhen the queue is finally emptied,you can remove the directory:.(brmdir /var/spool/omqueue.)b.sh 2 "The Alias Database".ppThe alias database exists in two forms.One is a text form,maintained in the file.i /etc/aliases.The aliases are of the form.(bname: name1, name2, ....)bOnly local names may be aliased;e.g.,.(beric@prep.ai.MIT.EDU: eric@CS.Berkeley.EDU.)bwill not have the desired effect.Aliases may be continued by starting any continuation lineswith a space or a tab.Blank lines and lines beginning with a sharp sign(\c.q # )are comments..ppThe second form is processed by the.i dbm \|(3)(or.i db \|(3))library.This form is in the files.i /etc/aliases.dirand.i /etc/aliases.pag.This is the form that.i sendmailactually uses to resolve aliases.This technique is used to improve performance..ppYou can also use.sm NIS -basedalias files.For example, the specification:.(bOA/etc/aliasesOAnis:mail.aliases@my.nis.domain.)bwill first search the /etc/aliases fileand then the map named.q mail.aliasesin.q my.nis.domain .Warning: if you build your own.sm NIS -basedalias files,be sure to provide the.b \-lflag to.i makedbm (8)to map upper case letters in the keys to lower case;otherwise, aliases with upper case letters in their nameswon't match incoming addresses..ppAdditional flags can be added after the colonexactly like a.b Kline \(em for example:.(bOAnis:-N mail.aliases@my.nis.domain.)bwill search the appropriate NIS map and always include null bytes in the key..sh 3 "Rebuilding the alias database".ppThe DB or DBM version of the databasemay be rebuilt explicitly by executing the command.(bnewaliases.)bThis is equivalent to giving.i sendmailthe.b \-biflag:.(b/usr/\*(SD/sendmail \-bi.)b.ppIf the.q Doption is specified in the configuration,.i sendmailwill rebuild the alias database automaticallyif possiblewhen it is out of date.Auto-rebuild can be dangerouson heavily loaded machineswith large alias files;if it might take more than five minutesto rebuild the database,there is a chance that several processes will start the rebuild processsimultaneously..ppIf you have multiple aliases databases specified,the.b \-biflag rebuilds all the database types it understands(for example, it can rebuild dbm databases but not nis databases)..sh 3 "Potential problems".ppThere are a number of problems that can occurwith the alias database.They all result from a.i sendmailprocess accessing the DBM versionwhile it is only partially built.This can happen under two circumstances:One process accesses the database
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -