[Dovecot] dovecot mounts user home dir?

Timo Sirainen tss at iki.fi
Fri Jul 30 08:46:58 EEST 2004


On 29.7.2004, at 11:38, Peter Evans wrote:

> TM (offmct at yahoo.com) wrote:
>> Why does dovecot mount the user home directory
>> whenever the user checks his email (either pop or imap)?
>
>> Is there a way to disable this?
>
> 	Ask the system nicely, its not dovecot per se,
> 	its the system doing things when dovecot becomes
> 	the user for the duration of the check.

I don't think simply changing user id for process does that. It's more 
likely because of this code in src/master/mail-process.c:

		/* NOTE: if home directory is NFS-mounted, we might not
		   have access to it as root. Change the effective UID
		   temporarily to make it work. */
		if (reply->uid != master_uid && seteuid(reply->uid) < 0)
			i_fatal("seteuid(%s) failed: %m", dec2str(reply->uid));
		ret = chdir(full_home_dir);
		if (reply->uid != master_uid && seteuid(master_uid) < 0)
			i_fatal("seteuid(%s) failed: %m", dec2str(master_uid));

		/* If user's home directory doesn't exist and we're not
		   trying to chroot anywhere, fallback to /tmp as the mails
		   could be stored elsewhere. */

Dovecot just wants to set current directory to user's home directory as 
that's the most logical location. I hadn't thought about any 
automounters.. One way to fix it would be to not use home directories 
in userdb at all, instead set the "mail" setting in it. Then Dovecot 
would chdir to /tmp. Another fix would be to just delete the code above 
and make it always chdir to /tmp. Maybe there should be a setting for 
this? ..
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://dovecot.org/pipermail/dovecot/attachments/20040730/ce0ec5cf/attachment-0001.bin>


More information about the dovecot mailing list