# HG changeset patch # User Timo Sirainen # Date 1250533113 14400 # Node ID a366666f4b502d6b1f1ee0b029fe4d714931e567 # Parent 0d0a801a4d1ef04711638a10260598496808bdc9 maildir: If opening a mail fails with EACCES, log a better error message. diff -r 0d0a801a4d1e -r a366666f4b50 src/lib-storage/index/maildir/maildir-mail.c --- a/src/lib-storage/index/maildir/maildir-mail.c Mon Aug 17 12:29:09 2009 -0400 +++ b/src/lib-storage/index/maildir/maildir-mail.c Mon Aug 17 14:18:33 2009 -0400 @@ -22,8 +22,13 @@ if (errno == ENOENT) return 0; - mail_storage_set_critical(&mbox->storage->storage, - "open(%s) failed: %m", path); + if (errno == EACCES) { + mail_storage_set_critical(&mbox->storage->storage, "%s", + mail_error_eacces_msg("open", path)); + } else { + mail_storage_set_critical(&mbox->storage->storage, + "open(%s) failed: %m", path); + } return -1; } @@ -35,8 +40,13 @@ if (errno == ENOENT) return 0; - mail_storage_set_critical(&mbox->storage->storage, - "stat(%s) failed: %m", path); + if (errno == EACCES) { + mail_storage_set_critical(&mbox->storage->storage, "%s", + mail_error_eacces_msg("stat", path)); + } else { + mail_storage_set_critical(&mbox->storage->storage, + "stat(%s) failed: %m", path); + } return -1; }