Folks,

Okay, so we know about the issue of munging Message-ID: (if you don't know what I'm talking about, see <http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq04.059.htp>).


The latest crisis that has me wondering is the subject prefix stuff. Looking in NewsRunner.py, starting at line 104, we have:


    # Should we restore the original, non-prefixed subject for gatewayed
    # messages?
    origsubj = msgdata.get('origsubj')
    if not mlist.news_prefix_subject_too and origsubj is not None:
        del msg['subject']
        msg['subject'] = origsubj


However, we still have a problem. If mail clients reply to the message to the list (which will include the subject prefix), then this will result in a new message with a subject prefix for the list already present. Now, Mailman is smart and avoids adding a second subject prefix, but it doesn't strip out the subject prefix if one already exists. For the mailing list, this subject prefix stripping isn't necessary. But for gatewaying to the newsgroup, it might be desirable.


This would also resolve the issue of restoring the original subject when gatewaying -- don't bother, and just let the subject prefix stripper deal with it.


If this were sed or Perl, I could quickly put together a one-line hack to implement this feature. For example, just doing something off the top of my head, you might be able to use something like:


                subject=y/\w*$prefix\w*/ /;

But this is Python, and I don't really grok Python. Can someone help me out here?

Looking at <http://www.python.org/doc/2.3.4/lib/module-string.html>, I'm imagining some sort of permutation of find(), split(), either lstrip() or rstrip(), and then join(), should be sufficient to do the job. But I'm not quite able to figure out how to put them all together.


Of course, the reason why I ask is that I'm getting complaints about the mail-to-news gateway I'm running at another site, and I don't want this to blow up into an ugly situation.


        Sigh....

--
Brad Knowles, <[EMAIL PROTECTED]>

"Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety."

    -- Benjamin Franklin (1706-1790), reply of the Pennsylvania
    Assembly to the Governor, November 11, 1755

  SAGE member since 1995.  See <http://www.sage.org/> for more info.
_______________________________________________
Mailman-Developers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Reply via email to