[exim-dev] [Bug 691] New: Incorrect maildirsize file mode

Góra strony
Delete this message
Reply to this message
Autor: Alexander Zagrebin
Data:  
Dla: exim-dev
Nowe tematy: [exim-dev] [Bug 691] Incorrect maildirsize file mode
Temat: [exim-dev] [Bug 691] New: Incorrect maildirsize file mode
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=691
           Summary: Incorrect maildirsize file mode
           Product: Exim
           Version: 4.69
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: wishlist
          Priority: medium
         Component: Unfiled
        AssignedTo: nigel@???
        ReportedBy: alexz@???
                CC: exim-dev@???



IMHO, when using maildir quota exim sets incorrect file mode for maildirsize
file.
Currently it uses 0600. So only mail owner has access to this file.
It generates some problems.

For example:
I need check quota before message delivery. At this stage exim runs under
exim_user, and has no access to user's maildirsize.
So, for successful quota check, the maildirsize file mode must be less
restrictive (0640 for example).

By default exim uses 0600 (changeable) for mail delivery and 0600
(unchangeable) for maildirsize.
As maildir files and maildirsize are logically similar, I use such patch

--- src/transports/tf_maildir.c.orig    2007-01-08 13:50:20.000000000 +0300
+++ src/transports/tf_maildir.c         2008-02-06 16:43:16.000000000 +0300
@@ -559,7 +559,7 @@
   tempname = string_sprintf("%s/tmp/%lu.H%luP%lu.%s", path, tv.tv_sec,
     tv.tv_usec, getpid(), primary_hostname);


-  fd = Uopen(tempname, O_RDWR|O_CREAT|O_EXCL, 0600);
+  fd = Uopen(tempname, O_RDWR|O_CREAT|O_EXCL, ob->mode);
   if (fd >= 0)
     {
     (void)sprintf(CS buffer, OFF_T_FMT "S,%dC\n" OFF_T_FMT " %d\n",


As I already use 0640 file mode for mail delivery, this solves the problem.
For those who uses default file mode (0600), this patch has no value
(0600=0600)
For those who uses world readable mail, maildirsize will world readable too.
All is logical.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email