]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If mail_debug=yes, log all permission (and some other) problems
authorTimo Sirainen <tss@iki.fi>
Mon, 8 Sep 2008 08:56:56 +0000 (11:56 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 8 Sep 2008 08:56:56 +0000 (11:56 +0300)
instead of only giving a generic "Permission denied" (or similar) error message.

--HG--
branch : HEAD

src/lib-storage/mail-storage.c

index 867fb5001bccb41b9a62f1638338bfc0235f917c..a01c65b939b2b51a0f0c0dccba3abec449027678 100644 (file)
@@ -437,6 +437,13 @@ bool mail_storage_set_error_from_errno(struct mail_storage *storage)
 
        if (!mail_error_from_errno(&error, &error_string))
                return FALSE;
+       if ((storage->flags & MAIL_STORAGE_FLAG_DEBUG) != 0 &&
+           error != MAIL_ERROR_NOTFOUND) {
+               /* debugging is enabled - admin may be debugging a
+                  (permission) problem, so return FALSE to get the caller to
+                  log the full error message. */
+               return FALSE;
+       }
 
        mail_storage_set_error(storage, error, error_string);
        return TRUE;