These events really aren't expected, so it's better to clearly log errors
about them rather than silently delete the cache file.
if (hdr->major_version != MAIL_CACHE_MAJOR_VERSION) {
/* version changed - upgrade silently */
- mail_cache_unlink(cache);
+ mail_cache_set_corrupted(cache, "Unsupported major version (%u)",
+ hdr->major_version);
return FALSE;
}
if (hdr->compat_sizeof_uoff_t != sizeof(uoff_t)) {
/* architecture change - handle silently(?) */
- mail_cache_unlink(cache);
+ mail_cache_set_corrupted(cache, "Unsupported uoff_t size (%u)",
+ hdr->compat_sizeof_uoff_t);
return FALSE;
}