1 --- a/src/transports/appendfile.c
2 +++ b/src/transports/appendfile.c
3 @@ -1769,19 +1769,28 @@
7 - /* We have successfully created and opened the file. Ensure that the group
8 + /* We have successfully created and opened the file. Ensure that the owner
9 and the mode are correct. */
11 - if(Uchown(filename, uid, gid) || Uchmod(filename, mode))
12 + /* Ignore failed chown if check_owner is disabled. */
13 + if(Uchown(filename, uid, gid) && ob->check_owner)
15 addr->basic_errno = errno;
16 - addr->message = string_sprintf("while setting perms on mailbox %s",
17 + addr->message = string_sprintf("while setting owner on mailbox %s",
19 addr->transport_return = FAIL;
24 + if(Uchmod(filename, mode))
26 + addr->basic_errno = errno;
27 + addr->message = string_sprintf("while setting chmod on mailbox %s",
29 + addr->transport_return = FAIL;
34 /* The file already exists. Test its type, ownership, and permissions, and
35 save the inode for checking later. If symlinks are permitted (not the