diff --git a/cassandane/Cassandane/Config.pm b/cassandane/Cassandane/Config.pm index 5ca72584a9c..f7860368b14 100644 --- a/cassandane/Cassandane/Config.pm +++ b/cassandane/Cassandane/Config.pm @@ -108,8 +108,6 @@ sub default delete_mode => 'delayed', # for debugging - see cassandane.ini.example debug_command => '@prefix@/utils/gdbtramp %s %d', - # everyone should be running this - improved_mboxlist_sort => 'yes', # default changed, we want to be explicit about it unixhierarchysep => 'no', # let's hear all about it diff --git a/cassandane/Cassandane/Cyrus/Prometheus.pm b/cassandane/Cassandane/Cyrus/Prometheus.pm index 4cb3456f331..6c8791562f3 100644 --- a/cassandane/Cassandane/Cyrus/Prometheus.pm +++ b/cassandane/Cassandane/Cyrus/Prometheus.pm @@ -257,70 +257,6 @@ sub test_quota_commitments $self->assert_equals(10000, $report->{'cyrus_usage_quota_commitment'}->{'partition="p2",resource="STORAGE"'}->{value}); } -# tests for pathological quotaroot/partition subdivisions -sub test_quota_commitments_no_improved_mboxlist_sort - :min_version_3_1 :needs_component_httpd :Partition2 :NoStartInstances -{ - my ($self) = @_; - - $self->{instance}->{config}->set('improved_mboxlist_sort', 'no'); - $self->_start_instances(); - - my $admintalk = $self->{adminstore}->get_client(); - - my $inbox = 'user.cassandane'; # allocate top level quota here - my $child = "$inbox.child"; - my $gchild1 = "$child.cat"; # we'll stick this one on a sep part - my $gchild2 = "$child.dog"; # give this one its own quota - my $gchild3 = "$child.sheep"; # normal, but sorts after weird ones - my $ggchild1 = "$gchild1.manx"; # and give this one its own quota - my $ggchild2 = "$gchild1.siamese"; # and this one back on def part - my $interm = "$inbox.foo.bar.baz"; # contains intermediate folders - my $inbox2 = 'user.cassandane-child'; # hyphen! own quota - - # make some folders - foreach my $f ($child, $gchild1, $gchild2, $gchild3, $ggchild1, - $ggchild2, $interm, $inbox2) { - $admintalk->create($f); - $self->assert_str_equals('ok', - $admintalk->get_last_completion_response()); - } - - # stick one of them on a different partition - $admintalk->rename($gchild1, $gchild1, 'p2'); - $self->assert_str_equals('ok', $admintalk->get_last_completion_response()); - - # but not one of its children - $admintalk->rename($ggchild2, $ggchild2, 'default'); - $self->assert_str_equals('ok', $admintalk->get_last_completion_response()); - - # create a mess of quotas - $admintalk->setquota($inbox, '(STORAGE 8000)'); - $self->assert_str_equals('ok', $admintalk->get_last_completion_response()); - $admintalk->setquota($gchild2, '(STORAGE 4000)'); - $self->assert_str_equals('ok', $admintalk->get_last_completion_response()); - $admintalk->setquota($ggchild1, '(STORAGE 2000)'); - $self->assert_str_equals('ok', $admintalk->get_last_completion_response()); - $admintalk->setquota($inbox2, '(STORAGE 1000)'); - $self->assert_str_equals('ok', $admintalk->get_last_completion_response()); - - $admintalk->logout(); - - sleep 3; - - my $response = $self->http_report(); - $self->assert($response->{success}); - - my $report = parse_report($response->{content}); - $self->assert(scalar keys %{$report}); - - # now we expect default partition to have 8000 + 4000 +1000 committed - $self->assert_equals(13000, $report->{'cyrus_usage_quota_commitment'}->{'partition="default",resource="STORAGE"'}->{value}); - - # and p2 partition to have 8000 + 2000 committed - $self->assert_equals(10000, $report->{'cyrus_usage_quota_commitment'}->{'partition="p2",resource="STORAGE"'}->{value}); -} - sub test_shared_mailbox_namespaces :min_version_3_1 :needs_component_httpd { diff --git a/cassandane/Cassandane/Cyrus/Quota.pm b/cassandane/Cassandane/Cyrus/Quota.pm index e7f3b6a088c..e01d9dc3c6a 100644 --- a/cassandane/Cassandane/Cyrus/Quota.pm +++ b/cassandane/Cassandane/Cyrus/Quota.pm @@ -1121,96 +1121,6 @@ sub test_quota_d $self->assert_does_not_match(qr{dave\@qux.com}, $content); } -# https://github.com/cyrusimap/cyrus-imapd/issues/2877 -sub test_quota_f_no_improved_mboxlist_sort - :unixHierarchySep :AltNamespace :VirtDomains :NoStartInstances -{ - my ($self) = @_; - - my $user = 'user1@example.com'; - my @otherusers = ( - 'user0@example.com', - 'user1-z@example.com', - 'user2@example.com', - ); - - $self->{instance}->{config}->set('improved_mboxlist_sort', 'no'); - $self->_start_instances(); - - my $admintalk = $self->{adminstore}->get_client(); - $admintalk->create("user/$user"); - $self->assert_str_equals('ok', - $admintalk->get_last_completion_response()); - $admintalk->setacl("user/$user", $user, 'lrswipkxtecdan'); - $self->assert_str_equals('ok', - $admintalk->get_last_completion_response()); - - xlog $self, "set ourselves a basic usage quota"; - $self->_set_limits( - quotaroot => "user/$user", - storage => 100000, - message => 50000, - $res_annot_storage => 10000, - ); - $self->_check_usages( - quotaroot => "user/$user", - storage => 0, - message => 0, - $res_annot_storage => 0, - ); - - # create some other users to tickle sort-order issues? - foreach my $x (@otherusers) { - $admintalk->create("user/$x"); - $self->_set_limits( - quotaroot => "user/$x", - storage => 100000, - message => 50000, - $res_annot_storage => 10000, - ); - } - - my $svc = $self->{instance}->get_service('imap'); - my $userstore = $svc->create_store(username => $user); - my $usertalk = $userstore->get_client(); - - foreach my $submbox ('Drafts', 'Junk', 'Sent', 'Trash') { - xlog $self, "creating $submbox..."; - $usertalk->create($submbox); - $self->assert_str_equals('ok', - $usertalk->get_last_completion_response()); - } - - $usertalk->list("", "*"); - - foreach my $mbox (qw(INBOX Drafts Sent Junk Trash)) { - $usertalk->select($mbox); - foreach (1..3) { - $self->make_message("msg $_ in $mbox", store => $userstore); - } - } - - xlog $self, "run quota -d"; - $self->{instance}->run_command({ cyrus => 1 }, - 'quota', '-d', 'example.com'); - - xlog $self, "run quota -d -f"; - my $outfile = $self->{instance}->{basedir} . '/quota.out'; - my @data = $self->{instance}->run_command({ - cyrus => 1, - redirects => { - stderr => $outfile, - stdout => $outfile, - }, - }, 'quota', '-f', '-d', 'example.com'); - - my $str = slurp_file($outfile); - xlog $self, $str; - - #example.com!user.user1.Junk: quota root example.com!user.user1 --> (none) - $self->assert_does_not_match(qr{ quota root \S+ --> \(none\)}, $str); -} - sub test_quota_f_unixhs :UnixHierarchySep { diff --git a/changes/next/deprecate_improved_mboxlist b/changes/next/deprecate_improved_mboxlist new file mode 100644 index 00000000000..8f3e2e89227 --- /dev/null +++ b/changes/next/deprecate_improved_mboxlist @@ -0,0 +1,20 @@ +Description: + +The improved_mboxlist_sort option had no effect since v3.6. It is now deprecated. + +cyr_dbtool option -M/--improved-mboxlist-sort is removed. + + +Config changes: + +improved_mboxlist_sort is now deprecated. + + +Upgrade instructions: + +Remove improved_mboxlist_sort from imapd.conf. It has no effect and is now deprecated. + + +GitHub issue: + +https://github.com/cyrusimap/cyrus-imapd/pull/4559 diff --git a/cunit/aaa-db.testc b/cunit/aaa-db.testc index b8abdbc0393..1e1b8a89fd7 100644 --- a/cunit/aaa-db.testc +++ b/cunit/aaa-db.testc @@ -799,9 +799,9 @@ static void test_mboxlist(void) r = cyrusdb_close(db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); - /* try again with mboxlist sort */ + /* try again. This test used CYRUSDB_MBOXSORT. */ - r = cyrusdb_open(backend, filename2, CYRUSDB_CREATE | CYRUSDB_MBOXSORT, &db); + r = cyrusdb_open(backend, filename2, CYRUSDB_CREATE, &db); CU_ASSERT_EQUAL(r, CYRUSDB_OK); CU_ASSERT_PTR_NOT_NULL(db); diff --git a/cunit/quota.testc b/cunit/quota.testc index 403f2ec29fc..d2d1ee3591f 100644 --- a/cunit/quota.testc +++ b/cunit/quota.testc @@ -734,8 +734,7 @@ static void notest_foreach(void) #endif /* - * TODO: should test for quota_foreach() iteration order, - * with and without IMAPOPT_IMPROVED_MBOXLIST_SORT set. + * TODO: should test for quota_foreach() iteration order. * There is code that depends on it, e.g. for quota -f. */ diff --git a/doc/README.cyrusdb.md b/doc/README.cyrusdb.md index d2d630324e8..9c89dedfe49 100644 --- a/doc/README.cyrusdb.md +++ b/doc/README.cyrusdb.md @@ -85,14 +85,6 @@ if (!r) return mydb; // if (r == CYRUSDB_OK) { ... } * `CYRUSDB_CREATE` - if the named database doesn't exist, create a blank database. -* `CYRUSDB_MBOXSORT` - use the abomination called - `improved_mboxlist_sort` which re-orders a couple of characters to - allow "foo.bar" to sort before "foo bar", for perfectly good - reasons, but we're going to fix it a better way. Not every engine - supports arbitrary collation, and if many engines corrupt horribly - if the same database is opened with different choices for this flag. - Ouch. - * `CYRUSDB_CONVERT` - if set and the database fails to open, attempt a magic detection on the file content and try to convert the database to the requested backend type before opening it. In-place upgrades! diff --git a/doc/internal/cyrusdb-api.html b/doc/internal/cyrusdb-api.html index e8fe6aab76e..9e606a6e4ff 100644 --- a/doc/internal/cyrusdb-api.html +++ b/doc/internal/cyrusdb-api.html @@ -154,7 +154,6 @@
Flags:
Errors:
diff --git a/doc/internal/improved_mboxlist_sort.html b/doc/internal/improved_mboxlist_sort.html deleted file mode 100644 index 5e1acd9936c..00000000000 --- a/doc/internal/improved_mboxlist_sort.html +++ /dev/null @@ -1,34 +0,0 @@ - - - -You can't enable and disable improved_mboxlist_sort on a live -system. You need to dump and load the necessary database after -stopping and before starting the master process.
- -
Dumping the mailboxes.db file
--ctl_mboxlist -d > /var/tmp/mailboxes.txt -ctl_mboxlist -u < /var/tmp/mailboxes.txt -- -
If your subscription databases are not in flat files you need to do -something similar. Each user will have his own subscription file. Do -the following for each subscription file.
- --cyr_dbtool -C $file skiplist show > $file.TXT -cyr_dbtool -n $file skiplist set < $file.TXT -- -
The above fragments will overwrite the original file. So you could -redirect to a temporary file and overwrite the database if the import -succeeds.
- - - diff --git a/doc/internal/index.html b/doc/internal/index.html index 69c65652a8e..bb7fe41674f 100644 --- a/doc/internal/index.html +++ b/doc/internal/index.html @@ -44,7 +44,6 @@