<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
--></style><title>Re: [Mailman-Users] News to Mail gateway
setup</title></head><body>
<blockquote type="cite" cite>I've got News to Mail gatewaying working,
almost. Currently, whenever<br>
someone posts to the news group, the post to the mailing list requires
my<br>
approval. Is there some way to automatically approve posts to
the mailling<br>
list from the news group short of allowing anyone to post to the
mailling<br>
list? I only ask because the news group I'm gating is not
public, and I</blockquote>
<blockquote type="cite" cite>assume the uni would like to keep it that
way...</blockquote>
<div><br></div>
<div>We needed the same thing, for pretty much the exact same setup.
You'll need to change the source code to do this. It isn't that
difficult, assuming that I've done this right:</div>
<div><br></div>
<div>In the "Handlers" directory of the "Mailman"
directory, there is a file called "Hold.py". This is the
script that determines whether or not a message needs to be
held.</div>
<div><br></div>
<div>There is a section in there that says:</div>
<div><br></div>
<div>In it, there is a section that says:<br>
<br>
if mlist.member_posting_only:<br>
posters =
Utils.List2Dict(map(string.lower, mlist.posters))<br>
if not
mlist.IsMember(sender) and \<br>
not
Utils.FindMatchingAddresses(sender, posters):<br>
#
the sender is neither a member of the list, nor in the list of<br>
#
explicitly approved posters<br>
hold_for_approval(mlist, msg, msgdata, NonMemberPost)<br>
#
no return</div>
<div><br></div>
<div><br></div>
<div>Change this to:</div>
<div><br></div>
<div><font face="Lucida Grande" size="+2"
color="#000000"> if mlist.member_posting_only:<br>
if
mlist.gateway_to_mail:<br>
needgroup = mlist.linked_newsgroup<br>
newsgroup = msg.getheader('newsgroups')<br>
<br>
posters =
Utils.List2Dict(map(string.lower, mlist.posters))<br>
if not
mlist.IsMember(sender) and \</font></div>
<div><font face="Lucida Grande" size="+2"
color="#000000"
> not
(mlist.gateway_to_mail and needgroup and newsgroup==needgroup) and
\</font></div>
<div><font face="Lucida Grande" size="+2"
color="#000000"
> not
Utils.FindMatchingAddresses(sender, posters):<br>
#
the sender is neither a member of the list, nor in the list of<br>
#
explicitly approved posters<br>
#
nor is it from the gatewayed newsgroup<br>
hold_for_approval(mlist, msg, msgdata, NonMemberPost)<br>
#
no return</font><br>
<font face="Lucida Grande" size="+2" color="#000000"></font></div>
<div>Note that this still has some problems: if there is more than one
newsgroup on the Newsgroups: line, the posting will still need
approval (this could be considered a feature, of course). And the code
does not check in a case-insensitive manner. I tried
newsgroup=string.lower(msg.getheader('newsgroups')) and that generated
errors in the error log for some reason. (I'm fairly new to python;
this is, in fact, the first thing I've done in it.)</div>
<div><br></div>
<div>The above changes the code so that if the group's
"gateway_to_mail" option is set, it checks to see if the
message has a "Newsgroups:" header set to the same thing as
the list's linked_newsgroup setting. If so, it lets the message
through.</div>
<div><br></div>
<div>Jerry</div>
<x-sigsep><pre>--
</pre></x-sigsep>
<div><font color="#000000">jerry@sandiego.edu</font></div>
<div><font
color="#000000">http://www.sandiego.edu/~jerry/</font></div>
<div><font color="#000000">Serra 188B/x8773<br>
<font face="Times" size="+2">--</font></font></div>
<div><font face="Palatino" size="+2" color="#000000">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.<br>
--The Silence of the Wise: The Sayings of Lao Zi</font></div>
</body>
</html>