On Tue, 23 Nov 1999 21:54:55 +0100 , "Ekker, Heinz" writes:
> > You could probably use a variant of the fixup/@fixme hack described
> > in the FAQ.  Feed the message through an appropriate formail command
> > line to add the headers, and then through forward or qmail-inject
> > to deliver it to the final destination.
> >
> > This will send the message twice through the queue, which is a bit
> > of a performance hit.
> 
> That's what I did first - but the results were not really satisfying. A bit
> of a performance hit does not quite describe it...

Yeah, I was being charitable ...

qmail-send's throughput is limited by the latency of two to three
fsync() calls per message.  That will pretty much be a constant
bottleneck to message processing.  The preprocessing should be done
in a per-message process, so that this bottleneck disappears.

The point is, plugging the extra program into the qmail pipeline
is not where you lose performance: going through the pipeline is.
 
> > I'm looking into rewriting headers in a
> > wrapper around qmail-queue.

[which will run an extra program, but do everything in one trip
through the queue]
 
> I'm thinking about patching qmail-smtpd a little. Basically it does some
> header-checking (checks the received: and delivered: for loops) already, and
> that's were I'm putting my little C-Knowledge in. With the use of
> (basically) the same function that inserts the received: headers, I'm
> putting a sender: and a to: - header in (taken from the envelope), if its
> missing. Messages without the blank line between header and body are
> bounced. Of course, this 'header rewriting' is not quite as sophisticated as
> it should be, or as qmail-inject is, but it saves a hop. If anyone is
> interested, drop me a mail!

You might want to take a look at ofmipd -- it is part of Bernstein's
mess822 package, and does header rewriting.  About the only thing
that keeps it from being a good production mail server is that it
is an open relaying server.  I don't know how hard it would be to
patch it to use rcpthosts.

I have a bias (even as a reasonably experienced C programmer) toward
using other people's tested code, rather than writing my own hacks
from scratch.  This is why I was turning you toward formail.  It
would be a reasonably simple hack to write a qmail-queue wrapper
that calls formail.  The difference is, this hack gives you all the
flexibility of formail (lots) with little effort on your part.

Even if you don't foresee exploiting all of that flexibility, it can't
hurt to leave the option open for later.

-- 
Chris Mikkelson  | Einstein himself said that God doesn't roll dice. But
[EMAIL PROTECTED] | he was wrong.  And in fact, anyone who has played role-
                 | playing games knows that God probably had to roll quite
                 | a few dice to come up with a character like Einstein.
                 |                              -- Larry Wall

Reply via email to