Cyrus IMAP 2.4.14 released

Carlos Velasco carlos.velasco at nimastelecom.com
Wed Mar 14 14:13:43 EDT 2012


In a Linux LFS Pure 64 (no 32 libs) upgrading from 2.4.13 to 2.4.14 with
fulldirhash: 1 and hashimapspool: 1 trigger the "System I/O error".

If I am right, previous to the long long patch this system was hashed in
32 and now in 2.4.14 it is looking for indexes in hash64.

So I tried to use rehash to convert to basic and then to full to
recreate in hash64.
First I had to patch the rehash tool a bit as it was lacking virtdomains
switch "userid" and also there was a reutilization of the SUB opendir
handle leading to nasty "invalid dirhandle" errors.

But the real problem is that hashing of "rehash" utility does not match
the used in cyrus imap.

Rehash:
domain moving k/kaka.com to N/kaka.com
moving n/newipnet.com to T/newipnet.com
moving n/nimastelecom.com to G/nimastelecom.com
moving p/prueba.com to T/prueba.com

Cyrus imap 2.4.14:
open("/imap/part1/domain/S/nimastelecom.com/C/user/carlos^velasco/cyrus.index",
O_RDWR) = -1 ENOENT (No such file or directory)
open("/imap/part1/domain/U/newipnet.com/C/user/carlos^velasco/cyrus.index",
O_RDWR) = -1 ENOENT (No such file or directory)

Using the formula in rehash utility:
===
require Math::BigInt;

my $name = "newipnet.com";

$n = Math::BigInt->new(0);
foreach my $b (split(/ */, $name)) {
  $n = (($n << 3) ^ ($n >> 5)) ^ ord($b);
}
$h = chr(ord('A') + ($n % 23));
print $h;
===
Output: T

But Cyrus Imap 2.4.14 is trying to get it into U in my case.

So, I think rehash utility is broken really.


--- cyrus-imapd-2.4.14/tools/rehash     2012-03-12 12:47:51.000000000 +0100
+++ cyrus-imapd-2.4.14.patched/tools/rehash     2012-03-14
18:59:20.001558956 +0100
@@ -194,7 +194,7 @@
            $sievedir = $1;
            print "you are using $sievedir as your sieve directory.\n";
         }
-        if (/^virtdomains:\s+(1|t|yes|on)/) {
+        if (/^virtdomains:\s+(1|t|yes|on|userid)/) {
            $virtdomains = 1;
            print "i will deal with virtual domains.\n";
         }
@@ -344,8 +344,8 @@
     }
     unless ($tonone) {
        foreach $i (@{$old}) {
-           if (opendir SUB, $i) {
-               while ($s = readdir SUB) {
+           if (opendir SUBMVDM, $i) {
+               while ($s = readdir SUBMVDM) {
                    if ($s =~ /^\./s) { next; }
 
                    chdir "$i/$s";
@@ -372,7 +372,7 @@
                        rename ("$h_32/$s", "$h_64/$s") or ouch
"couldn't move $s back!";
                    }
                }
-               closedir SUB;
+               closedir SUBMVDM;
                rmdir "$i" or die "couldn't remove $i";
            }
        }



More information about the Info-cyrus mailing list