[Dovecot] question mailbox format

alan premselaar alien at 12inch.com
Sun May 27 05:21:50 EEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 5/27/07 1:50 AM, sc2 at gmx.at wrote:
> hello marcus
>>> Typically with mbox it would be set to:
>>>
>>> mail_location = mbox:~/mail:INBOX=/var/mail/%u
> i know, i try it too so but then i get a error to.
> 
> On this system (Redhat 9), the mails are only saved in /var/spool/mail/%u
> the problem is when i try it with :
> 
> a.) mbox:~/mail:INBOX=/var/spool/mail/%u
>> mkdir_parents(/home/bernhard/mail) failed: Permission denied

Are you running the system with virtual users?
I didn't notice in your pasted dovecot configuration information if
you've configured dovecot to run with a single UID/GID (i.e. virtual
user support).

Basically what's happening here is if the user bernhard is an actual
system user and you don't have dovecot configured to run in virtual user
configuration then your user permissions are really messed up.

normally dovecot should setuid to the user that is logged in so that it
can write the mail (and necessary index, cache, etc) files in the user's
home directory. if you specifically tell dovecot to run as a single
UID/GID (for virtual user setup) then this UID/GID needs to have
permission to write where the mail/index/cache/etc files need to be written.

I'd be willing to bet this is your problem.

> 
> b.) when i try it with mbox:/var/spool/mail/%u, INBOX same, and index
> /var/indexes all works fine except this,when somebody logs in, and  the
> mailbox exist he gets the email (from mbox file), but when the mbox does
> not exist he makes a directory, instead of a file like /var/spool/mail/%u.
> Example:
> - mbox exist = all is ok
> -mbox does not exist >he creates a directory with %u
> but then new mails for this user not gone to %user mbox file, they are
> gone to %u directory (in directory) and then dovecot cant get it.

the mbox: parameter is apparently expecting a directory name, not a file
name. if you want to keep the index/cache/etc files in the same
directory tree as the inboxes, you may want to try something like this:

mail_location = mbox:/var/spool/mail/%u:INBOX=/var/spool/mail/%u/INBOX

in the case of the example from your log file, this will cause the
following to happen:

/var/spool/mail/bernhard/INBOX will store the received email in mbox format.
/var/spool/mail/bernhad/.imap/ will contain the necessary index, cache
and crontrol files that dovecot needs to store.


make sure the permissions are set properly for these directories so that
dovecot can read and write to them as necessary (either as the user that
is logged in, or the set UID/GID dovecot is configured to use)

HTH

alan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGWOs+E2gsBSKjZHQRAiPiAJ9gZ3leawpd1iIao0XiliYNamrJDACfVcqb
oqwy7i0K6oqeQwq1Lz0UXAM=
=kXYF
-----END PGP SIGNATURE-----


More information about the dovecot mailing list