John wrote in response to Olly Stephens:
>>PS> the configuration comments for "restrict_post" state that the filenames
>> can be space or colon separated. Trial and error followed by a scan of
>> the code indicates that this is not true - they must be separated by
>> colon, TAB or NEWLINEs. Space-separated filenames cause errors of the
>> form 'cannot open "file1 file2"'
>
> thanks for the note. Hopefully the entire mechanism will be replaced
> by something more flexible and useful.
I had the same problem with restrict_post plus an additional
requirement.
In setting up Majordomo for use at InterNIC Directory and Database
Services, I had requests to provide the ability to restrict posting
only the members of the lists and (optionally) to some additional
ids as well as having the ability to restrict posting to only a
FEW ids. The restrict_post feature as implemented in R1.92 only
allows you to restrict posting to a few ids since you can only specify
one id per file. I hacked the restrict_post code in resend to
search the entire file for the id, not just the first record in
the file.
So now if I have a list to which only list members should post, I
specify "restrict_post = <listname>:<listname>.restrict" and it
scans the subscription list for matches on the id. If I need to add
additional ids, they get listed in the file called <listname>.restrict.
Of course the drawback is still there that the <listname>.restrict
file can't be modified by the list owner via email. And - I
have to make sure that if the list is set for restricted_post that
the following ids are in <listname>.restrict and <listname>.restrict
is specified in "restrict_post =":
majordomo, majordomo-owner, owner-<listname>, <listname>-owner,
the list owner's email id , and (requirement by my mailer's
front end), Majordomo, and Majordomo-owner.
Otherwise, I ran into some very frustrating BOUNCE/APPROVE loops when
majordomo-owner tried to post to the list and when <listname>-owner
tried to approve the request when I had "restrict_post = <listname>"
(look at what headers are generated by the announce utility).
If you're interested in the hack it's attached (sorry it's not in patch
format), Also - if you're going to enhance restrict_post to be more
flexible, I think the above ids need to be allowed to post to the
list regardless of the setting of restrict_post.
- Debbie
====================================================================
Deborah Hamilton debbie@qsun.att.com
InterNIC Directory and Database (908) 949-9459
Services Support
AT&T Bell Laboratories
====================================================================
Code changes to resend to provide more inclusive restrict_post option:
297 if ( defined($opt_I) && defined($from) && ! defined($approved) ) {
298 local($infile) = 0;
299
300 @files = split (/[:\t\n]+/, $opt_I);
301
302 foreach $file (@files) {
303 if ($file !~ /^\//) {
304 $file = "$listdir/$file";
305 }
306 if ( open (LISTFD, "<${file}") != 0 ) {
307
308 # DAH - Add code to read and check EVERY address in the file, not
309 # just one address - this way we can restrict posts to
310 # a list of addresses contained in a file - which _could_ be the
311 # mailing list itself. This way, if you have a number of folks
312 # that you want to restrict the posting to, you don't need a
313 # file for each address. And you can have separate files too -
314 # one for list members and non-members. Each address in the
315 # file must be separated by a newline (\n).
316 #
317 # Replacing the next line with lines marked w/ inits
318 # @output = grep (&addr_match($from, $_), <LISTFD>);
319
320 local(@restrict) = (); # dah
321 while( <LISTFD> ) { # dah
322 push(@restrict, &chop_nl($_)); # dah
323 } # dah
324 @output = grep (&addr_match($from, $_), @restrict); # dah
325
326 close (LISTFD);
327
328 if ( $#output != -1 ) {
329 $infile = 1;
330 last;
331 }
332 } else {
333 die("resend: Can't open $file: $!");
334 }
335 }
336
337 if ( $infile == 0 ) {
338 &bounce ("Non-member submission from [$from]");
339 }
340 }
341
342 if (defined($opt_A) && ! defined($approved)) {
Follow-Ups:
|
|