[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exim: weird /var/mail permissions problem



Morn' Peter,

* Peter N. M. Hansteen [2004-10-24 23:31]:
> Fiddling with configuring spam+msworm filtering on a mail server I got
> to the point where the MTA (exim) was accepting messages, but never got
> them delivered. Trying to force delivery produced a message which would
> indicate that the permissions in /var/mail were somehow problematic:
> 
> peter_(_at_)_skapet:/etc/exim$ sudo /usr/sbin/sendmail -qff -v
> LOG: queue_run MAIN
>   Start queue run: pid=31743 -qff
> delivering 1CLpk7-0005cw-6c (queue run pid 31743)
> LOG: MAIN
>   == peter_(_at_)_ehtrib_(_dot_)_org R=localuser T=local_delivery defer (13):
>   Permission denied: creating lock file hitching post
>   /var/mail/peter.lock.skapet.datadok.no.417c1c32.00006a13 (euid=1000
>   egid=1000)
         ^^^^
The gid could be a problem problem (if /var/mail was group-writeable).
See the "group" option for the appendfile transport.

> LOG: queue_run MAIN
>   End queue run: pid=31743 -qff
> 
> permissions on /var/mail at that point were what the installer left there,
> 
> drwxr-xr-x  2 root     wheel      512 Oct 24 11:35 mail

As you see, the "group" option alone wouldn't help. You'd need to make
the directory group writeable.

On my 3.6 I have the same root-only-writeable /var/mail:

    drwxr-xr-x  2 root  wheel  512 Oct  1 15:00 /var/mail

> which sendmail for some reason was quite happy with.

Because mail.local stores temporary files in /tmp, as /tmp/local.*.

> A "sudo chmod 1777 /var/mail" made the messages flow into the
> mailboxes, but I'm somehow unconvinced this is the correct solution. 
> 
> Has anybody else seen this, possibly even come up with a more elegant
> solution?

I don't deliver mail to /var/mail... On a couple of FreeBSD systems I
have enabled delivery to /var/mail, there I have

    drwxrwxr-x  2 root  mail  512 Aug 13 19:07 /var/mail

The transport for local delivery used is

    system_mbox:
        driver = appendfile
        file = /var/mail/$local_part
        return_path_add
        mode = 0660
        no_mode_fail_narrower
        user = $local_part
        group = mail

You could create a group "mail", chgrp /var/mail to mail and chmod it 0775.

-- 
    -- Kirill Miazine <km_(_at_)_krot_(_dot_)_org>



Visit your host, monkey.org