Pitfalls
Each release of sendmail offers more and better ways to handle queue problems. They are mostly implemented as options. Table 24-7 on page 966 lists all options that affect the queue. Whenever you upgrade to a new sendmail release, be sure to read the RELEASE_NOTES for information about new ways to solve queueing problems.
The queue directory should never be shared among machines. Such sharing can make detection of orphaned locks impossible. Bugs in network-locking daemons can lead to race conditions in which neither of two machines can generate a queue identifier.
Homespun programs and shell scripts for delivery of local mail can fail and lose mail by exiting with the wrong value. In the case of a recoverable error (a full disk, for example), they should exit with EX_OSERR or EX_TEMPFAIL. Both of these exit values are defined in <sysexits.h> and cause the message to be re-queued.
Because sendmail does a chdir(2) into its queue directory, you should avoid removing and re-creating that directory while the sendmail daemon is running. When processing the queue, sendmail tries to read the queue directory by doing an opendir(3) of the current directory. When the queue directory is removed, sendmail fails that open and syslog(3)s the following warning:
orderq: cannot open "/usr/spool/mqueue" as ".": No such file or directory
Some very old versions of sendmail had a bug in handling the queue that could cause a message to be lost when that message was the last in a queue run to be processed. ...
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.