ProblemTo use queues optimized for the characteristics of the destination host, you must route mail bound for recipient addresses on those hosts to the optimized mail queues. SolutionCreate the directories for the queue groups and, if necessary, the physical devices the queue group directories will use. See Recipe 9.1 and Recipe 9.3 for details. Add QGRP : records to the access database to specify the queue groups used for specific recipients. The key of each entry is the tag QGRP : followed by a full or partial recipient address. The return value of the entry is the name of the queue group that should be used for the specified recipient. Create a sendmail configuration that defines the queue groups, enables the access database, and uses the queuegroup feature. Here are sample lines that might be added to the sendmail configuration: dnl Define a queue group QUEUE_GROUP(`slowq', `Path=/var/spool/mqueue/slowq, I=2h') dnl Define a queue group QUEUE_GROUP(`fastq', `Path=/var/spool/mqueue/fastq.*, I=10m, R=10') dnl Enable the access database FEATURE(`access_db') dnl Enable the queue group feature FEATURE(`queuegroup') Build and install /etc/mail/sendmail.cf , then restart sendmail, as shown in Recipe 1.8. DiscussionThe access database provides the most flexible means to utilize queue groups. QGRP : records in the access database allow you to assign individual domains, and even individual users, to specific queue groups. This makes it possible to create queue groups that have characteristics that are compatible with the characteristics of a recipient site. For example, the queue for a site that has repeated, long-duration outages might have a large Interval value, or multiple queues might be dedicated to a few domains that constitute the bulk of your outbound traffic. Here is a sample QGRP : entry: QGRP:example.com slowq The QGRP : record tells sendmail to use the slowq queue group to queue mail for every user on all hosts in the example.com domain. The recipient address in a queue group entry can identify an individual user or a group of hosts. The possible recipient address formats are:
Mail addressed to recipients not covered by a QGRP : entry is queued in the default queue. See AlsoRecipe 9.3 covers the QUEUE_GROUP macro. The access database is used extensively in recipes throughout this book, with particularly detailed coverage in Chapter 3 and Chapter 6. The sendmail book covers the QGRP : record in Section 11.4.4. |