[Mailman-Developers] New MTA interface in mailman 2.0b

Barry A. Warsaw bwarsaw@cnri.reston.va.us
Mon, 10 Apr 2000 17:28:47 -0400 (EDT)


>>>>> "NM" == Nigel Metheringham <Nigel.Metheringham@VData.co.uk> writes:

    NM> I would say from what I have seen of the Sendmail.py one that
    NM> most developers have been using SMTPDirect :-) - thats the
    NM> default in Defaults.py

Right.  Sendmail.py was essentially a quick hack to prove the concept
of the message handler pipeline.  I didn't and haven't put a lot of
work into it.  I definitely recommend people use SMTPDirect.py
instead, especially after the qrunner additions in 2.0beta2.

    NM> I also needed to patch Sendmail.py to get the envelope from
    NM> addresses right

Yup, I'll check that change in.

    NM>  1. Everything now looks like a list mail - looks like some
    NM> items which used to look distinct from list mails have the
    NM> same headers as the list mails
    |     [ie admin/info mails have now acquired extra headers]
    |     Is this intentional/good??
    |     [I'm agnostics really - its just a change]

Here's what happens.  When a message is destined for the entire list,
it is handled through the DeliverToList() pipeline (see
Mailman/Handlers/HandlerAPI.py).  You can see that there are a bunch
of modules that touch the message before it's sent out: SpamDetect,
Approve, Replybot, etc.

Messages that the system generates and is destined for a specific
individual are all delivered through DeliverToUser(), which has a much
shorter pipeline module list.

One module that all messages pass through is CookHeaders, which
touches headers like Sender, Errors-To, Precedence; it adds an
X-BeenThere header and an X-Mailman-Version header.  Note that
CookHeaders does /not/ munge the Subject header because DeliverToUser
sets the `fasttrack' attribute on the message object.  This is a flag
to all pipeline modules that the message is being delivered to an
individual user and not to the list.  It's a hack, but it allows me to
re-use most of the same code.

I don't see anything in the admin messages that concerns me; were
there specific headers that you thought might be a problem?  If so we
can either special-case them (with `fasttrack') in CookHeaders, or we
can write a separate CookHeaders for DeliverToUser().

    NM>  2. I'm concerned the patch above might do bad things when it
    NM> comes to sending out list reminders :-)

Password reminders are sent through DeliverToUser.  You can actually
force a mass password reminder mailing by running

    % python cron/mailpasswds

explicitly.  Don't do this on your production system :)  Again, none
of the headers that are included strike me as horrible.

    NM>  3. What happens in either MTA interface if the MTA cannot
    NM> accept the message
    NM>     [for SMTP either connection refused, or a negative reply
    NM> code?  For Sendmail a negative reply code] - is the message
    NM> dropped??  How does the bit of queue handling thats left tie
    NM> into this?

Ah, now here is a good reason to use SMTPDirect, at least with
2.0beta2.  If SMTPDirect either gets a fatal exception (socket.error
or smtplib.SMTPException) or if some individual users had
non-permanent failures, then the message is queued for redelivery to
the local smtpd.  There's a new cron script called qrunner which will
attempt re-delivery every 1/2 hour of those failed messages.  This has
only seen limited testing.

The Sendmail deliverer has no such fallback.  There was some
discussion about extending the error handling to catch any failures in
any pipeline module, but I think that's a bit more complicated than I
want to add right now.  It's definitely a good idea though.

Hope that helps,
-Barry