[Mailman-Developers] sendmail

Darrell Fuhriman darrell@grumblesmurf.net
04 Aug 2001 14:14:06 -0700


barry@zope.com (Barry A. Warsaw) writes:

> It would be great if Mailman and Sendmail could play better together.

Well, you could include my address sorting patch -- it does
help sendmail's performance quite a lot.  :-|  The onus can't be
put solely on sendmail, especially since Mailman could do
something of little of little cost but great benefit.

That being said, for Mailman, I run sendmail on a second port
with only Mailman uses.

/usr/lib/sendmail -bd -ODeliveryMode=defer \
    -ODaemonPortOptions=Name=Mailman,Port=26

You could also use that to bind only to localhost.

The only downside to this method is that messages won't be sent
until the queue is run on the normal interval.  I run only a
couple of relatively low traffic lists, and like the quick
turnaround, I myself got around that problem by writing a
wrapper around qrunner that runs the queue when qrunner finishes,
but only processes things that were put in the queue within the
last N minutes (currently fifteen).


--
/usr/local/bin/python -S /usr/local/mailman/cron/qrunner 
exec /usr/lib/sendmail `/usr/local/mailman/bin/qid` > /dev/null
--

The qid program is below.

The whole thing is a bit kludgey, but it does the right thing.

Darrell

#!/usr/local/bin/perl

# in which we generate a partial sendmail queue identifier for the
# current minute.  We have just translated this from sendmail's
# code.

use Time::gmtime;
@Base60Code=split('',
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx");
foreach $i (0 .. 15) {
        undef $idbuf;
        $gm = gmtime(time - ($i*60));
        
        $idbuf .= $Base60Code[$gm->year() % 60];
        $idbuf .= $Base60Code[$gm->mon()];
        $idbuf .= $Base60Code[$gm->mday()];
        $idbuf .= $Base60Code[$gm->hour()];
        $idbuf .= $Base60Code[$gm->min()];

print "-qI${idbuf} ";
}