Periodically with -q
The -q
command-line
switch is used both to cause queues to be processed
and to specify the interval between queue
runs.
A typical invocation of the sendmail daemon looks like this:
/usr/sbin/sendmail -bd -q1h
Here, the sendmail program is
placed into listening mode with the -bd
command-line switch.
The -q1h
command-line switch tells it to process the queue
once each hour. Note that either switch puts
sendmail into the background
as a daemon. The -bd
switch just allows
sendmail to listen for
incoming SMTP connections. Consider the
following:
/usr/sbin/sendmail -bd /usr/sbin/sendmail -q1h
This runs two daemons simultaneously. The first listens for incoming SMTP connections. The second processes the queues once per hour.
The time expression following the -q
is constructed from
an integer followed by a letter. The letters and the
meaning of each are listed in Table 11-5. Integer and
letter groups can be combined—for example, 5d12h
means 5 days, 12 hours. If a letter is missing, the
default is minutes.
Table 11-5. Meaning of time letters
Letter |
Meaning |
---|---|
w |
Week |
d |
Day |
h |
Hour |
m |
Minute |
s |
Second |
At small sites, where mail messages are rarely queued,
the time interval chosen can be small to ensure that
all mail is delivered promptly. An interval of
15m
(15
minutes) might be appropriate.
At many sites, an interval of one hour is probably best. It is short enough to ensure that delays in delivery remain tolerable, yet long enough to ensure that queue processing does not ...
Get sendmail, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.