home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

SingleThreadDelivery

Set single-threaded delivery V8.8 and later

Ordinarily, when sendmail processes the queue, it pays relatively little attention to other sendmail processes that might be processing the same queue at the same time. It locks a single qf file during delivery so that no other sendmail will attempt delivery of that message at the same time, but that is all. When sending many messages to a single other host, it is possible for multiple, parallel sendmail processes to try to deliver different messages from that queue to that single host all at once.

When parallelism is not desirable, you might wish to set up sendmail to be single-threaded. This ensures that only a single sendmail will ever be delivering to a given host at a given time. Single-threaded delivery is enabled with the SingleThreadDelivery option, the forms of which are as follows:

O SingleThreadDelivery=bool                 configuration file (V8.8 and later) 
-OSingleThreadDelivery=bool                 command line (V8.8 and later) 
define(`confSINGLE_THREAD_DELIVERY',`bool') mc configuration (V8.8 and later) 

The argument bool is of type Boolean. If it is missing, the default value is true (deliver single-threaded). If the entire SingleThreadDelivery option is missing, the default becomes false (deliver in parallel). The default for the mc configuration technique is false.

Note that the SingleThreadDelivery option will work only if the HostStatusDirectory option is also declared (HostStatusDirectory). If it is not, sendmail will print the following error and reset the SingleThreadDelivery option to false:

Warning: HostStatusDirectory required for SingleThreadDelivery

Be careful setting the SingleThreadDelivery option to true because it can slow down mail delivery by a substantial degree. To understand why, consider an ongoing queue run to a host that is receiving many messages. If interactive user mail arrives during that run, the sendmail process executed by the user's MUA might find that it cannot send the message because it is single-threaded and the other sendmail has that host locked. In that case the user's message will be queued and will wait in the queue until the next queue is run. Even if your site is on the Internet, one large message to a slow site can cause interactive mail for that site to be wrongly queued.

An appropriate use for the SingleThreadDelivery option is on the command line when processing the queue. In daemon mode, for example, these startup commands might be appropriate:

/usr/sbin/sendmail -bd
/usr/sbin/sendmail -OSingleThreadDelivery -q30m

Note that two sendmail programs are started: one to act as a daemon and the other to periodically process the queue. Don't combine them when using the SingleThreadDelivery option because incoming (relayed) mail can wrongly affect outgoing mail.

The SingleThreadDelivery option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

    Previous Section Next Section