Re: [Exim] directory permissions

Góra strony
Delete this message
Reply to this message
Autor: Nigel Wade
Data:  
Dla: Andy Wettstein
CC: exim-users
Temat: Re: [Exim] directory permissions
Andy Wettstein wrote:
> On Thu, Aug 12, 2004 at 09:14:26AM +0100, Nigel Wade wrote:
>
>>Andy Wettstein wrote:
>>
>>>Hello
>>>
>>>Is there a way to set the group for a directory that exim creates with
>>>create_directory? AFAICT, exim creates all directories with group
>>>ownership of exim_group and there is no other directory group ownership
>>>setting.
>>>
>>>Thanks
>>>Andy
>>>
>>
>>If we are talking about the appendfile transport, then
>>group = mail
>>directory_mode = 750
>>
>>will create directories with group mail and group rx permission.
>>
>>The group option makes the transport run as that group, so any
>>files/directories it creates will have that group ownership.
>
>
> This does not work. I have this transport:
>
> shared_local_delivery_mbx:
> driver = appendfile
> mbx_format = true
> message_prefix =
> message_suffix =
> file = /var/mail/imapshared/$local_part/INBOX
> delivery_date_add
> envelope_to_add
> return_path_add
> mode = 0660
> no_mode_fail_narrower
> directory_mode = 755
> group = ${lookup{$local_part}lsearch{/etc/mail/shared-mail}}
>
> I have shared email get accepted by this router:
>
> shared_mail:
> driver = accept
> user = imapshared
> local_parts = lsearch;/etc/mail/shared-mail
> group = ${lookup{$local_part}lsearch{/etc/mail/shared-mail}}
> transport = shared_local_delivery_mbx
>
> I create a test alias in /etc/mail/shared-mail that looks like this:
> test: sysadm
> So the group should by sysadm for everything.
>
> I do a delivery to test and here is what I get:
>
> [2484]root@florence# ls -la /var/mail/imapshared/test/
> total 8
> drwxr-xr-x  2 imapshared  mail     512 Aug 12 07:36 .
> drwxr-xr-x  7 imapshared  mail     512 Aug 12 07:36 ..
> -rw-rw----  1 imapshared  sysadm  3304 Aug 12 07:36 INBOX

>
> I use exim-4.41 on FreeBSD 5.2.
>
>


If I include the transport you have above on a test system running Fedora
Core 1 and exim 4.41 it works. The only change I made was to move the
directory to /var/mail/test, and use different existing user and group (user
server, group adm). I sent mail to test, with the alias "test: adm" in
/etc/mail/shared-mail.

The resulting directory structure at /var/mail/test is:

drwxrwxrwx 3 root root 4096 Aug 12 16:00 .
drwxr-xr-x 3 server adm 4096 Aug 12 16:00 ./imapshared
drwxr-xr-x 2 server adm 4096 Aug 12 16:00 ./imapshared/test
-rw-rw---- 1 server adm 2806 Aug 12 16:00 ./imapshared/test/INBOX

I suppose it must be a BSD'ism.

--
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