I investigated the deliver with quota's bug a little more (rc10, mysql, virtual domains, maildir). My log files reads:
deliver(test@ruijs.cc): Info: msgid=000f01c6fac1$bd4e8670$8801a8c0@Moskou: save failed to INBOX
deliver(test@ruijs.cc): Info: sieve runtime error: Keep: Generic Error
deliver(test@ruijs.cc): Info: msgid=000f01c6fac1$bd4e8670$8801a8c0@Moskou: save failed to INBOX
deliver(test@ruijs.cc): Error: open(ruijs.cc/test//.temp.in2sports2.vianetworks.nl.13210.72d247ac698d0019) failed: No such file or directory
deliver(mark@ruijs.cc): Info: msgid=dovecot-1162066721-407295-0@in2sports2.vianetworks.nl: saved mail to Junk
Dovecot tries to deliver, but notices quota exceeded. I don't think Sieve is playing a role here - I added Sieve before I encountered the problem.
Two problems:
The .dovecot.lda-dupes can't be written (that's what the
open...failed notice is about).
The Quota Exceed mail seem to contain mal-formed headers (that's
why it the notice-mail ends in my junk-folder).
Digging into deliver.c, I noticed that auth_client_put_user_env() changes the HOME environment from /var/mail (which is ok), to ruijs.cc/test/ (which is the maildir, relative to /var/mail). And then fopen fails (see the trace below). So I think that the code
auth_socket = getenv("AUTH_SOCKET_PATH");
if (auth_socket == NULL)
auth_socket = DEFAULT_AUTH_SOCKET_PATH;
ret = auth_client_put_user_env(ioloop, auth_socket,
destination, process_euid);
if (ret != 0)
return ret;
home = getenv("HOME");
if (home != NULL) {
/* If possible chdir to home directory so core file
could be written. If it fails, don't worry. */
(void)chdir(home);
is the key. Should the chdir be done *before* the call to auth_client_put_user_env()? I'm not familiar with the internal workings of the Dovecot LDA, so I won't suggest a proper fix. Who will.
As for the mal-formed headers, I'll take a look at it later.
Mark
#0 i_error (format=0x80ac5f7 "open(%s) failed: %m") at failures.c:203
#1 0x0809f900 in dotlock_create (path=0x9ece2c0 "ruijs.cc/test//.dovecot.lda-dupes", dotlock=0x9edfc48, flags=Variable "flags" is not available.
) at file-dotlock.c:265
#2 0x0809fb71 in file_dotlock_open (set=0x80b9c90, path=0x9ece2c0 "ruijs.cc/test//.dovecot.lda-dupes", flags=0, dotlock_r=0x9ee7920) at file-dotlock.c:614
#3 0x08056ec5 in duplicate_new (path=0x9ece2c0 "ruijs.cc/test//.dovecot.lda-dupes") at duplicate.c:157
#4 0x080571c6 in duplicate_mark (id=0x9ece270, id_size=55, user=0xbf9edb45 "test@ruijs.cc", time=1162163205) at duplicate.c:195
#5 0x080573c9 in mail_send_rejection (mail=0x9ede7e0, recipient=0xbf9edb45 "test@ruijs.cc", reason=0x9edc218 "Quota exceeded") at mail-send.c:51
#6 0x08056c51 in main (argc=5, argv=0xbf9ec5d4) at deliver.c:595