Hi Wietse! 05.11.2016, 15:36 +0100, Wietse Venema:
> Sorry, the question about the incoming queue was a red herring. > Postsuper 'releases' a message by moving it to the deferred queue. > > When postsuper renames a queue file, it recovers from a number of > errors, and the bug you found is that a recovered error was not > reported as a successful rename operation. The patch is at the end > of this message. > > postsuper recovers from the following file 'rename' errors: > > - With a hashed deferred queue (the default), a rename operation > may fail because the destination directory does not yet exist. > In that case Postfix creates the destination directory and retries > the rename operation. > > - With an NFS-mounted queue, the rename request succeeds but the > server reply is lost. The retransmitted rename request fails > because the old file name no longer exists. Postfix jumps some > hoops as described in http://www.postfix.org/NFS_README.html. Thanks for the patch and thanks for taking the time to explain what the problem is! JFTR: I could easily reproduce the erratic behaviour by removing some/all directories in /var/spool/postfix/deferred. After applying your patch, the problem is gone. > Wietse > > --- ./src/postsuper/postsuper.c- 2016-09-17 19:53:11.000000000 -0400 > +++ ./src/postsuper/postsuper.c 2016-11-05 10:17:18.000000000 -0400 > @@ -437,7 +437,7 @@ > if ((ret = sane_rename(old, new)) < 0) { > if (errno != ENOENT > || mail_queue_mkdirs(new) < 0 > - || sane_rename(old, new) < 0) > + || (ret = sane_rename(old, new)) < 0) > if (errno != ENOENT) > msg_fatal("rename file %s as %s: %m", old, new); > } else { > -- Regards mks