On Thu, Dec 05, 2002 at 04:12:38AM +0100, Matthias Blaser wrote:
> Hi,
>
> I've recently installed a new qmail-ldap box with patch revision 20021201,
> but on some accounts, following error occured:
>
> @400000003deeb278147a2e0c new msg 80599
> @400000003deeb278147b2fdc info msg 80599: bytes 1037 from <[EMAIL PROTECTED]>
> qp 32398 uid 201
> @400000003deeb278183a4734 starting delivery 4: msg 80599 to local
> [EMAIL PROTECTED]
> @400000003deeb278183ac434 status: local 1/10 remote 0/20
> @400000003deeb2781a8ff704 delivery 4: deferral:
> Unable_to_rewind_message._(#4.3.0)/
> @400000003deeb2781a9021fc status: local 0/10 remote 0/20
>
> ... but these ones only occured on accounts with localdelivery _and_
> forwarding to another account, or localdelivery with qmaildotmode set to
> both and using a .qmail file for further processing. these messages were
> not removed from queue nor queued for forwarding or processing with the
> .qmail file, but were delivered again and again to the users primary
> mailbox... all other accounts seemed to be ok.
>
OK, took me some time to find the bug.
Fast fix:
Set a quota (I used mailQuotaCount: 100000)
The correct fix is the following patch:
Index: qmail-local.c
===================================================================
RCS file: /home/cvs-qmail-ldap/CVS/qmail-ldap/qmail-local.c,v
retrieving revision 1.54
diff -u -r1.54 qmail-local.c
--- qmail-local.c 29 Oct 2002 15:03:59 -0000 1.54
+++ qmail-local.c 5 Dec 2002 18:44:16 -0000
@@ -84,7 +84,7 @@
char fnnewtph[83 + FMT_ULONG * 3];
void tryunlinktmp() { unlink(fntmptph); }
void sigalrm() { tryunlinktmp(); _exit(3); }
-int msfd; /* global filedescriptor to the quota file */
+int msfd = -1; /* global filedescriptor to the quota file */
void maildir_child(dir)
char *dir;
@@ -252,7 +252,7 @@
quota_t q;
unsigned long mailsize;
- if(quotastring && *quotastring) {
+ if (quotastring && *quotastring) {
if (fstat(0, &mailst) != 0)
strerr_die3x(111,"Can not stat mail for quota:
",error_str(errno),". (LDAP-ERR #2.4.1)")
;
mailsize = mailst.st_size;
@@ -296,7 +296,7 @@
_exit(111);
}
- close(msfd); /* close the maildirsize fd in the parent */
+ if (msfd != -1) close(msfd); /* close the maildirsize fd in the parent
*/
wait_pid(&wstat,child);
if (wait_crashed(wstat))
@@ -331,8 +331,6 @@
long int totalsize;
quota_t q;
- if (seek_begin(0) == -1) temp_rewind();
-
if( quotastring && *quotastring ) {
quota_get(&q, quotastring);
if (stat(fn, &filest) == -1) {
I will push Andre to build a interims release to fix the problem.
--
:wq Claudio