# when its mtime changes unexpectedly or when we can't find the mail otherwise.
#maildir_very_dirty_syncs = no
+# If enabled, Dovecot doesn't use the S=<size> in the Maildir filenames for
+# getting the mail's physical size, except when recalculating Maildir++ quota.
+# This can be useful in systems where a lot of the Maildir filenames have a
+# broken size. The performance hit for enabling this is very small.
+#maildir_broken_filename_sizes = no
+
##
## mbox-specific settings
##
}
/* size can be included in filename */
- if (maildir_filename_get_size(fname,
- vsize ? MAILDIR_EXTRA_VIRTUAL_SIZE :
- MAILDIR_EXTRA_FILE_SIZE,
- size_r))
- return 1;
+ if (vsize || !mbox->storage->set->maildir_broken_filename_sizes) {
+ if (maildir_filename_get_size(fname,
+ vsize ? MAILDIR_EXTRA_VIRTUAL_SIZE :
+ MAILDIR_EXTRA_FILE_SIZE, size_r))
+ return 1;
+ }
/* size can be included in uidlist entry */
if (!_mail->saving) {
static const struct setting_define maildir_setting_defines[] = {
DEF(SET_BOOL, maildir_copy_with_hardlinks),
DEF(SET_BOOL, maildir_very_dirty_syncs),
+ DEF(SET_BOOL, maildir_broken_filename_sizes),
SETTING_DEFINE_LIST_END
};
static const struct maildir_settings maildir_default_settings = {
.maildir_copy_with_hardlinks = TRUE,
- .maildir_very_dirty_syncs = FALSE
+ .maildir_very_dirty_syncs = FALSE,
+ .maildir_broken_filename_sizes = FALSE
};
static const struct setting_parser_info maildir_setting_parser_info = {
struct maildir_settings {
bool maildir_copy_with_hardlinks;
bool maildir_very_dirty_syncs;
+ bool maildir_broken_filename_sizes;
};
const struct setting_parser_info *maildir_get_setting_parser_info(void);