Sendmail Extended Queue Groups

This is an extension to existing queuegroup feature in Sendmail 8.12 versions. This new feature, called queuegroupx, provides extended queuegroups in Sendmail 8.12.

Download queuegroupx.m4

For securing permissions and generating database maps, you can download into /etc/mail and use my build script.

No need to make any changes to site.config.m4 inside sendmail-8.12.x/devtools/Site

For illustration purposes,

About queuegroupx feature

I added additional rules to queuegroup feature and its called queuegroupx
(extended queuegroups feature).

What is it ?

A feature that allows you to specify different queuegroups for different emails
when sendmail queues emails for delivering. You can choose what queuegroup to use
depending on

  1. sender domain,
  2. sender email address,
  3. recipient domain,
  4. recipient email address
  5. sender email address if email addressed to a specific recipient email address

How to use it?

  1. In your .mc file, first include FEATURE(access_db)
  2. Then include queuegroupx as follows

    FEATURE(queuegroupx)

    OR

    FEATURE(queuegroupx,`defaultqg')

    where defaultqg queuegroup will be used if no matching queuegroup found in access file

  3. Create entries in access file (Notice null sender specified as <>)

    IMPORTANT: recipient domain should NOT be in local-host-names. Otherwise,
    it will be just ignored. If you want to have a queuegroup for $=w names , i.e.,
    local host names, use mailer definition for local mailer instead of creating queuegroup in access file

    QFTO:sender@senderdomain.com<@>recipient@recipientdomain.com qg1
    QFTO:<><@>recipient1@recipientdomain1.com qg2
    QFRM:sender1@senderdomain1.com qg3
    QFRM:senderdomain2.com qg4
    QFRM:<> qg5
    QGRP:recipient2@recipientdomain2.com qg6
    QGRP:recipientdomain3.com qg
    ..........
  4. Compile and test
    sendmail -d21.4 -bt -Cyournewconfig.cf

    Call debugging ruleset queuegroupd for debugging purposes. See an example session below:

    joe@mydomain.com [~] $ sendmail -d21.4 -bt -Csendmail-new.cf
    ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
    Enter <ruleset> <address>
    > queuegroupd sender@senderdomain.com $| rec@recipientdomain.com
    queuegroupd input: sender @ senderdomain . com $| rec @ recipientdomain . com
    rewritten as: sender @ senderdomain . com $| rec @ recipientdomain . com
    queuegroup1 input: sender @ senderdomain . com $| rec @ recipientdomain . com
    rewritten as: sender @ senderdomain . com $| rec @ recipientdomain . com
    queuegroup2 input: sender @ senderdomain . com $| rec @ recipientdomain . com
    SearchList input: < ! qfrm > $| < F : sender @ senderdomain . com > < D : senderdomain . com > < >
    F input: < sender @ senderdomain . com > < ? > < ! qfrm > < >
    rewritten as: < ? > < sender @ senderdomain . com > < ? > < ! qfrm > < >
    rewritten as: < ? > < >
    F returns: < ? > < >
    rewritten as: < ! qfrm > $| < D : senderdomain . com > < > $| < ? > < >
    SearchList input: < ! qfrm > $| < D : senderdomain . com > < >
    D input: < senderdomain . com > < ? > < ! qfrm > < >
    rewritten as: < ? > < senderdomain . com > < ? > < ! qfrm > < >
    rewritten as: < ? > < senderdomain . com > < ? > < ! qfrm > < >
    D input: < com > < ? > < ! qfrm > < >
    rewritten as: < ? > < com > < ? > < ! qfrm > < >
    rewritten as: < ? > < >
    D returns: < ? > < >
    rewritten as: < ? > < >
    D returns: < ? > < >
    rewritten as: < ! qfrm > $| < > $| < ? > < >
    rewritten as: < ? >
    SearchList returns: < ? >
    rewritten as: < ? >
    SearchList returns: < ? >
    rewritten as: rec @ recipientdomain . com $| < ? >
    queuegroup4 input: rec @ recipientdomain . com
    SearchList input: < ! qgrp > $| < F : rec @ recipientdomain . com > < D : recipientdomain . com > < >
    F input: < rec @ recipientdomain . com > < ? > < ! qgrp > < >
    rewritten as: < ? > < rec @ recipientdomain . com > < ? > < ! qgrp > < >
    rewritten as: < ? > < >
    F returns: < ? > < >
    rewritten as: < ! qgrp > $| < D : recipientdomain . com > < > $| < ? > < >
    SearchList input: < ! qgrp > $| < D : recipientdomain . com > < >
    D input: < recipientdomain . com > < ? > < ! qgrp > < >
    rewritten as: < ? > < recipientdomain . com > < ? > < ! qgrp > < >
    rewritten as: < ? > < recipientdomain . com > < ? > < ! qgrp > < >
    D input: < com > < ? > < ! qgrp > < >
    rewritten as: < ? > < com > < ? > < ! qgrp > < >
    rewritten as: < ? > < >
    D returns: < ? > < >
    rewritten as: < ? > < >
    D returns: < ? > < >
    rewritten as: < ! qgrp > $| < > $| < ? > < >
    rewritten as: < ? >
    SearchList returns: < ? >
    rewritten as: < ? >
    SearchList returns: < ? >
    rewritten as: < ? >
    rewritten as: $# default
    queuegroup4 returns: $# default
    rewritten as: $# default
    queuegroup2 returns: $# default
    rewritten as: $# default
    queuegroup1 returns: $# default
    rewritten as: $# default
    queuegroupd returns: $# default
    > ^D
    joe@mydomain.com [~] $

Licence

GNU General Public License.

Disclaimer

No warranty. Use at your own risk.
Send Questions / Comments to:


© Murty Rompalli
All Rights Reserved.