#214911 courier-base: maildirmake hangs if invoked with -q on non-existing maildir

Package:
courier-base
Source:
courier
Description:
Courier mail server - base system
Submitter:
Alexander Koch
Date:
2017-12-24 14:57:08 UTC
Severity:
minor
#214911#5
Date:
2003-10-09 10:41:49 UTC
From:
To:
Following typescript shows a minor bug in maildirmake. When trying to
create a new maildir with quota, maildirmake hangs without error
message. Creating without quota and establishing the quota immediately
afterwards works fine.

root@pop3:~# maildirmake -q 1000S test
^C
root@pop3:~# ls -l
total 0
root@pop3:~#
root@pop3:~# maildirmake test
root@pop3:~# ls -l
total 4
drwx------    5 root     root         4096 Oct  9 12:37 test
root@pop3:~#
root@pop3:~# maildirmake -q 1000S test
root@pop3:~#

Regards,
Alexander Koch

#214911#10
Date:
2003-10-09 12:17:52 UTC
From:
To:
Hello, Courier users

Today the above problem was reported (Debian bug #214911) and I verified it
with maildirmake from Courier 0.42.2.

strace shows maildirmake running in a loop (below is one sample pass):

time([1065701758])                      = 1065701758
getpid()                                = 27705
stat64(0x804e2b0, 0xbffff4bc)           = -1 ENOENT (No such file or directory)
open("./test/tmp/1065701758.27705_NeWmAiLdIrSiZe.coldhand", O_RDWR|O_NONBLOCK|O_APPEND|O_CREAT, 0644) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({3, 0}, {3, 0})               = 0

Can someone please tell me how to fix this problem ?

Bye
	Racke

#214911#17
Date:
2008-10-08 11:33:36 UTC
From:
To:
Hi,

I still experience this in current Courier, 0.60.0-2. I actually think the
problem is a bit wider: maildirmake also hangs on a Maildir that doesn't
have the 'tmp' subdir.

I have a script that uses maildirmake and it keeps hanging forever on a
damaged Maildir that somehow lost tmp/. It should rather generate a proper
error message instead, or restore tmp/.

I think the issue in the original report is most probably the same: the
quota function is tried before the tmp/ subdir is created.


cheers,
Thijs

#214911#20
Date:
2017-12-24 14:53:54 UTC
From:
To:
Hi,

This is a minor bug report but an reasonable one to be fixed.

As reported originally by Alexander Koch in 2003:
https://bugs.debian.org/214911
https://bugs.debian.org/501557 (Duplicate)

| Following typescript shows a minor bug in maildirmake. When trying to
| create a new maildir with quota, maildirmake hangs without error
| message. Creating without quota and establishing the quota immediately
| afterwards works fine.
|
| root@pop3:~# maildirmake -q 1000S test
| ^C
| root@pop3:~# ls -l
| total 0
| root@pop3:~#
| root@pop3:~# maildirmake test
| root@pop3:~# ls -l
| total 4
| drwx------    5 root     root         4096 Oct  9 12:37 test
| root@pop3:~#
| root@pop3:~# maildirmake -q 1000S test
| root@pop3:~#

It's annoying since it hangs without any error message.

I checked this issue with the latest maildrop 2.9.3 package, this is
true.  Checking the current source tree, "maildirmake -q 1000S test" is
not checking the existence of maildir and doing the same as
"maildirquota  -q 1000S test"... No wonder.

Why not check the existence of the maildir first and if it doesn't
exist, let's create it before setting the quota.

Regards,

Osamu