SMM:08-12
Sendmail Installation and Operation Guide
1.3.11. /etc/rc or /etc/init.d/sendmail
It will be necessary to start up the sendmail daemon when your system reboots. This dae-
mon performs two functions: it listens on the SMTP socket for connections (to receive mail
from a remote system) and it processes the queue periodically to insure that mail gets delivered
when hosts come up.
If necessary, add the following lines to "/etc/rc" (or "/etc/rc.local" as appropriate) in the
area where it is starting up the daemons on a BSD-base system, or on a System-V-based system
in one of the startup files, typically "/etc/init.d/sendmail":
if [ -f /usr/sbin/sendmail -a -f /etc/mail/sendmail.cf ]; then
(cd /var/spool/mqueue; rm -f xf*)
/usr/sbin/sendmail -bd -q30m &
echo -n ' sendmail' >/dev/console
fi
The "cd" and "rm" commands insure that all transcript files have been removed; extraneous
transcript files may be left around if the system goes down in the middle of processing a mes-
sage. The line that actually invokes sendmail has two flags: "-bd" causes it to listen on the
SMTP port, and "-q30m" causes it to run the queue every half hour.
Some people use a more complex startup script, removing zero length qf/hf/Qf files and df
files for which there is no qf/hf/Qf file. Note this is not advisable. For example, see Figure 1 for
an example of a complex script which does this clean up.
1.3.12. /etc/mail/helpfile
This is the help file used by the SMTP HELP command. It should be copied from "send-
mail/helpfile":
cp sendmail/helpfile /etc/mail/helpfile
The actual path of this file is defined in the HelpFile option of the sendmail.cf file.
1.3.13. /etc/mail/statistics
If you wish to collect statistics about your mail traffic, you should create the file
"/etc/mail/statistics":
cp /dev/null /etc/mail/statistics
chmod 0600 /etc/mail/statistics
This file does not grow. It is printed with the program "mailstats/mailstats.c." The actual path
of this file is defined in the S option of the sendmail.cf file.
1.3.14. /usr/bin/mailq
If sendmail is invoked as "mailq," it will simulate the -bp flag (i.e., sendmail will print
the contents of the mail queue; see below). This should be a link to /usr/sbin/sendmail.
1.3.15. sendmail.pid
sendmail stores its current pid in the file specifed by the PidFile option (default is
_PATH_SENDMAILPID). sendmail uses TempFileMode (which defaults to 0600) as the per-
missions of that file to prevent local denial of service attacks as explained in the top level
README
in the sendmail distribution. If the file already exists, then it might be necessary to
change the permissions accordingly, e.g.,
chmod 0600 /var/run/sendmail.pid
Note that as of version 8.13, this file is unlinked when sendmail exits. As a result of this
change, a script such as the following, which may have worked prior to 8.13, will no longer