I've got a couple of queries about how the MTA interfaces in mailman hang together now - I'm also putting some of the initial stuff in more detail so others can find out what to hack to select things. There are 2 MTA modules - Mailman/Handlers/SMTPDirect.py Mailman/Handlers/Sendmail.py I would say from what I have seen of the Sendmail.py one that most developers have been using SMTPDirect :-) - thats the default in Defaults.py To use the sendmail i/f add this to mm_cfg.py DELIVERY_MODULE = 'Sendmail' SENDMAIL_CMD = '/usr/sbin/sendmail' [I actually use exim, but MTAs on linux with a sendmail like interface normally have a presence - either a symlink or a sendmail CLI emulator - at /usr/sbin/sendmail ] You also need to add the appropriate magic for your MTA to accept the lies that mailman tells it as an appropriate sender address (ie the -f parameter to sendmail). In my config with exim this means adding trusted_groups=mailman to my config file. I also needed to patch Sendmail.py to get the envelope from addresses right:- --- Sendmail.py.orig Tue Mar 21 06:25:51 2000 +++ Sendmail.py Sun Apr 9 22:17:37 2000 @@ -56,7 +56,7 @@ # nothing to do! return # Use -f to set the envelope sender - cmd = mm_cfg.SENDMAIL_CMD + ' -f ' + msg.GetSender() + ' ' + cmd = mm_cfg.SENDMAIL_CMD + ' -f ' + mlist.GetAdminEmail() + ' ' # make sure the command line is of a manageable size recipchunks = [] currentchunk = [] So, now to the questions:- 1. Everything now looks like a list mail - looks like some items which used to look distinct from list mails have the 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] 2. I'm concerned the patch above might do bad things when it comes to sending out list reminders :-) 3. What happens in either MTA interface if the MTA cannot accept the message [for SMTP either connection refused, or a negative reply code? For Sendmail a negative reply code] - is the message dropped?? How does the bit of queue handling thats left tie into this? Nigel. -- [ - Opinions expressed are personal and may not be shared by VData - ] [ Nigel Metheringham Nigel.Metheringham@VData.co.uk ] [ Phone: +44 1423 850000 Fax +44 1423 858866 ]
"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
participants (2)
-
Barry A. Warsaw -
Nigel Metheringham