Re: [exim] Message delivery when home directory does not exi…

Pàgina inicial
Delete this message
Reply to this message
Autor: Nigel Wade
Data:  
A: exim-users
Assumpte: Re: [exim] Message delivery when home directory does not exist
Graeme Fowler wrote:
> On Wed, 2007-08-08 at 11:15 +0100, Graeme Fowler wrote:
>> http://www.exim.org/exim-html-current/doc/html/spec_html/ch15.html
>>
>> for the details of check_local_user. When it runs it tries to set $home,
>> which is where yours is falling down.
>>
>> You probably need to define $home yourself in the router by using the
>> "router_home_directory" setting, and looking the value up. That will
>> then, I believe, override the (failing) $home setting from
>> check_local_user and allow the router to pass the message out to dovecot
>> via the appropriate transport.
>
> Actually, that won't work either if you end up with $home trying to be a
> nonexistent directory, because your error is coming inside the pipe
> transport you're using for delivery.
>
> You need to do one of:
>
> - remove check_local_user from the transport, or


Do transports have "check_local_user"? I thought that was part of the
router. Would removing it from the router prevent the transport from
chdir to the home directory? I've never tried that as in my case the
router routing to the appendfile transport is used for verification.

> - set $home to be something which does exist, which Exim can chdir to
> (like /tmp for example).


This is the only option I've ever managed to make work.

> - see if you can use http://wiki.dovecot.org/HowTo/DebianStable


That has the exact same problem, if the home directory doesn't exist the
appendfile transport fails in the same was as the pipe transport.
Appendfile will create the destination directory if it doesn't exist,
but it can't because it tries to chdir to the non-existent home
directory first.

What I do is to use these options for appendfile:

home_directory = HOME_DIR
directory = $home/$local_part/Maildir
group = mail
directory_mode = 770

where HOME_DIR is set to /home.

So, as far as the transport is concerned the "home" directory exists,
and it can happily chdir to it. When it delivers the message it creates
$home/$local_part/Maildir, resulting in the creation of the home
directory. The home directory is owned by the user, but has group mail
and all directories are writable by mail. Since users here don't log
into the mail server the group ownership isn't an issue. If it were I'd
probably try to get pam_mkhomedir to do the work - somehow...

As part of the user registration I send a "welcome" message, and
delivery of this message creates the initial home and Maildir
directories. Without this the POP/IMAP daemon throws a wobbly due to the
missing home directory.

-- 
Nigel Wade, System Administrator, Space Plasma Physics Group,
             University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@???
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555