[Mailman-Users] usenet gateway for mailman

Jerry Stratton jerry at sandiego.edu
Mon Apr 15 18:53:08 CEST 2002

>You mention 'usenet gateway' for mailman, does this mean your great product
>can integrate with a newsgroup, e.g. postings to the newsgroup get sent out
>as emails to those who prefer email and emails get automatically posted to
>the newsgroup for those who prefer newsgroups?  Or is this too much to ask.

This is exactly what it means.

1. You can set the mailing list to automatically send list messages 
to a specific newsgroup. ("gateway to news")

2. You can set the mailing list to automatically check that same 
newsgroup and remail new messages to the mailing list. ("gateway to 

Those features can be enabled separately (although if both are 
enabled they do have to both use the same newsgroup).

One issue you may run into is that if you require that postings come 
from listmembers, your Usenet readers have to be members of the 
mailing list. You can change this requirement so that mailman allows 
Usenet postings through automatically, but that requires hacking the 

The two changes I've made to make this feature more useful are:

1. Added the ability to put the newsgroup and news host on the list's 
info pages. This change is made in HTMLFormatter.py in the Mailman 
directory: Look for "def GetStandardReplacements(self):" and add the 
following lines:
             '<mm-newsgroup>' : self.linked_newsgroup,
             '<mm-newshost>' : self.nntp_host,

2. Made it so that if the gateway-to-mail option is set, then any 
messages coming from the appropriate newsgroup are allowed as if they 
were from a member. This change is made in "Hold.py" in 
Mailman/Handlers. Look for "def process(mlist, msg, msgdata):" and 
near "if mlist.member_posting_only" change to:

     # postings only from list members?  mlist.posters are allowed in addition
     # to list members.  If not set, then only the members in posters are
     # allowed to post without approval.
     #note: should find some way to compare needgroup and newsgroup 
     #note: should probably also trim whitespace away from both ends
     if mlist.member_posting_only:
         if mlist.gateway_to_mail:
             needgroup = mlist.linked_newsgroup
             newsgroup = msg.getheader('newsgroups')

         posters = Utils.List2Dict(map(string.lower, mlist.posters))
         if not mlist.IsMember(sender) and \
            not (mlist.gateway_to_mail and needgroup and 
newsgroup==needgroup) and \
            not Utils.FindMatchingAddresses(sender, posters):
             # the sender is neither a member of the list, nor in the list of
             # explicitly approved posters
             # nor is it from the gatewayed newsgroup
             hold_for_approval(mlist, msg, msgdata, NonMemberPost)
             # no return

Issues: the newsgroup name is case sensitive; and if multiple 
newsgroup names are listed, it will not match. (The latter is 
probably a good thing--you will still have the opportunity to approve 
after verifying that it is not spam.)

jerry at sandiego.edu
Serra 188B/x8773
The more restrictions there are, the poorer the people become. The 
greater the government¹s power, the more chaotic the nation would 
become. The more the ruler imposes laws and prohibitions on his 
people, the more frequently evil deeds would occur.
--The Silence of the Wise: The Sayings of Lao Zi

More information about the Mailman-Users mailing list