--- Ezmlm-0.08.2/Ezmlm.pm.saveconfig722 2016-04-19 10:12:50.000000000 -0400 +++ Ezmlm-0.08.2/Ezmlm.pm 2016-04-20 05:39:11.000000000 -0400 @@ -170,7 +170,8 @@ # can we actually alter this list; ($self->_seterror(-1, 'must setlist() before you update()') && return 0) unless(defined($self->{'LIST_NAME'})); # check for important files: 'config' (idx < v5.0) or 'flags' (idx >= 5.0) - ($self->_seterror(-1, "$self->{'LIST_NAME'} does not appear to be a valid list in update()") && return 0) unless((-e "$self->{'LIST_NAME'}/config") || (-e "$self->{'LIST_NAME'}/flags")); + #nomore config or flags in 7.2.2 + ($self->_seterror(-1, "$self->{'LIST_NAME'} does not appear to be a valid list in update()") && return 0) unless((-e "$self->{'LIST_NAME'}/config") || (-e "$self->{'LIST_NAME'}/flags") || (get_version() >= 7)); # Work out if this is a vhost. open(OUTHOST, "<$self->{'LIST_NAME'}/outhost") || ($self->_seterror(-1, 'unable to read outhost in update()') && return 0); @@ -205,7 +206,10 @@ my($options); # Read the config file - if(-e $self->{LIST_NAME} . "/flags") { + if (get_version() >= 7){ + # there are no more flags or config file, but file/flags in directory + $options = $self->_getconfig_idx7(); + } elsif(-e $self->{LIST_NAME} . "/flags") { # this file exists since ezmlm-idx-5.0.0 # 'config' is not authorative anymore since that version $options = $self->_getconfig_idx5(); @@ -860,6 +864,67 @@ return $options; } + +# == Internal function to work out a list configuration (idx >= v7.0) == +sub _getconfig_idx7 { + my($self) = @_; + my ($options, %optionfiles); + my ($file, $opt_num, $temp, $i); + $options = ''; + $options .= 'a' if ((-e "$self->{'LIST_NAME'}/archived") || (-e "$self->{'LIST_NAME'}/indexed"));#v7 could be archived or indexed + $options .= 'b' if (-e "$self->{'LIST_NAME'}/modgetonly"); + $options .= 'd' if (-e "$self->{'LIST_NAME'}/digested"); + $options .= 'f' if (-e "$self->{'LIST_NAME'}/prefix"); + $options .= 'g' if (-e "$self->{'LIST_NAME'}/subgetonly"); + $options .= 'h' if (-e "$self->{'LIST_NAME'}/nosubconfirm"); + $options .= 'i' if (-e "$self->{'LIST_NAME'}/threaded"); + $options .= 'j' if (-e "$self->{'LIST_NAME'}/nounsubconfirm"); + $options .= 'k' if (-e "$self->{'LIST_NAME'}/blacklist" || -e "$self->{'LIST_NAME'}/deny"); + $options .= 'l' if (-e "$self->{'LIST_NAME'}/modcanlist"); + $options .= 'm' if (-e "$self->{'LIST_NAME'}/modpost");# for v7 mu for noreturnposts + $options .= 'n' if (-e "$self->{'LIST_NAME'}/modcanedit"); + $options .= 'o' if (-e "$self->{'LIST_NAME'}/modpostonly"); + $options .= 'p' if (-e "$self->{'LIST_NAME'}/public"); + $options .= 'q' ;# always on in v7 + $options .= 'r' if (-e "$self->{'LIST_NAME'}/remote"); + $options .= 's' if (-e "$self->{'LIST_NAME'}/modsub"); + $options .= 't' if (-e "$self->{'LIST_NAME'}/addtrailer"); + $options .= 'u' if (-e "$self->{'LIST_NAME'}/subpostonly"); + $options .= 'x' if (-e "$self->{'LIST_NAME'}/extra" || -e "$self->{'LIST_NAME'}/allow"); + $options .= 'y' if (-e "$self->{'LIST_NAME'}/confirmpost"); + # Add the unselected options too + # but we will skip invalid options (any of 'cevz') + foreach $i ('a' .. 'z') { + $options .= uc($i) unless (('cevz' =~ /$i/) || ($options =~ /$i/i)) + } + + # values from different files + # first: preset a array with "filename" and "option_number" + %optionfiles = ( + 'sublist', 0, + 'fromheader', 3, + 'tstdigopts', 4, + 'owner', 5, + 'sql', 6, + 'modpost', 7, + 'modsub', 8, + 'remote', 9); + while (($file, $opt_num) = each(%optionfiles)) { + if (-e "$self->{'LIST_NAME'}/$file") { + chomp($temp = $self->getpart($file)); + $temp =~ m/^(.*)$/m; # take only the first line + $temp = $1; + # the 'owner' setting can be ignored if it is a path (starts with '/') + unless (($opt_num == 5) && ($temp =~ m#^/#)) { + $options .= " -$opt_num '$temp'" if ($temp =~ /\S/); + } + } + } + + return $options; +} + + # == Internal function to work out a list configuration manually (idx < v5.0.0 ) == sub _getconfigmanual { # use this function for strange lists without