[Mailman-Users] messages without Date:

Mark Sapiro msapiro at value.net
Fri Jun 10 19:47:37 CEST 2005

Meike Reichle wrote:
>maybe you can help me with a small problem: When creating a new mailing
>list using the web interface I receive two emails, the confirmation
>email and another one telling me which aliases I have to create. The
>latter however comes without a Date: line in the header. I am not sure
>whether this is a mailman issue or rather a flaw in my system/MTA
>It's more an inconvenience than an actual problem but I'd like to fix it
>anyway. So, if anyone can provide a hint ...

This is both a Mailman and an MTA problem. The MTA side is somewhat
controversial, but under some circumstances, when the MTA receives a
message without a Date:, it should add it. In your case it doesn't and
this is arguably correct - some at least say that the MTA should only
add Date:, Message-Id: and such headers when acting as an MUA.

On the Mailman side, Mailman should add these headers, but doesn't in
the case of the alias notification.

If you look at Mailman/Cgi/create.py, you'll see that it creates and
sends the "confirmation" e-mail as follows:

        msg = Message.UserNotification(
            owner, siteowner,
            _('Your new mailing list: %(listname)s'),
            text, mlist.preferred_language)

It is the send() method that adds the Date: and Message-Id: headers.

The create module also (actually just before sending the confirmation)
calles the MTA specific module defined by the Defaults.py/mm_cfg.py
variable MTA which in your case is 'Manual'. This module,
Mailman/MTA/Manual.py, creates the "aliases" message as above but
enqueues it directly rather than using the send() method to send it.

I think the simplest (but maybe not the best) way to fix this in
Mailman is to add

    if not msg.has_key('date'):
        msg['Date'] = email.Utils.formatdate(localtime=1)


    msg = Message.UserNotification(
        siteowner, siteowner,
        _('Mailing list creation request for list %(listname)s'),
        sfp.getvalue(), mm_cfg.DEFAULT_SERVER_LANGUAGE)

in the creation part of Manual.py and similarly in the deletion part.
Note that this also requires

import email.Utils

to be added.

Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list