[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Majordomo newconfig chokes on restrict_post



I wrote:
> When I send Majordomo an email with a "newconfig"
> command, it rejects it, complaining about a non-existent file:

> >>>> newconfig bjc-announce xxxxxxxx
> The new config file for bjc-announce was NOT accepted because:
> Can't find restrict_post file /usr/local/majordomo/www.bjc.org.uk/lists/bjc-announce.new at line 390

I have now investigated the problem and found a fix.

Analysis (assuming a list called "listname"):
The "newconfig" command writes the supplied new configuration to a
file "listname.new.config" within the lists directory $listdir, then
calls get_config with $list set to "listname.new".  get_config
validates the data by (1) setting values from its inbuilt defaults
(%known_keys); (2) reading various flag files (not used in RaQ
configuration); (3) reading from $list.config file.  Problem arises in
(1) because some default values are eval'ed and thus have $list
substituted into them.  In particular, the RaQ's default for
"restrict_post" is '#!"$list"' which evaluates to "listname.new".  The
routine grab_restrict_post validates its value by checking for the
existence of the file within $listdir and it is this validation
failure which causes the problem.

Solution:
In get_def, a variable $baselist is set to "listname" when $list is
"listname.new".  So in config_parse.pl, where the default values in
%known_keys have been modified by Cobalt, change $list to $baselist:

*** config_parse.pl	Sun Apr 16 20:06:37 2000
--- config_parse_fix.pl	Sun Apr 23 17:20:50 2000
***************
*** 119,125 ****
  				      # to null if it is not a -digest list,
  				      # or the non-digest list if it is
  				      # a -digest list.
!         'restrict_post',       '#!"$list"',   # Like -I in resend
          'purge_received', 	'no', # Remove received lines
          'administrivia', 	'yes',# Enable administrivia checks
  	'resend_host', 		'',   # Change the host name
--- 119,125 ----
  				      # to null if it is not a -digest list,
  				      # or the non-digest list if it is
  				      # a -digest list.
!         'restrict_post',       '#!"$baselist"',   # Like -I in resend
          'purge_received', 	'no', # Remove received lines
          'administrivia', 	'yes',# Enable administrivia checks
  	'resend_host', 		'',   # Change the host name


I hope this is of help to anyone else with the same problem (I have reported
the bug and solution to Cobalt).
-- 
Colin Hogben