[Dovecot] redirecting temp email files to another directory
Hi, Is is possible to redirect temp email files to another folder like /tmp or somewhere else, instead of having it in the same /var/spool where the mbox is?
the temp files that is randomly created when the users accesses their email. I've only noticed this with the dovecot 1.1.7 with squirrelmail server that I built. I do not see the temp files created in the /var/spool/mail with the old UW-IMAP + squirrelmail.
The last time I couldn't delete email from squirrelmail was because the /var/spool permission was 0700, I have to change it to 0770 to allow mail group to create the temp files to delete emails...
----- Original Message ----- From: Timo Sirainen tss@iki.fi Date: Saturday, January 17, 2009 5:03 pm Subject: Re: [Dovecot] redirecting temp email files to another directory To: Dovecot Mailing List dovecot@dovecot.org
On Jan 17, 2009, at 8:00 PM, JANE CUA wrote:
Hi, Is is possible to redirect temp email files to another folder like /tmp or somewhere else, instead of having it in the same /var/ spool where the mbox is?
What "temp email files"?
Give me an example of what a temp filename looks like? Also post your
dovecot -n output. Because there shouldn't be any temp files.
On Jan 17, 2009, at 8:10 PM, JANE CUA wrote:
the temp files that is randomly created when the users accesses
their email. I've only noticed this with the dovecot 1.1.7 with
squirrelmail server that I built. I do not see the temp files
created in the /var/spool/mail with the old UW-IMAP + squirrelmail.The last time I couldn't delete email from squirrelmail was because
the /var/spool permission was 0700, I have to change it to 0770 to
allow mail group to create the temp files to delete emails...----- Original Message ----- From: Timo Sirainen tss@iki.fi Date: Saturday, January 17, 2009 5:03 pm Subject: Re: [Dovecot] redirecting temp email files to another
directory To: Dovecot Mailing List dovecot@dovecot.orgOn Jan 17, 2009, at 8:00 PM, JANE CUA wrote:
Hi, Is is possible to redirect temp email files to another folder like /tmp or somewhere else, instead of having it in the same /var/ spool where the mbox is?
What "temp email files"?
Here's the dovecot -n output: # 1.1.7: /usr/local/etc/dovecot.conf # OS: Linux 2.6.18-92.1.22.el5PAE i686 CentOS release 5.2 (Final) log_path: /var/log/dovecot.log info_log_path: /var/log/dovecot-info.log ssl_disable: yes disable_plaintext_auth: no login_dir: /usr/local/var/run/dovecot/login login_executable: /usr/local/libexec/dovecot/imap-login login_greeting_capability: yes mail_privileged_group: mail mail_location: mbox:~/:INBOX=/var/spool/mail/%u auth default: passdb: driver: pam passdb: driver: passwd passdb: driver: shadow userdb: driver: passwd
sample temp files that gets create in /var/spool/mail -rw------ jane mail _43398509485894865jane -rw------ jane mail jane.lock
other users create these files randomly as well in /var/spool/mail, /var/spool/mail is an NFS mount.
Thank you, Jane
On Jan 19, 2009, at 1:40 AM, JANE CUA wrote:
sample temp files that gets create in /var/spool/mail -rw------ jane mail _43398509485894865jane
I'm certain Dovecot didn't create this file at least directly.
-rw------ jane mail jane.lock
This is a dotlock and it can be created by Dovecot. You could also
probably disable it. http://wiki.dovecot.org/MboxLocking http://wiki.dovecot.org/MailboxFormat/mbox
other users create these files randomly as well in /var/spool/mail, / var/spool/mail is an NFS mount.
Hmm. NFS is a pretty good suspect here. I know that in some situations
it creates such temp files, although they're usually
named .nfs.something. Are those files deleted or are they just lying
around? What size do they have?
sample temp files that gets create in /var/spool/mail -rw------ jane mail _43398509485894865jane
I'm certain Dovecot didn't create this file at least directly.
-rw------ jane mail jane.lock
This is a dotlock and it can be created by Dovecot. You could also probably disable it. http://wiki.dovecot.org/MboxLocking http://wiki.dovecot.org/MailboxFormat/mbox
I have put the squirrelmail+dovecot offline now. It's hard to simulate the problem when I am the only one testing it. The issues came about, when I put it up online and the users started to use it.
Disabling it meaning remarking the following? #mbox_read_locks = fcntl #mbox_write_locks = dotlock fcntl
other users create these files randomly as well in /var/spool/mail, / var/spool/mail is an NFS mount.
Hmm. NFS is a pretty good suspect here. I know that in some situations it creates such temp files, although they're usually named .nfs.something. Are those files deleted or are they just lying around? What size do they have?
The _* files go away but for the .lock files, some of them don't go away and if they don't go, users no longer receives new emails, but can still send out emails. The temp file with _* has 0 file size, I don't remember what the .lock size it, I will see if I can simulate this again.
On Sun, 2009-01-18 at 23:32 -0800, JANE CUA wrote:
sample temp files that gets create in /var/spool/mail -rw------ jane mail _43398509485894865jane
I'm certain Dovecot didn't create this file at least directly.
-rw------ jane mail jane.lock
This is a dotlock and it can be created by Dovecot. You could also
probably disable it. http://wiki.dovecot.org/MboxLocking http://wiki.dovecot.org/MailboxFormat/mboxI have put the squirrelmail+dovecot offline now. It's hard to simulate the problem when I am the only one testing it. The issues came about, when I put it up online and the users started to use it.
Disabling it meaning remarking the following? #mbox_read_locks = fcntl #mbox_write_locks = dotlock fcntl
You can disable dotlocks by setting:
mbox_write_locks = fcntl
But like the MboxLocking page says, you should make sure that the other software that accesses the mbox files also use fcntl locking. Otherwise you'll get corrupted files.
other users create these files randomly as well in /var/spool/mail, / var/spool/mail is an NFS mount.
Hmm. NFS is a pretty good suspect here. I know that in some situations
it creates such temp files, although they're usually
named .nfs.something. Are those files deleted or are they just lying
around? What size do they have?The _* files go away but for the .lock files, some of them don't go away and if they don't go, users no longer receives new emails, but can still send out emails. The temp file with _* has 0 file size, I don't remember what the .lock size it, I will see if I can simulate this again.
I guess the _* files are written when .lock file is deleted but another process still has the file open. But like I said, normally Linux uses ".nfs" prefix for them. I guess your kernel doesn't for some reason.
Anyway you shouldn't have .lock files lying around. Sounds like Dovecot (or something else) is crashing which leaves them. Have you looked if there are error messages in logs? http://wiki.dovecot.org/Logging
Hi Timo,
I believe disabling file locking will fix the problem. I have search other sites about file locking and sendmail, file locking may cause sendmail to do Denial of Service. I have to get people to use the new squirrelmail + Dovecot server again. Is there a great chance the files would get corrupted because I do not have file locking enabled in Dovecot?
As for the _298392349394823908<user> temp file this is created by, the pop3 server I have, this cause any problems. Thanks! jane
----- Original Message ----- From: Timo Sirainen tss@iki.fi Date: Sunday, January 18, 2009 10:45 pm Subject: Re: [Dovecot] redirecting temp email files to another directory To: Dovecot Mailing List dovecot@dovecot.org
On Jan 19, 2009, at 1:40 AM, JANE CUA wrote:
sample temp files that gets create in /var/spool/mail -rw------ jane mail _43398509485894865jane
I'm certain Dovecot didn't create this file at least directly.
-rw------ jane mail jane.lock
This is a dotlock and it can be created by Dovecot. You could also probably disable it. http://wiki.dovecot.org/MboxLocking http://wiki.dovecot.org/MailboxFormat/mbox
other users create these files randomly as well in /var/spool/mail, / var/spool/mail is an NFS mount.
Hmm. NFS is a pretty good suspect here. I know that in some situations it creates such temp files, although they're usually named .nfs.something. Are those files deleted or are they just lying around? What size do they have?
On Tue, 2009-01-20 at 11:00 -0800, JANE CUA wrote:
Hi Timo,
I believe disabling file locking will fix the problem. I have search other sites about file locking and sendmail, file locking may cause sendmail to do Denial of Service. I have to get people to use the new squirrelmail + Dovecot server again. Is there a great chance the files would get corrupted because I do not have file locking enabled in Dovecot?
If the locking doesn't work right then yes, the mbox files will easily get corrupted. So you should make sure all programs accessing the mbox also lock it using fcntl locking before removing the dotlock.
But the dotlocks should normally work fine too. Like I said before, check if you have errors in Dovecot's logs. Maybe they'll reveal a larger problem and after you solve that the dotlock problems will be gone as well.
participants (2)
-
JANE CUA
-
Timo Sirainen