+--- a/src/transports/appendfile.c
++++ b/src/transports/appendfile.c
+@@ -1769,19 +1769,28 @@
+ goto RETURN;
+ }
+
+- /* We have successfully created and opened the file. Ensure that the group
++ /* We have successfully created and opened the file. Ensure that the owner
+ and the mode are correct. */
+
+- if(Uchown(filename, uid, gid) || Uchmod(filename, mode))
++ /* Ignore failed chown if check_owner is disabled. */
++ if(Uchown(filename, uid, gid) && ob->check_owner)
+ {
+ addr->basic_errno = errno;
+- addr->message = string_sprintf("while setting perms on mailbox %s",
++ addr->message = string_sprintf("while setting owner on mailbox %s",
+ filename);
+ addr->transport_return = FAIL;
+ goto RETURN;
+ }
+- }
+
++ if(Uchmod(filename, mode))
++ {
++ addr->basic_errno = errno;
++ addr->message = string_sprintf("while setting perms on mailbox %s",
++ filename);
++ addr->transport_return = FAIL;
++ goto RETURN;
++ }
++ }
+
+ /* The file already exists. Test its type, ownership, and permissions, and
+ save the inode for checking later. If symlinks are permitted (not the