Package: qmail-src
Version: 1.03-38
Recent versions of dovecot are *very* fast at pulling mail messages out of
the new/ directory of a maildir. (Maybe they're using dnotify/inotify?)
Anyway, qmail-local.c contains the code:
> if (link(fntmptph,fnnewtph) == -1) goto fail;
> if ((fd = open(fnnewtph, O_RDONLY)) < 0 ||
> fsync(fd) < 0 || close(fd) < 0) goto fail;
>
> /* if it was error_exist, almost certainly successful; i hate NFS */
> tryunlinktmp(); _exit(0);
>
> fail: tryunlinktmp(); _exit(1);
> }
That is, after doing the link, it checks to see if it succeeded. This is
wrong; after linking the file into new/, it is the property of the MUA
and can be unlinked from that directory AT ANY TIME. Including before
the call the the open() above.
The net effect is that the mail is delivered, yet qmail-local thinks it's
not and retries. I have people with 9 copies of some email.
I'm compiling qmail with those lines commented out now.
Trace of erroneous behaviour:
13520 open("tmp/1122049256.13520.science", O_WRONLY|O_CREAT|O_EXCL, 0644) = 3
13520 read(0, "Received: (qmail 7443 invoked from network);"..., 1024) = 1024
13520 write(3, "Return-Path: "..., 64) = 64
13520 read(0, ""..., 1024) = 1024
13520 write(3, ""..., 1024) = 1024
13520 read(0, ""..., 1024) = 1024
13520 write(3, ""..., 1024) = 1024
13520 read(0, ""..., 1024) = 956
13520 write(3, ""..., 1024) = 1024
13520 read(0, "", 1024) = 0
13520 write(3, ""..., 956) = 956
13520 fsync(3) = 0
13520 close(3) = 0
13520 link("tmp/1122049256.13520.science", "new/1122049256.13520.science") = 0
13520 open("new/1122049256.13520.science", O_RDONLY) = -1 ENOENT (No such file
or directory)
13520 unlink("tmp/1122049256.13520.science") = 0
13520 exit_group(1) = ?
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]