[Dovecot] Effects of going read-only on dovecot & pop/imap clients
Hi all,
We need to set our filestore to read-only for quite a while, and I want to mitigate the effects for our clients. First issue; dovecot. If we just change the nfs mounts to read-only, dovecot complains:
2009-02-19T14:03:19+00:00 mail2 dovecot: pop3-login: Login: user=test2@markandruth.co.uk, method=PLAIN, rip=10.15.10.95, lip=10.15.10.102:11002 2009-02-19T14:03:19+00:00 mail2 dovecot: POP3(test2@markandruth.co.uk): open() failed with file /var/spool/mail/supplier_2/ma/rk/an/markandruth.co.uk/te/st/2_/test2/Mai ldir/dovecot.index.log: Read-only file system 2009-02-19T14:03:19+00:00 mail2 dovecot: POP3(test2@markandruth.co.uk): open(/var/spool/mail/supplier_2/ma/rk/an/markandruth.co.uk/te/st/2_/test 2/Maildir/dovecot-uidlist.lock) failed: Read-only file system 2009-02-19T14:03:19+00:00 mail2 dovecot: POP3(test2@markandruth.co.uk): file_dotlock_create(/var/spool/mail/supplier_2/ma/rk/an/markandruth.co.u k/te/st/2_/test2/Maildir/dovecot-uidlist) failed: Read-only file system 2009-02-19T14:03:19+00:00 mail2 dovecot: POP3(test2@markandruth.co.uk): Couldn't init INBOX: Internal error occurred. Refer to server log for more information. [2009-02-19 14:03:19] 2009-02-19T14:03:19+00:00 mail2 dovecot: POP3(test2@markandruth.co.uk): Mailbox init failed bytes=0/95, top=0/0, retr=0/0, del=0/0, size=0
Even when I use :INDEX=MEMORY, it's still complaining about creating .lock's or uidlist files and just issuing internal errors. Is there any way to make dovecot just do as much as it can under the circumstances ie allow read access to mails?
Also, has anyone got experience of how clients handle mailboxes being read-only? My guess is that pop clients would probably break and download the same messages over and over?
Thanks,
Mark
-- Mark Zealey -- Shared Hosting Team Leader Product Development * Webfusion 123-reg.co.uk, webfusion.co.uk, donhost.co.uk, supanames.co.uk
This mail is subject to http://www.gxn.net/disclaimer
On Thu, 2009-02-19 at 14:17 +0000, Mark Zealey wrote:
2009-02-19T14:03:19+00:00 mail2 dovecot: POP3(test2@markandruth.co.uk): open() failed with file /var/spool/mail/supplier_2/ma/rk/an/markandruth.co.uk/te/st/2_/test2/Mai ldir/dovecot.index.log: Read-only file system .. Even when I use :INDEX=MEMORY, it's still complaining about creating .lock's or uidlist files and just issuing internal errors. Is there any way to make dovecot just do as much as it can under the circumstances ie allow read access to mails?
Are you talking about only POP3 clients? I suppose in theory it should be possible, but it's such a special case that I'm not going to bother making Dovecot support that. Dovecot really wants to create dovecot-uidlist files. But I suppose you could just have it create them to some temp directories:
mail_location = maildir:~/Maildir:CONTROL=/tmp/%u:INDEX=MEMORY
And be sure to use:
pop3_uidl_format = %f
Also, has anyone got experience of how clients handle mailboxes being read-only? My guess is that pop clients would probably break and download the same messages over and over?
If client has configured to leave mail on server it should work, but if not it probably breaks.
Are you talking about only POP3 clients? I suppose in theory it should be possible, but it's such a special case that I'm not going to bother making Dovecot support that. Dovecot really wants to create dovecot-uidlist files. But I suppose you could just have it create them to some temp directories:
mail_location = maildir:~/Maildir:CONTROL=/tmp/%u:INDEX=MEMORY
Both IMAP and pop3 - I got the same errors with imap, but thanks to the CONTROL= parameter that's fixed now.
I get a weird error the first time I log in:
2009-02-19T16:48:14+00:00 mail2 dovecot: POP3(test2@markandruth.co.uk): Disconnected: Mailbox is in inconsistent state. bytes=0/56, top=0/0, retr=0/0, del=0/0, size=0 2009-02-19T16:48:14+00:00 mail2 dovecot: POP3(test2@markandruth.co.uk): Couldn't init INBOX: Mailbox was deleted under us
But second login is fine - must be something to do with the CONTROL param.
And be sure to use:
pop3_uidl_format = %f
Out of interest, why do we have to use that uidl format, or are you just saying we have to use some uidl format? We migrated from courier and so use "UID%u-%v".
Also, has anyone got experience of how clients handle mailboxes being read-only? My guess is that pop clients would probably break and download the same messages over and over?
If client has configured to leave mail on server it should work, but if not it probably breaks.
Hmm, weirdly enough (or perhaps not) dovecot looks successful if I delete the message (chmod -r):
dele 1 +OK Marked to be deleted. quit +OK Logging out, messages deleted.
Do you think IMAP clients would handle the read-only situation better? I can see that it correctly reports the mailbox as read-only if we chmod -r files, however if the filesystem itself is mounted read-only, dovecot reports the mailbox as being read-write (dovecot 1.1.6)
Thanks,
Mark
On Thu, 2009-02-19 at 17:10 +0000, Mark Zealey wrote:
Are you talking about only POP3 clients? I suppose in theory it should be possible, but it's such a special case that I'm not going to bother making Dovecot support that. Dovecot really wants to create dovecot-uidlist files. But I suppose you could just have it create them to some temp directories:
mail_location = maildir:~/Maildir:CONTROL=/tmp/%u:INDEX=MEMORY
Both IMAP and pop3 - I got the same errors with imap, but thanks to the CONTROL= parameter that's fixed now.
With IMAP that's a really bad idea, because then the UIDs won't be permanent.
2009-02-19T16:48:14+00:00 mail2 dovecot: POP3(test2@markandruth.co.uk): Disconnected: Mailbox is in inconsistent state. bytes=0/56, top=0/0, retr=0/0, del=0/0, size=0 2009-02-19T16:48:14+00:00 mail2 dovecot: POP3(test2@markandruth.co.uk): Couldn't init INBOX: Mailbox was deleted under us
But second login is fine - must be something to do with the CONTROL param.
Probably, yes.. Although didn't it log an error message to error log (may be in a different log)?
And be sure to use:
pop3_uidl_format = %f
Out of interest, why do we have to use that uidl format, or are you just saying we have to use some uidl format? We migrated from courier and so use "UID%u-%v".
Because the UIDs aren't permanent with that CONTROL change.
Hmm, weirdly enough (or perhaps not) dovecot looks successful if I delete the message (chmod -r):
dele 1 +OK Marked to be deleted. quit +OK Logging out, messages deleted.
chmod -r? Or -w? Did you do it to the messages or the cur directory? The only important thing is if cur directory has +w permission.
Do you think IMAP clients would handle the read-only situation better?
Yes. For example dovecot.org offers read-only mailing list archives.
I can see that it correctly reports the mailbox as read-only if we chmod -r files, however if the filesystem itself is mounted read-only, dovecot reports the mailbox as being read-write (dovecot 1.1.6)
Dovecot uses access(Maildir/cur) to see if it has write permissions. I guess the kernel says that the user does. I'm not sure if there's a good and easy way to fix that.
participants (2)
-
Mark Zealey
-
Timo Sirainen