At 11:57 AM 11/5/97 -0800, kwhite@msgate.cv.com wrote:
>
>Is there a way to have a mailing list closed to people outside of our domain
>(CV.COM) and keep it open to people inside our domain? Ideally I would
like to
>have people outside the domain require approval.
No. This feature has been asked for repeatedly, but Majordomo cannot do it
by default. <fan fare> But try this: :)
This is a patch for 1.94.4 to add subscribe/nosubscribe regexp arrays.
These arrays are sort of analogous to advertise/noadvertise. The
'nosubscribe' array implements an address "ban" function. Even if the list
policy is set to 'auto', subscribe attempts from matching addresses will be
sent to the owner for approval rather than subscribing. The complement
'subscribe' array implements a match-based 'auto' policy; even if a list is
'closed', subscribe attempts from matching addresses will be automatically
approved without owner intervention.
So in Keith's scenario: set the list to 'closed', and this will
automatically allow anyone @cv.com to subscribe without involving the
owner; all others will require approval.
subscribe << END
/@CV\.COM/i
END
The other common scenario of banning a site: keepout.com will require
approval, all others will adhere to whatever subscribe_policy is in place.
nosubscribe << END
/@keepout\.com/i
END
The arrays can have multiple members. 'nosubscribe' and 'subscribe' can be
used by themselves or together (nosub overrides sub); the +confirm
subscribe_policy modifier will be honored in all cases. This patch does not
change restrict_post or *_access behavior.
And there was much rejoicing...
--bill
---CUT HERE---
*** majordomo.orig Sun Nov 9 22:55:55 1997
--- majordomo Mon Nov 10 00:12:12 1997
***************
*** 286,291 ****
--- 286,321 ----
return 0;
}
+ # Check to see if this address matches an address in the
+ # "nosubscribe" ban array. Request -owner approval if so.
+ # NOTE: nosubscribe=.* is equivalent to sub_policy=closed
+ #
+ if (! $approved
+ && $config_opts{$clean_list,"nosubscribe"}) {
+ local($i); local($_) = $subscriber;
+ foreach $i
(split(/\001/,$config_opts{$clean_list,"nosubscribe"})) {
+ # Expects $_ = $subscriber
+
&check_and_request("subscribe",$clean_list,$subscriber),
+ return 1 if (eval $i);
+ }
+ }
+
+ # Check to see if this address matches an address in the
+ # "subscribe" array. If so, this is an automatic subscribe
+ # (even on a 'closed' list) -- set the approved flag. The
+ # regexps under "nosubscribe" override these values.
+ # NOTE: subscribe=.* is equivalent to sub_policy=auto
+ #
+ if (! $approved
+ && $config_opts{$clean_list,"subscribe"} &&
+ &check_and_request("subscribe", $clean_list,
+ $subscriber, "check_only")) {
+ local($i); local($_) = $subscriber;
+ foreach $i
(split(/\001/,$config_opts{$clean_list,"subscribe"})) {
+ # Expects $_ = $subscriber
+ $approved = 1, last if (eval $i);
+ }
+ }
# Check to see if this request is approved, or if the list is an
# auto-approve list, or if the list is an open list and the
***************
*** 293,299 ****
if ($approved
|| ($sub_policy =~ /auto/i &&
&check_and_request("subscribe", $clean_list,
! $subscriber, "check_only")) # I
don't think this check is doing the right thing. Chan 95/10/19
|| (($sub_policy !~ /closed/ )
&& &addr_match($reply_to, $subscriber,
(&cf_ck_bool($clean_list,"mungedomain") ? 2
: undef)))
--- 323,329 ----
if ($approved
|| ($sub_policy =~ /auto/i &&
&check_and_request("subscribe", $clean_list,
! $subscriber, "check_only"))
|| (($sub_policy !~ /closed/ )
&& &addr_match($reply_to, $subscriber,
(&cf_ck_bool($clean_list,"mungedomain") ? 2
: undef)))
*** config_parse.pl.orig Mon Nov 10 17:33:14 1997
--- config_parse.pl Mon Nov 10 18:09:39 1997
***************
*** 92,97 ****
--- 92,99 ----
# open, closed, or auto.
'unsubscribe_policy', "open\001closed\001auto\001open",
# open, closed, or auto.
+ 'subscribe', '', # if regexp matches address auto-subscribe
+ 'nosubscribe', '', # if regexp matches address ask
approval
'mungedomain', 'no', # is user@foo.com ==
user@host.foo.com
'admin_passwd', '#!"$list.admin"', #
administration password
'strip', 'yes', # remove comments from address on list
***************
*** 243,248 ****
--- 245,265 ----
exists, it is the same as specifying the value closed. The value of
this keyword overrides the value supplied by any existent files.",
+ 'subscribe',
+ "The 'subscribe' list provides a match-specific 'auto' subscribe policy.
+ If the requestor address matches one of these regexps, the subscribe
+ attempt will be approved automatically, even if the list is 'closed'.
+ The +confirm attribute is still honored accordingly.
+ The regexps under nosubscribe override these regexps.",
+
+ 'nosubscribe',
+ "The 'nosubscribe' list implements a subscriber 'ban' function.
+ If the requestor address matches one of these regexps, the subscribe
+ attempt will be sent to the list owner for approval even if the list is
+ 'open' or 'auto'.
+ The +confirm attribute is still honored accordingly.
+ The nosubscribe regexps override subscribe.",
+
'mungedomain',
"If set to yes, a different method is used to determine a matching
address. When set to yes, addresses of the form user\@dom.ain.com are
***************
*** 429,434 ****
--- 446,453 ----
'description', 'majordomo',
'subscribe_policy', 'majordomo',
'unsubscribe_policy', 'majordomo',
+ 'subscribe', 'majordomo',
+ 'nosubscribe', 'majordomo',
'mungedomain', 'majordomo',
'admin_passwd', 'majordomo',
'strip', 'majordomo',
***************
*** 485,490 ****
--- 504,511 ----
'description', 'grab_string',
'subscribe_policy', 'grab_enum',
'unsubscribe_policy', 'grab_enum',
+ 'subscribe', 'grab_regexp_array',
+ 'nosubscribe', 'grab_regexp_array',
'mungedomain', 'grab_bool',
'admin_passwd', 'grab_word',
'strip', 'grab_bool',
References:
|
|