Hi Mailman developers,
we at freexp.de are setting up Mailman and INN and are trying to get the Mail<->News facility to work. We are neither familiar with Mailman nor with Python, just being poor old Pascal programmers. ;)
I have been in touch with Brad Knowles before and he advised me to ask here.
We have three mailing lists and three corresponding newsgroups, which shall be gated bidirectional. It even works but what is puzzling us is that in Mail->News direction Mailman always creates an own MsgID. This screws up threading by references: If a newsgroup user replies to a posting that has been gated from the mailing list to the newsgroup, then
- from the perspective of the mailing list users - his references point to a "wrong" MsgID when they receive this followup posting being gated from the newsgroup to the mailing list.
I found the respective code in Queue/NewsRunner.py and also read the explanation why Mailmain is creating own MsgIDs (I'll come back to this later on). I changed the code as follows:
----------8<---------- # Our Message-ID format is <mailman.secs.pid.listname@hostname> msgid = msg['message-id'] hackmsgid = True if msgid: hackmsgid = False # mo = mcre.search(msgid) # if mo: # lname, hname = mo.group('listname', 'hostname') # if lname == mlist.internal_name() and hname == mlist.host_name: # hackmsgid = False if hackmsgid: del msg['message-id'] msg['Message-ID'] = Utils.unique_message_id(mlist) ----------8<----------
It is not really clear to me how Python can know where a conditional statement such as "if msgid:" ends (just by the indention?), but this piece seems to work: The MsgID is now being left untouched.
This is question #1: Is this code OK? I'm also not sure if the variable 'msgid' contains a boolean or a string...?
Now to the more important issues:
I understand that there are two main reasons why Mailman wants to create an own MsgID upon gating Mail->News, one of them being to avoid loops.
Even after I changed the code as above, I still can't see a loop. I first thought Mailman might check the MsgID of a posting upon deciding whether it should be gated from the newsgroup to the mailing list, but this is obviously not the case. I've had a look into cron/gate_news.py but couldn't figure out exactly how Mailman is taking that decision.
This is question #2: How does Mailman know if the mailing list has already seen a posting or not?
Anyway, the second and more important reason for creating own MsgIDs seems to be the issue of an XPost to two (or more) Usenet-gated mailing lists.
This is indeed a problem and I understand the background. Thus we'd like to tweak Mailman in a way that it does the following:
Say we have the mailing lists ml-1, ml-2 and ml-3 and the corresponding newsgroups ng-1, ng-2 and ng-3. Now a mail comes in, being addressed to ml-1 and ml-2 (which thus should be gated to ng-1 and ng-2).
In fact, two physical mails will come in, and obviously Mailman does now create two physical postings, one addressed to ng-1, the other one addressed to ng-2. This in fact creates the problem of duplicate MsgIDs.
But what Mailman should do is to create *one* physical posting, x-posted to ng-1 and ng-2 ("Newsgroups: ng-1,ng-2"). This would mean that upon dealing with the mail to ml-1 it would have to check if the addresses in the To: and Cc: headers contain more than one of "our" mailing lists and if these mailing lists are being gated to "our" Newsgroups. If so, then an x-posting as described shall be created.
When Mailman now has to deal with the second mail to ml-2 (with the same MsgID) it shall *not* create another posting anymore.
Can this be accomplished (and if yes, how)?
Of course, if a mail does not have a MsgID at all, then Mailman should still create its own MsgID.
Any hint will be appreciated (and again, please consider that we are newbees with regards to Mailman and Python). Even if we would have to hardcode some strings (of mailing lists and/or newsgroups) this would be a better solution than no solution.
Michael
Dear Michael,
we at freexp.de are setting up Mailman and INN and are trying to get the Mail<->News facility to work. We are neither familiar with Mailman nor with Python, just being poor old Pascal programmers. ;)
I have successfully set up the same combination at TYPO3s mailing list server (see http://typo3.org/1252.html).
Sorry I can not really answer your questions, but I can tell you how I did it. My solution is a bit different to your attempt. I munge _all_ message IDs the same way.
Visit http://www.mstucki.net/files/misc/mailman/ where I have uploaded a patch for CookHeaders.py.
I don't know if this is still neccessary, but you should also check if you need to run the filter_nnrpd.pl after each NNTP post (see INN documentation).
Good luck!
- michael
Michael Stucki <mundaun@gmx.ch> wrote on 03.01.04:
Dear Michael,
we at freexp.de are setting up Mailman and INN and are trying to get the Mail<->News facility to work. We are neither familiar with Mailman nor with Python, just being poor old Pascal programmers. ;)
I have successfully set up the same combination at TYPO3s mailing list server (see http://typo3.org/1252.html).
Sorry I can not really answer your questions,
Well, at least a response. :) I was already thinking if my questions were to simple or too complex for the list. Or if it's simply the wrong time to ask such questions.
but I can tell you how I did it. My solution is a bit different to your attempt. I munge _all_ message IDs the same way.
Visit http://www.mstucki.net/files/misc/mailman/ where I have uploaded a patch for CookHeaders.py.
Done and understood. But this will only work if *no* user will disable the option of receiving own posts to the list. Because if he does so then *no* reply to his own post would be correctly threaded (from his local point of view).
I don't know if this is still neccessary, but you should also check if you need to run the filter_nnrpd.pl after each NNTP post (see INN documentation).
The direction news=>mail is not the problem, it's mail=>news.
I don't know yet what filter_nnrpd.pl exactly does but if I would want to run it, what would I have to do? As I said, Python totally escapes me.
To all: I'm really and desperately still waiting for helpful responses to my original mail. Any reply will be highly appreciated.
Michael
Hi Michael,
Well, at least a response. :) I was already thinking if my questions were to simple or too complex for the list. Or if it's simply the wrong time to ask such questions.
I don't think so. My solution is just different but will work for sure!
Visit http://www.mstucki.net/files/misc/mailman/ where I have uploaded a patch for CookHeaders.py.
Done and understood. But this will only work if *no* user will disable the option of receiving own posts to the list. Because if he does so then *no* reply to his own post would be correctly threaded (from his local point of view).
No. Since _all_ MessageIDs (NNTP+Mailman) are regenerated the same way, it will work in any case.
The direction news=>mail is not the problem, it's mail=>news.
Nope. See above.
I don't know yet what filter_nnrpd.pl exactly does but if I would want to run it, what would I have to do? As I said, Python totally escapes me.
It's a Perl script: http://esm.logic.net/projects/inn/
Good luck!
- michael
Michael Stucki <mundaun@gmx.ch> wrote on 04.01.04:
Hi Michael,
Well, at least a response. :) I was already thinking if my questions were to simple or too complex for the list. Or if it's simply the wrong time to ask such questions.
I don't think so. My solution is just different but will work for sure!
See my explanation below. But whether your solution will work or not, it does still not achieve the goal that I outlined in my original post (create "real" X-Postings in mail=>news direction when somebody sends a mail to *both* Usenet-gated lists).
Or did I miss something?
Visit http://www.mstucki.net/files/misc/mailman/ where I have uploaded a patch for CookHeaders.py.
Done and understood. But this will only work if *no* user will disable the option of receiving own posts to the list. Because if he does so then *no* reply to his own post would be correctly threaded (from his local point of view).
No. Since _all_ MessageIDs (NNTP+Mailman) are regenerated the same way, it will work in any case.
Hmm, we might have a misunderstanding. Let me explain:
User is creating a post to the list, his mail reader locally creates a Message-ID. Let's assume he has disabled the option of receiving own posts to the list.
He sends out the post, your code will munge the MsgID. All subscribers (except the sender of the original mail!) will receive a mail with the munged MsgID, the same applies to all newsgroup users.
*Every* reply/followup to this mail/posting will point to this munged MsgID (in the In-Reply-To: and/or References: header). Thus the sender of the original mail will receive replies/followups pointing to a MsgID he will not be able to find in his message base (because he still and only has his original mail with the locally created MsgID).
Threading by references will work everywhere, but not on the system of the sender of the original mail.
See my point?
The direction news=>mail is not the problem, it's mail=>news.
Nope. See above.
I was talking about the creation of "real" X-Postings with two comma- delimited newsgroups in the Newsgroups: header here (rather than creating two physical newsgroup postings with just one newsgroup in each Newsgroups: header). Also see my original mail.
Michael
Michael Heydekamp <my@freexp.de> wrote on 28.12.03:
This is indeed a problem and I understand the background. Thus we'd like to tweak Mailman in a way that it does the following:
[...]
I don't want to believe that no developer is able to help in this matter, probably the post was too long. I try it shorter again:
Say we have these two Usenet-gated mailing lists plus two respective newsgroups:
support-list@freexp.de <=> crosspoint.freexp.support dev-list@freexp.de <=> crosspoint.freexp.dev
If somebody sends a mail to "support-list@freexp.de" and carbon copies "dev-list@freexp.de" (or vice versa) I want Mailman to create a crossposting with the header:
Newsgroups: crosspoint.freexp.support,crosspoint.freexp.dev
Currently Mailman creates two separate postings. What exactly would I have to change in which way in NewsRunner.py or elsewhere to create such a crossposting? As I said, Python totally escapes me, so I would need real working code.
I wouldn't object if Mailman would create *two* crosspostings if that is easier (as the second one will be rejected by the news server anyway).
Michael
participants (2)
-
Michael Heydekamp
-
Michael Stucki